repo_name string | path string | copies string | size string | content string | license string |
|---|---|---|---|---|---|
nyaki-HUN/DESIRE | DESIRE-Modules/ResourceLoader-Assimp/Externals/Assimp/contrib/unzip/crypt.c | 4 | 4977 | /* crypt.c -- base code for traditional PKWARE encryption
Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant
Modifications for Info-ZIP crypting
Copyright (C) 2003 Terry Thorsen
This code is a modified version of crypting code in Info-ZIP distribution
Copyright (C) 1990-2000 Info-ZIP. All rights reserved.
This program is distributed under the terms of the same license as zlib.
See the accompanying LICENSE file for the full text of the license.
This encryption code is a direct transcription of the algorithm from
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
file (appnote.txt) is distributed with the PKZIP program (even in the
version without encryption capabilities).
If you don't need crypting in your application, just define symbols
NOCRYPT and NOUNCRYPT.
*/
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#ifdef _WIN32
# include <windows.h>
# include <wincrypt.h>
#else
# include <sys/stat.h>
# include <fcntl.h>
# include <unistd.h>
#endif
#include "zlib.h"
#include "crypt.h"
#ifdef _WIN32
# pragma warning(push)
# pragma warning(disable : 4244)
#endif // _WIN32
/***************************************************************************/
#define CRC32(c, b) ((*(pcrc_32_tab+(((uint32_t)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
#ifndef ZCR_SEED2
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
#endif
/***************************************************************************/
uint8_t decrypt_byte(uint32_t *pkeys)
{
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */
temp = ((uint32_t)(*(pkeys+2)) & 0xffff) | 2;
return (uint8_t)(((temp * (temp ^ 1)) >> 8) & 0xff);
}
uint8_t update_keys(uint32_t *pkeys, const z_crc_t *pcrc_32_tab, int32_t c)
{
(*(pkeys+0)) = (uint32_t)CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{
register int32_t keyshift = (int32_t)((*(pkeys + 1)) >> 24);
(*(pkeys+2)) = (uint32_t)CRC32((*(pkeys+2)), keyshift);
}
return c;
}
void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab)
{
*(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L;
*(pkeys+2) = 878082192L;
while (*passwd != 0)
{
update_keys(pkeys, pcrc_32_tab, *passwd);
passwd += 1;
}
}
/***************************************************************************/
int cryptrand(unsigned char *buf, unsigned int len)
{
static unsigned calls = 0;
int rlen = 0;
#ifdef _WIN32
HCRYPTPROV provider;
unsigned __int64 pentium_tsc[1];
int result = 0;
if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
{
result = CryptGenRandom(provider, len, buf);
CryptReleaseContext(provider, 0);
if (result)
return len;
}
for (rlen = 0; rlen < (int)len; ++rlen)
{
if (rlen % 8 == 0)
QueryPerformanceCounter((LARGE_INTEGER *)pentium_tsc);
buf[rlen] = ((unsigned char*)pentium_tsc)[rlen % 8];
}
#else
int frand = open("/dev/urandom", O_RDONLY);
if (frand != -1)
{
rlen = (int)read(frand, buf, len);
close(frand);
}
#endif
if (rlen < (int)len)
{
/* Ensure different random header each time */
if (++calls == 1)
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
while (rlen < (int)len)
buf[rlen++] = (rand() >> 7) & 0xff;
}
return rlen;
}
int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2)
{
uint8_t n = 0; /* index in random header */
uint8_t header[RAND_HEAD_LEN-2]; /* random header */
uint16_t t = 0; /* temporary */
if (buf_size < RAND_HEAD_LEN)
return 0;
init_keys(passwd, pkeys, pcrc_32_tab);
/* First generate RAND_HEAD_LEN-2 random bytes. */
cryptrand(header, RAND_HEAD_LEN-2);
/* Encrypt random header (last two bytes is high word of crc) */
init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++)
buf[n] = (uint8_t)zencode(pkeys, pcrc_32_tab, header[n], t);
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify1, t);
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify2, t);
return n;
}
#ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
/***************************************************************************/
| bsd-2-clause |
seibert/numba | numba/cuda/cudadrv/_extras.c | 9 | 1176 | /*
* Helper binding to call some CUDA Runtime API that cannot be directly
* encoded using ctypes.
*/
#include "_pymodule.h"
#define CUDA_IPC_HANDLE_SIZE 64
typedef int CUresult;
typedef void* CUdeviceptr;
typedef struct CUipcMemHandle_st{
char reserved[CUDA_IPC_HANDLE_SIZE];
} CUipcMemHandle;
typedef CUresult (*cuIpcOpenMemHandle_t)(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int flags );
static
cuIpcOpenMemHandle_t cuIpcOpenMemHandle = 0;
static
void set_cuIpcOpenMemHandle(void* fnptr)
{
cuIpcOpenMemHandle = (cuIpcOpenMemHandle_t)fnptr;
}
static
CUresult call_cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle* handle, unsigned int flags)
{
return cuIpcOpenMemHandle(pdptr, *handle, flags);
}
MOD_INIT(_extras) {
PyObject *m;
MOD_DEF(m, "_extras", "No docs", NULL)
if (m == NULL)
return MOD_ERROR_VAL;
PyModule_AddObject(m, "set_cuIpcOpenMemHandle", PyLong_FromVoidPtr(&set_cuIpcOpenMemHandle));
PyModule_AddObject(m, "call_cuIpcOpenMemHandle", PyLong_FromVoidPtr(&call_cuIpcOpenMemHandle));
PyModule_AddIntConstant(m, "CUDA_IPC_HANDLE_SIZE", CUDA_IPC_HANDLE_SIZE);
return MOD_SUCCESS_VAL(m);
}
| bsd-2-clause |
reckonMe/reckonMe | reckonMe/Pods/proj4/proj/src/pj_gauss.c | 28 | 2793 | /*
** libproj -- library of cartographic projections
**
** Copyright (c) 2003 Gerald I. Evenden
*/
static const char
LIBPROJ_ID[] = "$Id: pj_gauss.c 1856 2010-06-11 03:26:04Z warmerdam $";
/*
** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the
** "Software"), to deal in the Software without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Software, and to
** permit persons to whom the Software is furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be
** included in all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define PJ_LIB__
#include <projects.h>
#define MAX_ITER 20
struct GAUSS {
double C;
double K;
double e;
double ratexp;
};
#define EN ((struct GAUSS *)en)
#define DEL_TOL 1e-14
static double
srat(double esinp, double exp) {
return(pow((1.-esinp)/(1.+esinp), exp));
}
void *
pj_gauss_ini(double e, double phi0, double *chi, double *rc) {
double sphi, cphi, es;
struct GAUSS *en;
if ((en = (struct GAUSS *)malloc(sizeof(struct GAUSS))) == NULL)
return (NULL);
es = e * e;
EN->e = e;
sphi = sin(phi0);
cphi = cos(phi0); cphi *= cphi;
*rc = sqrt(1. - es) / (1. - es * sphi * sphi);
EN->C = sqrt(1. + es * cphi * cphi / (1. - es));
*chi = asin(sphi / EN->C);
EN->ratexp = 0.5 * EN->C * e;
EN->K = tan(.5 * *chi + FORTPI) / (
pow(tan(.5 * phi0 + FORTPI), EN->C) *
srat(EN->e * sphi, EN->ratexp) );
return ((void *)en);
}
LP
pj_gauss(projCtx ctx, LP elp, const void *en) {
LP slp;
slp.phi = 2. * atan( EN->K *
pow(tan(.5 * elp.phi + FORTPI), EN->C) *
srat(EN->e * sin(elp.phi), EN->ratexp) ) - HALFPI;
slp.lam = EN->C * (elp.lam);
return(slp);
}
LP
pj_inv_gauss(projCtx ctx, LP slp, const void *en) {
LP elp;
double num;
int i;
elp.lam = slp.lam / EN->C;
num = pow(tan(.5 * slp.phi + FORTPI)/EN->K, 1./EN->C);
for (i = MAX_ITER; i; --i) {
elp.phi = 2. * atan(num * srat(EN->e * sin(slp.phi), -.5 * EN->e))
- HALFPI;
if (fabs(elp.phi - slp.phi) < DEL_TOL) break;
slp.phi = elp.phi;
}
/* convergence failed */
if (!i)
pj_ctx_set_errno( ctx, -17 );
return (elp);
}
| bsd-2-clause |
litoupu/nginx-rtmp-module | ngx_rtmp_notify_module.c | 30 | 47888 |
/*
* Copyright (C) Roman Arutyunyan
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_md5.h>
#include "ngx_rtmp.h"
#include "ngx_rtmp_cmd_module.h"
#include "ngx_rtmp_netcall_module.h"
#include "ngx_rtmp_record_module.h"
#include "ngx_rtmp_relay_module.h"
static ngx_rtmp_connect_pt next_connect;
static ngx_rtmp_disconnect_pt next_disconnect;
static ngx_rtmp_publish_pt next_publish;
static ngx_rtmp_play_pt next_play;
static ngx_rtmp_close_stream_pt next_close_stream;
static ngx_rtmp_record_done_pt next_record_done;
static char *ngx_rtmp_notify_on_srv_event(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static char *ngx_rtmp_notify_on_app_event(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static char *ngx_rtmp_notify_method(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static ngx_int_t ngx_rtmp_notify_postconfiguration(ngx_conf_t *cf);
static void * ngx_rtmp_notify_create_app_conf(ngx_conf_t *cf);
static char * ngx_rtmp_notify_merge_app_conf(ngx_conf_t *cf,
void *parent, void *child);
static void *ngx_rtmp_notify_create_srv_conf(ngx_conf_t *cf);
static char *ngx_rtmp_notify_merge_srv_conf(ngx_conf_t *cf, void *parent,
void *child);
static ngx_int_t ngx_rtmp_notify_done(ngx_rtmp_session_t *s, char *cbname,
ngx_uint_t url_idx);
ngx_str_t ngx_rtmp_notify_urlencoded =
ngx_string("application/x-www-form-urlencoded");
#define NGX_RTMP_NOTIFY_PUBLISHING 0x01
#define NGX_RTMP_NOTIFY_PLAYING 0x02
enum {
NGX_RTMP_NOTIFY_PLAY,
NGX_RTMP_NOTIFY_PUBLISH,
NGX_RTMP_NOTIFY_PLAY_DONE,
NGX_RTMP_NOTIFY_PUBLISH_DONE,
NGX_RTMP_NOTIFY_DONE,
NGX_RTMP_NOTIFY_RECORD_DONE,
NGX_RTMP_NOTIFY_UPDATE,
NGX_RTMP_NOTIFY_APP_MAX
};
enum {
NGX_RTMP_NOTIFY_CONNECT,
NGX_RTMP_NOTIFY_DISCONNECT,
NGX_RTMP_NOTIFY_SRV_MAX
};
typedef struct {
ngx_url_t *url[NGX_RTMP_NOTIFY_APP_MAX];
ngx_flag_t active;
ngx_uint_t method;
ngx_msec_t update_timeout;
ngx_flag_t update_strict;
ngx_flag_t relay_redirect;
} ngx_rtmp_notify_app_conf_t;
typedef struct {
ngx_url_t *url[NGX_RTMP_NOTIFY_SRV_MAX];
ngx_uint_t method;
} ngx_rtmp_notify_srv_conf_t;
typedef struct {
ngx_uint_t flags;
u_char name[NGX_RTMP_MAX_NAME];
u_char args[NGX_RTMP_MAX_ARGS];
ngx_event_t update_evt;
time_t start;
} ngx_rtmp_notify_ctx_t;
typedef struct {
u_char *cbname;
ngx_uint_t url_idx;
} ngx_rtmp_notify_done_t;
static ngx_command_t ngx_rtmp_notify_commands[] = {
{ ngx_string("on_connect"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_srv_event,
NGX_RTMP_SRV_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_disconnect"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_srv_event,
NGX_RTMP_SRV_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_publish"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_play"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_publish_done"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_play_done"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_done"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_record_done"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_RTMP_REC_CONF|
NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("on_update"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_on_app_event,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("notify_method"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_rtmp_notify_method,
NGX_RTMP_APP_CONF_OFFSET,
0,
NULL },
{ ngx_string("notify_update_timeout"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_conf_set_msec_slot,
NGX_RTMP_APP_CONF_OFFSET,
offsetof(ngx_rtmp_notify_app_conf_t, update_timeout),
NULL },
{ ngx_string("notify_update_strict"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_conf_set_flag_slot,
NGX_RTMP_APP_CONF_OFFSET,
offsetof(ngx_rtmp_notify_app_conf_t, update_strict),
NULL },
{ ngx_string("notify_relay_redirect"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_conf_set_flag_slot,
NGX_RTMP_APP_CONF_OFFSET,
offsetof(ngx_rtmp_notify_app_conf_t, relay_redirect),
NULL },
ngx_null_command
};
static ngx_rtmp_module_t ngx_rtmp_notify_module_ctx = {
NULL, /* preconfiguration */
ngx_rtmp_notify_postconfiguration, /* postconfiguration */
NULL, /* create main configuration */
NULL, /* init main configuration */
ngx_rtmp_notify_create_srv_conf, /* create server configuration */
ngx_rtmp_notify_merge_srv_conf, /* merge server configuration */
ngx_rtmp_notify_create_app_conf, /* create app configuration */
ngx_rtmp_notify_merge_app_conf /* merge app configuration */
};
ngx_module_t ngx_rtmp_notify_module = {
NGX_MODULE_V1,
&ngx_rtmp_notify_module_ctx, /* module context */
ngx_rtmp_notify_commands, /* module directives */
NGX_RTMP_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};
static void *
ngx_rtmp_notify_create_app_conf(ngx_conf_t *cf)
{
ngx_rtmp_notify_app_conf_t *nacf;
ngx_uint_t n;
nacf = ngx_pcalloc(cf->pool, sizeof(ngx_rtmp_notify_app_conf_t));
if (nacf == NULL) {
return NULL;
}
for (n = 0; n < NGX_RTMP_NOTIFY_APP_MAX; ++n) {
nacf->url[n] = NGX_CONF_UNSET_PTR;
}
nacf->method = NGX_CONF_UNSET_UINT;
nacf->update_timeout = NGX_CONF_UNSET_MSEC;
nacf->update_strict = NGX_CONF_UNSET;
nacf->relay_redirect = NGX_CONF_UNSET;
return nacf;
}
static char *
ngx_rtmp_notify_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_rtmp_notify_app_conf_t *prev = parent;
ngx_rtmp_notify_app_conf_t *conf = child;
ngx_uint_t n;
for (n = 0; n < NGX_RTMP_NOTIFY_APP_MAX; ++n) {
ngx_conf_merge_ptr_value(conf->url[n], prev->url[n], NULL);
if (conf->url[n]) {
conf->active = 1;
}
}
if (conf->active) {
prev->active = 1;
}
ngx_conf_merge_uint_value(conf->method, prev->method,
NGX_RTMP_NETCALL_HTTP_POST);
ngx_conf_merge_msec_value(conf->update_timeout, prev->update_timeout,
30000);
ngx_conf_merge_value(conf->update_strict, prev->update_strict, 0);
ngx_conf_merge_value(conf->relay_redirect, prev->relay_redirect, 0);
return NGX_CONF_OK;
}
static void *
ngx_rtmp_notify_create_srv_conf(ngx_conf_t *cf)
{
ngx_rtmp_notify_srv_conf_t *nscf;
ngx_uint_t n;
nscf = ngx_pcalloc(cf->pool, sizeof(ngx_rtmp_notify_srv_conf_t));
if (nscf == NULL) {
return NULL;
}
for (n = 0; n < NGX_RTMP_NOTIFY_SRV_MAX; ++n) {
nscf->url[n] = NGX_CONF_UNSET_PTR;
}
nscf->method = NGX_CONF_UNSET_UINT;
return nscf;
}
static char *
ngx_rtmp_notify_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_rtmp_notify_srv_conf_t *prev = parent;
ngx_rtmp_notify_srv_conf_t *conf = child;
ngx_uint_t n;
for (n = 0; n < NGX_RTMP_NOTIFY_SRV_MAX; ++n) {
ngx_conf_merge_ptr_value(conf->url[n], prev->url[n], NULL);
}
ngx_conf_merge_uint_value(conf->method, prev->method,
NGX_RTMP_NETCALL_HTTP_POST);
return NGX_CONF_OK;
}
static ngx_chain_t *
ngx_rtmp_notify_create_request(ngx_rtmp_session_t *s, ngx_pool_t *pool,
ngx_uint_t url_idx, ngx_chain_t *args)
{
ngx_rtmp_notify_app_conf_t *nacf;
ngx_chain_t *al, *bl, *cl;
ngx_url_t *url;
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
url = nacf->url[url_idx];
al = ngx_rtmp_netcall_http_format_session(s, pool);
if (al == NULL) {
return NULL;
}
al->next = args;
bl = NULL;
if (nacf->method == NGX_RTMP_NETCALL_HTTP_POST) {
cl = al;
al = bl;
bl = cl;
}
return ngx_rtmp_netcall_http_format_request(nacf->method, &url->host,
&url->uri, al, bl, pool,
&ngx_rtmp_notify_urlencoded);
}
static ngx_chain_t *
ngx_rtmp_notify_connect_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_rtmp_connect_t *v = arg;
ngx_rtmp_notify_srv_conf_t *nscf;
ngx_url_t *url;
ngx_chain_t *al, *bl;
ngx_buf_t *b;
ngx_str_t *addr_text;
size_t app_len, args_len, flashver_len,
swf_url_len, tc_url_len, page_url_len;
nscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_notify_module);
al = ngx_alloc_chain_link(pool);
if (al == NULL) {
return NULL;
}
/* these values are still missing in session
* so we have to construct the request from
* connection struct */
app_len = ngx_strlen(v->app);
args_len = ngx_strlen(v->args);
flashver_len = ngx_strlen(v->flashver);
swf_url_len = ngx_strlen(v->swf_url);
tc_url_len = ngx_strlen(v->tc_url);
page_url_len = ngx_strlen(v->page_url);
addr_text = &s->connection->addr_text;
b = ngx_create_temp_buf(pool,
sizeof("call=connect") - 1 +
sizeof("&app=") - 1 + app_len * 3 +
sizeof("&flashver=") - 1 + flashver_len * 3 +
sizeof("&swfurl=") - 1 + swf_url_len * 3 +
sizeof("&tcurl=") - 1 + tc_url_len * 3 +
sizeof("&pageurl=") - 1 + page_url_len * 3 +
sizeof("&addr=") - 1 + addr_text->len * 3 +
sizeof("&epoch=") - 1 + NGX_INT32_LEN +
1 + args_len
);
if (b == NULL) {
return NULL;
}
al->buf = b;
al->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "app=", sizeof("app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->app, app_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&flashver=",
sizeof("&flashver=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->flashver, flashver_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&swfurl=",
sizeof("&swfurl=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->swf_url, swf_url_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&tcurl=",
sizeof("&tcurl=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->tc_url, tc_url_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&pageurl=",
sizeof("&pageurl=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->page_url, page_url_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&addr=", sizeof("&addr=") -1);
b->last = (u_char*) ngx_escape_uri(b->last, addr_text->data,
addr_text->len, NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&epoch=", sizeof("&epoch=") -1);
b->last = ngx_sprintf(b->last, "%uD", (uint32_t) s->epoch);
b->last = ngx_cpymem(b->last, (u_char*) "&call=connect",
sizeof("&call=connect") - 1);
if (args_len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, v->args, args_len);
}
url = nscf->url[NGX_RTMP_NOTIFY_CONNECT];
bl = NULL;
if (nscf->method == NGX_RTMP_NETCALL_HTTP_POST) {
bl = al;
al = NULL;
}
return ngx_rtmp_netcall_http_format_request(nscf->method, &url->host,
&url->uri, al, bl, pool,
&ngx_rtmp_notify_urlencoded);
}
static ngx_chain_t *
ngx_rtmp_notify_disconnect_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_rtmp_notify_srv_conf_t *nscf;
ngx_url_t *url;
ngx_chain_t *al, *bl, *pl;
ngx_buf_t *b;
nscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_notify_module);
pl = ngx_alloc_chain_link(pool);
if (pl == NULL) {
return NULL;
}
b = ngx_create_temp_buf(pool,
sizeof("&call=disconnect") +
sizeof("&app=") + s->app.len * 3 +
1 + s->args.len);
if (b == NULL) {
return NULL;
}
pl->buf = b;
pl->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "&call=disconnect",
sizeof("&call=disconnect") - 1);
b->last = ngx_cpymem(b->last, (u_char*) "&app=", sizeof("&app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
NGX_ESCAPE_ARGS);
if (s->args.len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, s->args.data, s->args.len);
}
url = nscf->url[NGX_RTMP_NOTIFY_DISCONNECT];
al = ngx_rtmp_netcall_http_format_session(s, pool);
if (al == NULL) {
return NULL;
}
al->next = pl;
bl = NULL;
if (nscf->method == NGX_RTMP_NETCALL_HTTP_POST) {
bl = al;
al = NULL;
}
return ngx_rtmp_netcall_http_format_request(nscf->method, &url->host,
&url->uri, al, bl, pool,
&ngx_rtmp_notify_urlencoded);
}
static ngx_chain_t *
ngx_rtmp_notify_publish_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_rtmp_publish_t *v = arg;
ngx_chain_t *pl;
ngx_buf_t *b;
size_t name_len, type_len, args_len;
pl = ngx_alloc_chain_link(pool);
if (pl == NULL) {
return NULL;
}
name_len = ngx_strlen(v->name);
type_len = ngx_strlen(v->type);
args_len = ngx_strlen(v->args);
b = ngx_create_temp_buf(pool,
sizeof("&call=publish") +
sizeof("&name=") + name_len * 3 +
sizeof("&type=") + type_len * 3 +
1 + args_len);
if (b == NULL) {
return NULL;
}
pl->buf = b;
pl->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "&call=publish",
sizeof("&call=publish") - 1);
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->name, name_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&type=", sizeof("&type=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->type, type_len,
NGX_ESCAPE_ARGS);
if (args_len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, v->args, args_len);
}
return ngx_rtmp_notify_create_request(s, pool, NGX_RTMP_NOTIFY_PUBLISH, pl);
}
static ngx_chain_t *
ngx_rtmp_notify_play_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_rtmp_play_t *v = arg;
ngx_chain_t *pl;
ngx_buf_t *b;
size_t name_len, args_len;
pl = ngx_alloc_chain_link(pool);
if (pl == NULL) {
return NULL;
}
name_len = ngx_strlen(v->name);
args_len = ngx_strlen(v->args);
b = ngx_create_temp_buf(pool,
sizeof("&call=play") +
sizeof("&name=") + name_len * 3 +
sizeof("&start=&duration=&reset=") +
NGX_INT32_LEN * 3 + 1 + args_len);
if (b == NULL) {
return NULL;
}
pl->buf = b;
pl->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "&call=play",
sizeof("&call=play") - 1);
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->name, name_len,
NGX_ESCAPE_ARGS);
b->last = ngx_snprintf(b->last, b->end - b->last,
"&start=%uD&duration=%uD&reset=%d",
(uint32_t) v->start, (uint32_t) v->duration,
v->reset & 1);
if (args_len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, v->args, args_len);
}
return ngx_rtmp_notify_create_request(s, pool, NGX_RTMP_NOTIFY_PLAY, pl);
}
static ngx_chain_t *
ngx_rtmp_notify_done_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_rtmp_notify_done_t *ds = arg;
ngx_chain_t *pl;
ngx_buf_t *b;
size_t cbname_len, name_len, args_len;
ngx_rtmp_notify_ctx_t *ctx;
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
pl = ngx_alloc_chain_link(pool);
if (pl == NULL) {
return NULL;
}
cbname_len = ngx_strlen(ds->cbname);
name_len = ctx ? ngx_strlen(ctx->name) : 0;
args_len = ctx ? ngx_strlen(ctx->args) : 0;
b = ngx_create_temp_buf(pool,
sizeof("&call=") + cbname_len +
sizeof("&name=") + name_len * 3 +
1 + args_len);
if (b == NULL) {
return NULL;
}
pl->buf = b;
pl->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "&call=", sizeof("&call=") - 1);
b->last = ngx_cpymem(b->last, ds->cbname, cbname_len);
if (name_len) {
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, ctx->name, name_len,
NGX_ESCAPE_ARGS);
}
if (args_len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, ctx->args, args_len);
}
return ngx_rtmp_notify_create_request(s, pool, ds->url_idx, pl);
}
static ngx_chain_t *
ngx_rtmp_notify_update_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_chain_t *pl;
ngx_buf_t *b;
size_t name_len, args_len;
ngx_rtmp_notify_ctx_t *ctx;
ngx_str_t sfx;
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
pl = ngx_alloc_chain_link(pool);
if (pl == NULL) {
return NULL;
}
if (ctx->flags & NGX_RTMP_NOTIFY_PUBLISHING) {
ngx_str_set(&sfx, "_publish");
} else if (ctx->flags & NGX_RTMP_NOTIFY_PLAYING) {
ngx_str_set(&sfx, "_play");
} else {
ngx_str_null(&sfx);
}
name_len = ctx ? ngx_strlen(ctx->name) : 0;
args_len = ctx ? ngx_strlen(ctx->args) : 0;
b = ngx_create_temp_buf(pool,
sizeof("&call=update") + sfx.len +
sizeof("&time=") + NGX_TIME_T_LEN +
sizeof("×tamp=") + NGX_INT32_LEN +
sizeof("&name=") + name_len * 3 +
1 + args_len);
if (b == NULL) {
return NULL;
}
pl->buf = b;
pl->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "&call=update",
sizeof("&call=update") - 1);
b->last = ngx_cpymem(b->last, sfx.data, sfx.len);
b->last = ngx_cpymem(b->last, (u_char *) "&time=",
sizeof("&time=") - 1);
b->last = ngx_sprintf(b->last, "%T", ngx_cached_time->sec - ctx->start);
b->last = ngx_cpymem(b->last, (u_char *) "×tamp=",
sizeof("×tamp=") - 1);
b->last = ngx_sprintf(b->last, "%D", s->current_time);
if (name_len) {
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, ctx->name, name_len,
NGX_ESCAPE_ARGS);
}
if (args_len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, ctx->args, args_len);
}
return ngx_rtmp_notify_create_request(s, pool, NGX_RTMP_NOTIFY_UPDATE, pl);
}
static ngx_chain_t *
ngx_rtmp_notify_record_done_create(ngx_rtmp_session_t *s, void *arg,
ngx_pool_t *pool)
{
ngx_rtmp_record_done_t *v = arg;
ngx_rtmp_notify_ctx_t *ctx;
ngx_chain_t *pl;
ngx_buf_t *b;
size_t name_len, args_len;
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
pl = ngx_alloc_chain_link(pool);
if (pl == NULL) {
return NULL;
}
name_len = ngx_strlen(ctx->name);
args_len = ngx_strlen(ctx->args);
b = ngx_create_temp_buf(pool,
sizeof("&call=record_done") +
sizeof("&recorder=") + v->recorder.len +
sizeof("&name=") + name_len * 3 +
sizeof("&path=") + v->path.len * 3 +
1 + args_len);
if (b == NULL) {
return NULL;
}
pl->buf = b;
pl->next = NULL;
b->last = ngx_cpymem(b->last, (u_char*) "&call=record_done",
sizeof("&call=record_done") - 1);
b->last = ngx_cpymem(b->last, (u_char *) "&recorder=",
sizeof("&recorder=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->recorder.data,
v->recorder.len, NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, ctx->name, name_len,
NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&path=", sizeof("&path=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->path.data, v->path.len,
NGX_ESCAPE_ARGS);
if (args_len) {
*b->last++ = '&';
b->last = (u_char *) ngx_cpymem(b->last, ctx->args, args_len);
}
return ngx_rtmp_notify_create_request(s, pool, NGX_RTMP_NOTIFY_RECORD_DONE,
pl);
}
static ngx_int_t
ngx_rtmp_notify_parse_http_retcode(ngx_rtmp_session_t *s,
ngx_chain_t *in)
{
ngx_buf_t *b;
ngx_int_t n;
u_char c;
/* find 10th character */
n = 9;
while (in) {
b = in->buf;
if (b->last - b->pos > n) {
c = b->pos[n];
if (c >= (u_char)'0' && c <= (u_char)'9') {
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"notify: HTTP retcode: %dxx", (int)(c - '0'));
switch (c) {
case (u_char) '2':
return NGX_OK;
case (u_char) '3':
return NGX_AGAIN;
default:
return NGX_ERROR;
}
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: invalid HTTP retcode: %d..", (int)c);
return NGX_ERROR;
}
n -= (b->last - b->pos);
in = in->next;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: empty or broken HTTP response");
/*
* not enough data;
* it can happen in case of empty or broken reply
*/
return NGX_ERROR;
}
static ngx_int_t
ngx_rtmp_notify_parse_http_header(ngx_rtmp_session_t *s,
ngx_chain_t *in, ngx_str_t *name, u_char *data, size_t len)
{
ngx_buf_t *b;
ngx_int_t matched;
u_char *p, c;
ngx_uint_t n;
enum {
parse_name,
parse_space,
parse_value,
parse_value_newline
} state = parse_name;
n = 0;
matched = 0;
while (in) {
b = in->buf;
for (p = b->pos; p != b->last; ++p) {
c = *p;
if (c == '\r') {
continue;
}
switch (state) {
case parse_value_newline:
if (c == ' ' || c == '\t') {
state = parse_space;
break;
}
if (matched) {
return n;
}
if (c == '\n') {
return NGX_OK;
}
n = 0;
state = parse_name;
case parse_name:
switch (c) {
case ':':
matched = (n == name->len);
n = 0;
state = parse_space;
break;
case '\n':
n = 0;
break;
default:
if (n < name->len &&
ngx_tolower(c) == ngx_tolower(name->data[n]))
{
++n;
break;
}
n = name->len + 1;
}
break;
case parse_space:
if (c == ' ' || c == '\t') {
break;
}
state = parse_value;
case parse_value:
if (c == '\n') {
state = parse_value_newline;
break;
}
if (matched && n + 1 < len) {
data[n++] = c;
}
break;
}
}
in = in->next;
}
return NGX_OK;
}
static void
ngx_rtmp_notify_clear_flag(ngx_rtmp_session_t *s, ngx_uint_t flag)
{
ngx_rtmp_notify_ctx_t *ctx;
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
ctx->flags &= ~flag;
}
static ngx_int_t
ngx_rtmp_notify_connect_handle(ngx_rtmp_session_t *s,
void *arg, ngx_chain_t *in)
{
ngx_rtmp_connect_t *v = arg;
ngx_int_t rc;
u_char app[NGX_RTMP_MAX_NAME];
static ngx_str_t location = ngx_string("location");
rc = ngx_rtmp_notify_parse_http_retcode(s, in);
if (rc == NGX_ERROR) {
return NGX_ERROR;
}
if (rc == NGX_AGAIN) {
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"notify: connect redirect received");
rc = ngx_rtmp_notify_parse_http_header(s, in, &location, app,
sizeof(app) - 1);
if (rc > 0) {
*ngx_cpymem(v->app, app, rc) = 0;
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: connect redirect to '%s'", v->app);
}
}
return next_connect(s, v);
}
static void
ngx_rtmp_notify_set_name(u_char *dst, size_t dst_len, u_char *src,
size_t src_len)
{
u_char result[16], *p;
ngx_md5_t md5;
ngx_md5_init(&md5);
ngx_md5_update(&md5, src, src_len);
ngx_md5_final(result, &md5);
p = ngx_hex_dump(dst, result, ngx_min((dst_len - 1) / 2, 16));
*p = '\0';
}
static ngx_int_t
ngx_rtmp_notify_publish_handle(ngx_rtmp_session_t *s,
void *arg, ngx_chain_t *in)
{
ngx_rtmp_publish_t *v = arg;
ngx_int_t rc;
ngx_str_t local_name;
ngx_rtmp_relay_target_t target;
ngx_url_t *u;
ngx_rtmp_notify_app_conf_t *nacf;
u_char name[NGX_RTMP_MAX_NAME];
static ngx_str_t location = ngx_string("location");
rc = ngx_rtmp_notify_parse_http_retcode(s, in);
if (rc == NGX_ERROR) {
ngx_rtmp_notify_clear_flag(s, NGX_RTMP_NOTIFY_PUBLISHING);
return NGX_ERROR;
}
if (rc != NGX_AGAIN) {
goto next;
}
/* HTTP 3xx */
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"notify: publish redirect received");
rc = ngx_rtmp_notify_parse_http_header(s, in, &location, name,
sizeof(name) - 1);
if (rc <= 0) {
goto next;
}
if (ngx_strncasecmp(name, (u_char *) "rtmp://", 7)) {
*ngx_cpymem(v->name, name, rc) = 0;
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: publish redirect to '%s'", v->name);
goto next;
}
/* push */
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (nacf->relay_redirect) {
ngx_rtmp_notify_set_name(v->name, NGX_RTMP_MAX_NAME, name, (size_t) rc);
}
ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
"notify: push '%s' to '%*s'", v->name, rc, name);
local_name.data = v->name;
local_name.len = ngx_strlen(v->name);
ngx_memzero(&target, sizeof(target));
u = &target.url;
u->url = local_name;
u->url.data = name + 7;
u->url.len = rc - 7;
u->default_port = 1935;
u->uri_part = 1;
u->no_resolve = 1; /* want ip here */
if (ngx_parse_url(s->connection->pool, u) != NGX_OK) {
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: push failed '%V'", &local_name);
return NGX_ERROR;
}
ngx_rtmp_relay_push(s, &local_name, &target);
next:
return next_publish(s, v);
}
static ngx_int_t
ngx_rtmp_notify_play_handle(ngx_rtmp_session_t *s,
void *arg, ngx_chain_t *in)
{
ngx_rtmp_play_t *v = arg;
ngx_int_t rc;
ngx_str_t local_name;
ngx_rtmp_relay_target_t target;
ngx_url_t *u;
ngx_rtmp_notify_app_conf_t *nacf;
u_char name[NGX_RTMP_MAX_NAME];
static ngx_str_t location = ngx_string("location");
rc = ngx_rtmp_notify_parse_http_retcode(s, in);
if (rc == NGX_ERROR) {
ngx_rtmp_notify_clear_flag(s, NGX_RTMP_NOTIFY_PLAYING);
return NGX_ERROR;
}
if (rc != NGX_AGAIN) {
goto next;
}
/* HTTP 3xx */
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"notify: play redirect received");
rc = ngx_rtmp_notify_parse_http_header(s, in, &location, name,
sizeof(name) - 1);
if (rc <= 0) {
goto next;
}
if (ngx_strncasecmp(name, (u_char *) "rtmp://", 7)) {
*ngx_cpymem(v->name, name, rc) = 0;
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: play redirect to '%s'", v->name);
goto next;
}
/* pull */
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (nacf->relay_redirect) {
ngx_rtmp_notify_set_name(v->name, NGX_RTMP_MAX_NAME, name, (size_t) rc);
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: pull '%s' from '%*s'", v->name, rc, name);
local_name.data = v->name;
local_name.len = ngx_strlen(v->name);
ngx_memzero(&target, sizeof(target));
u = &target.url;
u->url = local_name;
u->url.data = name + 7;
u->url.len = rc - 7;
u->default_port = 1935;
u->uri_part = 1;
u->no_resolve = 1; /* want ip here */
if (ngx_parse_url(s->connection->pool, u) != NGX_OK) {
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: pull failed '%V'", &local_name);
return NGX_ERROR;
}
ngx_rtmp_relay_pull(s, &local_name, &target);
next:
return next_play(s, v);
}
static ngx_int_t
ngx_rtmp_notify_update_handle(ngx_rtmp_session_t *s,
void *arg, ngx_chain_t *in)
{
ngx_rtmp_notify_app_conf_t *nacf;
ngx_rtmp_notify_ctx_t *ctx;
ngx_int_t rc;
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
rc = ngx_rtmp_notify_parse_http_retcode(s, in);
if ((!nacf->update_strict && rc == NGX_ERROR) ||
(nacf->update_strict && rc != NGX_OK))
{
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: update failed");
return NGX_ERROR;
}
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"notify: schedule update %Mms",
nacf->update_timeout);
ngx_add_timer(&ctx->update_evt, nacf->update_timeout);
return NGX_OK;
}
static void
ngx_rtmp_notify_update(ngx_event_t *e)
{
ngx_connection_t *c;
ngx_rtmp_session_t *s;
ngx_rtmp_notify_app_conf_t *nacf;
ngx_rtmp_netcall_init_t ci;
ngx_url_t *url;
c = e->data;
s = c->data;
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
url = nacf->url[NGX_RTMP_NOTIFY_UPDATE];
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: update '%V'", &url->url);
ngx_memzero(&ci, sizeof(ci));
ci.url = url;
ci.create = ngx_rtmp_notify_update_create;
ci.handle = ngx_rtmp_notify_update_handle;
if (ngx_rtmp_netcall_create(s, &ci) == NGX_OK) {
return;
}
/* schedule next update on connection error */
ngx_rtmp_notify_update_handle(s, NULL, NULL);
}
static void
ngx_rtmp_notify_init(ngx_rtmp_session_t *s,
u_char name[NGX_RTMP_MAX_NAME], u_char args[NGX_RTMP_MAX_ARGS],
ngx_uint_t flags)
{
ngx_rtmp_notify_ctx_t *ctx;
ngx_rtmp_notify_app_conf_t *nacf;
ngx_event_t *e;
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (!nacf->active) {
return;
}
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
if (ctx == NULL) {
ctx = ngx_pcalloc(s->connection->pool, sizeof(ngx_rtmp_notify_ctx_t));
if (ctx == NULL) {
return;
}
ngx_rtmp_set_ctx(s, ctx, ngx_rtmp_notify_module);
}
ngx_memcpy(ctx->name, name, NGX_RTMP_MAX_NAME);
ngx_memcpy(ctx->args, args, NGX_RTMP_MAX_ARGS);
ctx->flags |= flags;
if (nacf->url[NGX_RTMP_NOTIFY_UPDATE] == NULL ||
nacf->update_timeout == 0)
{
return;
}
if (ctx->update_evt.timer_set) {
return;
}
ctx->start = ngx_cached_time->sec;
e = &ctx->update_evt;
e->data = s->connection;
e->log = s->connection->log;
e->handler = ngx_rtmp_notify_update;
ngx_add_timer(e, nacf->update_timeout);
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"notify: schedule initial update %Mms",
nacf->update_timeout);
}
static ngx_int_t
ngx_rtmp_notify_connect(ngx_rtmp_session_t *s, ngx_rtmp_connect_t *v)
{
ngx_rtmp_notify_srv_conf_t *nscf;
ngx_rtmp_netcall_init_t ci;
ngx_url_t *url;
if (s->auto_pushed || s->relay) {
goto next;
}
nscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_notify_module);
url = nscf->url[NGX_RTMP_NOTIFY_CONNECT];
if (url == NULL) {
goto next;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: connect '%V'", &url->url);
ngx_memzero(&ci, sizeof(ci));
ci.url = url;
ci.create = ngx_rtmp_notify_connect_create;
ci.handle = ngx_rtmp_notify_connect_handle;
ci.arg = v;
ci.argsize = sizeof(*v);
return ngx_rtmp_netcall_create(s, &ci);
next:
return next_connect(s, v);
}
static ngx_int_t
ngx_rtmp_notify_disconnect(ngx_rtmp_session_t *s)
{
ngx_rtmp_notify_srv_conf_t *nscf;
ngx_rtmp_netcall_init_t ci;
ngx_url_t *url;
if (s->auto_pushed || s->relay) {
goto next;
}
nscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_notify_module);
url = nscf->url[NGX_RTMP_NOTIFY_DISCONNECT];
if (url == NULL) {
goto next;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: disconnect '%V'", &url->url);
ngx_memzero(&ci, sizeof(ci));
ci.url = url;
ci.create = ngx_rtmp_notify_disconnect_create;
ngx_rtmp_netcall_create(s, &ci);
next:
return next_disconnect(s);
}
static ngx_int_t
ngx_rtmp_notify_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
{
ngx_rtmp_notify_app_conf_t *nacf;
ngx_rtmp_netcall_init_t ci;
ngx_url_t *url;
if (s->auto_pushed) {
goto next;
}
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (nacf == NULL) {
goto next;
}
url = nacf->url[NGX_RTMP_NOTIFY_PUBLISH];
ngx_rtmp_notify_init(s, v->name, v->args, NGX_RTMP_NOTIFY_PUBLISHING);
if (url == NULL) {
goto next;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: publish '%V'", &url->url);
ngx_memzero(&ci, sizeof(ci));
ci.url = url;
ci.create = ngx_rtmp_notify_publish_create;
ci.handle = ngx_rtmp_notify_publish_handle;
ci.arg = v;
ci.argsize = sizeof(*v);
return ngx_rtmp_netcall_create(s, &ci);
next:
return next_publish(s, v);
}
static ngx_int_t
ngx_rtmp_notify_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_rtmp_notify_app_conf_t *nacf;
ngx_rtmp_netcall_init_t ci;
ngx_url_t *url;
if (s->auto_pushed) {
goto next;
}
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (nacf == NULL) {
goto next;
}
url = nacf->url[NGX_RTMP_NOTIFY_PLAY];
ngx_rtmp_notify_init(s, v->name, v->args, NGX_RTMP_NOTIFY_PLAYING);
if (url == NULL) {
goto next;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: play '%V'", &url->url);
ngx_memzero(&ci, sizeof(ci));
ci.url = url;
ci.create = ngx_rtmp_notify_play_create;
ci.handle = ngx_rtmp_notify_play_handle;
ci.arg = v;
ci.argsize = sizeof(*v);
return ngx_rtmp_netcall_create(s, &ci);
next:
return next_play(s, v);
}
static ngx_int_t
ngx_rtmp_notify_close_stream(ngx_rtmp_session_t *s,
ngx_rtmp_close_stream_t *v)
{
ngx_rtmp_notify_ctx_t *ctx;
ngx_rtmp_notify_app_conf_t *nacf;
if (s->auto_pushed) {
goto next;
}
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
if (ctx == NULL) {
goto next;
}
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (nacf == NULL) {
goto next;
}
if (ctx->flags & NGX_RTMP_NOTIFY_PUBLISHING) {
ngx_rtmp_notify_done(s, "publish_done", NGX_RTMP_NOTIFY_PUBLISH_DONE);
}
if (ctx->flags & NGX_RTMP_NOTIFY_PLAYING) {
ngx_rtmp_notify_done(s, "play_done", NGX_RTMP_NOTIFY_PLAY_DONE);
}
if (ctx->flags) {
ngx_rtmp_notify_done(s, "done", NGX_RTMP_NOTIFY_DONE);
}
if (ctx->update_evt.timer_set) {
ngx_del_timer(&ctx->update_evt);
}
ctx->flags = 0;
next:
return next_close_stream(s, v);
}
static ngx_int_t
ngx_rtmp_notify_record_done(ngx_rtmp_session_t *s, ngx_rtmp_record_done_t *v)
{
ngx_rtmp_netcall_init_t ci;
ngx_rtmp_notify_app_conf_t *nacf;
if (s->auto_pushed) {
goto next;
}
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
if (nacf == NULL || nacf->url[NGX_RTMP_NOTIFY_RECORD_DONE] == NULL) {
goto next;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: record_done recorder=%V path='%V' url='%V'",
&v->recorder, &v->path,
&nacf->url[NGX_RTMP_NOTIFY_RECORD_DONE]->url);
ngx_memzero(&ci, sizeof(ci));
ci.url = nacf->url[NGX_RTMP_NOTIFY_RECORD_DONE];
ci.create = ngx_rtmp_notify_record_done_create;
ci.arg = v;
ngx_rtmp_netcall_create(s, &ci);
next:
return next_record_done(s, v);
}
static ngx_int_t
ngx_rtmp_notify_done(ngx_rtmp_session_t *s, char *cbname, ngx_uint_t url_idx)
{
ngx_rtmp_netcall_init_t ci;
ngx_rtmp_notify_done_t ds;
ngx_rtmp_notify_app_conf_t *nacf;
ngx_url_t *url;
nacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_notify_module);
url = nacf->url[url_idx];
if (url == NULL) {
return NGX_OK;
}
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"notify: %s '%V'", cbname, &url->url);
ds.cbname = (u_char *) cbname;
ds.url_idx = url_idx;
ngx_memzero(&ci, sizeof(ci));
ci.url = url;
ci.arg = &ds;
ci.create = ngx_rtmp_notify_done_create;
return ngx_rtmp_netcall_create(s, &ci);
}
static ngx_url_t *
ngx_rtmp_notify_parse_url(ngx_conf_t *cf, ngx_str_t *url)
{
ngx_url_t *u;
size_t add;
add = 0;
u = ngx_pcalloc(cf->pool, sizeof(ngx_url_t));
if (u == NULL) {
return NULL;
}
if (ngx_strncasecmp(url->data, (u_char *) "http://", 7) == 0) {
add = 7;
}
u->url.len = url->len - add;
u->url.data = url->data + add;
u->default_port = 80;
u->uri_part = 1;
if (ngx_parse_url(cf->pool, u) != NGX_OK) {
if (u->err) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"%s in url \"%V\"", u->err, &u->url);
}
return NULL;
}
return u;
}
static char *
ngx_rtmp_notify_on_srv_event(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_rtmp_notify_srv_conf_t *nscf = conf;
ngx_str_t *name, *value;
ngx_url_t *u;
ngx_uint_t n;
value = cf->args->elts;
u = ngx_rtmp_notify_parse_url(cf, &value[1]);
if (u == NULL) {
return NGX_CONF_ERROR;
}
name = &value[0];
n = 0;
switch (name->len) {
case sizeof("on_connect") - 1:
n = NGX_RTMP_NOTIFY_CONNECT;
break;
case sizeof("on_disconnect") - 1:
n = NGX_RTMP_NOTIFY_DISCONNECT;
break;
}
nscf->url[n] = u;
return NGX_CONF_OK;
}
static char *
ngx_rtmp_notify_on_app_event(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_rtmp_notify_app_conf_t *nacf = conf;
ngx_str_t *name, *value;
ngx_url_t *u;
ngx_uint_t n;
value = cf->args->elts;
u = ngx_rtmp_notify_parse_url(cf, &value[1]);
if (u == NULL) {
return NGX_CONF_ERROR;
}
name = &value[0];
n = 0;
switch (name->len) {
case sizeof("on_done") - 1: /* and on_play */
if (name->data[3] == 'd') {
n = NGX_RTMP_NOTIFY_DONE;
} else {
n = NGX_RTMP_NOTIFY_PLAY;
}
break;
case sizeof("on_update") - 1:
n = NGX_RTMP_NOTIFY_UPDATE;
break;
case sizeof("on_publish") - 1:
n = NGX_RTMP_NOTIFY_PUBLISH;
break;
case sizeof("on_play_done") - 1:
n = NGX_RTMP_NOTIFY_PLAY_DONE;
break;
case sizeof("on_record_done") - 1:
n = NGX_RTMP_NOTIFY_RECORD_DONE;
break;
case sizeof("on_publish_done") - 1:
n = NGX_RTMP_NOTIFY_PUBLISH_DONE;
break;
}
nacf->url[n] = u;
return NGX_CONF_OK;
}
static char *
ngx_rtmp_notify_method(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_rtmp_notify_app_conf_t *nacf = conf;
ngx_rtmp_notify_srv_conf_t *nscf;
ngx_str_t *value;
value = cf->args->elts;
value++;
if (value->len == sizeof("get") - 1 &&
ngx_strncasecmp(value->data, (u_char *) "get", value->len) == 0)
{
nacf->method = NGX_RTMP_NETCALL_HTTP_GET;
} else if (value->len == sizeof("post") - 1 &&
ngx_strncasecmp(value->data, (u_char *) "post", value->len) == 0)
{
nacf->method = NGX_RTMP_NETCALL_HTTP_POST;
} else {
return "got unexpected method";
}
nscf = ngx_rtmp_conf_get_module_srv_conf(cf, ngx_rtmp_notify_module);
nscf->method = nacf->method;
return NGX_CONF_OK;
}
static ngx_int_t
ngx_rtmp_notify_postconfiguration(ngx_conf_t *cf)
{
next_connect = ngx_rtmp_connect;
ngx_rtmp_connect = ngx_rtmp_notify_connect;
next_disconnect = ngx_rtmp_disconnect;
ngx_rtmp_disconnect = ngx_rtmp_notify_disconnect;
next_publish = ngx_rtmp_publish;
ngx_rtmp_publish = ngx_rtmp_notify_publish;
next_play = ngx_rtmp_play;
ngx_rtmp_play = ngx_rtmp_notify_play;
next_close_stream = ngx_rtmp_close_stream;
ngx_rtmp_close_stream = ngx_rtmp_notify_close_stream;
next_record_done = ngx_rtmp_record_done;
ngx_rtmp_record_done = ngx_rtmp_notify_record_done;
return NGX_OK;
}
| bsd-2-clause |
mikedlowis-prototypes/albase | source/kernel/kernel/rcu/tree.c | 46 | 145227 | /*
* Read-Copy Update mechanism for mutual exclusion
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can access it online at
* http://www.gnu.org/licenses/gpl-2.0.html.
*
* Copyright IBM Corporation, 2008
*
* Authors: Dipankar Sarma <dipankar@in.ibm.com>
* Manfred Spraul <manfred@colorfullife.com>
* Paul E. McKenney <paulmck@linux.vnet.ibm.com> Hierarchical version
*
* Based on the original work by Paul McKenney <paulmck@us.ibm.com>
* and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
*
* For detailed explanation of Read-Copy Update mechanism see -
* Documentation/RCU
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/smp.h>
#include <linux/rcupdate.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/nmi.h>
#include <linux/atomic.h>
#include <linux/bitops.h>
#include <linux/export.h>
#include <linux/completion.h>
#include <linux/moduleparam.h>
#include <linux/module.h>
#include <linux/percpu.h>
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/mutex.h>
#include <linux/time.h>
#include <linux/kernel_stat.h>
#include <linux/wait.h>
#include <linux/kthread.h>
#include <linux/prefetch.h>
#include <linux/delay.h>
#include <linux/stop_machine.h>
#include <linux/random.h>
#include <linux/trace_events.h>
#include <linux/suspend.h>
#include "tree.h"
#include "rcu.h"
MODULE_ALIAS("rcutree");
#ifdef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#endif
#define MODULE_PARAM_PREFIX "rcutree."
/* Data structures. */
/*
* In order to export the rcu_state name to the tracing tools, it
* needs to be added in the __tracepoint_string section.
* This requires defining a separate variable tp_<sname>_varname
* that points to the string being used, and this will allow
* the tracing userspace tools to be able to decipher the string
* address to the matching string.
*/
#ifdef CONFIG_TRACING
# define DEFINE_RCU_TPS(sname) \
static char sname##_varname[] = #sname; \
static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname;
# define RCU_STATE_NAME(sname) sname##_varname
#else
# define DEFINE_RCU_TPS(sname)
# define RCU_STATE_NAME(sname) __stringify(sname)
#endif
#define RCU_STATE_INITIALIZER(sname, sabbr, cr) \
DEFINE_RCU_TPS(sname) \
static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, sname##_data); \
struct rcu_state sname##_state = { \
.level = { &sname##_state.node[0] }, \
.rda = &sname##_data, \
.call = cr, \
.gp_state = RCU_GP_IDLE, \
.gpnum = 0UL - 300UL, \
.completed = 0UL - 300UL, \
.orphan_lock = __RAW_SPIN_LOCK_UNLOCKED(&sname##_state.orphan_lock), \
.orphan_nxttail = &sname##_state.orphan_nxtlist, \
.orphan_donetail = &sname##_state.orphan_donelist, \
.barrier_mutex = __MUTEX_INITIALIZER(sname##_state.barrier_mutex), \
.name = RCU_STATE_NAME(sname), \
.abbr = sabbr, \
}
RCU_STATE_INITIALIZER(rcu_sched, 's', call_rcu_sched);
RCU_STATE_INITIALIZER(rcu_bh, 'b', call_rcu_bh);
static struct rcu_state *const rcu_state_p;
static struct rcu_data __percpu *const rcu_data_p;
LIST_HEAD(rcu_struct_flavors);
/* Dump rcu_node combining tree at boot to verify correct setup. */
static bool dump_tree;
module_param(dump_tree, bool, 0444);
/* Control rcu_node-tree auto-balancing at boot time. */
static bool rcu_fanout_exact;
module_param(rcu_fanout_exact, bool, 0444);
/* Increase (but not decrease) the RCU_FANOUT_LEAF at boot time. */
static int rcu_fanout_leaf = RCU_FANOUT_LEAF;
module_param(rcu_fanout_leaf, int, 0444);
int rcu_num_lvls __read_mostly = RCU_NUM_LVLS;
/* Number of rcu_nodes at specified level. */
static int num_rcu_lvl[] = NUM_RCU_LVL_INIT;
int rcu_num_nodes __read_mostly = NUM_RCU_NODES; /* Total # rcu_nodes in use. */
/*
* The rcu_scheduler_active variable transitions from zero to one just
* before the first task is spawned. So when this variable is zero, RCU
* can assume that there is but one task, allowing RCU to (for example)
* optimize synchronize_sched() to a simple barrier(). When this variable
* is one, RCU must actually do all the hard work required to detect real
* grace periods. This variable is also used to suppress boot-time false
* positives from lockdep-RCU error checking.
*/
int rcu_scheduler_active __read_mostly;
EXPORT_SYMBOL_GPL(rcu_scheduler_active);
/*
* The rcu_scheduler_fully_active variable transitions from zero to one
* during the early_initcall() processing, which is after the scheduler
* is capable of creating new tasks. So RCU processing (for example,
* creating tasks for RCU priority boosting) must be delayed until after
* rcu_scheduler_fully_active transitions from zero to one. We also
* currently delay invocation of any RCU callbacks until after this point.
*
* It might later prove better for people registering RCU callbacks during
* early boot to take responsibility for these callbacks, but one step at
* a time.
*/
static int rcu_scheduler_fully_active __read_mostly;
static void rcu_init_new_rnp(struct rcu_node *rnp_leaf);
static void rcu_cleanup_dead_rnp(struct rcu_node *rnp_leaf);
static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu);
static void invoke_rcu_core(void);
static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp);
static void rcu_report_exp_rdp(struct rcu_state *rsp,
struct rcu_data *rdp, bool wake);
/* rcuc/rcub kthread realtime priority */
#ifdef CONFIG_RCU_KTHREAD_PRIO
static int kthread_prio = CONFIG_RCU_KTHREAD_PRIO;
#else /* #ifdef CONFIG_RCU_KTHREAD_PRIO */
static int kthread_prio = IS_ENABLED(CONFIG_RCU_BOOST) ? 1 : 0;
#endif /* #else #ifdef CONFIG_RCU_KTHREAD_PRIO */
module_param(kthread_prio, int, 0644);
/* Delay in jiffies for grace-period initialization delays, debug only. */
#ifdef CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT
static int gp_preinit_delay = CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT_DELAY;
module_param(gp_preinit_delay, int, 0644);
#else /* #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT */
static const int gp_preinit_delay;
#endif /* #else #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT */
#ifdef CONFIG_RCU_TORTURE_TEST_SLOW_INIT
static int gp_init_delay = CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY;
module_param(gp_init_delay, int, 0644);
#else /* #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_INIT */
static const int gp_init_delay;
#endif /* #else #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_INIT */
#ifdef CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP
static int gp_cleanup_delay = CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP_DELAY;
module_param(gp_cleanup_delay, int, 0644);
#else /* #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP */
static const int gp_cleanup_delay;
#endif /* #else #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP */
/*
* Number of grace periods between delays, normalized by the duration of
* the delay. The longer the the delay, the more the grace periods between
* each delay. The reason for this normalization is that it means that,
* for non-zero delays, the overall slowdown of grace periods is constant
* regardless of the duration of the delay. This arrangement balances
* the need for long delays to increase some race probabilities with the
* need for fast grace periods to increase other race probabilities.
*/
#define PER_RCU_NODE_PERIOD 3 /* Number of grace periods between delays. */
/*
* Track the rcutorture test sequence number and the update version
* number within a given test. The rcutorture_testseq is incremented
* on every rcutorture module load and unload, so has an odd value
* when a test is running. The rcutorture_vernum is set to zero
* when rcutorture starts and is incremented on each rcutorture update.
* These variables enable correlating rcutorture output with the
* RCU tracing information.
*/
unsigned long rcutorture_testseq;
unsigned long rcutorture_vernum;
/*
* Compute the mask of online CPUs for the specified rcu_node structure.
* This will not be stable unless the rcu_node structure's ->lock is
* held, but the bit corresponding to the current CPU will be stable
* in most contexts.
*/
unsigned long rcu_rnp_online_cpus(struct rcu_node *rnp)
{
return READ_ONCE(rnp->qsmaskinitnext);
}
/*
* Return true if an RCU grace period is in progress. The READ_ONCE()s
* permit this function to be invoked without holding the root rcu_node
* structure's ->lock, but of course results can be subject to change.
*/
static int rcu_gp_in_progress(struct rcu_state *rsp)
{
return READ_ONCE(rsp->completed) != READ_ONCE(rsp->gpnum);
}
/*
* Note a quiescent state. Because we do not need to know
* how many quiescent states passed, just if there was at least
* one since the start of the grace period, this just sets a flag.
* The caller must have disabled preemption.
*/
void rcu_sched_qs(void)
{
if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.s))
return;
trace_rcu_grace_period(TPS("rcu_sched"),
__this_cpu_read(rcu_sched_data.gpnum),
TPS("cpuqs"));
__this_cpu_write(rcu_sched_data.cpu_no_qs.b.norm, false);
if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp))
return;
__this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false);
rcu_report_exp_rdp(&rcu_sched_state,
this_cpu_ptr(&rcu_sched_data), true);
}
void rcu_bh_qs(void)
{
if (__this_cpu_read(rcu_bh_data.cpu_no_qs.s)) {
trace_rcu_grace_period(TPS("rcu_bh"),
__this_cpu_read(rcu_bh_data.gpnum),
TPS("cpuqs"));
__this_cpu_write(rcu_bh_data.cpu_no_qs.b.norm, false);
}
}
static DEFINE_PER_CPU(int, rcu_sched_qs_mask);
static DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {
.dynticks_nesting = DYNTICK_TASK_EXIT_IDLE,
.dynticks = ATOMIC_INIT(1),
#ifdef CONFIG_NO_HZ_FULL_SYSIDLE
.dynticks_idle_nesting = DYNTICK_TASK_NEST_VALUE,
.dynticks_idle = ATOMIC_INIT(1),
#endif /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
};
DEFINE_PER_CPU_SHARED_ALIGNED(unsigned long, rcu_qs_ctr);
EXPORT_PER_CPU_SYMBOL_GPL(rcu_qs_ctr);
/*
* Let the RCU core know that this CPU has gone through the scheduler,
* which is a quiescent state. This is called when the need for a
* quiescent state is urgent, so we burn an atomic operation and full
* memory barriers to let the RCU core know about it, regardless of what
* this CPU might (or might not) do in the near future.
*
* We inform the RCU core by emulating a zero-duration dyntick-idle
* period, which we in turn do by incrementing the ->dynticks counter
* by two.
*
* The caller must have disabled interrupts.
*/
static void rcu_momentary_dyntick_idle(void)
{
struct rcu_data *rdp;
struct rcu_dynticks *rdtp;
int resched_mask;
struct rcu_state *rsp;
/*
* Yes, we can lose flag-setting operations. This is OK, because
* the flag will be set again after some delay.
*/
resched_mask = raw_cpu_read(rcu_sched_qs_mask);
raw_cpu_write(rcu_sched_qs_mask, 0);
/* Find the flavor that needs a quiescent state. */
for_each_rcu_flavor(rsp) {
rdp = raw_cpu_ptr(rsp->rda);
if (!(resched_mask & rsp->flavor_mask))
continue;
smp_mb(); /* rcu_sched_qs_mask before cond_resched_completed. */
if (READ_ONCE(rdp->mynode->completed) !=
READ_ONCE(rdp->cond_resched_completed))
continue;
/*
* Pretend to be momentarily idle for the quiescent state.
* This allows the grace-period kthread to record the
* quiescent state, with no need for this CPU to do anything
* further.
*/
rdtp = this_cpu_ptr(&rcu_dynticks);
smp_mb__before_atomic(); /* Earlier stuff before QS. */
atomic_add(2, &rdtp->dynticks); /* QS. */
smp_mb__after_atomic(); /* Later stuff after QS. */
break;
}
}
/*
* Note a context switch. This is a quiescent state for RCU-sched,
* and requires special handling for preemptible RCU.
* The caller must have disabled interrupts.
*/
void rcu_note_context_switch(void)
{
barrier(); /* Avoid RCU read-side critical sections leaking down. */
trace_rcu_utilization(TPS("Start context switch"));
rcu_sched_qs();
rcu_preempt_note_context_switch();
if (unlikely(raw_cpu_read(rcu_sched_qs_mask)))
rcu_momentary_dyntick_idle();
trace_rcu_utilization(TPS("End context switch"));
barrier(); /* Avoid RCU read-side critical sections leaking up. */
}
EXPORT_SYMBOL_GPL(rcu_note_context_switch);
/*
* Register a quiescent state for all RCU flavors. If there is an
* emergency, invoke rcu_momentary_dyntick_idle() to do a heavy-weight
* dyntick-idle quiescent state visible to other CPUs (but only for those
* RCU flavors in desperate need of a quiescent state, which will normally
* be none of them). Either way, do a lightweight quiescent state for
* all RCU flavors.
*
* The barrier() calls are redundant in the common case when this is
* called externally, but just in case this is called from within this
* file.
*
*/
void rcu_all_qs(void)
{
unsigned long flags;
barrier(); /* Avoid RCU read-side critical sections leaking down. */
if (unlikely(raw_cpu_read(rcu_sched_qs_mask))) {
local_irq_save(flags);
rcu_momentary_dyntick_idle();
local_irq_restore(flags);
}
this_cpu_inc(rcu_qs_ctr);
barrier(); /* Avoid RCU read-side critical sections leaking up. */
}
EXPORT_SYMBOL_GPL(rcu_all_qs);
static long blimit = 10; /* Maximum callbacks per rcu_do_batch. */
static long qhimark = 10000; /* If this many pending, ignore blimit. */
static long qlowmark = 100; /* Once only this many pending, use blimit. */
module_param(blimit, long, 0444);
module_param(qhimark, long, 0444);
module_param(qlowmark, long, 0444);
static ulong jiffies_till_first_fqs = ULONG_MAX;
static ulong jiffies_till_next_fqs = ULONG_MAX;
module_param(jiffies_till_first_fqs, ulong, 0644);
module_param(jiffies_till_next_fqs, ulong, 0644);
/*
* How long the grace period must be before we start recruiting
* quiescent-state help from rcu_note_context_switch().
*/
static ulong jiffies_till_sched_qs = HZ / 20;
module_param(jiffies_till_sched_qs, ulong, 0644);
static bool rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp,
struct rcu_data *rdp);
static void force_qs_rnp(struct rcu_state *rsp,
int (*f)(struct rcu_data *rsp, bool *isidle,
unsigned long *maxj),
bool *isidle, unsigned long *maxj);
static void force_quiescent_state(struct rcu_state *rsp);
static int rcu_pending(void);
/*
* Return the number of RCU batches started thus far for debug & stats.
*/
unsigned long rcu_batches_started(void)
{
return rcu_state_p->gpnum;
}
EXPORT_SYMBOL_GPL(rcu_batches_started);
/*
* Return the number of RCU-sched batches started thus far for debug & stats.
*/
unsigned long rcu_batches_started_sched(void)
{
return rcu_sched_state.gpnum;
}
EXPORT_SYMBOL_GPL(rcu_batches_started_sched);
/*
* Return the number of RCU BH batches started thus far for debug & stats.
*/
unsigned long rcu_batches_started_bh(void)
{
return rcu_bh_state.gpnum;
}
EXPORT_SYMBOL_GPL(rcu_batches_started_bh);
/*
* Return the number of RCU batches completed thus far for debug & stats.
*/
unsigned long rcu_batches_completed(void)
{
return rcu_state_p->completed;
}
EXPORT_SYMBOL_GPL(rcu_batches_completed);
/*
* Return the number of RCU-sched batches completed thus far for debug & stats.
*/
unsigned long rcu_batches_completed_sched(void)
{
return rcu_sched_state.completed;
}
EXPORT_SYMBOL_GPL(rcu_batches_completed_sched);
/*
* Return the number of RCU BH batches completed thus far for debug & stats.
*/
unsigned long rcu_batches_completed_bh(void)
{
return rcu_bh_state.completed;
}
EXPORT_SYMBOL_GPL(rcu_batches_completed_bh);
/*
* Force a quiescent state.
*/
void rcu_force_quiescent_state(void)
{
force_quiescent_state(rcu_state_p);
}
EXPORT_SYMBOL_GPL(rcu_force_quiescent_state);
/*
* Force a quiescent state for RCU BH.
*/
void rcu_bh_force_quiescent_state(void)
{
force_quiescent_state(&rcu_bh_state);
}
EXPORT_SYMBOL_GPL(rcu_bh_force_quiescent_state);
/*
* Force a quiescent state for RCU-sched.
*/
void rcu_sched_force_quiescent_state(void)
{
force_quiescent_state(&rcu_sched_state);
}
EXPORT_SYMBOL_GPL(rcu_sched_force_quiescent_state);
/*
* Show the state of the grace-period kthreads.
*/
void show_rcu_gp_kthreads(void)
{
struct rcu_state *rsp;
for_each_rcu_flavor(rsp) {
pr_info("%s: wait state: %d ->state: %#lx\n",
rsp->name, rsp->gp_state, rsp->gp_kthread->state);
/* sched_show_task(rsp->gp_kthread); */
}
}
EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads);
/*
* Record the number of times rcutorture tests have been initiated and
* terminated. This information allows the debugfs tracing stats to be
* correlated to the rcutorture messages, even when the rcutorture module
* is being repeatedly loaded and unloaded. In other words, we cannot
* store this state in rcutorture itself.
*/
void rcutorture_record_test_transition(void)
{
rcutorture_testseq++;
rcutorture_vernum = 0;
}
EXPORT_SYMBOL_GPL(rcutorture_record_test_transition);
/*
* Send along grace-period-related data for rcutorture diagnostics.
*/
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
unsigned long *gpnum, unsigned long *completed)
{
struct rcu_state *rsp = NULL;
switch (test_type) {
case RCU_FLAVOR:
rsp = rcu_state_p;
break;
case RCU_BH_FLAVOR:
rsp = &rcu_bh_state;
break;
case RCU_SCHED_FLAVOR:
rsp = &rcu_sched_state;
break;
default:
break;
}
if (rsp != NULL) {
*flags = READ_ONCE(rsp->gp_flags);
*gpnum = READ_ONCE(rsp->gpnum);
*completed = READ_ONCE(rsp->completed);
return;
}
*flags = 0;
*gpnum = 0;
*completed = 0;
}
EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
/*
* Record the number of writer passes through the current rcutorture test.
* This is also used to correlate debugfs tracing stats with the rcutorture
* messages.
*/
void rcutorture_record_progress(unsigned long vernum)
{
rcutorture_vernum++;
}
EXPORT_SYMBOL_GPL(rcutorture_record_progress);
/*
* Does the CPU have callbacks ready to be invoked?
*/
static int
cpu_has_callbacks_ready_to_invoke(struct rcu_data *rdp)
{
return &rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL] &&
rdp->nxttail[RCU_DONE_TAIL] != NULL;
}
/*
* Return the root node of the specified rcu_state structure.
*/
static struct rcu_node *rcu_get_root(struct rcu_state *rsp)
{
return &rsp->node[0];
}
/*
* Is there any need for future grace periods?
* Interrupts must be disabled. If the caller does not hold the root
* rnp_node structure's ->lock, the results are advisory only.
*/
static int rcu_future_needs_gp(struct rcu_state *rsp)
{
struct rcu_node *rnp = rcu_get_root(rsp);
int idx = (READ_ONCE(rnp->completed) + 1) & 0x1;
int *fp = &rnp->need_future_gp[idx];
return READ_ONCE(*fp);
}
/*
* Does the current CPU require a not-yet-started grace period?
* The caller must have disabled interrupts to prevent races with
* normal callback registry.
*/
static bool
cpu_needs_another_gp(struct rcu_state *rsp, struct rcu_data *rdp)
{
int i;
if (rcu_gp_in_progress(rsp))
return false; /* No, a grace period is already in progress. */
if (rcu_future_needs_gp(rsp))
return true; /* Yes, a no-CBs CPU needs one. */
if (!rdp->nxttail[RCU_NEXT_TAIL])
return false; /* No, this is a no-CBs (or offline) CPU. */
if (*rdp->nxttail[RCU_NEXT_READY_TAIL])
return true; /* Yes, CPU has newly registered callbacks. */
for (i = RCU_WAIT_TAIL; i < RCU_NEXT_TAIL; i++)
if (rdp->nxttail[i - 1] != rdp->nxttail[i] &&
ULONG_CMP_LT(READ_ONCE(rsp->completed),
rdp->nxtcompleted[i]))
return true; /* Yes, CBs for future grace period. */
return false; /* No grace period needed. */
}
/*
* rcu_eqs_enter_common - current CPU is moving towards extended quiescent state
*
* If the new value of the ->dynticks_nesting counter now is zero,
* we really have entered idle, and must do the appropriate accounting.
* The caller must have disabled interrupts.
*/
static void rcu_eqs_enter_common(long long oldval, bool user)
{
struct rcu_state *rsp;
struct rcu_data *rdp;
struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
trace_rcu_dyntick(TPS("Start"), oldval, rdtp->dynticks_nesting);
if (IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
!user && !is_idle_task(current)) {
struct task_struct *idle __maybe_unused =
idle_task(smp_processor_id());
trace_rcu_dyntick(TPS("Error on entry: not idle task"), oldval, 0);
ftrace_dump(DUMP_ORIG);
WARN_ONCE(1, "Current pid: %d comm: %s / Idle pid: %d comm: %s",
current->pid, current->comm,
idle->pid, idle->comm); /* must be idle task! */
}
for_each_rcu_flavor(rsp) {
rdp = this_cpu_ptr(rsp->rda);
do_nocb_deferred_wakeup(rdp);
}
rcu_prepare_for_idle();
/* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
smp_mb__before_atomic(); /* See above. */
atomic_inc(&rdtp->dynticks);
smp_mb__after_atomic(); /* Force ordering with next sojourn. */
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
atomic_read(&rdtp->dynticks) & 0x1);
rcu_dynticks_task_enter();
/*
* It is illegal to enter an extended quiescent state while
* in an RCU read-side critical section.
*/
RCU_LOCKDEP_WARN(lock_is_held(&rcu_lock_map),
"Illegal idle entry in RCU read-side critical section.");
RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map),
"Illegal idle entry in RCU-bh read-side critical section.");
RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map),
"Illegal idle entry in RCU-sched read-side critical section.");
}
/*
* Enter an RCU extended quiescent state, which can be either the
* idle loop or adaptive-tickless usermode execution.
*/
static void rcu_eqs_enter(bool user)
{
long long oldval;
struct rcu_dynticks *rdtp;
rdtp = this_cpu_ptr(&rcu_dynticks);
oldval = rdtp->dynticks_nesting;
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
(oldval & DYNTICK_TASK_NEST_MASK) == 0);
if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) {
rdtp->dynticks_nesting = 0;
rcu_eqs_enter_common(oldval, user);
} else {
rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE;
}
}
/**
* rcu_idle_enter - inform RCU that current CPU is entering idle
*
* Enter idle mode, in other words, -leave- the mode in which RCU
* read-side critical sections can occur. (Though RCU read-side
* critical sections can occur in irq handlers in idle, a possibility
* handled by irq_enter() and irq_exit().)
*
* We crowbar the ->dynticks_nesting field to zero to allow for
* the possibility of usermode upcalls having messed up our count
* of interrupt nesting level during the prior busy period.
*/
void rcu_idle_enter(void)
{
unsigned long flags;
local_irq_save(flags);
rcu_eqs_enter(false);
rcu_sysidle_enter(0);
local_irq_restore(flags);
}
EXPORT_SYMBOL_GPL(rcu_idle_enter);
#ifdef CONFIG_NO_HZ_FULL
/**
* rcu_user_enter - inform RCU that we are resuming userspace.
*
* Enter RCU idle mode right before resuming userspace. No use of RCU
* is permitted between this call and rcu_user_exit(). This way the
* CPU doesn't need to maintain the tick for RCU maintenance purposes
* when the CPU runs in userspace.
*/
void rcu_user_enter(void)
{
rcu_eqs_enter(1);
}
#endif /* CONFIG_NO_HZ_FULL */
/**
* rcu_irq_exit - inform RCU that current CPU is exiting irq towards idle
*
* Exit from an interrupt handler, which might possibly result in entering
* idle mode, in other words, leaving the mode in which read-side critical
* sections can occur. The caller must have disabled interrupts.
*
* This code assumes that the idle loop never does anything that might
* result in unbalanced calls to irq_enter() and irq_exit(). If your
* architecture violates this assumption, RCU will give you what you
* deserve, good and hard. But very infrequently and irreproducibly.
*
* Use things like work queues to work around this limitation.
*
* You have been warned.
*/
void rcu_irq_exit(void)
{
long long oldval;
struct rcu_dynticks *rdtp;
RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_irq_exit() invoked with irqs enabled!!!");
rdtp = this_cpu_ptr(&rcu_dynticks);
oldval = rdtp->dynticks_nesting;
rdtp->dynticks_nesting--;
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
rdtp->dynticks_nesting < 0);
if (rdtp->dynticks_nesting)
trace_rcu_dyntick(TPS("--="), oldval, rdtp->dynticks_nesting);
else
rcu_eqs_enter_common(oldval, true);
rcu_sysidle_enter(1);
}
/*
* Wrapper for rcu_irq_exit() where interrupts are enabled.
*/
void rcu_irq_exit_irqson(void)
{
unsigned long flags;
local_irq_save(flags);
rcu_irq_exit();
local_irq_restore(flags);
}
/*
* rcu_eqs_exit_common - current CPU moving away from extended quiescent state
*
* If the new value of the ->dynticks_nesting counter was previously zero,
* we really have exited idle, and must do the appropriate accounting.
* The caller must have disabled interrupts.
*/
static void rcu_eqs_exit_common(long long oldval, int user)
{
struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
rcu_dynticks_task_exit();
smp_mb__before_atomic(); /* Force ordering w/previous sojourn. */
atomic_inc(&rdtp->dynticks);
/* CPUs seeing atomic_inc() must see later RCU read-side crit sects */
smp_mb__after_atomic(); /* See above. */
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
!(atomic_read(&rdtp->dynticks) & 0x1));
rcu_cleanup_after_idle();
trace_rcu_dyntick(TPS("End"), oldval, rdtp->dynticks_nesting);
if (IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
!user && !is_idle_task(current)) {
struct task_struct *idle __maybe_unused =
idle_task(smp_processor_id());
trace_rcu_dyntick(TPS("Error on exit: not idle task"),
oldval, rdtp->dynticks_nesting);
ftrace_dump(DUMP_ORIG);
WARN_ONCE(1, "Current pid: %d comm: %s / Idle pid: %d comm: %s",
current->pid, current->comm,
idle->pid, idle->comm); /* must be idle task! */
}
}
/*
* Exit an RCU extended quiescent state, which can be either the
* idle loop or adaptive-tickless usermode execution.
*/
static void rcu_eqs_exit(bool user)
{
struct rcu_dynticks *rdtp;
long long oldval;
rdtp = this_cpu_ptr(&rcu_dynticks);
oldval = rdtp->dynticks_nesting;
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && oldval < 0);
if (oldval & DYNTICK_TASK_NEST_MASK) {
rdtp->dynticks_nesting += DYNTICK_TASK_NEST_VALUE;
} else {
rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
rcu_eqs_exit_common(oldval, user);
}
}
/**
* rcu_idle_exit - inform RCU that current CPU is leaving idle
*
* Exit idle mode, in other words, -enter- the mode in which RCU
* read-side critical sections can occur.
*
* We crowbar the ->dynticks_nesting field to DYNTICK_TASK_NEST to
* allow for the possibility of usermode upcalls messing up our count
* of interrupt nesting level during the busy period that is just
* now starting.
*/
void rcu_idle_exit(void)
{
unsigned long flags;
local_irq_save(flags);
rcu_eqs_exit(false);
rcu_sysidle_exit(0);
local_irq_restore(flags);
}
EXPORT_SYMBOL_GPL(rcu_idle_exit);
#ifdef CONFIG_NO_HZ_FULL
/**
* rcu_user_exit - inform RCU that we are exiting userspace.
*
* Exit RCU idle mode while entering the kernel because it can
* run a RCU read side critical section anytime.
*/
void rcu_user_exit(void)
{
rcu_eqs_exit(1);
}
#endif /* CONFIG_NO_HZ_FULL */
/**
* rcu_irq_enter - inform RCU that current CPU is entering irq away from idle
*
* Enter an interrupt handler, which might possibly result in exiting
* idle mode, in other words, entering the mode in which read-side critical
* sections can occur. The caller must have disabled interrupts.
*
* Note that the Linux kernel is fully capable of entering an interrupt
* handler that it never exits, for example when doing upcalls to
* user mode! This code assumes that the idle loop never does upcalls to
* user mode. If your architecture does do upcalls from the idle loop (or
* does anything else that results in unbalanced calls to the irq_enter()
* and irq_exit() functions), RCU will give you what you deserve, good
* and hard. But very infrequently and irreproducibly.
*
* Use things like work queues to work around this limitation.
*
* You have been warned.
*/
void rcu_irq_enter(void)
{
struct rcu_dynticks *rdtp;
long long oldval;
RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_irq_enter() invoked with irqs enabled!!!");
rdtp = this_cpu_ptr(&rcu_dynticks);
oldval = rdtp->dynticks_nesting;
rdtp->dynticks_nesting++;
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
rdtp->dynticks_nesting == 0);
if (oldval)
trace_rcu_dyntick(TPS("++="), oldval, rdtp->dynticks_nesting);
else
rcu_eqs_exit_common(oldval, true);
rcu_sysidle_exit(1);
}
/*
* Wrapper for rcu_irq_enter() where interrupts are enabled.
*/
void rcu_irq_enter_irqson(void)
{
unsigned long flags;
local_irq_save(flags);
rcu_irq_enter();
local_irq_restore(flags);
}
/**
* rcu_nmi_enter - inform RCU of entry to NMI context
*
* If the CPU was idle from RCU's viewpoint, update rdtp->dynticks and
* rdtp->dynticks_nmi_nesting to let the RCU grace-period handling know
* that the CPU is active. This implementation permits nested NMIs, as
* long as the nesting level does not overflow an int. (You will probably
* run out of stack space first.)
*/
void rcu_nmi_enter(void)
{
struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
int incby = 2;
/* Complain about underflow. */
WARN_ON_ONCE(rdtp->dynticks_nmi_nesting < 0);
/*
* If idle from RCU viewpoint, atomically increment ->dynticks
* to mark non-idle and increment ->dynticks_nmi_nesting by one.
* Otherwise, increment ->dynticks_nmi_nesting by two. This means
* if ->dynticks_nmi_nesting is equal to one, we are guaranteed
* to be in the outermost NMI handler that interrupted an RCU-idle
* period (observation due to Andy Lutomirski).
*/
if (!(atomic_read(&rdtp->dynticks) & 0x1)) {
smp_mb__before_atomic(); /* Force delay from prior write. */
atomic_inc(&rdtp->dynticks);
/* atomic_inc() before later RCU read-side crit sects */
smp_mb__after_atomic(); /* See above. */
WARN_ON_ONCE(!(atomic_read(&rdtp->dynticks) & 0x1));
incby = 1;
}
rdtp->dynticks_nmi_nesting += incby;
barrier();
}
/**
* rcu_nmi_exit - inform RCU of exit from NMI context
*
* If we are returning from the outermost NMI handler that interrupted an
* RCU-idle period, update rdtp->dynticks and rdtp->dynticks_nmi_nesting
* to let the RCU grace-period handling know that the CPU is back to
* being RCU-idle.
*/
void rcu_nmi_exit(void)
{
struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
/*
* Check for ->dynticks_nmi_nesting underflow and bad ->dynticks.
* (We are exiting an NMI handler, so RCU better be paying attention
* to us!)
*/
WARN_ON_ONCE(rdtp->dynticks_nmi_nesting <= 0);
WARN_ON_ONCE(!(atomic_read(&rdtp->dynticks) & 0x1));
/*
* If the nesting level is not 1, the CPU wasn't RCU-idle, so
* leave it in non-RCU-idle state.
*/
if (rdtp->dynticks_nmi_nesting != 1) {
rdtp->dynticks_nmi_nesting -= 2;
return;
}
/* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */
rdtp->dynticks_nmi_nesting = 0;
/* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
smp_mb__before_atomic(); /* See above. */
atomic_inc(&rdtp->dynticks);
smp_mb__after_atomic(); /* Force delay to next write. */
WARN_ON_ONCE(atomic_read(&rdtp->dynticks) & 0x1);
}
/**
* __rcu_is_watching - are RCU read-side critical sections safe?
*
* Return true if RCU is watching the running CPU, which means that
* this CPU can safely enter RCU read-side critical sections. Unlike
* rcu_is_watching(), the caller of __rcu_is_watching() must have at
* least disabled preemption.
*/
bool notrace __rcu_is_watching(void)
{
return atomic_read(this_cpu_ptr(&rcu_dynticks.dynticks)) & 0x1;
}
/**
* rcu_is_watching - see if RCU thinks that the current CPU is idle
*
* If the current CPU is in its idle loop and is neither in an interrupt
* or NMI handler, return true.
*/
bool notrace rcu_is_watching(void)
{
bool ret;
preempt_disable_notrace();
ret = __rcu_is_watching();
preempt_enable_notrace();
return ret;
}
EXPORT_SYMBOL_GPL(rcu_is_watching);
#if defined(CONFIG_PROVE_RCU) && defined(CONFIG_HOTPLUG_CPU)
/*
* Is the current CPU online? Disable preemption to avoid false positives
* that could otherwise happen due to the current CPU number being sampled,
* this task being preempted, its old CPU being taken offline, resuming
* on some other CPU, then determining that its old CPU is now offline.
* It is OK to use RCU on an offline processor during initial boot, hence
* the check for rcu_scheduler_fully_active. Note also that it is OK
* for a CPU coming online to use RCU for one jiffy prior to marking itself
* online in the cpu_online_mask. Similarly, it is OK for a CPU going
* offline to continue to use RCU for one jiffy after marking itself
* offline in the cpu_online_mask. This leniency is necessary given the
* non-atomic nature of the online and offline processing, for example,
* the fact that a CPU enters the scheduler after completing the CPU_DYING
* notifiers.
*
* This is also why RCU internally marks CPUs online during the
* CPU_UP_PREPARE phase and offline during the CPU_DEAD phase.
*
* Disable checking if in an NMI handler because we cannot safely report
* errors from NMI handlers anyway.
*/
bool rcu_lockdep_current_cpu_online(void)
{
struct rcu_data *rdp;
struct rcu_node *rnp;
bool ret;
if (in_nmi())
return true;
preempt_disable();
rdp = this_cpu_ptr(&rcu_sched_data);
rnp = rdp->mynode;
ret = (rdp->grpmask & rcu_rnp_online_cpus(rnp)) ||
!rcu_scheduler_fully_active;
preempt_enable();
return ret;
}
EXPORT_SYMBOL_GPL(rcu_lockdep_current_cpu_online);
#endif /* #if defined(CONFIG_PROVE_RCU) && defined(CONFIG_HOTPLUG_CPU) */
/**
* rcu_is_cpu_rrupt_from_idle - see if idle or immediately interrupted from idle
*
* If the current CPU is idle or running at a first-level (not nested)
* interrupt from idle, return true. The caller must have at least
* disabled preemption.
*/
static int rcu_is_cpu_rrupt_from_idle(void)
{
return __this_cpu_read(rcu_dynticks.dynticks_nesting) <= 1;
}
/*
* Snapshot the specified CPU's dynticks counter so that we can later
* credit them with an implicit quiescent state. Return 1 if this CPU
* is in dynticks idle mode, which is an extended quiescent state.
*/
static int dyntick_save_progress_counter(struct rcu_data *rdp,
bool *isidle, unsigned long *maxj)
{
rdp->dynticks_snap = atomic_add_return(0, &rdp->dynticks->dynticks);
rcu_sysidle_check_cpu(rdp, isidle, maxj);
if ((rdp->dynticks_snap & 0x1) == 0) {
trace_rcu_fqs(rdp->rsp->name, rdp->gpnum, rdp->cpu, TPS("dti"));
return 1;
} else {
if (ULONG_CMP_LT(READ_ONCE(rdp->gpnum) + ULONG_MAX / 4,
rdp->mynode->gpnum))
WRITE_ONCE(rdp->gpwrap, true);
return 0;
}
}
/*
* Return true if the specified CPU has passed through a quiescent
* state by virtue of being in or having passed through an dynticks
* idle state since the last call to dyntick_save_progress_counter()
* for this same CPU, or by virtue of having been offline.
*/
static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
bool *isidle, unsigned long *maxj)
{
unsigned int curr;
int *rcrmp;
unsigned int snap;
curr = (unsigned int)atomic_add_return(0, &rdp->dynticks->dynticks);
snap = (unsigned int)rdp->dynticks_snap;
/*
* If the CPU passed through or entered a dynticks idle phase with
* no active irq/NMI handlers, then we can safely pretend that the CPU
* already acknowledged the request to pass through a quiescent
* state. Either way, that CPU cannot possibly be in an RCU
* read-side critical section that started before the beginning
* of the current RCU grace period.
*/
if ((curr & 0x1) == 0 || UINT_CMP_GE(curr, snap + 2)) {
trace_rcu_fqs(rdp->rsp->name, rdp->gpnum, rdp->cpu, TPS("dti"));
rdp->dynticks_fqs++;
return 1;
}
/*
* Check for the CPU being offline, but only if the grace period
* is old enough. We don't need to worry about the CPU changing
* state: If we see it offline even once, it has been through a
* quiescent state.
*
* The reason for insisting that the grace period be at least
* one jiffy old is that CPUs that are not quite online and that
* have just gone offline can still execute RCU read-side critical
* sections.
*/
if (ULONG_CMP_GE(rdp->rsp->gp_start + 2, jiffies))
return 0; /* Grace period is not old enough. */
barrier();
if (cpu_is_offline(rdp->cpu)) {
trace_rcu_fqs(rdp->rsp->name, rdp->gpnum, rdp->cpu, TPS("ofl"));
rdp->offline_fqs++;
return 1;
}
/*
* A CPU running for an extended time within the kernel can
* delay RCU grace periods. When the CPU is in NO_HZ_FULL mode,
* even context-switching back and forth between a pair of
* in-kernel CPU-bound tasks cannot advance grace periods.
* So if the grace period is old enough, make the CPU pay attention.
* Note that the unsynchronized assignments to the per-CPU
* rcu_sched_qs_mask variable are safe. Yes, setting of
* bits can be lost, but they will be set again on the next
* force-quiescent-state pass. So lost bit sets do not result
* in incorrect behavior, merely in a grace period lasting
* a few jiffies longer than it might otherwise. Because
* there are at most four threads involved, and because the
* updates are only once every few jiffies, the probability of
* lossage (and thus of slight grace-period extension) is
* quite low.
*
* Note that if the jiffies_till_sched_qs boot/sysfs parameter
* is set too high, we override with half of the RCU CPU stall
* warning delay.
*/
rcrmp = &per_cpu(rcu_sched_qs_mask, rdp->cpu);
if (ULONG_CMP_GE(jiffies,
rdp->rsp->gp_start + jiffies_till_sched_qs) ||
ULONG_CMP_GE(jiffies, rdp->rsp->jiffies_resched)) {
if (!(READ_ONCE(*rcrmp) & rdp->rsp->flavor_mask)) {
WRITE_ONCE(rdp->cond_resched_completed,
READ_ONCE(rdp->mynode->completed));
smp_mb(); /* ->cond_resched_completed before *rcrmp. */
WRITE_ONCE(*rcrmp,
READ_ONCE(*rcrmp) + rdp->rsp->flavor_mask);
resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
rdp->rsp->jiffies_resched += 5; /* Enable beating. */
} else if (ULONG_CMP_GE(jiffies, rdp->rsp->jiffies_resched)) {
/* Time to beat on that CPU again! */
resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
rdp->rsp->jiffies_resched += 5; /* Re-enable beating. */
}
}
return 0;
}
static void record_gp_stall_check_time(struct rcu_state *rsp)
{
unsigned long j = jiffies;
unsigned long j1;
rsp->gp_start = j;
smp_wmb(); /* Record start time before stall time. */
j1 = rcu_jiffies_till_stall_check();
WRITE_ONCE(rsp->jiffies_stall, j + j1);
rsp->jiffies_resched = j + j1 / 2;
rsp->n_force_qs_gpstart = READ_ONCE(rsp->n_force_qs);
}
/*
* Convert a ->gp_state value to a character string.
*/
static const char *gp_state_getname(short gs)
{
if (gs < 0 || gs >= ARRAY_SIZE(gp_state_names))
return "???";
return gp_state_names[gs];
}
/*
* Complain about starvation of grace-period kthread.
*/
static void rcu_check_gp_kthread_starvation(struct rcu_state *rsp)
{
unsigned long gpa;
unsigned long j;
j = jiffies;
gpa = READ_ONCE(rsp->gp_activity);
if (j - gpa > 2 * HZ) {
pr_err("%s kthread starved for %ld jiffies! g%lu c%lu f%#x %s(%d) ->state=%#lx\n",
rsp->name, j - gpa,
rsp->gpnum, rsp->completed,
rsp->gp_flags,
gp_state_getname(rsp->gp_state), rsp->gp_state,
rsp->gp_kthread ? rsp->gp_kthread->state : ~0);
if (rsp->gp_kthread)
sched_show_task(rsp->gp_kthread);
}
}
/*
* Dump stacks of all tasks running on stalled CPUs.
*/
static void rcu_dump_cpu_stacks(struct rcu_state *rsp)
{
int cpu;
unsigned long flags;
struct rcu_node *rnp;
rcu_for_each_leaf_node(rsp, rnp) {
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if (rnp->qsmask != 0) {
for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++)
if (rnp->qsmask & (1UL << cpu))
dump_cpu_task(rnp->grplo + cpu);
}
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
}
static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
{
int cpu;
long delta;
unsigned long flags;
unsigned long gpa;
unsigned long j;
int ndetected = 0;
struct rcu_node *rnp = rcu_get_root(rsp);
long totqlen = 0;
/* Only let one CPU complain about others per time interval. */
raw_spin_lock_irqsave_rcu_node(rnp, flags);
delta = jiffies - READ_ONCE(rsp->jiffies_stall);
if (delta < RCU_STALL_RAT_DELAY || !rcu_gp_in_progress(rsp)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
WRITE_ONCE(rsp->jiffies_stall,
jiffies + 3 * rcu_jiffies_till_stall_check() + 3);
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/*
* OK, time to rat on our buddy...
* See Documentation/RCU/stallwarn.txt for info on how to debug
* RCU CPU stall warnings.
*/
pr_err("INFO: %s detected stalls on CPUs/tasks:",
rsp->name);
print_cpu_stall_info_begin();
rcu_for_each_leaf_node(rsp, rnp) {
raw_spin_lock_irqsave_rcu_node(rnp, flags);
ndetected += rcu_print_task_stall(rnp);
if (rnp->qsmask != 0) {
for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++)
if (rnp->qsmask & (1UL << cpu)) {
print_cpu_stall_info(rsp,
rnp->grplo + cpu);
ndetected++;
}
}
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
print_cpu_stall_info_end();
for_each_possible_cpu(cpu)
totqlen += per_cpu_ptr(rsp->rda, cpu)->qlen;
pr_cont("(detected by %d, t=%ld jiffies, g=%ld, c=%ld, q=%lu)\n",
smp_processor_id(), (long)(jiffies - rsp->gp_start),
(long)rsp->gpnum, (long)rsp->completed, totqlen);
if (ndetected) {
rcu_dump_cpu_stacks(rsp);
} else {
if (READ_ONCE(rsp->gpnum) != gpnum ||
READ_ONCE(rsp->completed) == gpnum) {
pr_err("INFO: Stall ended before state dump start\n");
} else {
j = jiffies;
gpa = READ_ONCE(rsp->gp_activity);
pr_err("All QSes seen, last %s kthread activity %ld (%ld-%ld), jiffies_till_next_fqs=%ld, root ->qsmask %#lx\n",
rsp->name, j - gpa, j, gpa,
jiffies_till_next_fqs,
rcu_get_root(rsp)->qsmask);
/* In this case, the current CPU might be at fault. */
sched_show_task(current);
}
}
/* Complain about tasks blocking the grace period. */
rcu_print_detail_task_stall(rsp);
rcu_check_gp_kthread_starvation(rsp);
force_quiescent_state(rsp); /* Kick them all. */
}
static void print_cpu_stall(struct rcu_state *rsp)
{
int cpu;
unsigned long flags;
struct rcu_node *rnp = rcu_get_root(rsp);
long totqlen = 0;
/*
* OK, time to rat on ourselves...
* See Documentation/RCU/stallwarn.txt for info on how to debug
* RCU CPU stall warnings.
*/
pr_err("INFO: %s self-detected stall on CPU", rsp->name);
print_cpu_stall_info_begin();
print_cpu_stall_info(rsp, smp_processor_id());
print_cpu_stall_info_end();
for_each_possible_cpu(cpu)
totqlen += per_cpu_ptr(rsp->rda, cpu)->qlen;
pr_cont(" (t=%lu jiffies g=%ld c=%ld q=%lu)\n",
jiffies - rsp->gp_start,
(long)rsp->gpnum, (long)rsp->completed, totqlen);
rcu_check_gp_kthread_starvation(rsp);
rcu_dump_cpu_stacks(rsp);
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if (ULONG_CMP_GE(jiffies, READ_ONCE(rsp->jiffies_stall)))
WRITE_ONCE(rsp->jiffies_stall,
jiffies + 3 * rcu_jiffies_till_stall_check() + 3);
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/*
* Attempt to revive the RCU machinery by forcing a context switch.
*
* A context switch would normally allow the RCU state machine to make
* progress and it could be we're stuck in kernel space without context
* switches for an entirely unreasonable amount of time.
*/
resched_cpu(smp_processor_id());
}
static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
{
unsigned long completed;
unsigned long gpnum;
unsigned long gps;
unsigned long j;
unsigned long js;
struct rcu_node *rnp;
if (rcu_cpu_stall_suppress || !rcu_gp_in_progress(rsp))
return;
j = jiffies;
/*
* Lots of memory barriers to reject false positives.
*
* The idea is to pick up rsp->gpnum, then rsp->jiffies_stall,
* then rsp->gp_start, and finally rsp->completed. These values
* are updated in the opposite order with memory barriers (or
* equivalent) during grace-period initialization and cleanup.
* Now, a false positive can occur if we get an new value of
* rsp->gp_start and a old value of rsp->jiffies_stall. But given
* the memory barriers, the only way that this can happen is if one
* grace period ends and another starts between these two fetches.
* Detect this by comparing rsp->completed with the previous fetch
* from rsp->gpnum.
*
* Given this check, comparisons of jiffies, rsp->jiffies_stall,
* and rsp->gp_start suffice to forestall false positives.
*/
gpnum = READ_ONCE(rsp->gpnum);
smp_rmb(); /* Pick up ->gpnum first... */
js = READ_ONCE(rsp->jiffies_stall);
smp_rmb(); /* ...then ->jiffies_stall before the rest... */
gps = READ_ONCE(rsp->gp_start);
smp_rmb(); /* ...and finally ->gp_start before ->completed. */
completed = READ_ONCE(rsp->completed);
if (ULONG_CMP_GE(completed, gpnum) ||
ULONG_CMP_LT(j, js) ||
ULONG_CMP_GE(gps, js))
return; /* No stall or GP completed since entering function. */
rnp = rdp->mynode;
if (rcu_gp_in_progress(rsp) &&
(READ_ONCE(rnp->qsmask) & rdp->grpmask)) {
/* We haven't checked in, so go dump stack. */
print_cpu_stall(rsp);
} else if (rcu_gp_in_progress(rsp) &&
ULONG_CMP_GE(j, js + RCU_STALL_RAT_DELAY)) {
/* They had a few time units to dump stack, so complain. */
print_other_cpu_stall(rsp, gpnum);
}
}
/**
* rcu_cpu_stall_reset - prevent further stall warnings in current grace period
*
* Set the stall-warning timeout way off into the future, thus preventing
* any RCU CPU stall-warning messages from appearing in the current set of
* RCU grace periods.
*
* The caller must disable hard irqs.
*/
void rcu_cpu_stall_reset(void)
{
struct rcu_state *rsp;
for_each_rcu_flavor(rsp)
WRITE_ONCE(rsp->jiffies_stall, jiffies + ULONG_MAX / 2);
}
/*
* Initialize the specified rcu_data structure's default callback list
* to empty. The default callback list is the one that is not used by
* no-callbacks CPUs.
*/
static void init_default_callback_list(struct rcu_data *rdp)
{
int i;
rdp->nxtlist = NULL;
for (i = 0; i < RCU_NEXT_SIZE; i++)
rdp->nxttail[i] = &rdp->nxtlist;
}
/*
* Initialize the specified rcu_data structure's callback list to empty.
*/
static void init_callback_list(struct rcu_data *rdp)
{
if (init_nocb_callback_list(rdp))
return;
init_default_callback_list(rdp);
}
/*
* Determine the value that ->completed will have at the end of the
* next subsequent grace period. This is used to tag callbacks so that
* a CPU can invoke callbacks in a timely fashion even if that CPU has
* been dyntick-idle for an extended period with callbacks under the
* influence of RCU_FAST_NO_HZ.
*
* The caller must hold rnp->lock with interrupts disabled.
*/
static unsigned long rcu_cbs_completed(struct rcu_state *rsp,
struct rcu_node *rnp)
{
/*
* If RCU is idle, we just wait for the next grace period.
* But we can only be sure that RCU is idle if we are looking
* at the root rcu_node structure -- otherwise, a new grace
* period might have started, but just not yet gotten around
* to initializing the current non-root rcu_node structure.
*/
if (rcu_get_root(rsp) == rnp && rnp->gpnum == rnp->completed)
return rnp->completed + 1;
/*
* Otherwise, wait for a possible partial grace period and
* then the subsequent full grace period.
*/
return rnp->completed + 2;
}
/*
* Trace-event helper function for rcu_start_future_gp() and
* rcu_nocb_wait_gp().
*/
static void trace_rcu_future_gp(struct rcu_node *rnp, struct rcu_data *rdp,
unsigned long c, const char *s)
{
trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
rnp->completed, c, rnp->level,
rnp->grplo, rnp->grphi, s);
}
/*
* Start some future grace period, as needed to handle newly arrived
* callbacks. The required future grace periods are recorded in each
* rcu_node structure's ->need_future_gp field. Returns true if there
* is reason to awaken the grace-period kthread.
*
* The caller must hold the specified rcu_node structure's ->lock.
*/
static bool __maybe_unused
rcu_start_future_gp(struct rcu_node *rnp, struct rcu_data *rdp,
unsigned long *c_out)
{
unsigned long c;
int i;
bool ret = false;
struct rcu_node *rnp_root = rcu_get_root(rdp->rsp);
/*
* Pick up grace-period number for new callbacks. If this
* grace period is already marked as needed, return to the caller.
*/
c = rcu_cbs_completed(rdp->rsp, rnp);
trace_rcu_future_gp(rnp, rdp, c, TPS("Startleaf"));
if (rnp->need_future_gp[c & 0x1]) {
trace_rcu_future_gp(rnp, rdp, c, TPS("Prestartleaf"));
goto out;
}
/*
* If either this rcu_node structure or the root rcu_node structure
* believe that a grace period is in progress, then we must wait
* for the one following, which is in "c". Because our request
* will be noticed at the end of the current grace period, we don't
* need to explicitly start one. We only do the lockless check
* of rnp_root's fields if the current rcu_node structure thinks
* there is no grace period in flight, and because we hold rnp->lock,
* the only possible change is when rnp_root's two fields are
* equal, in which case rnp_root->gpnum might be concurrently
* incremented. But that is OK, as it will just result in our
* doing some extra useless work.
*/
if (rnp->gpnum != rnp->completed ||
READ_ONCE(rnp_root->gpnum) != READ_ONCE(rnp_root->completed)) {
rnp->need_future_gp[c & 0x1]++;
trace_rcu_future_gp(rnp, rdp, c, TPS("Startedleaf"));
goto out;
}
/*
* There might be no grace period in progress. If we don't already
* hold it, acquire the root rcu_node structure's lock in order to
* start one (if needed).
*/
if (rnp != rnp_root)
raw_spin_lock_rcu_node(rnp_root);
/*
* Get a new grace-period number. If there really is no grace
* period in progress, it will be smaller than the one we obtained
* earlier. Adjust callbacks as needed. Note that even no-CBs
* CPUs have a ->nxtcompleted[] array, so no no-CBs checks needed.
*/
c = rcu_cbs_completed(rdp->rsp, rnp_root);
for (i = RCU_DONE_TAIL; i < RCU_NEXT_TAIL; i++)
if (ULONG_CMP_LT(c, rdp->nxtcompleted[i]))
rdp->nxtcompleted[i] = c;
/*
* If the needed for the required grace period is already
* recorded, trace and leave.
*/
if (rnp_root->need_future_gp[c & 0x1]) {
trace_rcu_future_gp(rnp, rdp, c, TPS("Prestartedroot"));
goto unlock_out;
}
/* Record the need for the future grace period. */
rnp_root->need_future_gp[c & 0x1]++;
/* If a grace period is not already in progress, start one. */
if (rnp_root->gpnum != rnp_root->completed) {
trace_rcu_future_gp(rnp, rdp, c, TPS("Startedleafroot"));
} else {
trace_rcu_future_gp(rnp, rdp, c, TPS("Startedroot"));
ret = rcu_start_gp_advanced(rdp->rsp, rnp_root, rdp);
}
unlock_out:
if (rnp != rnp_root)
raw_spin_unlock(&rnp_root->lock);
out:
if (c_out != NULL)
*c_out = c;
return ret;
}
/*
* Clean up any old requests for the just-ended grace period. Also return
* whether any additional grace periods have been requested. Also invoke
* rcu_nocb_gp_cleanup() in order to wake up any no-callbacks kthreads
* waiting for this grace period to complete.
*/
static int rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
{
int c = rnp->completed;
int needmore;
struct rcu_data *rdp = this_cpu_ptr(rsp->rda);
rcu_nocb_gp_cleanup(rsp, rnp);
rnp->need_future_gp[c & 0x1] = 0;
needmore = rnp->need_future_gp[(c + 1) & 0x1];
trace_rcu_future_gp(rnp, rdp, c,
needmore ? TPS("CleanupMore") : TPS("Cleanup"));
return needmore;
}
/*
* Awaken the grace-period kthread for the specified flavor of RCU.
* Don't do a self-awaken, and don't bother awakening when there is
* nothing for the grace-period kthread to do (as in several CPUs
* raced to awaken, and we lost), and finally don't try to awaken
* a kthread that has not yet been created.
*/
static void rcu_gp_kthread_wake(struct rcu_state *rsp)
{
if (current == rsp->gp_kthread ||
!READ_ONCE(rsp->gp_flags) ||
!rsp->gp_kthread)
return;
wake_up(&rsp->gp_wq);
}
/*
* If there is room, assign a ->completed number to any callbacks on
* this CPU that have not already been assigned. Also accelerate any
* callbacks that were previously assigned a ->completed number that has
* since proven to be too conservative, which can happen if callbacks get
* assigned a ->completed number while RCU is idle, but with reference to
* a non-root rcu_node structure. This function is idempotent, so it does
* not hurt to call it repeatedly. Returns an flag saying that we should
* awaken the RCU grace-period kthread.
*
* The caller must hold rnp->lock with interrupts disabled.
*/
static bool rcu_accelerate_cbs(struct rcu_state *rsp, struct rcu_node *rnp,
struct rcu_data *rdp)
{
unsigned long c;
int i;
bool ret;
/* If the CPU has no callbacks, nothing to do. */
if (!rdp->nxttail[RCU_NEXT_TAIL] || !*rdp->nxttail[RCU_DONE_TAIL])
return false;
/*
* Starting from the sublist containing the callbacks most
* recently assigned a ->completed number and working down, find the
* first sublist that is not assignable to an upcoming grace period.
* Such a sublist has something in it (first two tests) and has
* a ->completed number assigned that will complete sooner than
* the ->completed number for newly arrived callbacks (last test).
*
* The key point is that any later sublist can be assigned the
* same ->completed number as the newly arrived callbacks, which
* means that the callbacks in any of these later sublist can be
* grouped into a single sublist, whether or not they have already
* been assigned a ->completed number.
*/
c = rcu_cbs_completed(rsp, rnp);
for (i = RCU_NEXT_TAIL - 1; i > RCU_DONE_TAIL; i--)
if (rdp->nxttail[i] != rdp->nxttail[i - 1] &&
!ULONG_CMP_GE(rdp->nxtcompleted[i], c))
break;
/*
* If there are no sublist for unassigned callbacks, leave.
* At the same time, advance "i" one sublist, so that "i" will
* index into the sublist where all the remaining callbacks should
* be grouped into.
*/
if (++i >= RCU_NEXT_TAIL)
return false;
/*
* Assign all subsequent callbacks' ->completed number to the next
* full grace period and group them all in the sublist initially
* indexed by "i".
*/
for (; i <= RCU_NEXT_TAIL; i++) {
rdp->nxttail[i] = rdp->nxttail[RCU_NEXT_TAIL];
rdp->nxtcompleted[i] = c;
}
/* Record any needed additional grace periods. */
ret = rcu_start_future_gp(rnp, rdp, NULL);
/* Trace depending on how much we were able to accelerate. */
if (!*rdp->nxttail[RCU_WAIT_TAIL])
trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("AccWaitCB"));
else
trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("AccReadyCB"));
return ret;
}
/*
* Move any callbacks whose grace period has completed to the
* RCU_DONE_TAIL sublist, then compact the remaining sublists and
* assign ->completed numbers to any callbacks in the RCU_NEXT_TAIL
* sublist. This function is idempotent, so it does not hurt to
* invoke it repeatedly. As long as it is not invoked -too- often...
* Returns true if the RCU grace-period kthread needs to be awakened.
*
* The caller must hold rnp->lock with interrupts disabled.
*/
static bool rcu_advance_cbs(struct rcu_state *rsp, struct rcu_node *rnp,
struct rcu_data *rdp)
{
int i, j;
/* If the CPU has no callbacks, nothing to do. */
if (!rdp->nxttail[RCU_NEXT_TAIL] || !*rdp->nxttail[RCU_DONE_TAIL])
return false;
/*
* Find all callbacks whose ->completed numbers indicate that they
* are ready to invoke, and put them into the RCU_DONE_TAIL sublist.
*/
for (i = RCU_WAIT_TAIL; i < RCU_NEXT_TAIL; i++) {
if (ULONG_CMP_LT(rnp->completed, rdp->nxtcompleted[i]))
break;
rdp->nxttail[RCU_DONE_TAIL] = rdp->nxttail[i];
}
/* Clean up any sublist tail pointers that were misordered above. */
for (j = RCU_WAIT_TAIL; j < i; j++)
rdp->nxttail[j] = rdp->nxttail[RCU_DONE_TAIL];
/* Copy down callbacks to fill in empty sublists. */
for (j = RCU_WAIT_TAIL; i < RCU_NEXT_TAIL; i++, j++) {
if (rdp->nxttail[j] == rdp->nxttail[RCU_NEXT_TAIL])
break;
rdp->nxttail[j] = rdp->nxttail[i];
rdp->nxtcompleted[j] = rdp->nxtcompleted[i];
}
/* Classify any remaining callbacks. */
return rcu_accelerate_cbs(rsp, rnp, rdp);
}
/*
* Update CPU-local rcu_data state to record the beginnings and ends of
* grace periods. The caller must hold the ->lock of the leaf rcu_node
* structure corresponding to the current CPU, and must have irqs disabled.
* Returns true if the grace-period kthread needs to be awakened.
*/
static bool __note_gp_changes(struct rcu_state *rsp, struct rcu_node *rnp,
struct rcu_data *rdp)
{
bool ret;
/* Handle the ends of any preceding grace periods first. */
if (rdp->completed == rnp->completed &&
!unlikely(READ_ONCE(rdp->gpwrap))) {
/* No grace period end, so just accelerate recent callbacks. */
ret = rcu_accelerate_cbs(rsp, rnp, rdp);
} else {
/* Advance callbacks. */
ret = rcu_advance_cbs(rsp, rnp, rdp);
/* Remember that we saw this grace-period completion. */
rdp->completed = rnp->completed;
trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpuend"));
}
if (rdp->gpnum != rnp->gpnum || unlikely(READ_ONCE(rdp->gpwrap))) {
/*
* If the current grace period is waiting for this CPU,
* set up to detect a quiescent state, otherwise don't
* go looking for one.
*/
rdp->gpnum = rnp->gpnum;
trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpustart"));
rdp->cpu_no_qs.b.norm = true;
rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr);
rdp->core_needs_qs = !!(rnp->qsmask & rdp->grpmask);
zero_cpu_stall_ticks(rdp);
WRITE_ONCE(rdp->gpwrap, false);
}
return ret;
}
static void note_gp_changes(struct rcu_state *rsp, struct rcu_data *rdp)
{
unsigned long flags;
bool needwake;
struct rcu_node *rnp;
local_irq_save(flags);
rnp = rdp->mynode;
if ((rdp->gpnum == READ_ONCE(rnp->gpnum) &&
rdp->completed == READ_ONCE(rnp->completed) &&
!unlikely(READ_ONCE(rdp->gpwrap))) || /* w/out lock. */
!raw_spin_trylock_rcu_node(rnp)) { /* irqs already off, so later. */
local_irq_restore(flags);
return;
}
needwake = __note_gp_changes(rsp, rnp, rdp);
raw_spin_unlock_irqrestore(&rnp->lock, flags);
if (needwake)
rcu_gp_kthread_wake(rsp);
}
static void rcu_gp_slow(struct rcu_state *rsp, int delay)
{
if (delay > 0 &&
!(rsp->gpnum % (rcu_num_nodes * PER_RCU_NODE_PERIOD * delay)))
schedule_timeout_uninterruptible(delay);
}
/*
* Initialize a new grace period. Return false if no grace period required.
*/
static bool rcu_gp_init(struct rcu_state *rsp)
{
unsigned long oldmask;
struct rcu_data *rdp;
struct rcu_node *rnp = rcu_get_root(rsp);
WRITE_ONCE(rsp->gp_activity, jiffies);
raw_spin_lock_irq_rcu_node(rnp);
if (!READ_ONCE(rsp->gp_flags)) {
/* Spurious wakeup, tell caller to go back to sleep. */
raw_spin_unlock_irq(&rnp->lock);
return false;
}
WRITE_ONCE(rsp->gp_flags, 0); /* Clear all flags: New grace period. */
if (WARN_ON_ONCE(rcu_gp_in_progress(rsp))) {
/*
* Grace period already in progress, don't start another.
* Not supposed to be able to happen.
*/
raw_spin_unlock_irq(&rnp->lock);
return false;
}
/* Advance to a new grace period and initialize state. */
record_gp_stall_check_time(rsp);
/* Record GP times before starting GP, hence smp_store_release(). */
smp_store_release(&rsp->gpnum, rsp->gpnum + 1);
trace_rcu_grace_period(rsp->name, rsp->gpnum, TPS("start"));
raw_spin_unlock_irq(&rnp->lock);
/*
* Apply per-leaf buffered online and offline operations to the
* rcu_node tree. Note that this new grace period need not wait
* for subsequent online CPUs, and that quiescent-state forcing
* will handle subsequent offline CPUs.
*/
rcu_for_each_leaf_node(rsp, rnp) {
rcu_gp_slow(rsp, gp_preinit_delay);
raw_spin_lock_irq_rcu_node(rnp);
if (rnp->qsmaskinit == rnp->qsmaskinitnext &&
!rnp->wait_blkd_tasks) {
/* Nothing to do on this leaf rcu_node structure. */
raw_spin_unlock_irq(&rnp->lock);
continue;
}
/* Record old state, apply changes to ->qsmaskinit field. */
oldmask = rnp->qsmaskinit;
rnp->qsmaskinit = rnp->qsmaskinitnext;
/* If zero-ness of ->qsmaskinit changed, propagate up tree. */
if (!oldmask != !rnp->qsmaskinit) {
if (!oldmask) /* First online CPU for this rcu_node. */
rcu_init_new_rnp(rnp);
else if (rcu_preempt_has_tasks(rnp)) /* blocked tasks */
rnp->wait_blkd_tasks = true;
else /* Last offline CPU and can propagate. */
rcu_cleanup_dead_rnp(rnp);
}
/*
* If all waited-on tasks from prior grace period are
* done, and if all this rcu_node structure's CPUs are
* still offline, propagate up the rcu_node tree and
* clear ->wait_blkd_tasks. Otherwise, if one of this
* rcu_node structure's CPUs has since come back online,
* simply clear ->wait_blkd_tasks (but rcu_cleanup_dead_rnp()
* checks for this, so just call it unconditionally).
*/
if (rnp->wait_blkd_tasks &&
(!rcu_preempt_has_tasks(rnp) ||
rnp->qsmaskinit)) {
rnp->wait_blkd_tasks = false;
rcu_cleanup_dead_rnp(rnp);
}
raw_spin_unlock_irq(&rnp->lock);
}
/*
* Set the quiescent-state-needed bits in all the rcu_node
* structures for all currently online CPUs in breadth-first order,
* starting from the root rcu_node structure, relying on the layout
* of the tree within the rsp->node[] array. Note that other CPUs
* will access only the leaves of the hierarchy, thus seeing that no
* grace period is in progress, at least until the corresponding
* leaf node has been initialized. In addition, we have excluded
* CPU-hotplug operations.
*
* The grace period cannot complete until the initialization
* process finishes, because this kthread handles both.
*/
rcu_for_each_node_breadth_first(rsp, rnp) {
rcu_gp_slow(rsp, gp_init_delay);
raw_spin_lock_irq_rcu_node(rnp);
rdp = this_cpu_ptr(rsp->rda);
rcu_preempt_check_blocked_tasks(rnp);
rnp->qsmask = rnp->qsmaskinit;
WRITE_ONCE(rnp->gpnum, rsp->gpnum);
if (WARN_ON_ONCE(rnp->completed != rsp->completed))
WRITE_ONCE(rnp->completed, rsp->completed);
if (rnp == rdp->mynode)
(void)__note_gp_changes(rsp, rnp, rdp);
rcu_preempt_boost_start_gp(rnp);
trace_rcu_grace_period_init(rsp->name, rnp->gpnum,
rnp->level, rnp->grplo,
rnp->grphi, rnp->qsmask);
raw_spin_unlock_irq(&rnp->lock);
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
}
return true;
}
/*
* Helper function for wait_event_interruptible_timeout() wakeup
* at force-quiescent-state time.
*/
static bool rcu_gp_fqs_check_wake(struct rcu_state *rsp, int *gfp)
{
struct rcu_node *rnp = rcu_get_root(rsp);
/* Someone like call_rcu() requested a force-quiescent-state scan. */
*gfp = READ_ONCE(rsp->gp_flags);
if (*gfp & RCU_GP_FLAG_FQS)
return true;
/* The current grace period has completed. */
if (!READ_ONCE(rnp->qsmask) && !rcu_preempt_blocked_readers_cgp(rnp))
return true;
return false;
}
/*
* Do one round of quiescent-state forcing.
*/
static void rcu_gp_fqs(struct rcu_state *rsp, bool first_time)
{
bool isidle = false;
unsigned long maxj;
struct rcu_node *rnp = rcu_get_root(rsp);
WRITE_ONCE(rsp->gp_activity, jiffies);
rsp->n_force_qs++;
if (first_time) {
/* Collect dyntick-idle snapshots. */
if (is_sysidle_rcu_state(rsp)) {
isidle = true;
maxj = jiffies - ULONG_MAX / 4;
}
force_qs_rnp(rsp, dyntick_save_progress_counter,
&isidle, &maxj);
rcu_sysidle_report_gp(rsp, isidle, maxj);
} else {
/* Handle dyntick-idle and offline CPUs. */
isidle = true;
force_qs_rnp(rsp, rcu_implicit_dynticks_qs, &isidle, &maxj);
}
/* Clear flag to prevent immediate re-entry. */
if (READ_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) {
raw_spin_lock_irq_rcu_node(rnp);
WRITE_ONCE(rsp->gp_flags,
READ_ONCE(rsp->gp_flags) & ~RCU_GP_FLAG_FQS);
raw_spin_unlock_irq(&rnp->lock);
}
}
/*
* Clean up after the old grace period.
*/
static void rcu_gp_cleanup(struct rcu_state *rsp)
{
unsigned long gp_duration;
bool needgp = false;
int nocb = 0;
struct rcu_data *rdp;
struct rcu_node *rnp = rcu_get_root(rsp);
WRITE_ONCE(rsp->gp_activity, jiffies);
raw_spin_lock_irq_rcu_node(rnp);
gp_duration = jiffies - rsp->gp_start;
if (gp_duration > rsp->gp_max)
rsp->gp_max = gp_duration;
/*
* We know the grace period is complete, but to everyone else
* it appears to still be ongoing. But it is also the case
* that to everyone else it looks like there is nothing that
* they can do to advance the grace period. It is therefore
* safe for us to drop the lock in order to mark the grace
* period as completed in all of the rcu_node structures.
*/
raw_spin_unlock_irq(&rnp->lock);
/*
* Propagate new ->completed value to rcu_node structures so
* that other CPUs don't have to wait until the start of the next
* grace period to process their callbacks. This also avoids
* some nasty RCU grace-period initialization races by forcing
* the end of the current grace period to be completely recorded in
* all of the rcu_node structures before the beginning of the next
* grace period is recorded in any of the rcu_node structures.
*/
rcu_for_each_node_breadth_first(rsp, rnp) {
raw_spin_lock_irq_rcu_node(rnp);
WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp(rnp));
WARN_ON_ONCE(rnp->qsmask);
WRITE_ONCE(rnp->completed, rsp->gpnum);
rdp = this_cpu_ptr(rsp->rda);
if (rnp == rdp->mynode)
needgp = __note_gp_changes(rsp, rnp, rdp) || needgp;
/* smp_mb() provided by prior unlock-lock pair. */
nocb += rcu_future_gp_cleanup(rsp, rnp);
raw_spin_unlock_irq(&rnp->lock);
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
rcu_gp_slow(rsp, gp_cleanup_delay);
}
rnp = rcu_get_root(rsp);
raw_spin_lock_irq_rcu_node(rnp); /* Order GP before ->completed update. */
rcu_nocb_gp_set(rnp, nocb);
/* Declare grace period done. */
WRITE_ONCE(rsp->completed, rsp->gpnum);
trace_rcu_grace_period(rsp->name, rsp->completed, TPS("end"));
rsp->gp_state = RCU_GP_IDLE;
rdp = this_cpu_ptr(rsp->rda);
/* Advance CBs to reduce false positives below. */
needgp = rcu_advance_cbs(rsp, rnp, rdp) || needgp;
if (needgp || cpu_needs_another_gp(rsp, rdp)) {
WRITE_ONCE(rsp->gp_flags, RCU_GP_FLAG_INIT);
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("newreq"));
}
raw_spin_unlock_irq(&rnp->lock);
}
/*
* Body of kthread that handles grace periods.
*/
static int __noreturn rcu_gp_kthread(void *arg)
{
bool first_gp_fqs;
int gf;
unsigned long j;
int ret;
struct rcu_state *rsp = arg;
struct rcu_node *rnp = rcu_get_root(rsp);
rcu_bind_gp_kthread();
for (;;) {
/* Handle grace-period start. */
for (;;) {
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("reqwait"));
rsp->gp_state = RCU_GP_WAIT_GPS;
wait_event_interruptible(rsp->gp_wq,
READ_ONCE(rsp->gp_flags) &
RCU_GP_FLAG_INIT);
rsp->gp_state = RCU_GP_DONE_GPS;
/* Locking provides needed memory barrier. */
if (rcu_gp_init(rsp))
break;
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
WARN_ON(signal_pending(current));
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("reqwaitsig"));
}
/* Handle quiescent-state forcing. */
first_gp_fqs = true;
j = jiffies_till_first_fqs;
if (j > HZ) {
j = HZ;
jiffies_till_first_fqs = HZ;
}
ret = 0;
for (;;) {
if (!ret)
rsp->jiffies_force_qs = jiffies + j;
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("fqswait"));
rsp->gp_state = RCU_GP_WAIT_FQS;
ret = wait_event_interruptible_timeout(rsp->gp_wq,
rcu_gp_fqs_check_wake(rsp, &gf), j);
rsp->gp_state = RCU_GP_DOING_FQS;
/* Locking provides needed memory barriers. */
/* If grace period done, leave loop. */
if (!READ_ONCE(rnp->qsmask) &&
!rcu_preempt_blocked_readers_cgp(rnp))
break;
/* If time for quiescent-state forcing, do it. */
if (ULONG_CMP_GE(jiffies, rsp->jiffies_force_qs) ||
(gf & RCU_GP_FLAG_FQS)) {
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("fqsstart"));
rcu_gp_fqs(rsp, first_gp_fqs);
first_gp_fqs = false;
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("fqsend"));
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
} else {
/* Deal with stray signal. */
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
WARN_ON(signal_pending(current));
trace_rcu_grace_period(rsp->name,
READ_ONCE(rsp->gpnum),
TPS("fqswaitsig"));
}
j = jiffies_till_next_fqs;
if (j > HZ) {
j = HZ;
jiffies_till_next_fqs = HZ;
} else if (j < 1) {
j = 1;
jiffies_till_next_fqs = 1;
}
}
/* Handle grace-period end. */
rsp->gp_state = RCU_GP_CLEANUP;
rcu_gp_cleanup(rsp);
rsp->gp_state = RCU_GP_CLEANED;
}
}
/*
* Start a new RCU grace period if warranted, re-initializing the hierarchy
* in preparation for detecting the next grace period. The caller must hold
* the root node's ->lock and hard irqs must be disabled.
*
* Note that it is legal for a dying CPU (which is marked as offline) to
* invoke this function. This can happen when the dying CPU reports its
* quiescent state.
*
* Returns true if the grace-period kthread must be awakened.
*/
static bool
rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp,
struct rcu_data *rdp)
{
if (!rsp->gp_kthread || !cpu_needs_another_gp(rsp, rdp)) {
/*
* Either we have not yet spawned the grace-period
* task, this CPU does not need another grace period,
* or a grace period is already in progress.
* Either way, don't start a new grace period.
*/
return false;
}
WRITE_ONCE(rsp->gp_flags, RCU_GP_FLAG_INIT);
trace_rcu_grace_period(rsp->name, READ_ONCE(rsp->gpnum),
TPS("newreq"));
/*
* We can't do wakeups while holding the rnp->lock, as that
* could cause possible deadlocks with the rq->lock. Defer
* the wakeup to our caller.
*/
return true;
}
/*
* Similar to rcu_start_gp_advanced(), but also advance the calling CPU's
* callbacks. Note that rcu_start_gp_advanced() cannot do this because it
* is invoked indirectly from rcu_advance_cbs(), which would result in
* endless recursion -- or would do so if it wasn't for the self-deadlock
* that is encountered beforehand.
*
* Returns true if the grace-period kthread needs to be awakened.
*/
static bool rcu_start_gp(struct rcu_state *rsp)
{
struct rcu_data *rdp = this_cpu_ptr(rsp->rda);
struct rcu_node *rnp = rcu_get_root(rsp);
bool ret = false;
/*
* If there is no grace period in progress right now, any
* callbacks we have up to this point will be satisfied by the
* next grace period. Also, advancing the callbacks reduces the
* probability of false positives from cpu_needs_another_gp()
* resulting in pointless grace periods. So, advance callbacks
* then start the grace period!
*/
ret = rcu_advance_cbs(rsp, rnp, rdp) || ret;
ret = rcu_start_gp_advanced(rsp, rnp, rdp) || ret;
return ret;
}
/*
* Report a full set of quiescent states to the specified rcu_state
* data structure. This involves cleaning up after the prior grace
* period and letting rcu_start_gp() start up the next grace period
* if one is needed. Note that the caller must hold rnp->lock, which
* is released before return.
*/
static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags)
__releases(rcu_get_root(rsp)->lock)
{
WARN_ON_ONCE(!rcu_gp_in_progress(rsp));
WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS);
raw_spin_unlock_irqrestore(&rcu_get_root(rsp)->lock, flags);
rcu_gp_kthread_wake(rsp);
}
/*
* Similar to rcu_report_qs_rdp(), for which it is a helper function.
* Allows quiescent states for a group of CPUs to be reported at one go
* to the specified rcu_node structure, though all the CPUs in the group
* must be represented by the same rcu_node structure (which need not be a
* leaf rcu_node structure, though it often will be). The gps parameter
* is the grace-period snapshot, which means that the quiescent states
* are valid only if rnp->gpnum is equal to gps. That structure's lock
* must be held upon entry, and it is released before return.
*/
static void
rcu_report_qs_rnp(unsigned long mask, struct rcu_state *rsp,
struct rcu_node *rnp, unsigned long gps, unsigned long flags)
__releases(rnp->lock)
{
unsigned long oldmask = 0;
struct rcu_node *rnp_c;
/* Walk up the rcu_node hierarchy. */
for (;;) {
if (!(rnp->qsmask & mask) || rnp->gpnum != gps) {
/*
* Our bit has already been cleared, or the
* relevant grace period is already over, so done.
*/
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
WARN_ON_ONCE(oldmask); /* Any child must be all zeroed! */
rnp->qsmask &= ~mask;
trace_rcu_quiescent_state_report(rsp->name, rnp->gpnum,
mask, rnp->qsmask, rnp->level,
rnp->grplo, rnp->grphi,
!!rnp->gp_tasks);
if (rnp->qsmask != 0 || rcu_preempt_blocked_readers_cgp(rnp)) {
/* Other bits still set at this level, so done. */
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
mask = rnp->grpmask;
if (rnp->parent == NULL) {
/* No more levels. Exit loop holding root lock. */
break;
}
raw_spin_unlock_irqrestore(&rnp->lock, flags);
rnp_c = rnp;
rnp = rnp->parent;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
oldmask = rnp_c->qsmask;
}
/*
* Get here if we are the last CPU to pass through a quiescent
* state for this grace period. Invoke rcu_report_qs_rsp()
* to clean up and start the next grace period if one is needed.
*/
rcu_report_qs_rsp(rsp, flags); /* releases rnp->lock. */
}
/*
* Record a quiescent state for all tasks that were previously queued
* on the specified rcu_node structure and that were blocking the current
* RCU grace period. The caller must hold the specified rnp->lock with
* irqs disabled, and this lock is released upon return, but irqs remain
* disabled.
*/
static void rcu_report_unblock_qs_rnp(struct rcu_state *rsp,
struct rcu_node *rnp, unsigned long flags)
__releases(rnp->lock)
{
unsigned long gps;
unsigned long mask;
struct rcu_node *rnp_p;
if (rcu_state_p == &rcu_sched_state || rsp != rcu_state_p ||
rnp->qsmask != 0 || rcu_preempt_blocked_readers_cgp(rnp)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return; /* Still need more quiescent states! */
}
rnp_p = rnp->parent;
if (rnp_p == NULL) {
/*
* Only one rcu_node structure in the tree, so don't
* try to report up to its nonexistent parent!
*/
rcu_report_qs_rsp(rsp, flags);
return;
}
/* Report up the rest of the hierarchy, tracking current ->gpnum. */
gps = rnp->gpnum;
mask = rnp->grpmask;
raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
raw_spin_lock_rcu_node(rnp_p); /* irqs already disabled. */
rcu_report_qs_rnp(mask, rsp, rnp_p, gps, flags);
}
/*
* Record a quiescent state for the specified CPU to that CPU's rcu_data
* structure. This must be either called from the specified CPU, or
* called when the specified CPU is known to be offline (and when it is
* also known that no other CPU is concurrently trying to help the offline
* CPU). The lastcomp argument is used to make sure we are still in the
* grace period of interest. We don't want to end the current grace period
* based on quiescent states detected in an earlier grace period!
*/
static void
rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp)
{
unsigned long flags;
unsigned long mask;
bool needwake;
struct rcu_node *rnp;
rnp = rdp->mynode;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if ((rdp->cpu_no_qs.b.norm &&
rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) ||
rdp->gpnum != rnp->gpnum || rnp->completed == rnp->gpnum ||
rdp->gpwrap) {
/*
* The grace period in which this quiescent state was
* recorded has ended, so don't report it upwards.
* We will instead need a new quiescent state that lies
* within the current grace period.
*/
rdp->cpu_no_qs.b.norm = true; /* need qs for new gp. */
rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr);
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
mask = rdp->grpmask;
if ((rnp->qsmask & mask) == 0) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
} else {
rdp->core_needs_qs = 0;
/*
* This GP can't end until cpu checks in, so all of our
* callbacks can be processed during the next GP.
*/
needwake = rcu_accelerate_cbs(rsp, rnp, rdp);
rcu_report_qs_rnp(mask, rsp, rnp, rnp->gpnum, flags);
/* ^^^ Released rnp->lock */
if (needwake)
rcu_gp_kthread_wake(rsp);
}
}
/*
* Check to see if there is a new grace period of which this CPU
* is not yet aware, and if so, set up local rcu_data state for it.
* Otherwise, see if this CPU has just passed through its first
* quiescent state for this grace period, and record that fact if so.
*/
static void
rcu_check_quiescent_state(struct rcu_state *rsp, struct rcu_data *rdp)
{
/* Check for grace-period ends and beginnings. */
note_gp_changes(rsp, rdp);
/*
* Does this CPU still need to do its part for current grace period?
* If no, return and let the other CPUs do their part as well.
*/
if (!rdp->core_needs_qs)
return;
/*
* Was there a quiescent state since the beginning of the grace
* period? If no, then exit and wait for the next call.
*/
if (rdp->cpu_no_qs.b.norm &&
rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr))
return;
/*
* Tell RCU we are done (but rcu_report_qs_rdp() will be the
* judge of that).
*/
rcu_report_qs_rdp(rdp->cpu, rsp, rdp);
}
/*
* Send the specified CPU's RCU callbacks to the orphanage. The
* specified CPU must be offline, and the caller must hold the
* ->orphan_lock.
*/
static void
rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp,
struct rcu_node *rnp, struct rcu_data *rdp)
{
/* No-CBs CPUs do not have orphanable callbacks. */
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU) || rcu_is_nocb_cpu(rdp->cpu))
return;
/*
* Orphan the callbacks. First adjust the counts. This is safe
* because _rcu_barrier() excludes CPU-hotplug operations, so it
* cannot be running now. Thus no memory barrier is required.
*/
if (rdp->nxtlist != NULL) {
rsp->qlen_lazy += rdp->qlen_lazy;
rsp->qlen += rdp->qlen;
rdp->n_cbs_orphaned += rdp->qlen;
rdp->qlen_lazy = 0;
WRITE_ONCE(rdp->qlen, 0);
}
/*
* Next, move those callbacks still needing a grace period to
* the orphanage, where some other CPU will pick them up.
* Some of the callbacks might have gone partway through a grace
* period, but that is too bad. They get to start over because we
* cannot assume that grace periods are synchronized across CPUs.
* We don't bother updating the ->nxttail[] array yet, instead
* we just reset the whole thing later on.
*/
if (*rdp->nxttail[RCU_DONE_TAIL] != NULL) {
*rsp->orphan_nxttail = *rdp->nxttail[RCU_DONE_TAIL];
rsp->orphan_nxttail = rdp->nxttail[RCU_NEXT_TAIL];
*rdp->nxttail[RCU_DONE_TAIL] = NULL;
}
/*
* Then move the ready-to-invoke callbacks to the orphanage,
* where some other CPU will pick them up. These will not be
* required to pass though another grace period: They are done.
*/
if (rdp->nxtlist != NULL) {
*rsp->orphan_donetail = rdp->nxtlist;
rsp->orphan_donetail = rdp->nxttail[RCU_DONE_TAIL];
}
/*
* Finally, initialize the rcu_data structure's list to empty and
* disallow further callbacks on this CPU.
*/
init_callback_list(rdp);
rdp->nxttail[RCU_NEXT_TAIL] = NULL;
}
/*
* Adopt the RCU callbacks from the specified rcu_state structure's
* orphanage. The caller must hold the ->orphan_lock.
*/
static void rcu_adopt_orphan_cbs(struct rcu_state *rsp, unsigned long flags)
{
int i;
struct rcu_data *rdp = raw_cpu_ptr(rsp->rda);
/* No-CBs CPUs are handled specially. */
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU) ||
rcu_nocb_adopt_orphan_cbs(rsp, rdp, flags))
return;
/* Do the accounting first. */
rdp->qlen_lazy += rsp->qlen_lazy;
rdp->qlen += rsp->qlen;
rdp->n_cbs_adopted += rsp->qlen;
if (rsp->qlen_lazy != rsp->qlen)
rcu_idle_count_callbacks_posted();
rsp->qlen_lazy = 0;
rsp->qlen = 0;
/*
* We do not need a memory barrier here because the only way we
* can get here if there is an rcu_barrier() in flight is if
* we are the task doing the rcu_barrier().
*/
/* First adopt the ready-to-invoke callbacks. */
if (rsp->orphan_donelist != NULL) {
*rsp->orphan_donetail = *rdp->nxttail[RCU_DONE_TAIL];
*rdp->nxttail[RCU_DONE_TAIL] = rsp->orphan_donelist;
for (i = RCU_NEXT_SIZE - 1; i >= RCU_DONE_TAIL; i--)
if (rdp->nxttail[i] == rdp->nxttail[RCU_DONE_TAIL])
rdp->nxttail[i] = rsp->orphan_donetail;
rsp->orphan_donelist = NULL;
rsp->orphan_donetail = &rsp->orphan_donelist;
}
/* And then adopt the callbacks that still need a grace period. */
if (rsp->orphan_nxtlist != NULL) {
*rdp->nxttail[RCU_NEXT_TAIL] = rsp->orphan_nxtlist;
rdp->nxttail[RCU_NEXT_TAIL] = rsp->orphan_nxttail;
rsp->orphan_nxtlist = NULL;
rsp->orphan_nxttail = &rsp->orphan_nxtlist;
}
}
/*
* Trace the fact that this CPU is going offline.
*/
static void rcu_cleanup_dying_cpu(struct rcu_state *rsp)
{
RCU_TRACE(unsigned long mask);
RCU_TRACE(struct rcu_data *rdp = this_cpu_ptr(rsp->rda));
RCU_TRACE(struct rcu_node *rnp = rdp->mynode);
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
RCU_TRACE(mask = rdp->grpmask);
trace_rcu_grace_period(rsp->name,
rnp->gpnum + 1 - !!(rnp->qsmask & mask),
TPS("cpuofl"));
}
/*
* All CPUs for the specified rcu_node structure have gone offline,
* and all tasks that were preempted within an RCU read-side critical
* section while running on one of those CPUs have since exited their RCU
* read-side critical section. Some other CPU is reporting this fact with
* the specified rcu_node structure's ->lock held and interrupts disabled.
* This function therefore goes up the tree of rcu_node structures,
* clearing the corresponding bits in the ->qsmaskinit fields. Note that
* the leaf rcu_node structure's ->qsmaskinit field has already been
* updated
*
* This function does check that the specified rcu_node structure has
* all CPUs offline and no blocked tasks, so it is OK to invoke it
* prematurely. That said, invoking it after the fact will cost you
* a needless lock acquisition. So once it has done its work, don't
* invoke it again.
*/
static void rcu_cleanup_dead_rnp(struct rcu_node *rnp_leaf)
{
long mask;
struct rcu_node *rnp = rnp_leaf;
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU) ||
rnp->qsmaskinit || rcu_preempt_has_tasks(rnp))
return;
for (;;) {
mask = rnp->grpmask;
rnp = rnp->parent;
if (!rnp)
break;
raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
rnp->qsmaskinit &= ~mask;
rnp->qsmask &= ~mask;
if (rnp->qsmaskinit) {
raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
return;
}
raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
}
}
/*
* The CPU is exiting the idle loop into the arch_cpu_idle_dead()
* function. We now remove it from the rcu_node tree's ->qsmaskinit
* bit masks.
*/
static void rcu_cleanup_dying_idle_cpu(int cpu, struct rcu_state *rsp)
{
unsigned long flags;
unsigned long mask;
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
/* Remove outgoing CPU from mask in the leaf rcu_node structure. */
mask = rdp->grpmask;
raw_spin_lock_irqsave_rcu_node(rnp, flags); /* Enforce GP memory-order guarantee. */
rnp->qsmaskinitnext &= ~mask;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
/*
* The CPU has been completely removed, and some other CPU is reporting
* this fact from process context. Do the remainder of the cleanup,
* including orphaning the outgoing CPU's RCU callbacks, and also
* adopting them. There can only be one CPU hotplug operation at a time,
* so no other CPU can be attempting to update rcu_cpu_kthread_task.
*/
static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
{
unsigned long flags;
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
/* Adjust any no-longer-needed kthreads. */
rcu_boost_kthread_setaffinity(rnp, -1);
/* Orphan the dead CPU's callbacks, and adopt them if appropriate. */
raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
rcu_send_cbs_to_orphanage(cpu, rsp, rnp, rdp);
rcu_adopt_orphan_cbs(rsp, flags);
raw_spin_unlock_irqrestore(&rsp->orphan_lock, flags);
WARN_ONCE(rdp->qlen != 0 || rdp->nxtlist != NULL,
"rcu_cleanup_dead_cpu: Callbacks on offline CPU %d: qlen=%lu, nxtlist=%p\n",
cpu, rdp->qlen, rdp->nxtlist);
}
/*
* Invoke any RCU callbacks that have made it to the end of their grace
* period. Thottle as specified by rdp->blimit.
*/
static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
{
unsigned long flags;
struct rcu_head *next, *list, **tail;
long bl, count, count_lazy;
int i;
/* If no callbacks are ready, just return. */
if (!cpu_has_callbacks_ready_to_invoke(rdp)) {
trace_rcu_batch_start(rsp->name, rdp->qlen_lazy, rdp->qlen, 0);
trace_rcu_batch_end(rsp->name, 0, !!READ_ONCE(rdp->nxtlist),
need_resched(), is_idle_task(current),
rcu_is_callbacks_kthread());
return;
}
/*
* Extract the list of ready callbacks, disabling to prevent
* races with call_rcu() from interrupt handlers.
*/
local_irq_save(flags);
WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));
bl = rdp->blimit;
trace_rcu_batch_start(rsp->name, rdp->qlen_lazy, rdp->qlen, bl);
list = rdp->nxtlist;
rdp->nxtlist = *rdp->nxttail[RCU_DONE_TAIL];
*rdp->nxttail[RCU_DONE_TAIL] = NULL;
tail = rdp->nxttail[RCU_DONE_TAIL];
for (i = RCU_NEXT_SIZE - 1; i >= 0; i--)
if (rdp->nxttail[i] == rdp->nxttail[RCU_DONE_TAIL])
rdp->nxttail[i] = &rdp->nxtlist;
local_irq_restore(flags);
/* Invoke callbacks. */
count = count_lazy = 0;
while (list) {
next = list->next;
prefetch(next);
debug_rcu_head_unqueue(list);
if (__rcu_reclaim(rsp->name, list))
count_lazy++;
list = next;
/* Stop only if limit reached and CPU has something to do. */
if (++count >= bl &&
(need_resched() ||
(!is_idle_task(current) && !rcu_is_callbacks_kthread())))
break;
}
local_irq_save(flags);
trace_rcu_batch_end(rsp->name, count, !!list, need_resched(),
is_idle_task(current),
rcu_is_callbacks_kthread());
/* Update count, and requeue any remaining callbacks. */
if (list != NULL) {
*tail = rdp->nxtlist;
rdp->nxtlist = list;
for (i = 0; i < RCU_NEXT_SIZE; i++)
if (&rdp->nxtlist == rdp->nxttail[i])
rdp->nxttail[i] = tail;
else
break;
}
smp_mb(); /* List handling before counting for rcu_barrier(). */
rdp->qlen_lazy -= count_lazy;
WRITE_ONCE(rdp->qlen, rdp->qlen - count);
rdp->n_cbs_invoked += count;
/* Reinstate batch limit if we have worked down the excess. */
if (rdp->blimit == LONG_MAX && rdp->qlen <= qlowmark)
rdp->blimit = blimit;
/* Reset ->qlen_last_fqs_check trigger if enough CBs have drained. */
if (rdp->qlen == 0 && rdp->qlen_last_fqs_check != 0) {
rdp->qlen_last_fqs_check = 0;
rdp->n_force_qs_snap = rsp->n_force_qs;
} else if (rdp->qlen < rdp->qlen_last_fqs_check - qhimark)
rdp->qlen_last_fqs_check = rdp->qlen;
WARN_ON_ONCE((rdp->nxtlist == NULL) != (rdp->qlen == 0));
local_irq_restore(flags);
/* Re-invoke RCU core processing if there are callbacks remaining. */
if (cpu_has_callbacks_ready_to_invoke(rdp))
invoke_rcu_core();
}
/*
* Check to see if this CPU is in a non-context-switch quiescent state
* (user mode or idle loop for rcu, non-softirq execution for rcu_bh).
* Also schedule RCU core processing.
*
* This function must be called from hardirq context. It is normally
* invoked from the scheduling-clock interrupt. If rcu_pending returns
* false, there is no point in invoking rcu_check_callbacks().
*/
void rcu_check_callbacks(int user)
{
trace_rcu_utilization(TPS("Start scheduler-tick"));
increment_cpu_stall_ticks();
if (user || rcu_is_cpu_rrupt_from_idle()) {
/*
* Get here if this CPU took its interrupt from user
* mode or from the idle loop, and if this is not a
* nested interrupt. In this case, the CPU is in
* a quiescent state, so note it.
*
* No memory barrier is required here because both
* rcu_sched_qs() and rcu_bh_qs() reference only CPU-local
* variables that other CPUs neither access nor modify,
* at least not while the corresponding CPU is online.
*/
rcu_sched_qs();
rcu_bh_qs();
} else if (!in_softirq()) {
/*
* Get here if this CPU did not take its interrupt from
* softirq, in other words, if it is not interrupting
* a rcu_bh read-side critical section. This is an _bh
* critical section, so note it.
*/
rcu_bh_qs();
}
rcu_preempt_check_callbacks();
if (rcu_pending())
invoke_rcu_core();
if (user)
rcu_note_voluntary_context_switch(current);
trace_rcu_utilization(TPS("End scheduler-tick"));
}
/*
* Scan the leaf rcu_node structures, processing dyntick state for any that
* have not yet encountered a quiescent state, using the function specified.
* Also initiate boosting for any threads blocked on the root rcu_node.
*
* The caller must have suppressed start of new grace periods.
*/
static void force_qs_rnp(struct rcu_state *rsp,
int (*f)(struct rcu_data *rsp, bool *isidle,
unsigned long *maxj),
bool *isidle, unsigned long *maxj)
{
unsigned long bit;
int cpu;
unsigned long flags;
unsigned long mask;
struct rcu_node *rnp;
rcu_for_each_leaf_node(rsp, rnp) {
cond_resched_rcu_qs();
mask = 0;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if (rnp->qsmask == 0) {
if (rcu_state_p == &rcu_sched_state ||
rsp != rcu_state_p ||
rcu_preempt_blocked_readers_cgp(rnp)) {
/*
* No point in scanning bits because they
* are all zero. But we might need to
* priority-boost blocked readers.
*/
rcu_initiate_boost(rnp, flags);
/* rcu_initiate_boost() releases rnp->lock */
continue;
}
if (rnp->parent &&
(rnp->parent->qsmask & rnp->grpmask)) {
/*
* Race between grace-period
* initialization and task exiting RCU
* read-side critical section: Report.
*/
rcu_report_unblock_qs_rnp(rsp, rnp, flags);
/* rcu_report_unblock_qs_rnp() rlses ->lock */
continue;
}
}
cpu = rnp->grplo;
bit = 1;
for (; cpu <= rnp->grphi; cpu++, bit <<= 1) {
if ((rnp->qsmask & bit) != 0) {
if (f(per_cpu_ptr(rsp->rda, cpu), isidle, maxj))
mask |= bit;
}
}
if (mask != 0) {
/* Idle/offline CPUs, report (releases rnp->lock. */
rcu_report_qs_rnp(mask, rsp, rnp, rnp->gpnum, flags);
} else {
/* Nothing to do here, so just drop the lock. */
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
}
}
/*
* Force quiescent states on reluctant CPUs, and also detect which
* CPUs are in dyntick-idle mode.
*/
static void force_quiescent_state(struct rcu_state *rsp)
{
unsigned long flags;
bool ret;
struct rcu_node *rnp;
struct rcu_node *rnp_old = NULL;
/* Funnel through hierarchy to reduce memory contention. */
rnp = __this_cpu_read(rsp->rda->mynode);
for (; rnp != NULL; rnp = rnp->parent) {
ret = (READ_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) ||
!raw_spin_trylock(&rnp->fqslock);
if (rnp_old != NULL)
raw_spin_unlock(&rnp_old->fqslock);
if (ret) {
rsp->n_force_qs_lh++;
return;
}
rnp_old = rnp;
}
/* rnp_old == rcu_get_root(rsp), rnp == NULL. */
/* Reached the root of the rcu_node tree, acquire lock. */
raw_spin_lock_irqsave_rcu_node(rnp_old, flags);
raw_spin_unlock(&rnp_old->fqslock);
if (READ_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) {
rsp->n_force_qs_lh++;
raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
return; /* Someone beat us to it. */
}
WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS);
raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
rcu_gp_kthread_wake(rsp);
}
/*
* This does the RCU core processing work for the specified rcu_state
* and rcu_data structures. This may be called only from the CPU to
* whom the rdp belongs.
*/
static void
__rcu_process_callbacks(struct rcu_state *rsp)
{
unsigned long flags;
bool needwake;
struct rcu_data *rdp = raw_cpu_ptr(rsp->rda);
WARN_ON_ONCE(rdp->beenonline == 0);
/* Update RCU state based on any recent quiescent states. */
rcu_check_quiescent_state(rsp, rdp);
/* Does this CPU require a not-yet-started grace period? */
local_irq_save(flags);
if (cpu_needs_another_gp(rsp, rdp)) {
raw_spin_lock_rcu_node(rcu_get_root(rsp)); /* irqs disabled. */
needwake = rcu_start_gp(rsp);
raw_spin_unlock_irqrestore(&rcu_get_root(rsp)->lock, flags);
if (needwake)
rcu_gp_kthread_wake(rsp);
} else {
local_irq_restore(flags);
}
/* If there are callbacks ready, invoke them. */
if (cpu_has_callbacks_ready_to_invoke(rdp))
invoke_rcu_callbacks(rsp, rdp);
/* Do any needed deferred wakeups of rcuo kthreads. */
do_nocb_deferred_wakeup(rdp);
}
/*
* Do RCU core processing for the current CPU.
*/
static void rcu_process_callbacks(struct softirq_action *unused)
{
struct rcu_state *rsp;
if (cpu_is_offline(smp_processor_id()))
return;
trace_rcu_utilization(TPS("Start RCU core"));
for_each_rcu_flavor(rsp)
__rcu_process_callbacks(rsp);
trace_rcu_utilization(TPS("End RCU core"));
}
/*
* Schedule RCU callback invocation. If the specified type of RCU
* does not support RCU priority boosting, just do a direct call,
* otherwise wake up the per-CPU kernel kthread. Note that because we
* are running on the current CPU with softirqs disabled, the
* rcu_cpu_kthread_task cannot disappear out from under us.
*/
static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
{
if (unlikely(!READ_ONCE(rcu_scheduler_fully_active)))
return;
if (likely(!rsp->boost)) {
rcu_do_batch(rsp, rdp);
return;
}
invoke_rcu_callbacks_kthread();
}
static void invoke_rcu_core(void)
{
if (cpu_online(smp_processor_id()))
raise_softirq(RCU_SOFTIRQ);
}
/*
* Handle any core-RCU processing required by a call_rcu() invocation.
*/
static void __call_rcu_core(struct rcu_state *rsp, struct rcu_data *rdp,
struct rcu_head *head, unsigned long flags)
{
bool needwake;
/*
* If called from an extended quiescent state, invoke the RCU
* core in order to force a re-evaluation of RCU's idleness.
*/
if (!rcu_is_watching())
invoke_rcu_core();
/* If interrupts were disabled or CPU offline, don't invoke RCU core. */
if (irqs_disabled_flags(flags) || cpu_is_offline(smp_processor_id()))
return;
/*
* Force the grace period if too many callbacks or too long waiting.
* Enforce hysteresis, and don't invoke force_quiescent_state()
* if some other CPU has recently done so. Also, don't bother
* invoking force_quiescent_state() if the newly enqueued callback
* is the only one waiting for a grace period to complete.
*/
if (unlikely(rdp->qlen > rdp->qlen_last_fqs_check + qhimark)) {
/* Are we ignoring a completed grace period? */
note_gp_changes(rsp, rdp);
/* Start a new grace period if one not already started. */
if (!rcu_gp_in_progress(rsp)) {
struct rcu_node *rnp_root = rcu_get_root(rsp);
raw_spin_lock_rcu_node(rnp_root);
needwake = rcu_start_gp(rsp);
raw_spin_unlock(&rnp_root->lock);
if (needwake)
rcu_gp_kthread_wake(rsp);
} else {
/* Give the grace period a kick. */
rdp->blimit = LONG_MAX;
if (rsp->n_force_qs == rdp->n_force_qs_snap &&
*rdp->nxttail[RCU_DONE_TAIL] != head)
force_quiescent_state(rsp);
rdp->n_force_qs_snap = rsp->n_force_qs;
rdp->qlen_last_fqs_check = rdp->qlen;
}
}
}
/*
* RCU callback function to leak a callback.
*/
static void rcu_leak_callback(struct rcu_head *rhp)
{
}
/*
* Helper function for call_rcu() and friends. The cpu argument will
* normally be -1, indicating "currently running CPU". It may specify
* a CPU only if that CPU is a no-CBs CPU. Currently, only _rcu_barrier()
* is expected to specify a CPU.
*/
static void
__call_rcu(struct rcu_head *head, rcu_callback_t func,
struct rcu_state *rsp, int cpu, bool lazy)
{
unsigned long flags;
struct rcu_data *rdp;
WARN_ON_ONCE((unsigned long)head & 0x1); /* Misaligned rcu_head! */
if (debug_rcu_head_queue(head)) {
/* Probable double call_rcu(), so leak the callback. */
WRITE_ONCE(head->func, rcu_leak_callback);
WARN_ONCE(1, "__call_rcu(): Leaked duplicate callback\n");
return;
}
head->func = func;
head->next = NULL;
/*
* Opportunistically note grace-period endings and beginnings.
* Note that we might see a beginning right after we see an
* end, but never vice versa, since this CPU has to pass through
* a quiescent state betweentimes.
*/
local_irq_save(flags);
rdp = this_cpu_ptr(rsp->rda);
/* Add the callback to our list. */
if (unlikely(rdp->nxttail[RCU_NEXT_TAIL] == NULL) || cpu != -1) {
int offline;
if (cpu != -1)
rdp = per_cpu_ptr(rsp->rda, cpu);
if (likely(rdp->mynode)) {
/* Post-boot, so this should be for a no-CBs CPU. */
offline = !__call_rcu_nocb(rdp, head, lazy, flags);
WARN_ON_ONCE(offline);
/* Offline CPU, _call_rcu() illegal, leak callback. */
local_irq_restore(flags);
return;
}
/*
* Very early boot, before rcu_init(). Initialize if needed
* and then drop through to queue the callback.
*/
BUG_ON(cpu != -1);
WARN_ON_ONCE(!rcu_is_watching());
if (!likely(rdp->nxtlist))
init_default_callback_list(rdp);
}
WRITE_ONCE(rdp->qlen, rdp->qlen + 1);
if (lazy)
rdp->qlen_lazy++;
else
rcu_idle_count_callbacks_posted();
smp_mb(); /* Count before adding callback for rcu_barrier(). */
*rdp->nxttail[RCU_NEXT_TAIL] = head;
rdp->nxttail[RCU_NEXT_TAIL] = &head->next;
if (__is_kfree_rcu_offset((unsigned long)func))
trace_rcu_kfree_callback(rsp->name, head, (unsigned long)func,
rdp->qlen_lazy, rdp->qlen);
else
trace_rcu_callback(rsp->name, head, rdp->qlen_lazy, rdp->qlen);
/* Go handle any RCU core processing required. */
__call_rcu_core(rsp, rdp, head, flags);
local_irq_restore(flags);
}
/*
* Queue an RCU-sched callback for invocation after a grace period.
*/
void call_rcu_sched(struct rcu_head *head, rcu_callback_t func)
{
__call_rcu(head, func, &rcu_sched_state, -1, 0);
}
EXPORT_SYMBOL_GPL(call_rcu_sched);
/*
* Queue an RCU callback for invocation after a quicker grace period.
*/
void call_rcu_bh(struct rcu_head *head, rcu_callback_t func)
{
__call_rcu(head, func, &rcu_bh_state, -1, 0);
}
EXPORT_SYMBOL_GPL(call_rcu_bh);
/*
* Queue an RCU callback for lazy invocation after a grace period.
* This will likely be later named something like "call_rcu_lazy()",
* but this change will require some way of tagging the lazy RCU
* callbacks in the list of pending callbacks. Until then, this
* function may only be called from __kfree_rcu().
*/
void kfree_call_rcu(struct rcu_head *head,
rcu_callback_t func)
{
__call_rcu(head, func, rcu_state_p, -1, 1);
}
EXPORT_SYMBOL_GPL(kfree_call_rcu);
/*
* Because a context switch is a grace period for RCU-sched and RCU-bh,
* any blocking grace-period wait automatically implies a grace period
* if there is only one CPU online at any point time during execution
* of either synchronize_sched() or synchronize_rcu_bh(). It is OK to
* occasionally incorrectly indicate that there are multiple CPUs online
* when there was in fact only one the whole time, as this just adds
* some overhead: RCU still operates correctly.
*/
static inline int rcu_blocking_is_gp(void)
{
int ret;
might_sleep(); /* Check for RCU read-side critical section. */
preempt_disable();
ret = num_online_cpus() <= 1;
preempt_enable();
return ret;
}
/**
* synchronize_sched - wait until an rcu-sched grace period has elapsed.
*
* Control will return to the caller some time after a full rcu-sched
* grace period has elapsed, in other words after all currently executing
* rcu-sched read-side critical sections have completed. These read-side
* critical sections are delimited by rcu_read_lock_sched() and
* rcu_read_unlock_sched(), and may be nested. Note that preempt_disable(),
* local_irq_disable(), and so on may be used in place of
* rcu_read_lock_sched().
*
* This means that all preempt_disable code sequences, including NMI and
* non-threaded hardware-interrupt handlers, in progress on entry will
* have completed before this primitive returns. However, this does not
* guarantee that softirq handlers will have completed, since in some
* kernels, these handlers can run in process context, and can block.
*
* Note that this guarantee implies further memory-ordering guarantees.
* On systems with more than one CPU, when synchronize_sched() returns,
* each CPU is guaranteed to have executed a full memory barrier since the
* end of its last RCU-sched read-side critical section whose beginning
* preceded the call to synchronize_sched(). In addition, each CPU having
* an RCU read-side critical section that extends beyond the return from
* synchronize_sched() is guaranteed to have executed a full memory barrier
* after the beginning of synchronize_sched() and before the beginning of
* that RCU read-side critical section. Note that these guarantees include
* CPUs that are offline, idle, or executing in user mode, as well as CPUs
* that are executing in the kernel.
*
* Furthermore, if CPU A invoked synchronize_sched(), which returned
* to its caller on CPU B, then both CPU A and CPU B are guaranteed
* to have executed a full memory barrier during the execution of
* synchronize_sched() -- even if CPU A and CPU B are the same CPU (but
* again only if the system has more than one CPU).
*
* This primitive provides the guarantees made by the (now removed)
* synchronize_kernel() API. In contrast, synchronize_rcu() only
* guarantees that rcu_read_lock() sections will have completed.
* In "classic RCU", these two guarantees happen to be one and
* the same, but can differ in realtime RCU implementations.
*/
void synchronize_sched(void)
{
RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) ||
lock_is_held(&rcu_lock_map) ||
lock_is_held(&rcu_sched_lock_map),
"Illegal synchronize_sched() in RCU-sched read-side critical section");
if (rcu_blocking_is_gp())
return;
if (rcu_gp_is_expedited())
synchronize_sched_expedited();
else
wait_rcu_gp(call_rcu_sched);
}
EXPORT_SYMBOL_GPL(synchronize_sched);
/**
* synchronize_rcu_bh - wait until an rcu_bh grace period has elapsed.
*
* Control will return to the caller some time after a full rcu_bh grace
* period has elapsed, in other words after all currently executing rcu_bh
* read-side critical sections have completed. RCU read-side critical
* sections are delimited by rcu_read_lock_bh() and rcu_read_unlock_bh(),
* and may be nested.
*
* See the description of synchronize_sched() for more detailed information
* on memory ordering guarantees.
*/
void synchronize_rcu_bh(void)
{
RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) ||
lock_is_held(&rcu_lock_map) ||
lock_is_held(&rcu_sched_lock_map),
"Illegal synchronize_rcu_bh() in RCU-bh read-side critical section");
if (rcu_blocking_is_gp())
return;
if (rcu_gp_is_expedited())
synchronize_rcu_bh_expedited();
else
wait_rcu_gp(call_rcu_bh);
}
EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
/**
* get_state_synchronize_rcu - Snapshot current RCU state
*
* Returns a cookie that is used by a later call to cond_synchronize_rcu()
* to determine whether or not a full grace period has elapsed in the
* meantime.
*/
unsigned long get_state_synchronize_rcu(void)
{
/*
* Any prior manipulation of RCU-protected data must happen
* before the load from ->gpnum.
*/
smp_mb(); /* ^^^ */
/*
* Make sure this load happens before the purportedly
* time-consuming work between get_state_synchronize_rcu()
* and cond_synchronize_rcu().
*/
return smp_load_acquire(&rcu_state_p->gpnum);
}
EXPORT_SYMBOL_GPL(get_state_synchronize_rcu);
/**
* cond_synchronize_rcu - Conditionally wait for an RCU grace period
*
* @oldstate: return value from earlier call to get_state_synchronize_rcu()
*
* If a full RCU grace period has elapsed since the earlier call to
* get_state_synchronize_rcu(), just return. Otherwise, invoke
* synchronize_rcu() to wait for a full grace period.
*
* Yes, this function does not take counter wrap into account. But
* counter wrap is harmless. If the counter wraps, we have waited for
* more than 2 billion grace periods (and way more on a 64-bit system!),
* so waiting for one additional grace period should be just fine.
*/
void cond_synchronize_rcu(unsigned long oldstate)
{
unsigned long newstate;
/*
* Ensure that this load happens before any RCU-destructive
* actions the caller might carry out after we return.
*/
newstate = smp_load_acquire(&rcu_state_p->completed);
if (ULONG_CMP_GE(oldstate, newstate))
synchronize_rcu();
}
EXPORT_SYMBOL_GPL(cond_synchronize_rcu);
/**
* get_state_synchronize_sched - Snapshot current RCU-sched state
*
* Returns a cookie that is used by a later call to cond_synchronize_sched()
* to determine whether or not a full grace period has elapsed in the
* meantime.
*/
unsigned long get_state_synchronize_sched(void)
{
/*
* Any prior manipulation of RCU-protected data must happen
* before the load from ->gpnum.
*/
smp_mb(); /* ^^^ */
/*
* Make sure this load happens before the purportedly
* time-consuming work between get_state_synchronize_sched()
* and cond_synchronize_sched().
*/
return smp_load_acquire(&rcu_sched_state.gpnum);
}
EXPORT_SYMBOL_GPL(get_state_synchronize_sched);
/**
* cond_synchronize_sched - Conditionally wait for an RCU-sched grace period
*
* @oldstate: return value from earlier call to get_state_synchronize_sched()
*
* If a full RCU-sched grace period has elapsed since the earlier call to
* get_state_synchronize_sched(), just return. Otherwise, invoke
* synchronize_sched() to wait for a full grace period.
*
* Yes, this function does not take counter wrap into account. But
* counter wrap is harmless. If the counter wraps, we have waited for
* more than 2 billion grace periods (and way more on a 64-bit system!),
* so waiting for one additional grace period should be just fine.
*/
void cond_synchronize_sched(unsigned long oldstate)
{
unsigned long newstate;
/*
* Ensure that this load happens before any RCU-destructive
* actions the caller might carry out after we return.
*/
newstate = smp_load_acquire(&rcu_sched_state.completed);
if (ULONG_CMP_GE(oldstate, newstate))
synchronize_sched();
}
EXPORT_SYMBOL_GPL(cond_synchronize_sched);
/* Adjust sequence number for start of update-side operation. */
static void rcu_seq_start(unsigned long *sp)
{
WRITE_ONCE(*sp, *sp + 1);
smp_mb(); /* Ensure update-side operation after counter increment. */
WARN_ON_ONCE(!(*sp & 0x1));
}
/* Adjust sequence number for end of update-side operation. */
static void rcu_seq_end(unsigned long *sp)
{
smp_mb(); /* Ensure update-side operation before counter increment. */
WRITE_ONCE(*sp, *sp + 1);
WARN_ON_ONCE(*sp & 0x1);
}
/* Take a snapshot of the update side's sequence number. */
static unsigned long rcu_seq_snap(unsigned long *sp)
{
unsigned long s;
s = (READ_ONCE(*sp) + 3) & ~0x1;
smp_mb(); /* Above access must not bleed into critical section. */
return s;
}
/*
* Given a snapshot from rcu_seq_snap(), determine whether or not a
* full update-side operation has occurred.
*/
static bool rcu_seq_done(unsigned long *sp, unsigned long s)
{
return ULONG_CMP_GE(READ_ONCE(*sp), s);
}
/* Wrapper functions for expedited grace periods. */
static void rcu_exp_gp_seq_start(struct rcu_state *rsp)
{
rcu_seq_start(&rsp->expedited_sequence);
}
static void rcu_exp_gp_seq_end(struct rcu_state *rsp)
{
rcu_seq_end(&rsp->expedited_sequence);
smp_mb(); /* Ensure that consecutive grace periods serialize. */
}
static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
{
smp_mb(); /* Caller's modifications seen first by other CPUs. */
return rcu_seq_snap(&rsp->expedited_sequence);
}
static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s)
{
return rcu_seq_done(&rsp->expedited_sequence, s);
}
/*
* Reset the ->expmaskinit values in the rcu_node tree to reflect any
* recent CPU-online activity. Note that these masks are not cleared
* when CPUs go offline, so they reflect the union of all CPUs that have
* ever been online. This means that this function normally takes its
* no-work-to-do fastpath.
*/
static void sync_exp_reset_tree_hotplug(struct rcu_state *rsp)
{
bool done;
unsigned long flags;
unsigned long mask;
unsigned long oldmask;
int ncpus = READ_ONCE(rsp->ncpus);
struct rcu_node *rnp;
struct rcu_node *rnp_up;
/* If no new CPUs onlined since last time, nothing to do. */
if (likely(ncpus == rsp->ncpus_snap))
return;
rsp->ncpus_snap = ncpus;
/*
* Each pass through the following loop propagates newly onlined
* CPUs for the current rcu_node structure up the rcu_node tree.
*/
rcu_for_each_leaf_node(rsp, rnp) {
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if (rnp->expmaskinit == rnp->expmaskinitnext) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
continue; /* No new CPUs, nothing to do. */
}
/* Update this node's mask, track old value for propagation. */
oldmask = rnp->expmaskinit;
rnp->expmaskinit = rnp->expmaskinitnext;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/* If was already nonzero, nothing to propagate. */
if (oldmask)
continue;
/* Propagate the new CPU up the tree. */
mask = rnp->grpmask;
rnp_up = rnp->parent;
done = false;
while (rnp_up) {
raw_spin_lock_irqsave_rcu_node(rnp_up, flags);
if (rnp_up->expmaskinit)
done = true;
rnp_up->expmaskinit |= mask;
raw_spin_unlock_irqrestore(&rnp_up->lock, flags);
if (done)
break;
mask = rnp_up->grpmask;
rnp_up = rnp_up->parent;
}
}
}
/*
* Reset the ->expmask values in the rcu_node tree in preparation for
* a new expedited grace period.
*/
static void __maybe_unused sync_exp_reset_tree(struct rcu_state *rsp)
{
unsigned long flags;
struct rcu_node *rnp;
sync_exp_reset_tree_hotplug(rsp);
rcu_for_each_node_breadth_first(rsp, rnp) {
raw_spin_lock_irqsave_rcu_node(rnp, flags);
WARN_ON_ONCE(rnp->expmask);
rnp->expmask = rnp->expmaskinit;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
}
/*
* Return non-zero if there is no RCU expedited grace period in progress
* for the specified rcu_node structure, in other words, if all CPUs and
* tasks covered by the specified rcu_node structure have done their bit
* for the current expedited grace period. Works only for preemptible
* RCU -- other RCU implementation use other means.
*
* Caller must hold the root rcu_node's exp_funnel_mutex.
*/
static int sync_rcu_preempt_exp_done(struct rcu_node *rnp)
{
return rnp->exp_tasks == NULL &&
READ_ONCE(rnp->expmask) == 0;
}
/*
* Report the exit from RCU read-side critical section for the last task
* that queued itself during or before the current expedited preemptible-RCU
* grace period. This event is reported either to the rcu_node structure on
* which the task was queued or to one of that rcu_node structure's ancestors,
* recursively up the tree. (Calm down, calm down, we do the recursion
* iteratively!)
*
* Caller must hold the root rcu_node's exp_funnel_mutex and the
* specified rcu_node structure's ->lock.
*/
static void __rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
bool wake, unsigned long flags)
__releases(rnp->lock)
{
unsigned long mask;
for (;;) {
if (!sync_rcu_preempt_exp_done(rnp)) {
if (!rnp->expmask)
rcu_initiate_boost(rnp, flags);
else
raw_spin_unlock_irqrestore(&rnp->lock, flags);
break;
}
if (rnp->parent == NULL) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
if (wake) {
smp_mb(); /* EGP done before wake_up(). */
wake_up(&rsp->expedited_wq);
}
break;
}
mask = rnp->grpmask;
raw_spin_unlock(&rnp->lock); /* irqs remain disabled */
rnp = rnp->parent;
raw_spin_lock_rcu_node(rnp); /* irqs already disabled */
WARN_ON_ONCE(!(rnp->expmask & mask));
rnp->expmask &= ~mask;
}
}
/*
* Report expedited quiescent state for specified node. This is a
* lock-acquisition wrapper function for __rcu_report_exp_rnp().
*
* Caller must hold the root rcu_node's exp_funnel_mutex.
*/
static void __maybe_unused rcu_report_exp_rnp(struct rcu_state *rsp,
struct rcu_node *rnp, bool wake)
{
unsigned long flags;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
__rcu_report_exp_rnp(rsp, rnp, wake, flags);
}
/*
* Report expedited quiescent state for multiple CPUs, all covered by the
* specified leaf rcu_node structure. Caller must hold the root
* rcu_node's exp_funnel_mutex.
*/
static void rcu_report_exp_cpu_mult(struct rcu_state *rsp, struct rcu_node *rnp,
unsigned long mask, bool wake)
{
unsigned long flags;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if (!(rnp->expmask & mask)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
rnp->expmask &= ~mask;
__rcu_report_exp_rnp(rsp, rnp, wake, flags); /* Releases rnp->lock. */
}
/*
* Report expedited quiescent state for specified rcu_data (CPU).
* Caller must hold the root rcu_node's exp_funnel_mutex.
*/
static void rcu_report_exp_rdp(struct rcu_state *rsp, struct rcu_data *rdp,
bool wake)
{
rcu_report_exp_cpu_mult(rsp, rdp->mynode, rdp->grpmask, wake);
}
/* Common code for synchronize_{rcu,sched}_expedited() work-done checking. */
static bool sync_exp_work_done(struct rcu_state *rsp, struct rcu_node *rnp,
struct rcu_data *rdp,
atomic_long_t *stat, unsigned long s)
{
if (rcu_exp_gp_seq_done(rsp, s)) {
if (rnp)
mutex_unlock(&rnp->exp_funnel_mutex);
else if (rdp)
mutex_unlock(&rdp->exp_funnel_mutex);
/* Ensure test happens before caller kfree(). */
smp_mb__before_atomic(); /* ^^^ */
atomic_long_inc(stat);
return true;
}
return false;
}
/*
* Funnel-lock acquisition for expedited grace periods. Returns a
* pointer to the root rcu_node structure, or NULL if some other
* task did the expedited grace period for us.
*/
static struct rcu_node *exp_funnel_lock(struct rcu_state *rsp, unsigned long s)
{
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, raw_smp_processor_id());
struct rcu_node *rnp0;
struct rcu_node *rnp1 = NULL;
/*
* First try directly acquiring the root lock in order to reduce
* latency in the common case where expedited grace periods are
* rare. We check mutex_is_locked() to avoid pathological levels of
* memory contention on ->exp_funnel_mutex in the heavy-load case.
*/
rnp0 = rcu_get_root(rsp);
if (!mutex_is_locked(&rnp0->exp_funnel_mutex)) {
if (mutex_trylock(&rnp0->exp_funnel_mutex)) {
if (sync_exp_work_done(rsp, rnp0, NULL,
&rdp->expedited_workdone0, s))
return NULL;
return rnp0;
}
}
/*
* Each pass through the following loop works its way
* up the rcu_node tree, returning if others have done the
* work or otherwise falls through holding the root rnp's
* ->exp_funnel_mutex. The mapping from CPU to rcu_node structure
* can be inexact, as it is just promoting locality and is not
* strictly needed for correctness.
*/
if (sync_exp_work_done(rsp, NULL, NULL, &rdp->expedited_workdone1, s))
return NULL;
mutex_lock(&rdp->exp_funnel_mutex);
rnp0 = rdp->mynode;
for (; rnp0 != NULL; rnp0 = rnp0->parent) {
if (sync_exp_work_done(rsp, rnp1, rdp,
&rdp->expedited_workdone2, s))
return NULL;
mutex_lock(&rnp0->exp_funnel_mutex);
if (rnp1)
mutex_unlock(&rnp1->exp_funnel_mutex);
else
mutex_unlock(&rdp->exp_funnel_mutex);
rnp1 = rnp0;
}
if (sync_exp_work_done(rsp, rnp1, rdp,
&rdp->expedited_workdone3, s))
return NULL;
return rnp1;
}
/* Invoked on each online non-idle CPU for expedited quiescent state. */
static void sync_sched_exp_handler(void *data)
{
struct rcu_data *rdp;
struct rcu_node *rnp;
struct rcu_state *rsp = data;
rdp = this_cpu_ptr(rsp->rda);
rnp = rdp->mynode;
if (!(READ_ONCE(rnp->expmask) & rdp->grpmask) ||
__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp))
return;
__this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, true);
resched_cpu(smp_processor_id());
}
/* Send IPI for expedited cleanup if needed at end of CPU-hotplug operation. */
static void sync_sched_exp_online_cleanup(int cpu)
{
struct rcu_data *rdp;
int ret;
struct rcu_node *rnp;
struct rcu_state *rsp = &rcu_sched_state;
rdp = per_cpu_ptr(rsp->rda, cpu);
rnp = rdp->mynode;
if (!(READ_ONCE(rnp->expmask) & rdp->grpmask))
return;
ret = smp_call_function_single(cpu, sync_sched_exp_handler, rsp, 0);
WARN_ON_ONCE(ret);
}
/*
* Select the nodes that the upcoming expedited grace period needs
* to wait for.
*/
static void sync_rcu_exp_select_cpus(struct rcu_state *rsp,
smp_call_func_t func)
{
int cpu;
unsigned long flags;
unsigned long mask;
unsigned long mask_ofl_test;
unsigned long mask_ofl_ipi;
int ret;
struct rcu_node *rnp;
sync_exp_reset_tree(rsp);
rcu_for_each_leaf_node(rsp, rnp) {
raw_spin_lock_irqsave_rcu_node(rnp, flags);
/* Each pass checks a CPU for identity, offline, and idle. */
mask_ofl_test = 0;
for (cpu = rnp->grplo; cpu <= rnp->grphi; cpu++) {
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu);
if (raw_smp_processor_id() == cpu ||
!(atomic_add_return(0, &rdtp->dynticks) & 0x1))
mask_ofl_test |= rdp->grpmask;
}
mask_ofl_ipi = rnp->expmask & ~mask_ofl_test;
/*
* Need to wait for any blocked tasks as well. Note that
* additional blocking tasks will also block the expedited
* GP until such time as the ->expmask bits are cleared.
*/
if (rcu_preempt_has_tasks(rnp))
rnp->exp_tasks = rnp->blkd_tasks.next;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/* IPI the remaining CPUs for expedited quiescent state. */
mask = 1;
for (cpu = rnp->grplo; cpu <= rnp->grphi; cpu++, mask <<= 1) {
if (!(mask_ofl_ipi & mask))
continue;
retry_ipi:
ret = smp_call_function_single(cpu, func, rsp, 0);
if (!ret) {
mask_ofl_ipi &= ~mask;
continue;
}
/* Failed, raced with offline. */
raw_spin_lock_irqsave_rcu_node(rnp, flags);
if (cpu_online(cpu) &&
(rnp->expmask & mask)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags);
schedule_timeout_uninterruptible(1);
if (cpu_online(cpu) &&
(rnp->expmask & mask))
goto retry_ipi;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
}
if (!(rnp->expmask & mask))
mask_ofl_ipi &= ~mask;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
/* Report quiescent states for those that went offline. */
mask_ofl_test |= mask_ofl_ipi;
if (mask_ofl_test)
rcu_report_exp_cpu_mult(rsp, rnp, mask_ofl_test, false);
}
}
static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
{
int cpu;
unsigned long jiffies_stall;
unsigned long jiffies_start;
unsigned long mask;
int ndetected;
struct rcu_node *rnp;
struct rcu_node *rnp_root = rcu_get_root(rsp);
int ret;
jiffies_stall = rcu_jiffies_till_stall_check();
jiffies_start = jiffies;
for (;;) {
ret = wait_event_interruptible_timeout(
rsp->expedited_wq,
sync_rcu_preempt_exp_done(rnp_root),
jiffies_stall);
if (ret > 0 || sync_rcu_preempt_exp_done(rnp_root))
return;
if (ret < 0) {
/* Hit a signal, disable CPU stall warnings. */
wait_event(rsp->expedited_wq,
sync_rcu_preempt_exp_done(rnp_root));
return;
}
pr_err("INFO: %s detected expedited stalls on CPUs/tasks: {",
rsp->name);
ndetected = 0;
rcu_for_each_leaf_node(rsp, rnp) {
ndetected = rcu_print_task_exp_stall(rnp);
mask = 1;
for (cpu = rnp->grplo; cpu <= rnp->grphi; cpu++, mask <<= 1) {
struct rcu_data *rdp;
if (!(rnp->expmask & mask))
continue;
ndetected++;
rdp = per_cpu_ptr(rsp->rda, cpu);
pr_cont(" %d-%c%c%c", cpu,
"O."[cpu_online(cpu)],
"o."[!!(rdp->grpmask & rnp->expmaskinit)],
"N."[!!(rdp->grpmask & rnp->expmaskinitnext)]);
}
mask <<= 1;
}
pr_cont(" } %lu jiffies s: %lu root: %#lx/%c\n",
jiffies - jiffies_start, rsp->expedited_sequence,
rnp_root->expmask, ".T"[!!rnp_root->exp_tasks]);
if (!ndetected) {
pr_err("blocking rcu_node structures:");
rcu_for_each_node_breadth_first(rsp, rnp) {
if (rnp == rnp_root)
continue; /* printed unconditionally */
if (sync_rcu_preempt_exp_done(rnp))
continue;
pr_cont(" l=%u:%d-%d:%#lx/%c",
rnp->level, rnp->grplo, rnp->grphi,
rnp->expmask,
".T"[!!rnp->exp_tasks]);
}
pr_cont("\n");
}
rcu_for_each_leaf_node(rsp, rnp) {
mask = 1;
for (cpu = rnp->grplo; cpu <= rnp->grphi; cpu++, mask <<= 1) {
if (!(rnp->expmask & mask))
continue;
dump_cpu_task(cpu);
}
}
jiffies_stall = 3 * rcu_jiffies_till_stall_check() + 3;
}
}
/**
* synchronize_sched_expedited - Brute-force RCU-sched grace period
*
* Wait for an RCU-sched grace period to elapse, but use a "big hammer"
* approach to force the grace period to end quickly. This consumes
* significant time on all CPUs and is unfriendly to real-time workloads,
* so is thus not recommended for any sort of common-case code. In fact,
* if you are using synchronize_sched_expedited() in a loop, please
* restructure your code to batch your updates, and then use a single
* synchronize_sched() instead.
*
* This implementation can be thought of as an application of sequence
* locking to expedited grace periods, but using the sequence counter to
* determine when someone else has already done the work instead of for
* retrying readers.
*/
void synchronize_sched_expedited(void)
{
unsigned long s;
struct rcu_node *rnp;
struct rcu_state *rsp = &rcu_sched_state;
/* If only one CPU, this is automatically a grace period. */
if (rcu_blocking_is_gp())
return;
/* If expedited grace periods are prohibited, fall back to normal. */
if (rcu_gp_is_normal()) {
wait_rcu_gp(call_rcu_sched);
return;
}
/* Take a snapshot of the sequence number. */
s = rcu_exp_gp_seq_snap(rsp);
rnp = exp_funnel_lock(rsp, s);
if (rnp == NULL)
return; /* Someone else did our work for us. */
rcu_exp_gp_seq_start(rsp);
sync_rcu_exp_select_cpus(rsp, sync_sched_exp_handler);
synchronize_sched_expedited_wait(rsp);
rcu_exp_gp_seq_end(rsp);
mutex_unlock(&rnp->exp_funnel_mutex);
}
EXPORT_SYMBOL_GPL(synchronize_sched_expedited);
/*
* Check to see if there is any immediate RCU-related work to be done
* by the current CPU, for the specified type of RCU, returning 1 if so.
* The checks are in order of increasing expense: checks that can be
* carried out against CPU-local state are performed first. However,
* we must check for CPU stalls first, else we might not get a chance.
*/
static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
{
struct rcu_node *rnp = rdp->mynode;
rdp->n_rcu_pending++;
/* Check for CPU stalls, if enabled. */
check_cpu_stall(rsp, rdp);
/* Is this CPU a NO_HZ_FULL CPU that should ignore RCU? */
if (rcu_nohz_full_cpu(rsp))
return 0;
/* Is the RCU core waiting for a quiescent state from this CPU? */
if (rcu_scheduler_fully_active &&
rdp->core_needs_qs && rdp->cpu_no_qs.b.norm &&
rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) {
rdp->n_rp_core_needs_qs++;
} else if (rdp->core_needs_qs &&
(!rdp->cpu_no_qs.b.norm ||
rdp->rcu_qs_ctr_snap != __this_cpu_read(rcu_qs_ctr))) {
rdp->n_rp_report_qs++;
return 1;
}
/* Does this CPU have callbacks ready to invoke? */
if (cpu_has_callbacks_ready_to_invoke(rdp)) {
rdp->n_rp_cb_ready++;
return 1;
}
/* Has RCU gone idle with this CPU needing another grace period? */
if (cpu_needs_another_gp(rsp, rdp)) {
rdp->n_rp_cpu_needs_gp++;
return 1;
}
/* Has another RCU grace period completed? */
if (READ_ONCE(rnp->completed) != rdp->completed) { /* outside lock */
rdp->n_rp_gp_completed++;
return 1;
}
/* Has a new RCU grace period started? */
if (READ_ONCE(rnp->gpnum) != rdp->gpnum ||
unlikely(READ_ONCE(rdp->gpwrap))) { /* outside lock */
rdp->n_rp_gp_started++;
return 1;
}
/* Does this CPU need a deferred NOCB wakeup? */
if (rcu_nocb_need_deferred_wakeup(rdp)) {
rdp->n_rp_nocb_defer_wakeup++;
return 1;
}
/* nothing to do */
rdp->n_rp_need_nothing++;
return 0;
}
/*
* Check to see if there is any immediate RCU-related work to be done
* by the current CPU, returning 1 if so. This function is part of the
* RCU implementation; it is -not- an exported member of the RCU API.
*/
static int rcu_pending(void)
{
struct rcu_state *rsp;
for_each_rcu_flavor(rsp)
if (__rcu_pending(rsp, this_cpu_ptr(rsp->rda)))
return 1;
return 0;
}
/*
* Return true if the specified CPU has any callback. If all_lazy is
* non-NULL, store an indication of whether all callbacks are lazy.
* (If there are no callbacks, all of them are deemed to be lazy.)
*/
static bool __maybe_unused rcu_cpu_has_callbacks(bool *all_lazy)
{
bool al = true;
bool hc = false;
struct rcu_data *rdp;
struct rcu_state *rsp;
for_each_rcu_flavor(rsp) {
rdp = this_cpu_ptr(rsp->rda);
if (!rdp->nxtlist)
continue;
hc = true;
if (rdp->qlen != rdp->qlen_lazy || !all_lazy) {
al = false;
break;
}
}
if (all_lazy)
*all_lazy = al;
return hc;
}
/*
* Helper function for _rcu_barrier() tracing. If tracing is disabled,
* the compiler is expected to optimize this away.
*/
static void _rcu_barrier_trace(struct rcu_state *rsp, const char *s,
int cpu, unsigned long done)
{
trace_rcu_barrier(rsp->name, s, cpu,
atomic_read(&rsp->barrier_cpu_count), done);
}
/*
* RCU callback function for _rcu_barrier(). If we are last, wake
* up the task executing _rcu_barrier().
*/
static void rcu_barrier_callback(struct rcu_head *rhp)
{
struct rcu_data *rdp = container_of(rhp, struct rcu_data, barrier_head);
struct rcu_state *rsp = rdp->rsp;
if (atomic_dec_and_test(&rsp->barrier_cpu_count)) {
_rcu_barrier_trace(rsp, "LastCB", -1, rsp->barrier_sequence);
complete(&rsp->barrier_completion);
} else {
_rcu_barrier_trace(rsp, "CB", -1, rsp->barrier_sequence);
}
}
/*
* Called with preemption disabled, and from cross-cpu IRQ context.
*/
static void rcu_barrier_func(void *type)
{
struct rcu_state *rsp = type;
struct rcu_data *rdp = raw_cpu_ptr(rsp->rda);
_rcu_barrier_trace(rsp, "IRQ", -1, rsp->barrier_sequence);
atomic_inc(&rsp->barrier_cpu_count);
rsp->call(&rdp->barrier_head, rcu_barrier_callback);
}
/*
* Orchestrate the specified type of RCU barrier, waiting for all
* RCU callbacks of the specified type to complete.
*/
static void _rcu_barrier(struct rcu_state *rsp)
{
int cpu;
struct rcu_data *rdp;
unsigned long s = rcu_seq_snap(&rsp->barrier_sequence);
_rcu_barrier_trace(rsp, "Begin", -1, s);
/* Take mutex to serialize concurrent rcu_barrier() requests. */
mutex_lock(&rsp->barrier_mutex);
/* Did someone else do our work for us? */
if (rcu_seq_done(&rsp->barrier_sequence, s)) {
_rcu_barrier_trace(rsp, "EarlyExit", -1, rsp->barrier_sequence);
smp_mb(); /* caller's subsequent code after above check. */
mutex_unlock(&rsp->barrier_mutex);
return;
}
/* Mark the start of the barrier operation. */
rcu_seq_start(&rsp->barrier_sequence);
_rcu_barrier_trace(rsp, "Inc1", -1, rsp->barrier_sequence);
/*
* Initialize the count to one rather than to zero in order to
* avoid a too-soon return to zero in case of a short grace period
* (or preemption of this task). Exclude CPU-hotplug operations
* to ensure that no offline CPU has callbacks queued.
*/
init_completion(&rsp->barrier_completion);
atomic_set(&rsp->barrier_cpu_count, 1);
get_online_cpus();
/*
* Force each CPU with callbacks to register a new callback.
* When that callback is invoked, we will know that all of the
* corresponding CPU's preceding callbacks have been invoked.
*/
for_each_possible_cpu(cpu) {
if (!cpu_online(cpu) && !rcu_is_nocb_cpu(cpu))
continue;
rdp = per_cpu_ptr(rsp->rda, cpu);
if (rcu_is_nocb_cpu(cpu)) {
if (!rcu_nocb_cpu_needs_barrier(rsp, cpu)) {
_rcu_barrier_trace(rsp, "OfflineNoCB", cpu,
rsp->barrier_sequence);
} else {
_rcu_barrier_trace(rsp, "OnlineNoCB", cpu,
rsp->barrier_sequence);
smp_mb__before_atomic();
atomic_inc(&rsp->barrier_cpu_count);
__call_rcu(&rdp->barrier_head,
rcu_barrier_callback, rsp, cpu, 0);
}
} else if (READ_ONCE(rdp->qlen)) {
_rcu_barrier_trace(rsp, "OnlineQ", cpu,
rsp->barrier_sequence);
smp_call_function_single(cpu, rcu_barrier_func, rsp, 1);
} else {
_rcu_barrier_trace(rsp, "OnlineNQ", cpu,
rsp->barrier_sequence);
}
}
put_online_cpus();
/*
* Now that we have an rcu_barrier_callback() callback on each
* CPU, and thus each counted, remove the initial count.
*/
if (atomic_dec_and_test(&rsp->barrier_cpu_count))
complete(&rsp->barrier_completion);
/* Wait for all rcu_barrier_callback() callbacks to be invoked. */
wait_for_completion(&rsp->barrier_completion);
/* Mark the end of the barrier operation. */
_rcu_barrier_trace(rsp, "Inc2", -1, rsp->barrier_sequence);
rcu_seq_end(&rsp->barrier_sequence);
/* Other rcu_barrier() invocations can now safely proceed. */
mutex_unlock(&rsp->barrier_mutex);
}
/**
* rcu_barrier_bh - Wait until all in-flight call_rcu_bh() callbacks complete.
*/
void rcu_barrier_bh(void)
{
_rcu_barrier(&rcu_bh_state);
}
EXPORT_SYMBOL_GPL(rcu_barrier_bh);
/**
* rcu_barrier_sched - Wait for in-flight call_rcu_sched() callbacks.
*/
void rcu_barrier_sched(void)
{
_rcu_barrier(&rcu_sched_state);
}
EXPORT_SYMBOL_GPL(rcu_barrier_sched);
/*
* Propagate ->qsinitmask bits up the rcu_node tree to account for the
* first CPU in a given leaf rcu_node structure coming online. The caller
* must hold the corresponding leaf rcu_node ->lock with interrrupts
* disabled.
*/
static void rcu_init_new_rnp(struct rcu_node *rnp_leaf)
{
long mask;
struct rcu_node *rnp = rnp_leaf;
for (;;) {
mask = rnp->grpmask;
rnp = rnp->parent;
if (rnp == NULL)
return;
raw_spin_lock_rcu_node(rnp); /* Interrupts already disabled. */
rnp->qsmaskinit |= mask;
raw_spin_unlock(&rnp->lock); /* Interrupts remain disabled. */
}
}
/*
* Do boot-time initialization of a CPU's per-CPU RCU data.
*/
static void __init
rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp)
{
unsigned long flags;
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_node *rnp = rcu_get_root(rsp);
/* Set up local state, ensuring consistent view of global state. */
raw_spin_lock_irqsave_rcu_node(rnp, flags);
rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo);
rdp->dynticks = &per_cpu(rcu_dynticks, cpu);
WARN_ON_ONCE(rdp->dynticks->dynticks_nesting != DYNTICK_TASK_EXIT_IDLE);
WARN_ON_ONCE(atomic_read(&rdp->dynticks->dynticks) != 1);
rdp->cpu = cpu;
rdp->rsp = rsp;
mutex_init(&rdp->exp_funnel_mutex);
rcu_boot_init_nocb_percpu_data(rdp);
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
/*
* Initialize a CPU's per-CPU RCU data. Note that only one online or
* offline event can be happening at a given time. Note also that we
* can accept some slop in the rsp->completed access due to the fact
* that this CPU cannot possibly have any RCU callbacks in flight yet.
*/
static void
rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
{
unsigned long flags;
unsigned long mask;
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_node *rnp = rcu_get_root(rsp);
/* Set up local state, ensuring consistent view of global state. */
raw_spin_lock_irqsave_rcu_node(rnp, flags);
rdp->qlen_last_fqs_check = 0;
rdp->n_force_qs_snap = rsp->n_force_qs;
rdp->blimit = blimit;
if (!rdp->nxtlist)
init_callback_list(rdp); /* Re-enable callbacks on this CPU. */
rdp->dynticks->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
rcu_sysidle_init_percpu_data(rdp->dynticks);
atomic_set(&rdp->dynticks->dynticks,
(atomic_read(&rdp->dynticks->dynticks) & ~0x1) + 1);
raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
/*
* Add CPU to leaf rcu_node pending-online bitmask. Any needed
* propagation up the rcu_node tree will happen at the beginning
* of the next grace period.
*/
rnp = rdp->mynode;
mask = rdp->grpmask;
raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
rnp->qsmaskinitnext |= mask;
rnp->expmaskinitnext |= mask;
if (!rdp->beenonline)
WRITE_ONCE(rsp->ncpus, READ_ONCE(rsp->ncpus) + 1);
rdp->beenonline = true; /* We have now been online. */
rdp->gpnum = rnp->completed; /* Make CPU later note any new GP. */
rdp->completed = rnp->completed;
rdp->cpu_no_qs.b.norm = true;
rdp->rcu_qs_ctr_snap = per_cpu(rcu_qs_ctr, cpu);
rdp->core_needs_qs = false;
trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpuonl"));
raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
static void rcu_prepare_cpu(int cpu)
{
struct rcu_state *rsp;
for_each_rcu_flavor(rsp)
rcu_init_percpu_data(cpu, rsp);
}
/*
* Handle CPU online/offline notification events.
*/
int rcu_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
long cpu = (long)hcpu;
struct rcu_data *rdp = per_cpu_ptr(rcu_state_p->rda, cpu);
struct rcu_node *rnp = rdp->mynode;
struct rcu_state *rsp;
switch (action) {
case CPU_UP_PREPARE:
case CPU_UP_PREPARE_FROZEN:
rcu_prepare_cpu(cpu);
rcu_prepare_kthreads(cpu);
rcu_spawn_all_nocb_kthreads(cpu);
break;
case CPU_ONLINE:
case CPU_DOWN_FAILED:
sync_sched_exp_online_cleanup(cpu);
rcu_boost_kthread_setaffinity(rnp, -1);
break;
case CPU_DOWN_PREPARE:
rcu_boost_kthread_setaffinity(rnp, cpu);
break;
case CPU_DYING:
case CPU_DYING_FROZEN:
for_each_rcu_flavor(rsp)
rcu_cleanup_dying_cpu(rsp);
break;
case CPU_DYING_IDLE:
/* QS for any half-done expedited RCU-sched GP. */
preempt_disable();
rcu_report_exp_rdp(&rcu_sched_state,
this_cpu_ptr(rcu_sched_state.rda), true);
preempt_enable();
for_each_rcu_flavor(rsp) {
rcu_cleanup_dying_idle_cpu(cpu, rsp);
}
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
case CPU_UP_CANCELED:
case CPU_UP_CANCELED_FROZEN:
for_each_rcu_flavor(rsp) {
rcu_cleanup_dead_cpu(cpu, rsp);
do_nocb_deferred_wakeup(per_cpu_ptr(rsp->rda, cpu));
}
break;
default:
break;
}
return NOTIFY_OK;
}
static int rcu_pm_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
switch (action) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
if (nr_cpu_ids <= 256) /* Expediting bad for large systems. */
rcu_expedite_gp();
break;
case PM_POST_HIBERNATION:
case PM_POST_SUSPEND:
if (nr_cpu_ids <= 256) /* Expediting bad for large systems. */
rcu_unexpedite_gp();
break;
default:
break;
}
return NOTIFY_OK;
}
/*
* Spawn the kthreads that handle each RCU flavor's grace periods.
*/
static int __init rcu_spawn_gp_kthread(void)
{
unsigned long flags;
int kthread_prio_in = kthread_prio;
struct rcu_node *rnp;
struct rcu_state *rsp;
struct sched_param sp;
struct task_struct *t;
/* Force priority into range. */
if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 1)
kthread_prio = 1;
else if (kthread_prio < 0)
kthread_prio = 0;
else if (kthread_prio > 99)
kthread_prio = 99;
if (kthread_prio != kthread_prio_in)
pr_alert("rcu_spawn_gp_kthread(): Limited prio to %d from %d\n",
kthread_prio, kthread_prio_in);
rcu_scheduler_fully_active = 1;
for_each_rcu_flavor(rsp) {
t = kthread_create(rcu_gp_kthread, rsp, "%s", rsp->name);
BUG_ON(IS_ERR(t));
rnp = rcu_get_root(rsp);
raw_spin_lock_irqsave_rcu_node(rnp, flags);
rsp->gp_kthread = t;
if (kthread_prio) {
sp.sched_priority = kthread_prio;
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
}
raw_spin_unlock_irqrestore(&rnp->lock, flags);
wake_up_process(t);
}
rcu_spawn_nocb_kthreads();
rcu_spawn_boost_kthreads();
return 0;
}
early_initcall(rcu_spawn_gp_kthread);
/*
* This function is invoked towards the end of the scheduler's initialization
* process. Before this is called, the idle task might contain
* RCU read-side critical sections (during which time, this idle
* task is booting the system). After this function is called, the
* idle tasks are prohibited from containing RCU read-side critical
* sections. This function also enables RCU lockdep checking.
*/
void rcu_scheduler_starting(void)
{
WARN_ON(num_online_cpus() != 1);
WARN_ON(nr_context_switches() > 0);
rcu_scheduler_active = 1;
}
/*
* Compute the per-level fanout, either using the exact fanout specified
* or balancing the tree, depending on the rcu_fanout_exact boot parameter.
*/
static void __init rcu_init_levelspread(int *levelspread, const int *levelcnt)
{
int i;
if (rcu_fanout_exact) {
levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
for (i = rcu_num_lvls - 2; i >= 0; i--)
levelspread[i] = RCU_FANOUT;
} else {
int ccur;
int cprv;
cprv = nr_cpu_ids;
for (i = rcu_num_lvls - 1; i >= 0; i--) {
ccur = levelcnt[i];
levelspread[i] = (cprv + ccur - 1) / ccur;
cprv = ccur;
}
}
}
/*
* Helper function for rcu_init() that initializes one rcu_state structure.
*/
static void __init rcu_init_one(struct rcu_state *rsp)
{
static const char * const buf[] = RCU_NODE_NAME_INIT;
static const char * const fqs[] = RCU_FQS_NAME_INIT;
static const char * const exp[] = RCU_EXP_NAME_INIT;
static struct lock_class_key rcu_node_class[RCU_NUM_LVLS];
static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS];
static struct lock_class_key rcu_exp_class[RCU_NUM_LVLS];
static u8 fl_mask = 0x1;
int levelcnt[RCU_NUM_LVLS]; /* # nodes in each level. */
int levelspread[RCU_NUM_LVLS]; /* kids/node in each level. */
int cpustride = 1;
int i;
int j;
struct rcu_node *rnp;
BUILD_BUG_ON(RCU_NUM_LVLS > ARRAY_SIZE(buf)); /* Fix buf[] init! */
/* Silence gcc 4.8 false positive about array index out of range. */
if (rcu_num_lvls <= 0 || rcu_num_lvls > RCU_NUM_LVLS)
panic("rcu_init_one: rcu_num_lvls out of range");
/* Initialize the level-tracking arrays. */
for (i = 0; i < rcu_num_lvls; i++)
levelcnt[i] = num_rcu_lvl[i];
for (i = 1; i < rcu_num_lvls; i++)
rsp->level[i] = rsp->level[i - 1] + levelcnt[i - 1];
rcu_init_levelspread(levelspread, levelcnt);
rsp->flavor_mask = fl_mask;
fl_mask <<= 1;
/* Initialize the elements themselves, starting from the leaves. */
for (i = rcu_num_lvls - 1; i >= 0; i--) {
cpustride *= levelspread[i];
rnp = rsp->level[i];
for (j = 0; j < levelcnt[i]; j++, rnp++) {
raw_spin_lock_init(&rnp->lock);
lockdep_set_class_and_name(&rnp->lock,
&rcu_node_class[i], buf[i]);
raw_spin_lock_init(&rnp->fqslock);
lockdep_set_class_and_name(&rnp->fqslock,
&rcu_fqs_class[i], fqs[i]);
rnp->gpnum = rsp->gpnum;
rnp->completed = rsp->completed;
rnp->qsmask = 0;
rnp->qsmaskinit = 0;
rnp->grplo = j * cpustride;
rnp->grphi = (j + 1) * cpustride - 1;
if (rnp->grphi >= nr_cpu_ids)
rnp->grphi = nr_cpu_ids - 1;
if (i == 0) {
rnp->grpnum = 0;
rnp->grpmask = 0;
rnp->parent = NULL;
} else {
rnp->grpnum = j % levelspread[i - 1];
rnp->grpmask = 1UL << rnp->grpnum;
rnp->parent = rsp->level[i - 1] +
j / levelspread[i - 1];
}
rnp->level = i;
INIT_LIST_HEAD(&rnp->blkd_tasks);
rcu_init_one_nocb(rnp);
mutex_init(&rnp->exp_funnel_mutex);
lockdep_set_class_and_name(&rnp->exp_funnel_mutex,
&rcu_exp_class[i], exp[i]);
}
}
init_waitqueue_head(&rsp->gp_wq);
init_waitqueue_head(&rsp->expedited_wq);
rnp = rsp->level[rcu_num_lvls - 1];
for_each_possible_cpu(i) {
while (i > rnp->grphi)
rnp++;
per_cpu_ptr(rsp->rda, i)->mynode = rnp;
rcu_boot_init_percpu_data(i, rsp);
}
list_add(&rsp->flavors, &rcu_struct_flavors);
}
/*
* Compute the rcu_node tree geometry from kernel parameters. This cannot
* replace the definitions in tree.h because those are needed to size
* the ->node array in the rcu_state structure.
*/
static void __init rcu_init_geometry(void)
{
ulong d;
int i;
int rcu_capacity[RCU_NUM_LVLS];
/*
* Initialize any unspecified boot parameters.
* The default values of jiffies_till_first_fqs and
* jiffies_till_next_fqs are set to the RCU_JIFFIES_TILL_FORCE_QS
* value, which is a function of HZ, then adding one for each
* RCU_JIFFIES_FQS_DIV CPUs that might be on the system.
*/
d = RCU_JIFFIES_TILL_FORCE_QS + nr_cpu_ids / RCU_JIFFIES_FQS_DIV;
if (jiffies_till_first_fqs == ULONG_MAX)
jiffies_till_first_fqs = d;
if (jiffies_till_next_fqs == ULONG_MAX)
jiffies_till_next_fqs = d;
/* If the compile-time values are accurate, just leave. */
if (rcu_fanout_leaf == RCU_FANOUT_LEAF &&
nr_cpu_ids == NR_CPUS)
return;
pr_info("RCU: Adjusting geometry for rcu_fanout_leaf=%d, nr_cpu_ids=%d\n",
rcu_fanout_leaf, nr_cpu_ids);
/*
* The boot-time rcu_fanout_leaf parameter must be at least two
* and cannot exceed the number of bits in the rcu_node masks.
* Complain and fall back to the compile-time values if this
* limit is exceeded.
*/
if (rcu_fanout_leaf < 2 ||
rcu_fanout_leaf > sizeof(unsigned long) * 8) {
rcu_fanout_leaf = RCU_FANOUT_LEAF;
WARN_ON(1);
return;
}
/*
* Compute number of nodes that can be handled an rcu_node tree
* with the given number of levels.
*/
rcu_capacity[0] = rcu_fanout_leaf;
for (i = 1; i < RCU_NUM_LVLS; i++)
rcu_capacity[i] = rcu_capacity[i - 1] * RCU_FANOUT;
/*
* The tree must be able to accommodate the configured number of CPUs.
* If this limit is exceeded, fall back to the compile-time values.
*/
if (nr_cpu_ids > rcu_capacity[RCU_NUM_LVLS - 1]) {
rcu_fanout_leaf = RCU_FANOUT_LEAF;
WARN_ON(1);
return;
}
/* Calculate the number of levels in the tree. */
for (i = 0; nr_cpu_ids > rcu_capacity[i]; i++) {
}
rcu_num_lvls = i + 1;
/* Calculate the number of rcu_nodes at each level of the tree. */
for (i = 0; i < rcu_num_lvls; i++) {
int cap = rcu_capacity[(rcu_num_lvls - 1) - i];
num_rcu_lvl[i] = DIV_ROUND_UP(nr_cpu_ids, cap);
}
/* Calculate the total number of rcu_node structures. */
rcu_num_nodes = 0;
for (i = 0; i < rcu_num_lvls; i++)
rcu_num_nodes += num_rcu_lvl[i];
}
/*
* Dump out the structure of the rcu_node combining tree associated
* with the rcu_state structure referenced by rsp.
*/
static void __init rcu_dump_rcu_node_tree(struct rcu_state *rsp)
{
int level = 0;
struct rcu_node *rnp;
pr_info("rcu_node tree layout dump\n");
pr_info(" ");
rcu_for_each_node_breadth_first(rsp, rnp) {
if (rnp->level != level) {
pr_cont("\n");
pr_info(" ");
level = rnp->level;
}
pr_cont("%d:%d ^%d ", rnp->grplo, rnp->grphi, rnp->grpnum);
}
pr_cont("\n");
}
void __init rcu_init(void)
{
int cpu;
rcu_early_boot_tests();
rcu_bootup_announce();
rcu_init_geometry();
rcu_init_one(&rcu_bh_state);
rcu_init_one(&rcu_sched_state);
if (dump_tree)
rcu_dump_rcu_node_tree(&rcu_sched_state);
__rcu_init_preempt();
open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
/*
* We don't need protection against CPU-hotplug here because
* this is called early in boot, before either interrupts
* or the scheduler are operational.
*/
cpu_notifier(rcu_cpu_notify, 0);
pm_notifier(rcu_pm_notify, 0);
for_each_online_cpu(cpu)
rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)cpu);
}
#include "tree_plugin.h"
| bsd-2-clause |
ericli1989/nginx-1.0.14_comment | src/http/modules/ngx_http_charset_filter_module.c | 55 | 40984 |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#define NGX_HTTP_CHARSET_OFF -2
#define NGX_HTTP_NO_CHARSET -3
#define NGX_HTTP_CHARSET_VAR 0x10000
/* 1 byte length and up to 3 bytes for the UTF-8 encoding of the UCS-2 */
#define NGX_UTF_LEN 4
#define NGX_HTML_ENTITY_LEN (sizeof("") - 1)
typedef struct {
u_char **tables;
ngx_str_t name;
unsigned length:16;
unsigned utf8:1;
} ngx_http_charset_t;
typedef struct {
ngx_int_t src;
ngx_int_t dst;
} ngx_http_charset_recode_t;
typedef struct {
ngx_int_t src;
ngx_int_t dst;
u_char *src2dst;
u_char *dst2src;
} ngx_http_charset_tables_t;
typedef struct {
ngx_array_t charsets; /* ngx_http_charset_t */
ngx_array_t tables; /* ngx_http_charset_tables_t */
ngx_array_t recodes; /* ngx_http_charset_recode_t */
} ngx_http_charset_main_conf_t;
typedef struct {
ngx_int_t charset;
ngx_int_t source_charset;
ngx_flag_t override_charset;
ngx_hash_t types;
ngx_array_t *types_keys;
} ngx_http_charset_loc_conf_t;
typedef struct {
u_char *table;
ngx_int_t charset;
ngx_str_t charset_name;
ngx_chain_t *busy;
ngx_chain_t *free_bufs;
ngx_chain_t *free_buffers;
size_t saved_len;
u_char saved[NGX_UTF_LEN];
unsigned length:16;
unsigned from_utf8:1;
unsigned to_utf8:1;
} ngx_http_charset_ctx_t;
typedef struct {
ngx_http_charset_tables_t *table;
ngx_http_charset_t *charset;
ngx_uint_t characters;
} ngx_http_charset_conf_ctx_t;
static ngx_int_t ngx_http_destination_charset(ngx_http_request_t *r,
ngx_str_t *name);
static ngx_int_t ngx_http_main_request_charset(ngx_http_request_t *r,
ngx_str_t *name);
static ngx_int_t ngx_http_source_charset(ngx_http_request_t *r,
ngx_str_t *name);
static ngx_int_t ngx_http_get_charset(ngx_http_request_t *r, ngx_str_t *name);
static ngx_inline void ngx_http_set_charset(ngx_http_request_t *r,
ngx_str_t *charset);
static ngx_int_t ngx_http_charset_ctx(ngx_http_request_t *r,
ngx_http_charset_t *charsets, ngx_int_t charset, ngx_int_t source_charset);
static ngx_uint_t ngx_http_charset_recode(ngx_buf_t *b, u_char *table);
static ngx_chain_t *ngx_http_charset_recode_from_utf8(ngx_pool_t *pool,
ngx_buf_t *buf, ngx_http_charset_ctx_t *ctx);
static ngx_chain_t *ngx_http_charset_recode_to_utf8(ngx_pool_t *pool,
ngx_buf_t *buf, ngx_http_charset_ctx_t *ctx);
static ngx_chain_t *ngx_http_charset_get_buf(ngx_pool_t *pool,
ngx_http_charset_ctx_t *ctx);
static ngx_chain_t *ngx_http_charset_get_buffer(ngx_pool_t *pool,
ngx_http_charset_ctx_t *ctx, size_t size);
static char *ngx_http_charset_map_block(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static char *ngx_http_charset_map(ngx_conf_t *cf, ngx_command_t *dummy,
void *conf);
static char *ngx_http_set_charset_slot(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static ngx_int_t ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name);
static void *ngx_http_charset_create_main_conf(ngx_conf_t *cf);
static void *ngx_http_charset_create_loc_conf(ngx_conf_t *cf);
static char *ngx_http_charset_merge_loc_conf(ngx_conf_t *cf,
void *parent, void *child);
static ngx_int_t ngx_http_charset_postconfiguration(ngx_conf_t *cf);
ngx_str_t ngx_http_charset_default_types[] = {
ngx_string("text/html"),
ngx_string("text/xml"),
ngx_string("text/plain"),
ngx_string("text/vnd.wap.wml"),
ngx_string("application/x-javascript"),
ngx_string("application/rss+xml"),
ngx_null_string
};
static ngx_command_t ngx_http_charset_filter_commands[] = {
{ ngx_string("charset"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
ngx_http_set_charset_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(ngx_http_charset_loc_conf_t, charset),
NULL },
{ ngx_string("source_charset"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
ngx_http_set_charset_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(ngx_http_charset_loc_conf_t, source_charset),
NULL },
{ ngx_string("override_charset"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG,
ngx_conf_set_flag_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(ngx_http_charset_loc_conf_t, override_charset),
NULL },
{ ngx_string("charset_types"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
ngx_http_types_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(ngx_http_charset_loc_conf_t, types_keys),
&ngx_http_charset_default_types[0] },
{ ngx_string("charset_map"),
NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE2,
ngx_http_charset_map_block,
NGX_HTTP_MAIN_CONF_OFFSET,
0,
NULL },
ngx_null_command
};
static ngx_http_module_t ngx_http_charset_filter_module_ctx = {
NULL, /* preconfiguration */
ngx_http_charset_postconfiguration, /* postconfiguration */
ngx_http_charset_create_main_conf, /* create main configuration */
NULL, /* init main configuration */
NULL, /* create server configuration */
NULL, /* merge server configuration */
ngx_http_charset_create_loc_conf, /* create location configuration */
ngx_http_charset_merge_loc_conf /* merge location configuration */
};
ngx_module_t ngx_http_charset_filter_module = {
NGX_MODULE_V1,
&ngx_http_charset_filter_module_ctx, /* module context */
ngx_http_charset_filter_commands, /* module directives */
NGX_HTTP_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};
static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
static ngx_int_t
ngx_http_charset_header_filter(ngx_http_request_t *r)
{
ngx_int_t charset, source_charset;
ngx_str_t dst, src;
ngx_http_charset_t *charsets;
ngx_http_charset_main_conf_t *mcf;
if (r == r->main) {
charset = ngx_http_destination_charset(r, &dst);
} else {
charset = ngx_http_main_request_charset(r, &dst);
}
if (charset == NGX_ERROR) {
return NGX_ERROR;
}
if (charset == NGX_DECLINED) {
return ngx_http_next_header_filter(r);
}
/* charset: charset index or NGX_HTTP_NO_CHARSET */
source_charset = ngx_http_source_charset(r, &src);
if (source_charset == NGX_ERROR) {
return NGX_ERROR;
}
/*
* source_charset: charset index, NGX_HTTP_NO_CHARSET,
* or NGX_HTTP_CHARSET_OFF
*/
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"charset: \"%V\" > \"%V\"", &src, &dst);
if (source_charset == NGX_HTTP_CHARSET_OFF) {
ngx_http_set_charset(r, &dst);
return ngx_http_next_header_filter(r);
}
if (charset == NGX_HTTP_NO_CHARSET
|| source_charset == NGX_HTTP_NO_CHARSET)
{
if (source_charset != charset
|| ngx_strncasecmp(dst.data, src.data, dst.len) != 0)
{
goto no_charset_map;
}
ngx_http_set_charset(r, &dst);
return ngx_http_next_header_filter(r);
}
mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
charsets = mcf->charsets.elts;
if (source_charset != charset
&& (charsets[source_charset].tables == NULL
|| charsets[source_charset].tables[charset] == NULL))
{
goto no_charset_map;
}
r->headers_out.content_type.len = r->headers_out.content_type_len;
ngx_http_set_charset(r, &dst);
if (source_charset != charset) {
return ngx_http_charset_ctx(r, charsets, charset, source_charset);
}
return ngx_http_next_header_filter(r);
no_charset_map:
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"no \"charset_map\" between the charsets \"%V\" and \"%V\"",
&src, &dst);
return ngx_http_next_header_filter(r);
}
static ngx_int_t
ngx_http_destination_charset(ngx_http_request_t *r, ngx_str_t *name)
{
ngx_int_t charset;
ngx_http_charset_t *charsets;
ngx_http_variable_value_t *vv;
ngx_http_charset_loc_conf_t *mlcf;
ngx_http_charset_main_conf_t *mcf;
if (!r->ignore_content_encoding
&& r->headers_out.content_encoding
&& r->headers_out.content_encoding->value.len)
{
return NGX_DECLINED;
}
if (r->headers_out.content_type.len == 0) {
return NGX_DECLINED;
}
if (r->headers_out.override_charset
&& r->headers_out.override_charset->len)
{
*name = *r->headers_out.override_charset;
charset = ngx_http_get_charset(r, name);
if (charset != NGX_HTTP_NO_CHARSET) {
return charset;
}
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"unknown charset \"%V\" to override", name);
return NGX_DECLINED;
}
mlcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module);
charset = mlcf->charset;
if (charset == NGX_HTTP_CHARSET_OFF) {
return NGX_DECLINED;
}
if (r->headers_out.charset.len) {
if (mlcf->override_charset == 0) {
return NGX_DECLINED;
}
} else {
if (ngx_http_test_content_type(r, &mlcf->types) == NULL) {
return NGX_DECLINED;
}
}
if (charset < NGX_HTTP_CHARSET_VAR) {
mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
charsets = mcf->charsets.elts;
*name = charsets[charset].name;
return charset;
}
vv = ngx_http_get_indexed_variable(r, charset - NGX_HTTP_CHARSET_VAR);
if (vv == NULL || vv->not_found) {
return NGX_ERROR;
}
name->len = vv->len;
name->data = vv->data;
return ngx_http_get_charset(r, name);
}
static ngx_int_t
ngx_http_main_request_charset(ngx_http_request_t *r, ngx_str_t *src)
{
ngx_int_t charset;
ngx_str_t *main_charset;
ngx_http_charset_ctx_t *ctx;
ctx = ngx_http_get_module_ctx(r->main, ngx_http_charset_filter_module);
if (ctx) {
*src = ctx->charset_name;
return ctx->charset;
}
main_charset = &r->main->headers_out.charset;
if (main_charset->len == 0) {
return NGX_DECLINED;
}
ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_charset_ctx_t));
if (ctx == NULL) {
return NGX_ERROR;
}
ngx_http_set_ctx(r->main, ctx, ngx_http_charset_filter_module);
charset = ngx_http_get_charset(r, main_charset);
ctx->charset = charset;
ctx->charset_name = *main_charset;
*src = *main_charset;
return charset;
}
static ngx_int_t
ngx_http_source_charset(ngx_http_request_t *r, ngx_str_t *name)
{
ngx_int_t charset;
ngx_http_charset_t *charsets;
ngx_http_variable_value_t *vv;
ngx_http_charset_loc_conf_t *lcf;
ngx_http_charset_main_conf_t *mcf;
if (r->headers_out.charset.len) {
*name = r->headers_out.charset;
return ngx_http_get_charset(r, name);
}
lcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module);
charset = lcf->source_charset;
if (charset == NGX_HTTP_CHARSET_OFF) {
name->len = 0;
return charset;
}
if (charset < NGX_HTTP_CHARSET_VAR) {
mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
charsets = mcf->charsets.elts;
*name = charsets[charset].name;
return charset;
}
vv = ngx_http_get_indexed_variable(r, charset - NGX_HTTP_CHARSET_VAR);
if (vv == NULL || vv->not_found) {
return NGX_ERROR;
}
name->len = vv->len;
name->data = vv->data;
return ngx_http_get_charset(r, name);
}
static ngx_int_t
ngx_http_get_charset(ngx_http_request_t *r, ngx_str_t *name)
{
ngx_uint_t i, n;
ngx_http_charset_t *charset;
ngx_http_charset_main_conf_t *mcf;
mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
charset = mcf->charsets.elts;
n = mcf->charsets.nelts;
for (i = 0; i < n; i++) {
if (charset[i].name.len != name->len) {
continue;
}
if (ngx_strncasecmp(charset[i].name.data, name->data, name->len) == 0) {
return i;
}
}
return NGX_HTTP_NO_CHARSET;
}
static ngx_inline void
ngx_http_set_charset(ngx_http_request_t *r, ngx_str_t *charset)
{
if (r != r->main) {
return;
}
if (r->headers_out.status == NGX_HTTP_MOVED_PERMANENTLY
|| r->headers_out.status == NGX_HTTP_MOVED_TEMPORARILY)
{
/*
* do not set charset for the redirect because NN 4.x
* use this charset instead of the next page charset
*/
r->headers_out.charset.len = 0;
return;
}
r->headers_out.charset = *charset;
}
static ngx_int_t
ngx_http_charset_ctx(ngx_http_request_t *r, ngx_http_charset_t *charsets,
ngx_int_t charset, ngx_int_t source_charset)
{
ngx_http_charset_ctx_t *ctx;
ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_charset_ctx_t));
if (ctx == NULL) {
return NGX_ERROR;
}
ngx_http_set_ctx(r, ctx, ngx_http_charset_filter_module);
ctx->table = charsets[source_charset].tables[charset];
ctx->charset = charset;
ctx->charset_name = charsets[charset].name;
ctx->length = charsets[charset].length;
ctx->from_utf8 = charsets[source_charset].utf8;
ctx->to_utf8 = charsets[charset].utf8;
r->filter_need_in_memory = 1;
if ((ctx->to_utf8 || ctx->from_utf8) && r == r->main) {
ngx_http_clear_content_length(r);
} else {
r->filter_need_temporary = 1;
}
return ngx_http_next_header_filter(r);
}
static ngx_int_t
ngx_http_charset_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
{
ngx_int_t rc;
ngx_buf_t *b;
ngx_chain_t *cl, *out, **ll;
ngx_http_charset_ctx_t *ctx;
ctx = ngx_http_get_module_ctx(r, ngx_http_charset_filter_module);
if (ctx == NULL || ctx->table == NULL) {
return ngx_http_next_body_filter(r, in);
}
if ((ctx->to_utf8 || ctx->from_utf8) || ctx->busy) {
out = NULL;
ll = &out;
for (cl = in; cl; cl = cl->next) {
b = cl->buf;
if (ngx_buf_size(b) == 0) {
*ll = ngx_alloc_chain_link(r->pool);
if (*ll == NULL) {
return NGX_ERROR;
}
(*ll)->buf = b;
(*ll)->next = NULL;
ll = &(*ll)->next;
continue;
}
if (ctx->to_utf8) {
*ll = ngx_http_charset_recode_to_utf8(r->pool, b, ctx);
} else {
*ll = ngx_http_charset_recode_from_utf8(r->pool, b, ctx);
}
if (*ll == NULL) {
return NGX_ERROR;
}
while (*ll) {
ll = &(*ll)->next;
}
}
rc = ngx_http_next_body_filter(r, out);
if (out) {
if (ctx->busy == NULL) {
ctx->busy = out;
} else {
for (cl = ctx->busy; cl->next; cl = cl->next) { /* void */ }
cl->next = out;
}
}
while (ctx->busy) {
cl = ctx->busy;
b = cl->buf;
if (ngx_buf_size(b) != 0) {
break;
}
ctx->busy = cl->next;
if (b->tag != (ngx_buf_tag_t) &ngx_http_charset_filter_module) {
continue;
}
if (b->shadow) {
b->shadow->pos = b->shadow->last;
}
if (b->pos) {
cl->next = ctx->free_buffers;
ctx->free_buffers = cl;
continue;
}
cl->next = ctx->free_bufs;
ctx->free_bufs = cl;
}
return rc;
}
for (cl = in; cl; cl = cl->next) {
(void) ngx_http_charset_recode(cl->buf, ctx->table);
}
return ngx_http_next_body_filter(r, in);
}
static ngx_uint_t
ngx_http_charset_recode(ngx_buf_t *b, u_char *table)
{
u_char *p, *last;
last = b->last;
for (p = b->pos; p < last; p++) {
if (*p != table[*p]) {
goto recode;
}
}
return 0;
recode:
do {
if (*p != table[*p]) {
*p = table[*p];
}
p++;
} while (p < last);
b->in_file = 0;
return 1;
}
static ngx_chain_t *
ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf,
ngx_http_charset_ctx_t *ctx)
{
size_t len, size;
u_char c, *p, *src, *dst, *saved, **table;
uint32_t n;
ngx_buf_t *b;
ngx_uint_t i;
ngx_chain_t *out, *cl, **ll;
src = buf->pos;
if (ctx->saved_len == 0) {
for ( /* void */ ; src < buf->last; src++) {
if (*src < 0x80) {
continue;
}
len = src - buf->pos;
if (len > 512) {
out = ngx_http_charset_get_buf(pool, ctx);
if (out == NULL) {
return NULL;
}
b = out->buf;
b->temporary = buf->temporary;
b->memory = buf->memory;
b->mmap = buf->mmap;
b->flush = buf->flush;
b->pos = buf->pos;
b->last = src;
out->buf = b;
out->next = NULL;
size = buf->last - src;
saved = src;
n = ngx_utf8_decode(&saved, size);
if (n == 0xfffffffe) {
/* incomplete UTF-8 symbol */
ngx_memcpy(ctx->saved, src, size);
ctx->saved_len = size;
b->shadow = buf;
return out;
}
} else {
out = NULL;
size = len + buf->last - src;
src = buf->pos;
}
if (size < NGX_HTML_ENTITY_LEN) {
size += NGX_HTML_ENTITY_LEN;
}
cl = ngx_http_charset_get_buffer(pool, ctx, size);
if (cl == NULL) {
return NULL;
}
if (out) {
out->next = cl;
} else {
out = cl;
}
b = cl->buf;
dst = b->pos;
goto recode;
}
out = ngx_alloc_chain_link(pool);
if (out == NULL) {
return NULL;
}
out->buf = buf;
out->next = NULL;
return out;
}
/* process incomplete UTF sequence from previous buffer */
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pool->log, 0,
"http charset utf saved: %z", ctx->saved_len);
p = src;
for (i = ctx->saved_len; i < NGX_UTF_LEN; i++) {
ctx->saved[i] = *p++;
if (p == buf->last) {
break;
}
}
saved = ctx->saved;
n = ngx_utf8_decode(&saved, i);
c = '\0';
if (n < 0x10000) {
table = (u_char **) ctx->table;
p = table[n >> 8];
if (p) {
c = p[n & 0xff];
}
} else if (n == 0xfffffffe) {
/* incomplete UTF-8 symbol */
if (i < NGX_UTF_LEN) {
out = ngx_http_charset_get_buf(pool, ctx);
if (out == NULL) {
return NULL;
}
b = out->buf;
b->pos = buf->pos;
b->last = buf->last;
b->sync = 1;
b->shadow = buf;
ngx_memcpy(&ctx->saved[ctx->saved_len], src, i);
ctx->saved_len += i;
return out;
}
}
size = buf->last - buf->pos;
if (size < NGX_HTML_ENTITY_LEN) {
size += NGX_HTML_ENTITY_LEN;
}
cl = ngx_http_charset_get_buffer(pool, ctx, size);
if (cl == NULL) {
return NULL;
}
out = cl;
b = cl->buf;
dst = b->pos;
if (c) {
*dst++ = c;
} else if (n == 0xfffffffe) {
*dst++ = '?';
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0,
"http charset invalid utf 0");
saved = &ctx->saved[NGX_UTF_LEN];
} else if (n > 0x10ffff) {
*dst++ = '?';
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0,
"http charset invalid utf 1");
} else {
dst = ngx_sprintf(dst, "&#%uD;", n);
}
src += (saved - ctx->saved) - ctx->saved_len;
ctx->saved_len = 0;
recode:
ll = &cl->next;
table = (u_char **) ctx->table;
while (src < buf->last) {
if ((size_t) (b->end - dst) < NGX_HTML_ENTITY_LEN) {
b->last = dst;
size = buf->last - src + NGX_HTML_ENTITY_LEN;
cl = ngx_http_charset_get_buffer(pool, ctx, size);
if (cl == NULL) {
return NULL;
}
*ll = cl;
ll = &cl->next;
b = cl->buf;
dst = b->pos;
}
if (*src < 0x80) {
*dst++ = *src++;
continue;
}
len = buf->last - src;
n = ngx_utf8_decode(&src, len);
if (n < 0x10000) {
p = table[n >> 8];
if (p) {
c = p[n & 0xff];
if (c) {
*dst++ = c;
continue;
}
}
dst = ngx_sprintf(dst, "&#%uD;", n);
continue;
}
if (n == 0xfffffffe) {
/* incomplete UTF-8 symbol */
ngx_memcpy(ctx->saved, src, len);
ctx->saved_len = len;
if (b->pos == dst) {
b->sync = 1;
b->temporary = 0;
}
break;
}
if (n > 0x10ffff) {
*dst++ = '?';
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0,
"http charset invalid utf 2");
continue;
}
/* n > 0xffff */
dst = ngx_sprintf(dst, "&#%uD;", n);
}
b->last = dst;
b->last_buf = buf->last_buf;
b->last_in_chain = buf->last_in_chain;
b->flush = buf->flush;
b->shadow = buf;
return out;
}
static ngx_chain_t *
ngx_http_charset_recode_to_utf8(ngx_pool_t *pool, ngx_buf_t *buf,
ngx_http_charset_ctx_t *ctx)
{
size_t len, size;
u_char *p, *src, *dst, *table;
ngx_buf_t *b;
ngx_chain_t *out, *cl, **ll;
table = ctx->table;
for (src = buf->pos; src < buf->last; src++) {
if (table[*src * NGX_UTF_LEN] == '\1') {
continue;
}
goto recode;
}
out = ngx_alloc_chain_link(pool);
if (out == NULL) {
return NULL;
}
out->buf = buf;
out->next = NULL;
return out;
recode:
/*
* we assume that there are about half of characters to be recoded,
* so we preallocate "size / 2 + size / 2 * ctx->length"
*/
len = src - buf->pos;
if (len > 512) {
out = ngx_http_charset_get_buf(pool, ctx);
if (out == NULL) {
return NULL;
}
b = out->buf;
b->temporary = buf->temporary;
b->memory = buf->memory;
b->mmap = buf->mmap;
b->flush = buf->flush;
b->pos = buf->pos;
b->last = src;
out->buf = b;
out->next = NULL;
size = buf->last - src;
size = size / 2 + size / 2 * ctx->length;
} else {
out = NULL;
size = buf->last - src;
size = len + size / 2 + size / 2 * ctx->length;
src = buf->pos;
}
cl = ngx_http_charset_get_buffer(pool, ctx, size);
if (cl == NULL) {
return NULL;
}
if (out) {
out->next = cl;
} else {
out = cl;
}
ll = &cl->next;
b = cl->buf;
dst = b->pos;
while (src < buf->last) {
p = &table[*src++ * NGX_UTF_LEN];
len = *p++;
if ((size_t) (b->end - dst) < len) {
b->last = dst;
size = buf->last - src;
size = len + size / 2 + size / 2 * ctx->length;
cl = ngx_http_charset_get_buffer(pool, ctx, size);
if (cl == NULL) {
return NULL;
}
*ll = cl;
ll = &cl->next;
b = cl->buf;
dst = b->pos;
}
while (len) {
*dst++ = *p++;
len--;
}
}
b->last = dst;
b->last_buf = buf->last_buf;
b->last_in_chain = buf->last_in_chain;
b->flush = buf->flush;
b->shadow = buf;
return out;
}
static ngx_chain_t *
ngx_http_charset_get_buf(ngx_pool_t *pool, ngx_http_charset_ctx_t *ctx)
{
ngx_chain_t *cl;
cl = ctx->free_bufs;
if (cl) {
ctx->free_bufs = cl->next;
cl->buf->shadow = NULL;
cl->next = NULL;
return cl;
}
cl = ngx_alloc_chain_link(pool);
if (cl == NULL) {
return NULL;
}
cl->buf = ngx_calloc_buf(pool);
if (cl->buf == NULL) {
return NULL;
}
cl->next = NULL;
cl->buf->tag = (ngx_buf_tag_t) &ngx_http_charset_filter_module;
return cl;
}
static ngx_chain_t *
ngx_http_charset_get_buffer(ngx_pool_t *pool, ngx_http_charset_ctx_t *ctx,
size_t size)
{
ngx_buf_t *b;
ngx_chain_t *cl, **ll;
for (ll = &ctx->free_buffers, cl = ctx->free_buffers;
cl;
ll = &cl->next, cl = cl->next)
{
b = cl->buf;
if ((size_t) (b->end - b->start) >= size) {
*ll = cl->next;
cl->next = NULL;
b->pos = b->start;
b->temporary = 1;
b->shadow = NULL;
return cl;
}
}
cl = ngx_alloc_chain_link(pool);
if (cl == NULL) {
return NULL;
}
cl->buf = ngx_create_temp_buf(pool, size);
if (cl->buf == NULL) {
return NULL;
}
cl->next = NULL;
cl->buf->temporary = 1;
cl->buf->tag = (ngx_buf_tag_t) &ngx_http_charset_filter_module;
return cl;
}
static char *
ngx_http_charset_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_charset_main_conf_t *mcf = conf;
char *rv;
u_char *p, *dst2src, **pp;
ngx_int_t src, dst;
ngx_uint_t i, n;
ngx_str_t *value;
ngx_conf_t pvcf;
ngx_http_charset_t *charset;
ngx_http_charset_tables_t *table;
ngx_http_charset_conf_ctx_t ctx;
value = cf->args->elts;
src = ngx_http_add_charset(&mcf->charsets, &value[1]);
if (src == NGX_ERROR) {
return NGX_CONF_ERROR;
}
dst = ngx_http_add_charset(&mcf->charsets, &value[2]);
if (dst == NGX_ERROR) {
return NGX_CONF_ERROR;
}
if (src == dst) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"charset_map\" between the same charsets "
"\"%V\" and \"%V\"", &value[1], &value[2]);
return NGX_CONF_ERROR;
}
table = mcf->tables.elts;
for (i = 0; i < mcf->tables.nelts; i++) {
if ((src == table->src && dst == table->dst)
|| (src == table->dst && dst == table->src))
{
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"duplicate \"charset_map\" between "
"\"%V\" and \"%V\"", &value[1], &value[2]);
return NGX_CONF_ERROR;
}
}
table = ngx_array_push(&mcf->tables);
if (table == NULL) {
return NGX_CONF_ERROR;
}
table->src = src;
table->dst = dst;
if (ngx_strcasecmp(value[2].data, (u_char *) "utf-8") == 0) {
table->src2dst = ngx_pcalloc(cf->pool, 256 * NGX_UTF_LEN);
if (table->src2dst == NULL) {
return NGX_CONF_ERROR;
}
table->dst2src = ngx_pcalloc(cf->pool, 256 * sizeof(void *));
if (table->dst2src == NULL) {
return NGX_CONF_ERROR;
}
dst2src = ngx_pcalloc(cf->pool, 256);
if (dst2src == NULL) {
return NGX_CONF_ERROR;
}
pp = (u_char **) &table->dst2src[0];
pp[0] = dst2src;
for (i = 0; i < 128; i++) {
p = &table->src2dst[i * NGX_UTF_LEN];
p[0] = '\1';
p[1] = (u_char) i;
dst2src[i] = (u_char) i;
}
for (/* void */; i < 256; i++) {
p = &table->src2dst[i * NGX_UTF_LEN];
p[0] = '\1';
p[1] = '?';
}
} else {
table->src2dst = ngx_palloc(cf->pool, 256);
if (table->src2dst == NULL) {
return NGX_CONF_ERROR;
}
table->dst2src = ngx_palloc(cf->pool, 256);
if (table->dst2src == NULL) {
return NGX_CONF_ERROR;
}
for (i = 0; i < 128; i++) {
table->src2dst[i] = (u_char) i;
table->dst2src[i] = (u_char) i;
}
for (/* void */; i < 256; i++) {
table->src2dst[i] = '?';
table->dst2src[i] = '?';
}
}
charset = mcf->charsets.elts;
ctx.table = table;
ctx.charset = &charset[dst];
ctx.characters = 0;
pvcf = *cf;
cf->ctx = &ctx;
cf->handler = ngx_http_charset_map;
cf->handler_conf = conf;
rv = ngx_conf_parse(cf, NULL);
*cf = pvcf;
if (ctx.characters) {
n = ctx.charset->length;
ctx.charset->length /= ctx.characters;
if (((n * 10) / ctx.characters) % 10 > 4) {
ctx.charset->length++;
}
}
return rv;
}
static char *
ngx_http_charset_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
{
u_char *p, *dst2src, **pp;
uint32_t n;
ngx_int_t src, dst;
ngx_str_t *value;
ngx_uint_t i;
ngx_http_charset_tables_t *table;
ngx_http_charset_conf_ctx_t *ctx;
if (cf->args->nelts != 2) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameters number");
return NGX_CONF_ERROR;
}
value = cf->args->elts;
src = ngx_hextoi(value[0].data, value[0].len);
if (src == NGX_ERROR || src > 255) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid value \"%V\"", &value[0]);
return NGX_CONF_ERROR;
}
ctx = cf->ctx;
table = ctx->table;
if (ctx->charset->utf8) {
p = &table->src2dst[src * NGX_UTF_LEN];
*p++ = (u_char) (value[1].len / 2);
for (i = 0; i < value[1].len; i += 2) {
dst = ngx_hextoi(&value[1].data[i], 2);
if (dst == NGX_ERROR || dst > 255) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid value \"%V\"", &value[1]);
return NGX_CONF_ERROR;
}
*p++ = (u_char) dst;
}
i /= 2;
ctx->charset->length += i;
ctx->characters++;
p = &table->src2dst[src * NGX_UTF_LEN] + 1;
n = ngx_utf8_decode(&p, i);
if (n > 0xffff) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid value \"%V\"", &value[1]);
return NGX_CONF_ERROR;
}
pp = (u_char **) &table->dst2src[0];
dst2src = pp[n >> 8];
if (dst2src == NULL) {
dst2src = ngx_pcalloc(cf->pool, 256);
if (dst2src == NULL) {
return NGX_CONF_ERROR;
}
pp[n >> 8] = dst2src;
}
dst2src[n & 0xff] = (u_char) src;
} else {
dst = ngx_hextoi(value[1].data, value[1].len);
if (dst == NGX_ERROR || dst > 255) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid value \"%V\"", &value[1]);
return NGX_CONF_ERROR;
}
table->src2dst[src] = (u_char) dst;
table->dst2src[dst] = (u_char) src;
}
return NGX_CONF_OK;
}
static char *
ngx_http_set_charset_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
char *p = conf;
ngx_int_t *cp;
ngx_str_t *value, var;
ngx_http_charset_main_conf_t *mcf;
cp = (ngx_int_t *) (p + cmd->offset);
if (*cp != NGX_CONF_UNSET) {
return "is duplicate";
}
value = cf->args->elts;
if (cmd->offset == offsetof(ngx_http_charset_loc_conf_t, charset)
&& ngx_strcmp(value[1].data, "off") == 0)
{
*cp = NGX_HTTP_CHARSET_OFF;
return NGX_CONF_OK;
}
if (value[1].data[0] == '$') {
var.len = value[1].len - 1;
var.data = value[1].data + 1;
*cp = ngx_http_get_variable_index(cf, &var);
if (*cp == NGX_ERROR) {
return NGX_CONF_ERROR;
}
*cp += NGX_HTTP_CHARSET_VAR;
return NGX_CONF_OK;
}
mcf = ngx_http_conf_get_module_main_conf(cf,
ngx_http_charset_filter_module);
*cp = ngx_http_add_charset(&mcf->charsets, &value[1]);
if (*cp == NGX_ERROR) {
return NGX_CONF_ERROR;
}
return NGX_CONF_OK;
}
static ngx_int_t
ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name)
{
ngx_uint_t i;
ngx_http_charset_t *c;
c = charsets->elts;
for (i = 0; i < charsets->nelts; i++) {
if (name->len != c[i].name.len) {
continue;
}
if (ngx_strcasecmp(name->data, c[i].name.data) == 0) {
break;
}
}
if (i < charsets->nelts) {
return i;
}
c = ngx_array_push(charsets);
if (c == NULL) {
return NGX_ERROR;
}
c->tables = NULL;
c->name = *name;
c->length = 0;
if (ngx_strcasecmp(name->data, (u_char *) "utf-8") == 0) {
c->utf8 = 1;
} else {
c->utf8 = 0;
}
return i;
}
static void *
ngx_http_charset_create_main_conf(ngx_conf_t *cf)
{
ngx_http_charset_main_conf_t *mcf;
mcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_main_conf_t));
if (mcf == NULL) {
return NULL;
}
if (ngx_array_init(&mcf->charsets, cf->pool, 2, sizeof(ngx_http_charset_t))
!= NGX_OK)
{
return NULL;
}
if (ngx_array_init(&mcf->tables, cf->pool, 1,
sizeof(ngx_http_charset_tables_t))
!= NGX_OK)
{
return NULL;
}
if (ngx_array_init(&mcf->recodes, cf->pool, 2,
sizeof(ngx_http_charset_recode_t))
!= NGX_OK)
{
return NULL;
}
return mcf;
}
static void *
ngx_http_charset_create_loc_conf(ngx_conf_t *cf)
{
ngx_http_charset_loc_conf_t *lcf;
lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_loc_conf_t));
if (lcf == NULL) {
return NULL;
}
/*
* set by ngx_pcalloc():
*
* lcf->types = { NULL };
* lcf->types_keys = NULL;
*/
lcf->charset = NGX_CONF_UNSET;
lcf->source_charset = NGX_CONF_UNSET;
lcf->override_charset = NGX_CONF_UNSET;
return lcf;
}
static char *
ngx_http_charset_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_http_charset_loc_conf_t *prev = parent;
ngx_http_charset_loc_conf_t *conf = child;
ngx_uint_t i;
ngx_http_charset_recode_t *recode;
ngx_http_charset_main_conf_t *mcf;
if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
&prev->types_keys, &prev->types,
ngx_http_charset_default_types)
!= NGX_OK)
{
return NGX_CONF_ERROR;
}
ngx_conf_merge_value(conf->override_charset, prev->override_charset, 0);
ngx_conf_merge_value(conf->charset, prev->charset, NGX_HTTP_CHARSET_OFF);
ngx_conf_merge_value(conf->source_charset, prev->source_charset,
NGX_HTTP_CHARSET_OFF);
if (conf->charset == NGX_HTTP_CHARSET_OFF
|| conf->source_charset == NGX_HTTP_CHARSET_OFF
|| conf->charset == conf->source_charset)
{
return NGX_CONF_OK;
}
if (conf->source_charset >= NGX_HTTP_CHARSET_VAR
|| conf->charset >= NGX_HTTP_CHARSET_VAR)
{
return NGX_CONF_OK;
}
mcf = ngx_http_conf_get_module_main_conf(cf,
ngx_http_charset_filter_module);
recode = mcf->recodes.elts;
for (i = 0; i < mcf->recodes.nelts; i++) {
if (conf->source_charset == recode[i].src
&& conf->charset == recode[i].dst)
{
return NGX_CONF_OK;
}
}
recode = ngx_array_push(&mcf->recodes);
if (recode == NULL) {
return NGX_CONF_ERROR;
}
recode->src = conf->source_charset;
recode->dst = conf->charset;
return NGX_CONF_OK;
}
static ngx_int_t
ngx_http_charset_postconfiguration(ngx_conf_t *cf)
{
u_char **src, **dst;
ngx_int_t c;
ngx_uint_t i, t;
ngx_http_charset_t *charset;
ngx_http_charset_recode_t *recode;
ngx_http_charset_tables_t *tables;
ngx_http_charset_main_conf_t *mcf;
mcf = ngx_http_conf_get_module_main_conf(cf,
ngx_http_charset_filter_module);
recode = mcf->recodes.elts;
tables = mcf->tables.elts;
charset = mcf->charsets.elts;
for (i = 0; i < mcf->recodes.nelts; i++) {
c = recode[i].src;
for (t = 0; t < mcf->tables.nelts; t++) {
if (c == tables[t].src && recode[i].dst == tables[t].dst) {
goto next;
}
if (c == tables[t].dst && recode[i].dst == tables[t].src) {
goto next;
}
}
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"no \"charset_map\" between the charsets \"%V\" and \"%V\"",
&charset[c].name, &charset[recode[i].dst].name);
return NGX_ERROR;
next:
continue;
}
for (t = 0; t < mcf->tables.nelts; t++) {
src = charset[tables[t].src].tables;
if (src == NULL) {
src = ngx_pcalloc(cf->pool, sizeof(u_char *) * mcf->charsets.nelts);
if (src == NULL) {
return NGX_ERROR;
}
charset[tables[t].src].tables = src;
}
dst = charset[tables[t].dst].tables;
if (dst == NULL) {
dst = ngx_pcalloc(cf->pool, sizeof(u_char *) * mcf->charsets.nelts);
if (dst == NULL) {
return NGX_ERROR;
}
charset[tables[t].dst].tables = dst;
}
src[tables[t].dst] = tables[t].src2dst;
dst[tables[t].src] = tables[t].dst2src;
}
ngx_http_next_header_filter = ngx_http_top_header_filter;
ngx_http_top_header_filter = ngx_http_charset_header_filter;
ngx_http_next_body_filter = ngx_http_top_body_filter;
ngx_http_top_body_filter = ngx_http_charset_body_filter;
return NGX_OK;
}
| bsd-2-clause |
ethronsoft/stor | core/dependencies/osx/openssl/source/crypto/objects/o_names.c | 61 | 9930 | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/err.h>
#include <openssl/lhash.h>
#include <openssl/objects.h>
#include <openssl/safestack.h>
#include <openssl/e_os2.h>
/*
* Later versions of DEC C has started to add lnkage information to certain
* functions, which makes it tricky to use them as values to regular function
* pointers. One way is to define a macro that takes care of casting them
* correctly.
*/
#ifdef OPENSSL_SYS_VMS_DECC
# define OPENSSL_strcmp (int (*)(const char *,const char *))strcmp
#else
# define OPENSSL_strcmp strcmp
#endif
/*
* I use the ex_data stuff to manage the identifiers for the obj_name_types
* that applications may define. I only really use the free function field.
*/
DECLARE_LHASH_OF(OBJ_NAME);
static LHASH_OF(OBJ_NAME) *names_lh = NULL;
static int names_type_num = OBJ_NAME_TYPE_NUM;
typedef struct name_funcs_st {
unsigned long (*hash_func) (const char *name);
int (*cmp_func) (const char *a, const char *b);
void (*free_func) (const char *, int, const char *);
} NAME_FUNCS;
DECLARE_STACK_OF(NAME_FUNCS)
IMPLEMENT_STACK_OF(NAME_FUNCS)
static STACK_OF(NAME_FUNCS) *name_funcs_stack;
/*
* The LHASH callbacks now use the raw "void *" prototypes and do
* per-variable casting in the functions. This prevents function pointer
* casting without the need for macro-generated wrapper functions.
*/
/* static unsigned long obj_name_hash(OBJ_NAME *a); */
static unsigned long obj_name_hash(const void *a_void);
/* static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); */
static int obj_name_cmp(const void *a_void, const void *b_void);
static IMPLEMENT_LHASH_HASH_FN(obj_name, OBJ_NAME)
static IMPLEMENT_LHASH_COMP_FN(obj_name, OBJ_NAME)
int OBJ_NAME_init(void)
{
if (names_lh != NULL)
return (1);
MemCheck_off();
names_lh = lh_OBJ_NAME_new();
MemCheck_on();
return (names_lh != NULL);
}
int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
int (*cmp_func) (const char *, const char *),
void (*free_func) (const char *, int, const char *))
{
int ret;
int i;
NAME_FUNCS *name_funcs;
if (name_funcs_stack == NULL) {
MemCheck_off();
name_funcs_stack = sk_NAME_FUNCS_new_null();
MemCheck_on();
}
if (name_funcs_stack == NULL) {
/* ERROR */
return (0);
}
ret = names_type_num;
names_type_num++;
for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
MemCheck_off();
name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
MemCheck_on();
if (!name_funcs) {
OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
return (0);
}
name_funcs->hash_func = lh_strhash;
name_funcs->cmp_func = OPENSSL_strcmp;
name_funcs->free_func = 0; /* NULL is often declared to * ((void
* *)0), which according * to Compaq C is
* not really * compatible with a function
* * pointer. -- Richard Levitte */
MemCheck_off();
sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
MemCheck_on();
}
name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
if (hash_func != NULL)
name_funcs->hash_func = hash_func;
if (cmp_func != NULL)
name_funcs->cmp_func = cmp_func;
if (free_func != NULL)
name_funcs->free_func = free_func;
return (ret);
}
/* static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b) */
static int obj_name_cmp(const void *a_void, const void *b_void)
{
int ret;
const OBJ_NAME *a = (const OBJ_NAME *)a_void;
const OBJ_NAME *b = (const OBJ_NAME *)b_void;
ret = a->type - b->type;
if (ret == 0) {
if ((name_funcs_stack != NULL)
&& (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
ret = sk_NAME_FUNCS_value(name_funcs_stack,
a->type)->cmp_func(a->name, b->name);
} else
ret = strcmp(a->name, b->name);
}
return (ret);
}
/* static unsigned long obj_name_hash(OBJ_NAME *a) */
static unsigned long obj_name_hash(const void *a_void)
{
unsigned long ret;
const OBJ_NAME *a = (const OBJ_NAME *)a_void;
if ((name_funcs_stack != NULL)
&& (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
ret =
sk_NAME_FUNCS_value(name_funcs_stack,
a->type)->hash_func(a->name);
} else {
ret = lh_strhash(a->name);
}
ret ^= a->type;
return (ret);
}
const char *OBJ_NAME_get(const char *name, int type)
{
OBJ_NAME on, *ret;
int num = 0, alias;
if (name == NULL)
return (NULL);
if ((names_lh == NULL) && !OBJ_NAME_init())
return (NULL);
alias = type & OBJ_NAME_ALIAS;
type &= ~OBJ_NAME_ALIAS;
on.name = name;
on.type = type;
for (;;) {
ret = lh_OBJ_NAME_retrieve(names_lh, &on);
if (ret == NULL)
return (NULL);
if ((ret->alias) && !alias) {
if (++num > 10)
return (NULL);
on.name = ret->data;
} else {
return (ret->data);
}
}
}
int OBJ_NAME_add(const char *name, int type, const char *data)
{
OBJ_NAME *onp, *ret;
int alias;
if ((names_lh == NULL) && !OBJ_NAME_init())
return (0);
alias = type & OBJ_NAME_ALIAS;
type &= ~OBJ_NAME_ALIAS;
onp = (OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
if (onp == NULL) {
/* ERROR */
return 0;
}
onp->name = name;
onp->alias = alias;
onp->type = type;
onp->data = data;
ret = lh_OBJ_NAME_insert(names_lh, onp);
if (ret != NULL) {
/* free things */
if ((name_funcs_stack != NULL)
&& (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
/*
* XXX: I'm not sure I understand why the free function should
* get three arguments... -- Richard Levitte
*/
sk_NAME_FUNCS_value(name_funcs_stack,
ret->type)->free_func(ret->name, ret->type,
ret->data);
}
OPENSSL_free(ret);
} else {
if (lh_OBJ_NAME_error(names_lh)) {
/* ERROR */
OPENSSL_free(onp);
return 0;
}
}
return 1;
}
int OBJ_NAME_remove(const char *name, int type)
{
OBJ_NAME on, *ret;
if (names_lh == NULL)
return (0);
type &= ~OBJ_NAME_ALIAS;
on.name = name;
on.type = type;
ret = lh_OBJ_NAME_delete(names_lh, &on);
if (ret != NULL) {
/* free things */
if ((name_funcs_stack != NULL)
&& (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
/*
* XXX: I'm not sure I understand why the free function should
* get three arguments... -- Richard Levitte
*/
sk_NAME_FUNCS_value(name_funcs_stack,
ret->type)->free_func(ret->name, ret->type,
ret->data);
}
OPENSSL_free(ret);
return (1);
} else
return (0);
}
struct doall {
int type;
void (*fn) (const OBJ_NAME *, void *arg);
void *arg;
};
static void do_all_fn_doall_arg(const OBJ_NAME *name, struct doall *d)
{
if (name->type == d->type)
d->fn(name, d->arg);
}
static IMPLEMENT_LHASH_DOALL_ARG_FN(do_all_fn, const OBJ_NAME, struct doall)
void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
void *arg)
{
struct doall d;
d.type = type;
d.fn = fn;
d.arg = arg;
lh_OBJ_NAME_doall_arg(names_lh, LHASH_DOALL_ARG_FN(do_all_fn),
struct doall, &d);
}
struct doall_sorted {
int type;
int n;
const OBJ_NAME **names;
};
static void do_all_sorted_fn(const OBJ_NAME *name, void *d_)
{
struct doall_sorted *d = d_;
if (name->type != d->type)
return;
d->names[d->n++] = name;
}
static int do_all_sorted_cmp(const void *n1_, const void *n2_)
{
const OBJ_NAME *const *n1 = n1_;
const OBJ_NAME *const *n2 = n2_;
return strcmp((*n1)->name, (*n2)->name);
}
void OBJ_NAME_do_all_sorted(int type,
void (*fn) (const OBJ_NAME *, void *arg),
void *arg)
{
struct doall_sorted d;
int n;
d.type = type;
d.names =
OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof *d.names);
/* Really should return an error if !d.names...but its a void function! */
if (d.names) {
d.n = 0;
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
qsort((void *)d.names, d.n, sizeof *d.names, do_all_sorted_cmp);
for (n = 0; n < d.n; ++n)
fn(d.names[n], arg);
OPENSSL_free((void *)d.names);
}
}
static int free_type;
static void names_lh_free_doall(OBJ_NAME *onp)
{
if (onp == NULL)
return;
if (free_type < 0 || free_type == onp->type)
OBJ_NAME_remove(onp->name, onp->type);
}
static IMPLEMENT_LHASH_DOALL_FN(names_lh_free, OBJ_NAME)
static void name_funcs_free(NAME_FUNCS *ptr)
{
OPENSSL_free(ptr);
}
void OBJ_NAME_cleanup(int type)
{
unsigned long down_load;
if (names_lh == NULL)
return;
free_type = type;
down_load = lh_OBJ_NAME_down_load(names_lh);
lh_OBJ_NAME_down_load(names_lh) = 0;
lh_OBJ_NAME_doall(names_lh, LHASH_DOALL_FN(names_lh_free));
if (type < 0) {
lh_OBJ_NAME_free(names_lh);
sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
names_lh = NULL;
name_funcs_stack = NULL;
} else
lh_OBJ_NAME_down_load(names_lh) = down_load;
}
| bsd-2-clause |
ProfFan/RMBoardTest | Drivers/CMSIS/DSP_Lib/Examples/arm_variance_example/ARM/arm_variance_example_f32.c | 79 | 7428 | /* ----------------------------------------------------------------------
* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
*
* $Date: 17. January 2013
* $Revision: V1.4.0
*
* Project: CMSIS DSP Library
* Title: arm_variance_example_f32.c
*
* Description: Example code demonstrating variance calculation of input sequence.
*
* Target Processor: Cortex-M4/Cortex-M3
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* - Neither the name of ARM LIMITED nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* -------------------------------------------------------------------- */
/**
* @ingroup groupExamples
*/
/**
* @defgroup VarianceExample Variance Example
*
* \par Description:
* \par
* Demonstrates the use of Basic Math and Support Functions to calculate the variance of an
* input sequence with N samples. Uniformly distributed white noise is taken as input.
*
* \par Algorithm:
* \par
* The variance of a sequence is the mean of the squared deviation of the sequence from its mean.
* \par
* This is denoted by the following equation:
* <pre> variance = ((x[0] - x') * (x[0] - x') + (x[1] - x') * (x[1] - x') + ... + * (x[n-1] - x') * (x[n-1] - x')) / (N-1)</pre>
* where, <code>x[n]</code> is the input sequence, <code>N</code> is the number of input samples, and
* <code>x'</code> is the mean value of the input sequence, <code>x[n]</code>.
* \par
* The mean value <code>x'</code> is defined as:
* <pre> x' = (x[0] + x[1] + ... + x[n-1]) / N</pre>
*
* \par Block Diagram:
* \par
* \image html Variance.gif
*
*
* \par Variables Description:
* \par
* \li \c testInput_f32 points to the input data
* \li \c wire1, \c wir2, \c wire3 temporary buffers
* \li \c blockSize number of samples processed at a time
* \li \c refVarianceOut reference variance value
*
* \par CMSIS DSP Software Library Functions Used:
* \par
* - arm_dot_prod_f32()
* - arm_mult_f32()
* - arm_sub_f32()
* - arm_fill_f32()
* - arm_copy_f32()
*
* <b> Refer </b>
* \link arm_variance_example_f32.c \endlink
*
*/
/** \example arm_variance_example_f32.c
*/
#include <math.h>
#include "arm_math.h"
/* ----------------------------------------------------------------------
* Defines each of the tests performed
* ------------------------------------------------------------------- */
#define MAX_BLOCKSIZE 32
#define DELTA (0.000001f)
/* ----------------------------------------------------------------------
* Declare I/O buffers
* ------------------------------------------------------------------- */
float32_t wire1[MAX_BLOCKSIZE];
float32_t wire2[MAX_BLOCKSIZE];
float32_t wire3[MAX_BLOCKSIZE];
/* ----------------------------------------------------------------------
* Test input data for Floating point Variance example for 32-blockSize
* Generated by the MATLAB randn() function
* ------------------------------------------------------------------- */
float32_t testInput_f32[32] =
{
-0.432564811528221, -1.665584378238097, 0.125332306474831, 0.287676420358549,
-1.146471350681464, 1.190915465642999, 1.189164201652103, -0.037633276593318,
0.327292361408654, 0.174639142820925, -0.186708577681439, 0.725790548293303,
-0.588316543014189, 2.183185818197101, -0.136395883086596, 0.113931313520810,
1.066768211359189, 0.059281460523605, -0.095648405483669, -0.832349463650022,
0.294410816392640, -1.336181857937804, 0.714324551818952, 1.623562064446271,
-0.691775701702287, 0.857996672828263, 1.254001421602532, -1.593729576447477,
-1.440964431901020, 0.571147623658178, -0.399885577715363, 0.689997375464345
};
/* ----------------------------------------------------------------------
* Declare Global variables
* ------------------------------------------------------------------- */
uint32_t blockSize = 32;
float32_t refVarianceOut = 0.903941793931839;
/* ----------------------------------------------------------------------
* Variance calculation test
* ------------------------------------------------------------------- */
int32_t main(void)
{
arm_status status;
float32_t mean, oneByBlockSize;
float32_t variance;
float32_t diff;
status = ARM_MATH_SUCCESS;
/* Calculation of mean value of input */
/* x' = 1/blockSize * (x(0)* 1 + x(1) * 1 + ... + x(n-1) * 1) */
/* Fill wire1 buffer with 1.0 value */
arm_fill_f32(1.0, wire1, blockSize);
/* Calculate the dot product of wire1 and wire2 */
/* (x(0)* 1 + x(1) * 1 + ...+ x(n-1) * 1) */
arm_dot_prod_f32(testInput_f32, wire1, blockSize, &mean);
/* Calculation of 1/blockSize */
oneByBlockSize = 1.0 / (blockSize);
/* 1/blockSize * (x(0)* 1 + x(1) * 1 + ... + x(n-1) * 1) */
arm_mult_f32(&mean, &oneByBlockSize, &mean, 1);
/* Calculation of variance value of input */
/* (1/blockSize) * (x(0) - x') * (x(0) - x') + (x(1) - x') * (x(1) - x') + ... + (x(n-1) - x') * (x(n-1) - x') */
/* Fill wire2 with mean value x' */
arm_fill_f32(mean, wire2, blockSize);
/* wire3 contains (x-x') */
arm_sub_f32(testInput_f32, wire2, wire3, blockSize);
/* wire2 contains (x-x') */
arm_copy_f32(wire3, wire2, blockSize);
/* (x(0) - x') * (x(0) - x') + (x(1) - x') * (x(1) - x') + ... + (x(n-1) - x') * (x(n-1) - x') */
arm_dot_prod_f32(wire2, wire3, blockSize, &variance);
/* Calculation of 1/blockSize */
oneByBlockSize = 1.0 / (blockSize - 1);
/* Calculation of variance */
arm_mult_f32(&variance, &oneByBlockSize, &variance, 1);
/* absolute value of difference between ref and test */
diff = fabsf(refVarianceOut - variance);
/* Comparison of variance value with reference */
if(diff > DELTA)
{
status = ARM_MATH_TEST_FAILURE;
}
if( status != ARM_MATH_SUCCESS)
{
while(1);
}
while(1); /* main function does not return */
}
/** \endlink */
| bsd-2-clause |
endplay/omniplay | linux-lts-quantal-3.5.0/drivers/net/ethernet/intel/igb/e1000_mac.c | 181 | 40884 | /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include <linux/if_ether.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include "e1000_mac.h"
#include "igb.h"
static s32 igb_set_default_fc(struct e1000_hw *hw);
static s32 igb_set_fc_watermarks(struct e1000_hw *hw);
/**
* igb_get_bus_info_pcie - Get PCIe bus information
* @hw: pointer to the HW structure
*
* Determines and stores the system bus information for a particular
* network interface. The following bus information is determined and stored:
* bus speed, bus width, type (PCIe), and PCIe function.
**/
s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
{
struct e1000_bus_info *bus = &hw->bus;
s32 ret_val;
u32 reg;
u16 pcie_link_status;
bus->type = e1000_bus_type_pci_express;
ret_val = igb_read_pcie_cap_reg(hw,
PCI_EXP_LNKSTA,
&pcie_link_status);
if (ret_val) {
bus->width = e1000_bus_width_unknown;
bus->speed = e1000_bus_speed_unknown;
} else {
switch (pcie_link_status & PCI_EXP_LNKSTA_CLS) {
case PCI_EXP_LNKSTA_CLS_2_5GB:
bus->speed = e1000_bus_speed_2500;
break;
case PCI_EXP_LNKSTA_CLS_5_0GB:
bus->speed = e1000_bus_speed_5000;
break;
default:
bus->speed = e1000_bus_speed_unknown;
break;
}
bus->width = (enum e1000_bus_width)((pcie_link_status &
PCI_EXP_LNKSTA_NLW) >>
PCI_EXP_LNKSTA_NLW_SHIFT);
}
reg = rd32(E1000_STATUS);
bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
return 0;
}
/**
* igb_clear_vfta - Clear VLAN filter table
* @hw: pointer to the HW structure
*
* Clears the register array which contains the VLAN filter table by
* setting all the values to 0.
**/
void igb_clear_vfta(struct e1000_hw *hw)
{
u32 offset;
for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
array_wr32(E1000_VFTA, offset, 0);
wrfl();
}
}
/**
* igb_write_vfta - Write value to VLAN filter table
* @hw: pointer to the HW structure
* @offset: register offset in VLAN filter table
* @value: register value written to VLAN filter table
*
* Writes value at the given offset in the register array which stores
* the VLAN filter table.
**/
static void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
{
array_wr32(E1000_VFTA, offset, value);
wrfl();
}
/* Due to a hw errata, if the host tries to configure the VFTA register
* while performing queries from the BMC or DMA, then the VFTA in some
* cases won't be written.
*/
/**
* igb_clear_vfta_i350 - Clear VLAN filter table
* @hw: pointer to the HW structure
*
* Clears the register array which contains the VLAN filter table by
* setting all the values to 0.
**/
void igb_clear_vfta_i350(struct e1000_hw *hw)
{
u32 offset;
int i;
for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
for (i = 0; i < 10; i++)
array_wr32(E1000_VFTA, offset, 0);
wrfl();
}
}
/**
* igb_write_vfta_i350 - Write value to VLAN filter table
* @hw: pointer to the HW structure
* @offset: register offset in VLAN filter table
* @value: register value written to VLAN filter table
*
* Writes value at the given offset in the register array which stores
* the VLAN filter table.
**/
static void igb_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value)
{
int i;
for (i = 0; i < 10; i++)
array_wr32(E1000_VFTA, offset, value);
wrfl();
}
/**
* igb_init_rx_addrs - Initialize receive address's
* @hw: pointer to the HW structure
* @rar_count: receive address registers
*
* Setups the receive address registers by setting the base receive address
* register to the devices MAC address and clearing all the other receive
* address registers to 0.
**/
void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
{
u32 i;
u8 mac_addr[ETH_ALEN] = {0};
/* Setup the receive address */
hw_dbg("Programming MAC Address into RAR[0]\n");
hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
/* Zero out the other (rar_entry_count - 1) receive addresses */
hw_dbg("Clearing RAR[1-%u]\n", rar_count-1);
for (i = 1; i < rar_count; i++)
hw->mac.ops.rar_set(hw, mac_addr, i);
}
/**
* igb_vfta_set - enable or disable vlan in VLAN filter table
* @hw: pointer to the HW structure
* @vid: VLAN id to add or remove
* @add: if true add filter, if false remove
*
* Sets or clears a bit in the VLAN filter table array based on VLAN id
* and if we are adding or removing the filter
**/
s32 igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add)
{
u32 index = (vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK;
u32 mask = 1 << (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
u32 vfta;
struct igb_adapter *adapter = hw->back;
s32 ret_val = 0;
vfta = adapter->shadow_vfta[index];
/* bit was set/cleared before we started */
if ((!!(vfta & mask)) == add) {
ret_val = -E1000_ERR_CONFIG;
} else {
if (add)
vfta |= mask;
else
vfta &= ~mask;
}
if (hw->mac.type == e1000_i350)
igb_write_vfta_i350(hw, index, vfta);
else
igb_write_vfta(hw, index, vfta);
adapter->shadow_vfta[index] = vfta;
return ret_val;
}
/**
* igb_check_alt_mac_addr - Check for alternate MAC addr
* @hw: pointer to the HW structure
*
* Checks the nvm for an alternate MAC address. An alternate MAC address
* can be setup by pre-boot software and must be treated like a permanent
* address and must override the actual permanent MAC address. If an
* alternate MAC address is fopund it is saved in the hw struct and
* prgrammed into RAR0 and the cuntion returns success, otherwise the
* function returns an error.
**/
s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
{
u32 i;
s32 ret_val = 0;
u16 offset, nvm_alt_mac_addr_offset, nvm_data;
u8 alt_mac_addr[ETH_ALEN];
/*
* Alternate MAC address is handled by the option ROM for 82580
* and newer. SW support not required.
*/
if (hw->mac.type >= e1000_82580)
goto out;
ret_val = hw->nvm.ops.read(hw, NVM_ALT_MAC_ADDR_PTR, 1,
&nvm_alt_mac_addr_offset);
if (ret_val) {
hw_dbg("NVM Read Error\n");
goto out;
}
if ((nvm_alt_mac_addr_offset == 0xFFFF) ||
(nvm_alt_mac_addr_offset == 0x0000))
/* There is no Alternate MAC Address */
goto out;
if (hw->bus.func == E1000_FUNC_1)
nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN1;
if (hw->bus.func == E1000_FUNC_2)
nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN2;
if (hw->bus.func == E1000_FUNC_3)
nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN3;
for (i = 0; i < ETH_ALEN; i += 2) {
offset = nvm_alt_mac_addr_offset + (i >> 1);
ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
if (ret_val) {
hw_dbg("NVM Read Error\n");
goto out;
}
alt_mac_addr[i] = (u8)(nvm_data & 0xFF);
alt_mac_addr[i + 1] = (u8)(nvm_data >> 8);
}
/* if multicast bit is set, the alternate address will not be used */
if (is_multicast_ether_addr(alt_mac_addr)) {
hw_dbg("Ignoring Alternate Mac Address with MC bit set\n");
goto out;
}
/*
* We have a valid alternate MAC address, and we want to treat it the
* same as the normal permanent MAC address stored by the HW into the
* RAR. Do this by mapping this address into RAR0.
*/
hw->mac.ops.rar_set(hw, alt_mac_addr, 0);
out:
return ret_val;
}
/**
* igb_rar_set - Set receive address register
* @hw: pointer to the HW structure
* @addr: pointer to the receive address
* @index: receive address array register
*
* Sets the receive address array register at index to the address passed
* in by addr.
**/
void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
{
u32 rar_low, rar_high;
/*
* HW expects these in little endian so we reverse the byte order
* from network order (big endian) to little endian
*/
rar_low = ((u32) addr[0] |
((u32) addr[1] << 8) |
((u32) addr[2] << 16) | ((u32) addr[3] << 24));
rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
/* If MAC address zero, no need to set the AV bit */
if (rar_low || rar_high)
rar_high |= E1000_RAH_AV;
/*
* Some bridges will combine consecutive 32-bit writes into
* a single burst write, which will malfunction on some parts.
* The flushes avoid this.
*/
wr32(E1000_RAL(index), rar_low);
wrfl();
wr32(E1000_RAH(index), rar_high);
wrfl();
}
/**
* igb_mta_set - Set multicast filter table address
* @hw: pointer to the HW structure
* @hash_value: determines the MTA register and bit to set
*
* The multicast table address is a register array of 32-bit registers.
* The hash_value is used to determine what register the bit is in, the
* current value is read, the new bit is OR'd in and the new value is
* written back into the register.
**/
void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
{
u32 hash_bit, hash_reg, mta;
/*
* The MTA is a register array of 32-bit registers. It is
* treated like an array of (32*mta_reg_count) bits. We want to
* set bit BitArray[hash_value]. So we figure out what register
* the bit is in, read it, OR in the new bit, then write
* back the new value. The (hw->mac.mta_reg_count - 1) serves as a
* mask to bits 31:5 of the hash value which gives us the
* register we're modifying. The hash bit within that register
* is determined by the lower 5 bits of the hash value.
*/
hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
hash_bit = hash_value & 0x1F;
mta = array_rd32(E1000_MTA, hash_reg);
mta |= (1 << hash_bit);
array_wr32(E1000_MTA, hash_reg, mta);
wrfl();
}
/**
* igb_hash_mc_addr - Generate a multicast hash value
* @hw: pointer to the HW structure
* @mc_addr: pointer to a multicast address
*
* Generates a multicast address hash value which is used to determine
* the multicast filter table array address and new table value. See
* igb_mta_set()
**/
static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
{
u32 hash_value, hash_mask;
u8 bit_shift = 0;
/* Register count multiplied by bits per register */
hash_mask = (hw->mac.mta_reg_count * 32) - 1;
/*
* For a mc_filter_type of 0, bit_shift is the number of left-shifts
* where 0xFF would still fall within the hash mask.
*/
while (hash_mask >> bit_shift != 0xFF)
bit_shift++;
/*
* The portion of the address that is used for the hash table
* is determined by the mc_filter_type setting.
* The algorithm is such that there is a total of 8 bits of shifting.
* The bit_shift for a mc_filter_type of 0 represents the number of
* left-shifts where the MSB of mc_addr[5] would still fall within
* the hash_mask. Case 0 does this exactly. Since there are a total
* of 8 bits of shifting, then mc_addr[4] will shift right the
* remaining number of bits. Thus 8 - bit_shift. The rest of the
* cases are a variation of this algorithm...essentially raising the
* number of bits to shift mc_addr[5] left, while still keeping the
* 8-bit shifting total.
*
* For example, given the following Destination MAC Address and an
* mta register count of 128 (thus a 4096-bit vector and 0xFFF mask),
* we can see that the bit_shift for case 0 is 4. These are the hash
* values resulting from each mc_filter_type...
* [0] [1] [2] [3] [4] [5]
* 01 AA 00 12 34 56
* LSB MSB
*
* case 0: hash_value = ((0x34 >> 4) | (0x56 << 4)) & 0xFFF = 0x563
* case 1: hash_value = ((0x34 >> 3) | (0x56 << 5)) & 0xFFF = 0xAC6
* case 2: hash_value = ((0x34 >> 2) | (0x56 << 6)) & 0xFFF = 0x163
* case 3: hash_value = ((0x34 >> 0) | (0x56 << 8)) & 0xFFF = 0x634
*/
switch (hw->mac.mc_filter_type) {
default:
case 0:
break;
case 1:
bit_shift += 1;
break;
case 2:
bit_shift += 2;
break;
case 3:
bit_shift += 4;
break;
}
hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
(((u16) mc_addr[5]) << bit_shift)));
return hash_value;
}
/**
* igb_update_mc_addr_list - Update Multicast addresses
* @hw: pointer to the HW structure
* @mc_addr_list: array of multicast addresses to program
* @mc_addr_count: number of multicast addresses to program
*
* Updates entire Multicast Table Array.
* The caller must have a packed mc_addr_list of multicast addresses.
**/
void igb_update_mc_addr_list(struct e1000_hw *hw,
u8 *mc_addr_list, u32 mc_addr_count)
{
u32 hash_value, hash_bit, hash_reg;
int i;
/* clear mta_shadow */
memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
/* update mta_shadow from mc_addr_list */
for (i = 0; (u32) i < mc_addr_count; i++) {
hash_value = igb_hash_mc_addr(hw, mc_addr_list);
hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
hash_bit = hash_value & 0x1F;
hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit);
mc_addr_list += (ETH_ALEN);
}
/* replace the entire MTA table */
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
wrfl();
}
/**
* igb_clear_hw_cntrs_base - Clear base hardware counters
* @hw: pointer to the HW structure
*
* Clears the base hardware counters by reading the counter registers.
**/
void igb_clear_hw_cntrs_base(struct e1000_hw *hw)
{
rd32(E1000_CRCERRS);
rd32(E1000_SYMERRS);
rd32(E1000_MPC);
rd32(E1000_SCC);
rd32(E1000_ECOL);
rd32(E1000_MCC);
rd32(E1000_LATECOL);
rd32(E1000_COLC);
rd32(E1000_DC);
rd32(E1000_SEC);
rd32(E1000_RLEC);
rd32(E1000_XONRXC);
rd32(E1000_XONTXC);
rd32(E1000_XOFFRXC);
rd32(E1000_XOFFTXC);
rd32(E1000_FCRUC);
rd32(E1000_GPRC);
rd32(E1000_BPRC);
rd32(E1000_MPRC);
rd32(E1000_GPTC);
rd32(E1000_GORCL);
rd32(E1000_GORCH);
rd32(E1000_GOTCL);
rd32(E1000_GOTCH);
rd32(E1000_RNBC);
rd32(E1000_RUC);
rd32(E1000_RFC);
rd32(E1000_ROC);
rd32(E1000_RJC);
rd32(E1000_TORL);
rd32(E1000_TORH);
rd32(E1000_TOTL);
rd32(E1000_TOTH);
rd32(E1000_TPR);
rd32(E1000_TPT);
rd32(E1000_MPTC);
rd32(E1000_BPTC);
}
/**
* igb_check_for_copper_link - Check for link (Copper)
* @hw: pointer to the HW structure
*
* Checks to see of the link status of the hardware has changed. If a
* change in link status has been detected, then we read the PHY registers
* to get the current speed/duplex if link exists.
**/
s32 igb_check_for_copper_link(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
s32 ret_val;
bool link;
/*
* We only want to go out to the PHY registers to see if Auto-Neg
* has completed and/or if our link status has changed. The
* get_link_status flag is set upon receiving a Link Status
* Change or Rx Sequence Error interrupt.
*/
if (!mac->get_link_status) {
ret_val = 0;
goto out;
}
/*
* First we want to see if the MII Status Register reports
* link. If so, then we want to get the current speed/duplex
* of the PHY.
*/
ret_val = igb_phy_has_link(hw, 1, 0, &link);
if (ret_val)
goto out;
if (!link)
goto out; /* No link detected */
mac->get_link_status = false;
/*
* Check if there was DownShift, must be checked
* immediately after link-up
*/
igb_check_downshift(hw);
/*
* If we are forcing speed/duplex, then we simply return since
* we have already determined whether we have link or not.
*/
if (!mac->autoneg) {
ret_val = -E1000_ERR_CONFIG;
goto out;
}
/*
* Auto-Neg is enabled. Auto Speed Detection takes care
* of MAC speed/duplex configuration. So we only need to
* configure Collision Distance in the MAC.
*/
igb_config_collision_dist(hw);
/*
* Configure Flow Control now that Auto-Neg has completed.
* First, we need to restore the desired flow control
* settings because we may have had to re-autoneg with a
* different link partner.
*/
ret_val = igb_config_fc_after_link_up(hw);
if (ret_val)
hw_dbg("Error configuring flow control\n");
out:
return ret_val;
}
/**
* igb_setup_link - Setup flow control and link settings
* @hw: pointer to the HW structure
*
* Determines which flow control settings to use, then configures flow
* control. Calls the appropriate media-specific link configuration
* function. Assuming the adapter has a valid link partner, a valid link
* should be established. Assumes the hardware has previously been reset
* and the transmitter and receiver are not enabled.
**/
s32 igb_setup_link(struct e1000_hw *hw)
{
s32 ret_val = 0;
/*
* In the case of the phy reset being blocked, we already have a link.
* We do not need to set it up again.
*/
if (igb_check_reset_block(hw))
goto out;
/*
* If requested flow control is set to default, set flow control
* based on the EEPROM flow control settings.
*/
if (hw->fc.requested_mode == e1000_fc_default) {
ret_val = igb_set_default_fc(hw);
if (ret_val)
goto out;
}
/*
* We want to save off the original Flow Control configuration just
* in case we get disconnected and then reconnected into a different
* hub or switch with different Flow Control capabilities.
*/
hw->fc.current_mode = hw->fc.requested_mode;
hw_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode);
/* Call the necessary media_type subroutine to configure the link. */
ret_val = hw->mac.ops.setup_physical_interface(hw);
if (ret_val)
goto out;
/*
* Initialize the flow control address, type, and PAUSE timer
* registers to their default values. This is done even if flow
* control is disabled, because it does not hurt anything to
* initialize these registers.
*/
hw_dbg("Initializing the Flow Control address, type and timer regs\n");
wr32(E1000_FCT, FLOW_CONTROL_TYPE);
wr32(E1000_FCAH, FLOW_CONTROL_ADDRESS_HIGH);
wr32(E1000_FCAL, FLOW_CONTROL_ADDRESS_LOW);
wr32(E1000_FCTTV, hw->fc.pause_time);
ret_val = igb_set_fc_watermarks(hw);
out:
return ret_val;
}
/**
* igb_config_collision_dist - Configure collision distance
* @hw: pointer to the HW structure
*
* Configures the collision distance to the default value and is used
* during link setup. Currently no func pointer exists and all
* implementations are handled in the generic version of this function.
**/
void igb_config_collision_dist(struct e1000_hw *hw)
{
u32 tctl;
tctl = rd32(E1000_TCTL);
tctl &= ~E1000_TCTL_COLD;
tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT;
wr32(E1000_TCTL, tctl);
wrfl();
}
/**
* igb_set_fc_watermarks - Set flow control high/low watermarks
* @hw: pointer to the HW structure
*
* Sets the flow control high/low threshold (watermark) registers. If
* flow control XON frame transmission is enabled, then set XON frame
* tansmission as well.
**/
static s32 igb_set_fc_watermarks(struct e1000_hw *hw)
{
s32 ret_val = 0;
u32 fcrtl = 0, fcrth = 0;
/*
* Set the flow control receive threshold registers. Normally,
* these registers will be set to a default threshold that may be
* adjusted later by the driver's runtime code. However, if the
* ability to transmit pause frames is not enabled, then these
* registers will be set to 0.
*/
if (hw->fc.current_mode & e1000_fc_tx_pause) {
/*
* We need to set up the Receive Threshold high and low water
* marks as well as (optionally) enabling the transmission of
* XON frames.
*/
fcrtl = hw->fc.low_water;
if (hw->fc.send_xon)
fcrtl |= E1000_FCRTL_XONE;
fcrth = hw->fc.high_water;
}
wr32(E1000_FCRTL, fcrtl);
wr32(E1000_FCRTH, fcrth);
return ret_val;
}
/**
* igb_set_default_fc - Set flow control default values
* @hw: pointer to the HW structure
*
* Read the EEPROM for the default values for flow control and store the
* values.
**/
static s32 igb_set_default_fc(struct e1000_hw *hw)
{
s32 ret_val = 0;
u16 nvm_data;
/*
* Read and store word 0x0F of the EEPROM. This word contains bits
* that determine the hardware's default PAUSE (flow control) mode,
* a bit that determines whether the HW defaults to enabling or
* disabling auto-negotiation, and the direction of the
* SW defined pins. If there is no SW over-ride of the flow
* control setting, then the variable hw->fc will
* be initialized based on a value in the EEPROM.
*/
ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
if (ret_val) {
hw_dbg("NVM Read Error\n");
goto out;
}
if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0)
hw->fc.requested_mode = e1000_fc_none;
else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) ==
NVM_WORD0F_ASM_DIR)
hw->fc.requested_mode = e1000_fc_tx_pause;
else
hw->fc.requested_mode = e1000_fc_full;
out:
return ret_val;
}
/**
* igb_force_mac_fc - Force the MAC's flow control settings
* @hw: pointer to the HW structure
*
* Force the MAC's flow control settings. Sets the TFCE and RFCE bits in the
* device control register to reflect the adapter settings. TFCE and RFCE
* need to be explicitly set by software when a copper PHY is used because
* autonegotiation is managed by the PHY rather than the MAC. Software must
* also configure these bits when link is forced on a fiber connection.
**/
s32 igb_force_mac_fc(struct e1000_hw *hw)
{
u32 ctrl;
s32 ret_val = 0;
ctrl = rd32(E1000_CTRL);
/*
* Because we didn't get link via the internal auto-negotiation
* mechanism (we either forced link or we got link via PHY
* auto-neg), we have to manually enable/disable transmit an
* receive flow control.
*
* The "Case" statement below enables/disable flow control
* according to the "hw->fc.current_mode" parameter.
*
* The possible values of the "fc" parameter are:
* 0: Flow control is completely disabled
* 1: Rx flow control is enabled (we can receive pause
* frames but not send pause frames).
* 2: Tx flow control is enabled (we can send pause frames
* frames but we do not receive pause frames).
* 3: Both Rx and TX flow control (symmetric) is enabled.
* other: No other values should be possible at this point.
*/
hw_dbg("hw->fc.current_mode = %u\n", hw->fc.current_mode);
switch (hw->fc.current_mode) {
case e1000_fc_none:
ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE));
break;
case e1000_fc_rx_pause:
ctrl &= (~E1000_CTRL_TFCE);
ctrl |= E1000_CTRL_RFCE;
break;
case e1000_fc_tx_pause:
ctrl &= (~E1000_CTRL_RFCE);
ctrl |= E1000_CTRL_TFCE;
break;
case e1000_fc_full:
ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE);
break;
default:
hw_dbg("Flow control param set incorrectly\n");
ret_val = -E1000_ERR_CONFIG;
goto out;
}
wr32(E1000_CTRL, ctrl);
out:
return ret_val;
}
/**
* igb_config_fc_after_link_up - Configures flow control after link
* @hw: pointer to the HW structure
*
* Checks the status of auto-negotiation after link up to ensure that the
* speed and duplex were not forced. If the link needed to be forced, then
* flow control needs to be forced also. If auto-negotiation is enabled
* and did not fail, then we configure flow control based on our link
* partner.
**/
s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
s32 ret_val = 0;
u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;
u16 speed, duplex;
/*
* Check for the case where we have fiber media and auto-neg failed
* so we had to force link. In this case, we need to force the
* configuration of the MAC to match the "fc" parameter.
*/
if (mac->autoneg_failed) {
if (hw->phy.media_type == e1000_media_type_internal_serdes)
ret_val = igb_force_mac_fc(hw);
} else {
if (hw->phy.media_type == e1000_media_type_copper)
ret_val = igb_force_mac_fc(hw);
}
if (ret_val) {
hw_dbg("Error forcing flow control settings\n");
goto out;
}
/*
* Check for the case where we have copper media and auto-neg is
* enabled. In this case, we need to check and see if Auto-Neg
* has completed, and if so, how the PHY and link partner has
* flow control configured.
*/
if ((hw->phy.media_type == e1000_media_type_copper) && mac->autoneg) {
/*
* Read the MII Status Register and check to see if AutoNeg
* has completed. We read this twice because this reg has
* some "sticky" (latched) bits.
*/
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS,
&mii_status_reg);
if (ret_val)
goto out;
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS,
&mii_status_reg);
if (ret_val)
goto out;
if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
hw_dbg("Copper PHY and Auto Neg "
"has not completed.\n");
goto out;
}
/*
* The AutoNeg process has completed, so we now need to
* read both the Auto Negotiation Advertisement
* Register (Address 4) and the Auto_Negotiation Base
* Page Ability Register (Address 5) to determine how
* flow control was negotiated.
*/
ret_val = hw->phy.ops.read_reg(hw, PHY_AUTONEG_ADV,
&mii_nway_adv_reg);
if (ret_val)
goto out;
ret_val = hw->phy.ops.read_reg(hw, PHY_LP_ABILITY,
&mii_nway_lp_ability_reg);
if (ret_val)
goto out;
/*
* Two bits in the Auto Negotiation Advertisement Register
* (Address 4) and two bits in the Auto Negotiation Base
* Page Ability Register (Address 5) determine flow control
* for both the PHY and the link partner. The following
* table, taken out of the IEEE 802.3ab/D6.0 dated March 25,
* 1999, describes these PAUSE resolution bits and how flow
* control is determined based upon these settings.
* NOTE: DC = Don't Care
*
* LOCAL DEVICE | LINK PARTNER
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution
*-------|---------|-------|---------|--------------------
* 0 | 0 | DC | DC | e1000_fc_none
* 0 | 1 | 0 | DC | e1000_fc_none
* 0 | 1 | 1 | 0 | e1000_fc_none
* 0 | 1 | 1 | 1 | e1000_fc_tx_pause
* 1 | 0 | 0 | DC | e1000_fc_none
* 1 | DC | 1 | DC | e1000_fc_full
* 1 | 1 | 0 | 0 | e1000_fc_none
* 1 | 1 | 0 | 1 | e1000_fc_rx_pause
*
* Are both PAUSE bits set to 1? If so, this implies
* Symmetric Flow Control is enabled at both ends. The
* ASM_DIR bits are irrelevant per the spec.
*
* For Symmetric Flow Control:
*
* LOCAL DEVICE | LINK PARTNER
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
*-------|---------|-------|---------|--------------------
* 1 | DC | 1 | DC | E1000_fc_full
*
*/
if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE)) {
/*
* Now we need to check if the user selected RX ONLY
* of pause frames. In this case, we had to advertise
* FULL flow control because we could not advertise RX
* ONLY. Hence, we must now check to see if we need to
* turn OFF the TRANSMISSION of PAUSE frames.
*/
if (hw->fc.requested_mode == e1000_fc_full) {
hw->fc.current_mode = e1000_fc_full;
hw_dbg("Flow Control = FULL.\r\n");
} else {
hw->fc.current_mode = e1000_fc_rx_pause;
hw_dbg("Flow Control = "
"RX PAUSE frames only.\r\n");
}
}
/*
* For receiving PAUSE frames ONLY.
*
* LOCAL DEVICE | LINK PARTNER
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
*-------|---------|-------|---------|--------------------
* 0 | 1 | 1 | 1 | e1000_fc_tx_pause
*/
else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
hw->fc.current_mode = e1000_fc_tx_pause;
hw_dbg("Flow Control = TX PAUSE frames only.\r\n");
}
/*
* For transmitting PAUSE frames ONLY.
*
* LOCAL DEVICE | LINK PARTNER
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
*-------|---------|-------|---------|--------------------
* 1 | 1 | 0 | 1 | e1000_fc_rx_pause
*/
else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
!(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
hw->fc.current_mode = e1000_fc_rx_pause;
hw_dbg("Flow Control = RX PAUSE frames only.\r\n");
}
/*
* Per the IEEE spec, at this point flow control should be
* disabled. However, we want to consider that we could
* be connected to a legacy switch that doesn't advertise
* desired flow control, but can be forced on the link
* partner. So if we advertised no flow control, that is
* what we will resolve to. If we advertised some kind of
* receive capability (Rx Pause Only or Full Flow Control)
* and the link partner advertised none, we will configure
* ourselves to enable Rx Flow Control only. We can do
* this safely for two reasons: If the link partner really
* didn't want flow control enabled, and we enable Rx, no
* harm done since we won't be receiving any PAUSE frames
* anyway. If the intent on the link partner was to have
* flow control enabled, then by us enabling RX only, we
* can at least receive pause frames and process them.
* This is a good idea because in most cases, since we are
* predominantly a server NIC, more times than not we will
* be asked to delay transmission of packets than asking
* our link partner to pause transmission of frames.
*/
else if ((hw->fc.requested_mode == e1000_fc_none ||
hw->fc.requested_mode == e1000_fc_tx_pause) ||
hw->fc.strict_ieee) {
hw->fc.current_mode = e1000_fc_none;
hw_dbg("Flow Control = NONE.\r\n");
} else {
hw->fc.current_mode = e1000_fc_rx_pause;
hw_dbg("Flow Control = RX PAUSE frames only.\r\n");
}
/*
* Now we need to do one last check... If we auto-
* negotiated to HALF DUPLEX, flow control should not be
* enabled per IEEE 802.3 spec.
*/
ret_val = hw->mac.ops.get_speed_and_duplex(hw, &speed, &duplex);
if (ret_val) {
hw_dbg("Error getting link speed and duplex\n");
goto out;
}
if (duplex == HALF_DUPLEX)
hw->fc.current_mode = e1000_fc_none;
/*
* Now we call a subroutine to actually force the MAC
* controller to use the correct flow control settings.
*/
ret_val = igb_force_mac_fc(hw);
if (ret_val) {
hw_dbg("Error forcing flow control settings\n");
goto out;
}
}
out:
return ret_val;
}
/**
* igb_get_speed_and_duplex_copper - Retrieve current speed/duplex
* @hw: pointer to the HW structure
* @speed: stores the current speed
* @duplex: stores the current duplex
*
* Read the status register for the current speed/duplex and store the current
* speed and duplex for copper connections.
**/
s32 igb_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
u16 *duplex)
{
u32 status;
status = rd32(E1000_STATUS);
if (status & E1000_STATUS_SPEED_1000) {
*speed = SPEED_1000;
hw_dbg("1000 Mbs, ");
} else if (status & E1000_STATUS_SPEED_100) {
*speed = SPEED_100;
hw_dbg("100 Mbs, ");
} else {
*speed = SPEED_10;
hw_dbg("10 Mbs, ");
}
if (status & E1000_STATUS_FD) {
*duplex = FULL_DUPLEX;
hw_dbg("Full Duplex\n");
} else {
*duplex = HALF_DUPLEX;
hw_dbg("Half Duplex\n");
}
return 0;
}
/**
* igb_get_hw_semaphore - Acquire hardware semaphore
* @hw: pointer to the HW structure
*
* Acquire the HW semaphore to access the PHY or NVM
**/
s32 igb_get_hw_semaphore(struct e1000_hw *hw)
{
u32 swsm;
s32 ret_val = 0;
s32 timeout = hw->nvm.word_size + 1;
s32 i = 0;
/* Get the SW semaphore */
while (i < timeout) {
swsm = rd32(E1000_SWSM);
if (!(swsm & E1000_SWSM_SMBI))
break;
udelay(50);
i++;
}
if (i == timeout) {
hw_dbg("Driver can't access device - SMBI bit is set.\n");
ret_val = -E1000_ERR_NVM;
goto out;
}
/* Get the FW semaphore. */
for (i = 0; i < timeout; i++) {
swsm = rd32(E1000_SWSM);
wr32(E1000_SWSM, swsm | E1000_SWSM_SWESMBI);
/* Semaphore acquired if bit latched */
if (rd32(E1000_SWSM) & E1000_SWSM_SWESMBI)
break;
udelay(50);
}
if (i == timeout) {
/* Release semaphores */
igb_put_hw_semaphore(hw);
hw_dbg("Driver can't access the NVM\n");
ret_val = -E1000_ERR_NVM;
goto out;
}
out:
return ret_val;
}
/**
* igb_put_hw_semaphore - Release hardware semaphore
* @hw: pointer to the HW structure
*
* Release hardware semaphore used to access the PHY or NVM
**/
void igb_put_hw_semaphore(struct e1000_hw *hw)
{
u32 swsm;
swsm = rd32(E1000_SWSM);
swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI);
wr32(E1000_SWSM, swsm);
}
/**
* igb_get_auto_rd_done - Check for auto read completion
* @hw: pointer to the HW structure
*
* Check EEPROM for Auto Read done bit.
**/
s32 igb_get_auto_rd_done(struct e1000_hw *hw)
{
s32 i = 0;
s32 ret_val = 0;
while (i < AUTO_READ_DONE_TIMEOUT) {
if (rd32(E1000_EECD) & E1000_EECD_AUTO_RD)
break;
msleep(1);
i++;
}
if (i == AUTO_READ_DONE_TIMEOUT) {
hw_dbg("Auto read by HW from NVM has not completed.\n");
ret_val = -E1000_ERR_RESET;
goto out;
}
out:
return ret_val;
}
/**
* igb_valid_led_default - Verify a valid default LED config
* @hw: pointer to the HW structure
* @data: pointer to the NVM (EEPROM)
*
* Read the EEPROM for the current default LED configuration. If the
* LED configuration is not valid, set to a valid LED configuration.
**/
static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data)
{
s32 ret_val;
ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
if (ret_val) {
hw_dbg("NVM Read Error\n");
goto out;
}
if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) {
switch(hw->phy.media_type) {
case e1000_media_type_internal_serdes:
*data = ID_LED_DEFAULT_82575_SERDES;
break;
case e1000_media_type_copper:
default:
*data = ID_LED_DEFAULT;
break;
}
}
out:
return ret_val;
}
/**
* igb_id_led_init -
* @hw: pointer to the HW structure
*
**/
s32 igb_id_led_init(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
s32 ret_val;
const u32 ledctl_mask = 0x000000FF;
const u32 ledctl_on = E1000_LEDCTL_MODE_LED_ON;
const u32 ledctl_off = E1000_LEDCTL_MODE_LED_OFF;
u16 data, i, temp;
const u16 led_mask = 0x0F;
ret_val = igb_valid_led_default(hw, &data);
if (ret_val)
goto out;
mac->ledctl_default = rd32(E1000_LEDCTL);
mac->ledctl_mode1 = mac->ledctl_default;
mac->ledctl_mode2 = mac->ledctl_default;
for (i = 0; i < 4; i++) {
temp = (data >> (i << 2)) & led_mask;
switch (temp) {
case ID_LED_ON1_DEF2:
case ID_LED_ON1_ON2:
case ID_LED_ON1_OFF2:
mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3));
mac->ledctl_mode1 |= ledctl_on << (i << 3);
break;
case ID_LED_OFF1_DEF2:
case ID_LED_OFF1_ON2:
case ID_LED_OFF1_OFF2:
mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3));
mac->ledctl_mode1 |= ledctl_off << (i << 3);
break;
default:
/* Do nothing */
break;
}
switch (temp) {
case ID_LED_DEF1_ON2:
case ID_LED_ON1_ON2:
case ID_LED_OFF1_ON2:
mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3));
mac->ledctl_mode2 |= ledctl_on << (i << 3);
break;
case ID_LED_DEF1_OFF2:
case ID_LED_ON1_OFF2:
case ID_LED_OFF1_OFF2:
mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3));
mac->ledctl_mode2 |= ledctl_off << (i << 3);
break;
default:
/* Do nothing */
break;
}
}
out:
return ret_val;
}
/**
* igb_cleanup_led - Set LED config to default operation
* @hw: pointer to the HW structure
*
* Remove the current LED configuration and set the LED configuration
* to the default value, saved from the EEPROM.
**/
s32 igb_cleanup_led(struct e1000_hw *hw)
{
wr32(E1000_LEDCTL, hw->mac.ledctl_default);
return 0;
}
/**
* igb_blink_led - Blink LED
* @hw: pointer to the HW structure
*
* Blink the led's which are set to be on.
**/
s32 igb_blink_led(struct e1000_hw *hw)
{
u32 ledctl_blink = 0;
u32 i;
/*
* set the blink bit for each LED that's "on" (0x0E)
* in ledctl_mode2
*/
ledctl_blink = hw->mac.ledctl_mode2;
for (i = 0; i < 4; i++)
if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
E1000_LEDCTL_MODE_LED_ON)
ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
(i * 8));
wr32(E1000_LEDCTL, ledctl_blink);
return 0;
}
/**
* igb_led_off - Turn LED off
* @hw: pointer to the HW structure
*
* Turn LED off.
**/
s32 igb_led_off(struct e1000_hw *hw)
{
switch (hw->phy.media_type) {
case e1000_media_type_copper:
wr32(E1000_LEDCTL, hw->mac.ledctl_mode1);
break;
default:
break;
}
return 0;
}
/**
* igb_disable_pcie_master - Disables PCI-express master access
* @hw: pointer to the HW structure
*
* Returns 0 (0) if successful, else returns -10
* (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not casued
* the master requests to be disabled.
*
* Disables PCI-Express master access and verifies there are no pending
* requests.
**/
s32 igb_disable_pcie_master(struct e1000_hw *hw)
{
u32 ctrl;
s32 timeout = MASTER_DISABLE_TIMEOUT;
s32 ret_val = 0;
if (hw->bus.type != e1000_bus_type_pci_express)
goto out;
ctrl = rd32(E1000_CTRL);
ctrl |= E1000_CTRL_GIO_MASTER_DISABLE;
wr32(E1000_CTRL, ctrl);
while (timeout) {
if (!(rd32(E1000_STATUS) &
E1000_STATUS_GIO_MASTER_ENABLE))
break;
udelay(100);
timeout--;
}
if (!timeout) {
hw_dbg("Master requests are pending.\n");
ret_val = -E1000_ERR_MASTER_REQUESTS_PENDING;
goto out;
}
out:
return ret_val;
}
/**
* igb_validate_mdi_setting - Verify MDI/MDIx settings
* @hw: pointer to the HW structure
*
* Verify that when not using auto-negotitation that MDI/MDIx is correctly
* set, which is forced to MDI mode only.
**/
s32 igb_validate_mdi_setting(struct e1000_hw *hw)
{
s32 ret_val = 0;
if (!hw->mac.autoneg && (hw->phy.mdix == 0 || hw->phy.mdix == 3)) {
hw_dbg("Invalid MDI setting detected\n");
hw->phy.mdix = 1;
ret_val = -E1000_ERR_CONFIG;
goto out;
}
out:
return ret_val;
}
/**
* igb_write_8bit_ctrl_reg - Write a 8bit CTRL register
* @hw: pointer to the HW structure
* @reg: 32bit register offset such as E1000_SCTL
* @offset: register offset to write to
* @data: data to write at register offset
*
* Writes an address/data control type register. There are several of these
* and they all have the format address << 8 | data and bit 31 is polled for
* completion.
**/
s32 igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,
u32 offset, u8 data)
{
u32 i, regvalue = 0;
s32 ret_val = 0;
/* Set up the address and data */
regvalue = ((u32)data) | (offset << E1000_GEN_CTL_ADDRESS_SHIFT);
wr32(reg, regvalue);
/* Poll the ready bit to see if the MDI read completed */
for (i = 0; i < E1000_GEN_POLL_TIMEOUT; i++) {
udelay(5);
regvalue = rd32(reg);
if (regvalue & E1000_GEN_CTL_READY)
break;
}
if (!(regvalue & E1000_GEN_CTL_READY)) {
hw_dbg("Reg %08x did not indicate ready\n", reg);
ret_val = -E1000_ERR_PHY;
goto out;
}
out:
return ret_val;
}
/**
* igb_enable_mng_pass_thru - Enable processing of ARP's
* @hw: pointer to the HW structure
*
* Verifies the hardware needs to leave interface enabled so that frames can
* be directed to and from the management interface.
**/
bool igb_enable_mng_pass_thru(struct e1000_hw *hw)
{
u32 manc;
u32 fwsm, factps;
bool ret_val = false;
if (!hw->mac.asf_firmware_present)
goto out;
manc = rd32(E1000_MANC);
if (!(manc & E1000_MANC_RCV_TCO_EN))
goto out;
if (hw->mac.arc_subsystem_valid) {
fwsm = rd32(E1000_FWSM);
factps = rd32(E1000_FACTPS);
if (!(factps & E1000_FACTPS_MNGCG) &&
((fwsm & E1000_FWSM_MODE_MASK) ==
(e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
ret_val = true;
goto out;
}
} else {
if ((manc & E1000_MANC_SMBUS_EN) &&
!(manc & E1000_MANC_ASF_EN)) {
ret_val = true;
goto out;
}
}
out:
return ret_val;
}
| bsd-2-clause |
jrobhoward/SCADAbase | sys/dev/mpt/mpt.c | 1 | 85742 | /*-
* Generic routines for LSI Fusion adapters.
* FreeBSD Version.
*
* Copyright (c) 2000, 2001 by Greg Ansley
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice immediately at the beginning of the file, without modification,
* this list of conditions, and the following disclaimer.
* 2. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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.
*/
/*-
* Copyright (c) 2002, 2006 by Matthew Jacob
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon including
* a substantially similar Disclaimer requirement for further binary
* redistribution.
* 3. Neither the names of the above listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT
* OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Support from Chris Ellsworth in order to make SAS adapters work
* is gratefully acknowledged.
*
*
* Support from LSI-Logic has also gone a great deal toward making this a
* workable subsystem and is gratefully acknowledged.
*/
/*-
* Copyright (c) 2004, Avid Technology, Inc. and its contributors.
* Copyright (c) 2005, WHEEL Sp. z o.o.
* Copyright (c) 2004, 2005 Justin T. Gibbs
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon including
* a substantially similar Disclaimer requirement for further binary
* redistribution.
* 3. Neither the names of the above listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT
* OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <dev/mpt/mpt.h>
#include <dev/mpt/mpt_cam.h> /* XXX For static handler registration */
#include <dev/mpt/mpt_raid.h> /* XXX For static handler registration */
#include <dev/mpt/mpilib/mpi.h>
#include <dev/mpt/mpilib/mpi_ioc.h>
#include <dev/mpt/mpilib/mpi_fc.h>
#include <dev/mpt/mpilib/mpi_targ.h>
#include <sys/sysctl.h>
#define MPT_MAX_TRYS 3
#define MPT_MAX_WAIT 300000
static int maxwait_ack = 0;
static int maxwait_int = 0;
static int maxwait_state = 0;
static TAILQ_HEAD(, mpt_softc) mpt_tailq = TAILQ_HEAD_INITIALIZER(mpt_tailq);
mpt_reply_handler_t *mpt_reply_handlers[MPT_NUM_REPLY_HANDLERS];
static mpt_reply_handler_t mpt_default_reply_handler;
static mpt_reply_handler_t mpt_config_reply_handler;
static mpt_reply_handler_t mpt_handshake_reply_handler;
static mpt_reply_handler_t mpt_event_reply_handler;
static void mpt_send_event_ack(struct mpt_softc *mpt, request_t *ack_req,
MSG_EVENT_NOTIFY_REPLY *msg, uint32_t context);
static int mpt_send_event_request(struct mpt_softc *mpt, int onoff);
static int mpt_soft_reset(struct mpt_softc *mpt);
static void mpt_hard_reset(struct mpt_softc *mpt);
static int mpt_dma_buf_alloc(struct mpt_softc *mpt);
static void mpt_dma_buf_free(struct mpt_softc *mpt);
static int mpt_configure_ioc(struct mpt_softc *mpt, int, int);
static int mpt_enable_ioc(struct mpt_softc *mpt, int);
/************************* Personality Module Support *************************/
/*
* We include one extra entry that is guaranteed to be NULL
* to simplify our itterator.
*/
static struct mpt_personality *mpt_personalities[MPT_MAX_PERSONALITIES + 1];
static __inline struct mpt_personality*
mpt_pers_find(struct mpt_softc *, u_int);
static __inline struct mpt_personality*
mpt_pers_find_reverse(struct mpt_softc *, u_int);
static __inline struct mpt_personality *
mpt_pers_find(struct mpt_softc *mpt, u_int start_at)
{
KASSERT(start_at <= MPT_MAX_PERSONALITIES,
("mpt_pers_find: starting position out of range"));
while (start_at < MPT_MAX_PERSONALITIES
&& (mpt->mpt_pers_mask & (0x1 << start_at)) == 0) {
start_at++;
}
return (mpt_personalities[start_at]);
}
/*
* Used infrequently, so no need to optimize like a forward
* traversal where we use the MAX+1 is guaranteed to be NULL
* trick.
*/
static __inline struct mpt_personality *
mpt_pers_find_reverse(struct mpt_softc *mpt, u_int start_at)
{
while (start_at < MPT_MAX_PERSONALITIES
&& (mpt->mpt_pers_mask & (0x1 << start_at)) == 0) {
start_at--;
}
if (start_at < MPT_MAX_PERSONALITIES)
return (mpt_personalities[start_at]);
return (NULL);
}
#define MPT_PERS_FOREACH(mpt, pers) \
for (pers = mpt_pers_find(mpt, /*start_at*/0); \
pers != NULL; \
pers = mpt_pers_find(mpt, /*start_at*/pers->id+1))
#define MPT_PERS_FOREACH_REVERSE(mpt, pers) \
for (pers = mpt_pers_find_reverse(mpt, MPT_MAX_PERSONALITIES-1);\
pers != NULL; \
pers = mpt_pers_find_reverse(mpt, /*start_at*/pers->id-1))
static mpt_load_handler_t mpt_stdload;
static mpt_probe_handler_t mpt_stdprobe;
static mpt_attach_handler_t mpt_stdattach;
static mpt_enable_handler_t mpt_stdenable;
static mpt_ready_handler_t mpt_stdready;
static mpt_event_handler_t mpt_stdevent;
static mpt_reset_handler_t mpt_stdreset;
static mpt_shutdown_handler_t mpt_stdshutdown;
static mpt_detach_handler_t mpt_stddetach;
static mpt_unload_handler_t mpt_stdunload;
static struct mpt_personality mpt_default_personality =
{
.load = mpt_stdload,
.probe = mpt_stdprobe,
.attach = mpt_stdattach,
.enable = mpt_stdenable,
.ready = mpt_stdready,
.event = mpt_stdevent,
.reset = mpt_stdreset,
.shutdown = mpt_stdshutdown,
.detach = mpt_stddetach,
.unload = mpt_stdunload
};
static mpt_load_handler_t mpt_core_load;
static mpt_attach_handler_t mpt_core_attach;
static mpt_enable_handler_t mpt_core_enable;
static mpt_reset_handler_t mpt_core_ioc_reset;
static mpt_event_handler_t mpt_core_event;
static mpt_shutdown_handler_t mpt_core_shutdown;
static mpt_shutdown_handler_t mpt_core_detach;
static mpt_unload_handler_t mpt_core_unload;
static struct mpt_personality mpt_core_personality =
{
.name = "mpt_core",
.load = mpt_core_load,
// .attach = mpt_core_attach,
// .enable = mpt_core_enable,
.event = mpt_core_event,
.reset = mpt_core_ioc_reset,
.shutdown = mpt_core_shutdown,
.detach = mpt_core_detach,
.unload = mpt_core_unload,
};
/*
* Manual declaration so that DECLARE_MPT_PERSONALITY doesn't need
* ordering information. We want the core to always register FIRST.
* other modules are set to SI_ORDER_SECOND.
*/
static moduledata_t mpt_core_mod = {
"mpt_core", mpt_modevent, &mpt_core_personality
};
DECLARE_MODULE(mpt_core, mpt_core_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
MODULE_VERSION(mpt_core, 1);
#define MPT_PERS_ATTACHED(pers, mpt) ((mpt)->mpt_pers_mask & (0x1 << pers->id))
int
mpt_modevent(module_t mod, int type, void *data)
{
struct mpt_personality *pers;
int error;
pers = (struct mpt_personality *)data;
error = 0;
switch (type) {
case MOD_LOAD:
{
mpt_load_handler_t **def_handler;
mpt_load_handler_t **pers_handler;
int i;
for (i = 0; i < MPT_MAX_PERSONALITIES; i++) {
if (mpt_personalities[i] == NULL)
break;
}
if (i >= MPT_MAX_PERSONALITIES) {
error = ENOMEM;
break;
}
pers->id = i;
mpt_personalities[i] = pers;
/* Install standard/noop handlers for any NULL entries. */
def_handler = MPT_PERS_FIRST_HANDLER(&mpt_default_personality);
pers_handler = MPT_PERS_FIRST_HANDLER(pers);
while (pers_handler <= MPT_PERS_LAST_HANDLER(pers)) {
if (*pers_handler == NULL)
*pers_handler = *def_handler;
pers_handler++;
def_handler++;
}
error = (pers->load(pers));
if (error != 0)
mpt_personalities[i] = NULL;
break;
}
case MOD_SHUTDOWN:
break;
case MOD_QUIESCE:
break;
case MOD_UNLOAD:
error = pers->unload(pers);
mpt_personalities[pers->id] = NULL;
break;
default:
error = EINVAL;
break;
}
return (error);
}
static int
mpt_stdload(struct mpt_personality *pers)
{
/* Load is always successful. */
return (0);
}
static int
mpt_stdprobe(struct mpt_softc *mpt)
{
/* Probe is always successful. */
return (0);
}
static int
mpt_stdattach(struct mpt_softc *mpt)
{
/* Attach is always successful. */
return (0);
}
static int
mpt_stdenable(struct mpt_softc *mpt)
{
/* Enable is always successful. */
return (0);
}
static void
mpt_stdready(struct mpt_softc *mpt)
{
}
static int
mpt_stdevent(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg)
{
mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_stdevent: 0x%x\n", msg->Event & 0xFF);
/* Event was not for us. */
return (0);
}
static void
mpt_stdreset(struct mpt_softc *mpt, int type)
{
}
static void
mpt_stdshutdown(struct mpt_softc *mpt)
{
}
static void
mpt_stddetach(struct mpt_softc *mpt)
{
}
static int
mpt_stdunload(struct mpt_personality *pers)
{
/* Unload is always successful. */
return (0);
}
/*
* Post driver attachment, we may want to perform some global actions.
* Here is the hook to do so.
*/
static void
mpt_postattach(void *unused)
{
struct mpt_softc *mpt;
struct mpt_personality *pers;
TAILQ_FOREACH(mpt, &mpt_tailq, links) {
MPT_PERS_FOREACH(mpt, pers)
pers->ready(mpt);
}
}
SYSINIT(mptdev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, mpt_postattach, NULL);
/******************************* Bus DMA Support ******************************/
void
mpt_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error)
{
struct mpt_map_info *map_info;
map_info = (struct mpt_map_info *)arg;
map_info->error = error;
map_info->phys = segs->ds_addr;
}
/**************************** Reply/Event Handling ****************************/
int
mpt_register_handler(struct mpt_softc *mpt, mpt_handler_type type,
mpt_handler_t handler, uint32_t *phandler_id)
{
switch (type) {
case MPT_HANDLER_REPLY:
{
u_int cbi;
u_int free_cbi;
if (phandler_id == NULL)
return (EINVAL);
free_cbi = MPT_HANDLER_ID_NONE;
for (cbi = 0; cbi < MPT_NUM_REPLY_HANDLERS; cbi++) {
/*
* If the same handler is registered multiple
* times, don't error out. Just return the
* index of the original registration.
*/
if (mpt_reply_handlers[cbi] == handler.reply_handler) {
*phandler_id = MPT_CBI_TO_HID(cbi);
return (0);
}
/*
* Fill from the front in the hope that
* all registered handlers consume only a
* single cache line.
*
* We don't break on the first empty slot so
* that the full table is checked to see if
* this handler was previously registered.
*/
if (free_cbi == MPT_HANDLER_ID_NONE &&
(mpt_reply_handlers[cbi]
== mpt_default_reply_handler))
free_cbi = cbi;
}
if (free_cbi == MPT_HANDLER_ID_NONE) {
return (ENOMEM);
}
mpt_reply_handlers[free_cbi] = handler.reply_handler;
*phandler_id = MPT_CBI_TO_HID(free_cbi);
break;
}
default:
mpt_prt(mpt, "mpt_register_handler unknown type %d\n", type);
return (EINVAL);
}
return (0);
}
int
mpt_deregister_handler(struct mpt_softc *mpt, mpt_handler_type type,
mpt_handler_t handler, uint32_t handler_id)
{
switch (type) {
case MPT_HANDLER_REPLY:
{
u_int cbi;
cbi = MPT_CBI(handler_id);
if (cbi >= MPT_NUM_REPLY_HANDLERS
|| mpt_reply_handlers[cbi] != handler.reply_handler)
return (ENOENT);
mpt_reply_handlers[cbi] = mpt_default_reply_handler;
break;
}
default:
mpt_prt(mpt, "mpt_deregister_handler unknown type %d\n", type);
return (EINVAL);
}
return (0);
}
static int
mpt_default_reply_handler(struct mpt_softc *mpt, request_t *req,
uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame)
{
mpt_prt(mpt,
"Default Handler Called: req=%p:%u reply_descriptor=%x frame=%p\n",
req, req->serno, reply_desc, reply_frame);
if (reply_frame != NULL)
mpt_dump_reply_frame(mpt, reply_frame);
mpt_prt(mpt, "Reply Frame Ignored\n");
return (/*free_reply*/TRUE);
}
static int
mpt_config_reply_handler(struct mpt_softc *mpt, request_t *req,
uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame)
{
if (req != NULL) {
if (reply_frame != NULL) {
MSG_CONFIG *cfgp;
MSG_CONFIG_REPLY *reply;
cfgp = (MSG_CONFIG *)req->req_vbuf;
reply = (MSG_CONFIG_REPLY *)reply_frame;
req->IOCStatus = le16toh(reply_frame->IOCStatus);
bcopy(&reply->Header, &cfgp->Header,
sizeof(cfgp->Header));
cfgp->ExtPageLength = reply->ExtPageLength;
cfgp->ExtPageType = reply->ExtPageType;
}
req->state &= ~REQ_STATE_QUEUED;
req->state |= REQ_STATE_DONE;
TAILQ_REMOVE(&mpt->request_pending_list, req, links);
if ((req->state & REQ_STATE_NEED_WAKEUP) != 0) {
wakeup(req);
} else if ((req->state & REQ_STATE_TIMEDOUT) != 0) {
/*
* Whew- we can free this request (late completion)
*/
mpt_free_request(mpt, req);
}
}
return (TRUE);
}
static int
mpt_handshake_reply_handler(struct mpt_softc *mpt, request_t *req,
uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame)
{
/* Nothing to be done. */
return (TRUE);
}
static int
mpt_event_reply_handler(struct mpt_softc *mpt, request_t *req,
uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame)
{
int free_reply;
KASSERT(reply_frame != NULL, ("null reply in mpt_event_reply_handler"));
KASSERT(req != NULL, ("null request in mpt_event_reply_handler"));
free_reply = TRUE;
switch (reply_frame->Function) {
case MPI_FUNCTION_EVENT_NOTIFICATION:
{
MSG_EVENT_NOTIFY_REPLY *msg;
struct mpt_personality *pers;
u_int handled;
handled = 0;
msg = (MSG_EVENT_NOTIFY_REPLY *)reply_frame;
msg->EventDataLength = le16toh(msg->EventDataLength);
msg->IOCStatus = le16toh(msg->IOCStatus);
msg->IOCLogInfo = le32toh(msg->IOCLogInfo);
msg->Event = le32toh(msg->Event);
MPT_PERS_FOREACH(mpt, pers)
handled += pers->event(mpt, req, msg);
if (handled == 0 && mpt->mpt_pers_mask == 0) {
mpt_lprt(mpt, MPT_PRT_INFO,
"No Handlers For Any Event Notify Frames. "
"Event %#x (ACK %sequired).\n",
msg->Event, msg->AckRequired? "r" : "not r");
} else if (handled == 0) {
mpt_lprt(mpt,
msg->AckRequired? MPT_PRT_WARN : MPT_PRT_INFO,
"Unhandled Event Notify Frame. Event %#x "
"(ACK %sequired).\n",
msg->Event, msg->AckRequired? "r" : "not r");
}
if (msg->AckRequired) {
request_t *ack_req;
uint32_t context;
context = req->index | MPT_REPLY_HANDLER_EVENTS;
ack_req = mpt_get_request(mpt, FALSE);
if (ack_req == NULL) {
struct mpt_evtf_record *evtf;
evtf = (struct mpt_evtf_record *)reply_frame;
evtf->context = context;
LIST_INSERT_HEAD(&mpt->ack_frames, evtf, links);
free_reply = FALSE;
break;
}
mpt_send_event_ack(mpt, ack_req, msg, context);
/*
* Don't check for CONTINUATION_REPLY here
*/
return (free_reply);
}
break;
}
case MPI_FUNCTION_PORT_ENABLE:
mpt_lprt(mpt, MPT_PRT_DEBUG , "enable port reply\n");
break;
case MPI_FUNCTION_EVENT_ACK:
break;
default:
mpt_prt(mpt, "unknown event function: %x\n",
reply_frame->Function);
break;
}
/*
* I'm not sure that this continuation stuff works as it should.
*
* I've had FC async events occur that free the frame up because
* the continuation bit isn't set, and then additional async events
* then occur using the same context. As you might imagine, this
* leads to Very Bad Thing.
*
* Let's just be safe for now and not free them up until we figure
* out what's actually happening here.
*/
#if 0
if ((reply_frame->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) == 0) {
TAILQ_REMOVE(&mpt->request_pending_list, req, links);
mpt_free_request(mpt, req);
mpt_prt(mpt, "event_reply %x for req %p:%u NOT a continuation",
reply_frame->Function, req, req->serno);
if (reply_frame->Function == MPI_FUNCTION_EVENT_NOTIFICATION) {
MSG_EVENT_NOTIFY_REPLY *msg =
(MSG_EVENT_NOTIFY_REPLY *)reply_frame;
mpt_prtc(mpt, " Event=0x%x AckReq=%d",
msg->Event, msg->AckRequired);
}
} else {
mpt_prt(mpt, "event_reply %x for %p:%u IS a continuation",
reply_frame->Function, req, req->serno);
if (reply_frame->Function == MPI_FUNCTION_EVENT_NOTIFICATION) {
MSG_EVENT_NOTIFY_REPLY *msg =
(MSG_EVENT_NOTIFY_REPLY *)reply_frame;
mpt_prtc(mpt, " Event=0x%x AckReq=%d",
msg->Event, msg->AckRequired);
}
mpt_prtc(mpt, "\n");
}
#endif
return (free_reply);
}
/*
* Process an asynchronous event from the IOC.
*/
static int
mpt_core_event(struct mpt_softc *mpt, request_t *req,
MSG_EVENT_NOTIFY_REPLY *msg)
{
mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_core_event: 0x%x\n",
msg->Event & 0xFF);
switch(msg->Event & 0xFF) {
case MPI_EVENT_NONE:
break;
case MPI_EVENT_LOG_DATA:
{
int i;
/* Some error occurred that LSI wants logged */
mpt_prt(mpt, "EvtLogData: IOCLogInfo: 0x%08x\n",
msg->IOCLogInfo);
mpt_prt(mpt, "\tEvtLogData: Event Data:");
for (i = 0; i < msg->EventDataLength; i++)
mpt_prtc(mpt, " %08x", msg->Data[i]);
mpt_prtc(mpt, "\n");
break;
}
case MPI_EVENT_EVENT_CHANGE:
/*
* This is just an acknowledgement
* of our mpt_send_event_request.
*/
break;
case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE:
break;
default:
return (0);
break;
}
return (1);
}
static void
mpt_send_event_ack(struct mpt_softc *mpt, request_t *ack_req,
MSG_EVENT_NOTIFY_REPLY *msg, uint32_t context)
{
MSG_EVENT_ACK *ackp;
ackp = (MSG_EVENT_ACK *)ack_req->req_vbuf;
memset(ackp, 0, sizeof (*ackp));
ackp->Function = MPI_FUNCTION_EVENT_ACK;
ackp->Event = htole32(msg->Event);
ackp->EventContext = htole32(msg->EventContext);
ackp->MsgContext = htole32(context);
mpt_check_doorbell(mpt);
mpt_send_cmd(mpt, ack_req);
}
/***************************** Interrupt Handling *****************************/
void
mpt_intr(void *arg)
{
struct mpt_softc *mpt;
uint32_t reply_desc;
int ntrips = 0;
mpt = (struct mpt_softc *)arg;
mpt_lprt(mpt, MPT_PRT_DEBUG2, "enter mpt_intr\n");
MPT_LOCK_ASSERT(mpt);
while ((reply_desc = mpt_pop_reply_queue(mpt)) != MPT_REPLY_EMPTY) {
request_t *req;
MSG_DEFAULT_REPLY *reply_frame;
uint32_t reply_baddr;
uint32_t ctxt_idx;
u_int cb_index;
u_int req_index;
u_int offset;
int free_rf;
req = NULL;
reply_frame = NULL;
reply_baddr = 0;
offset = 0;
if ((reply_desc & MPI_ADDRESS_REPLY_A_BIT) != 0) {
/*
* Ensure that the reply frame is coherent.
*/
reply_baddr = MPT_REPLY_BADDR(reply_desc);
offset = reply_baddr - (mpt->reply_phys & 0xFFFFFFFF);
bus_dmamap_sync_range(mpt->reply_dmat,
mpt->reply_dmap, offset, MPT_REPLY_SIZE,
BUS_DMASYNC_POSTREAD);
reply_frame = MPT_REPLY_OTOV(mpt, offset);
ctxt_idx = le32toh(reply_frame->MsgContext);
} else {
uint32_t type;
type = MPI_GET_CONTEXT_REPLY_TYPE(reply_desc);
ctxt_idx = reply_desc;
mpt_lprt(mpt, MPT_PRT_DEBUG1, "Context Reply: 0x%08x\n",
reply_desc);
switch (type) {
case MPI_CONTEXT_REPLY_TYPE_SCSI_INIT:
ctxt_idx &= MPI_CONTEXT_REPLY_CONTEXT_MASK;
break;
case MPI_CONTEXT_REPLY_TYPE_SCSI_TARGET:
ctxt_idx = GET_IO_INDEX(reply_desc);
if (mpt->tgt_cmd_ptrs == NULL) {
mpt_prt(mpt,
"mpt_intr: no target cmd ptrs\n");
reply_desc = MPT_REPLY_EMPTY;
break;
}
if (ctxt_idx >= mpt->tgt_cmds_allocated) {
mpt_prt(mpt,
"mpt_intr: bad tgt cmd ctxt %u\n",
ctxt_idx);
reply_desc = MPT_REPLY_EMPTY;
ntrips = 1000;
break;
}
req = mpt->tgt_cmd_ptrs[ctxt_idx];
if (req == NULL) {
mpt_prt(mpt, "no request backpointer "
"at index %u", ctxt_idx);
reply_desc = MPT_REPLY_EMPTY;
ntrips = 1000;
break;
}
/*
* Reformulate ctxt_idx to be just as if
* it were another type of context reply
* so the code below will find the request
* via indexing into the pool.
*/
ctxt_idx =
req->index | mpt->scsi_tgt_handler_id;
req = NULL;
break;
case MPI_CONTEXT_REPLY_TYPE_LAN:
mpt_prt(mpt, "LAN CONTEXT REPLY: 0x%08x\n",
reply_desc);
reply_desc = MPT_REPLY_EMPTY;
break;
default:
mpt_prt(mpt, "Context Reply 0x%08x?\n", type);
reply_desc = MPT_REPLY_EMPTY;
break;
}
if (reply_desc == MPT_REPLY_EMPTY) {
if (ntrips++ > 1000) {
break;
}
continue;
}
}
cb_index = MPT_CONTEXT_TO_CBI(ctxt_idx);
req_index = MPT_CONTEXT_TO_REQI(ctxt_idx);
if (req_index < MPT_MAX_REQUESTS(mpt)) {
req = &mpt->request_pool[req_index];
} else {
mpt_prt(mpt, "WARN: mpt_intr index == %d (reply_desc =="
" 0x%x)\n", req_index, reply_desc);
}
bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
free_rf = mpt_reply_handlers[cb_index](mpt, req,
reply_desc, reply_frame);
if (reply_frame != NULL && free_rf) {
bus_dmamap_sync_range(mpt->reply_dmat,
mpt->reply_dmap, offset, MPT_REPLY_SIZE,
BUS_DMASYNC_PREREAD);
mpt_free_reply(mpt, reply_baddr);
}
/*
* If we got ourselves disabled, don't get stuck in a loop
*/
if (mpt->disabled) {
mpt_disable_ints(mpt);
break;
}
if (ntrips++ > 1000) {
break;
}
}
mpt_lprt(mpt, MPT_PRT_DEBUG2, "exit mpt_intr\n");
}
/******************************* Error Recovery *******************************/
void
mpt_complete_request_chain(struct mpt_softc *mpt, struct req_queue *chain,
u_int iocstatus)
{
MSG_DEFAULT_REPLY ioc_status_frame;
request_t *req;
memset(&ioc_status_frame, 0, sizeof(ioc_status_frame));
ioc_status_frame.MsgLength = roundup2(sizeof(ioc_status_frame), 4);
ioc_status_frame.IOCStatus = iocstatus;
while((req = TAILQ_FIRST(chain)) != NULL) {
MSG_REQUEST_HEADER *msg_hdr;
u_int cb_index;
bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf;
ioc_status_frame.Function = msg_hdr->Function;
ioc_status_frame.MsgContext = msg_hdr->MsgContext;
cb_index = MPT_CONTEXT_TO_CBI(le32toh(msg_hdr->MsgContext));
mpt_reply_handlers[cb_index](mpt, req, msg_hdr->MsgContext,
&ioc_status_frame);
if (mpt_req_on_pending_list(mpt, req) != 0)
TAILQ_REMOVE(chain, req, links);
}
}
/********************************* Diagnostics ********************************/
/*
* Perform a diagnostic dump of a reply frame.
*/
void
mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame)
{
mpt_prt(mpt, "Address Reply:\n");
mpt_print_reply(reply_frame);
}
/******************************* Doorbell Access ******************************/
static __inline uint32_t mpt_rd_db(struct mpt_softc *mpt);
static __inline uint32_t mpt_rd_intr(struct mpt_softc *mpt);
static __inline uint32_t
mpt_rd_db(struct mpt_softc *mpt)
{
return mpt_read(mpt, MPT_OFFSET_DOORBELL);
}
static __inline uint32_t
mpt_rd_intr(struct mpt_softc *mpt)
{
return mpt_read(mpt, MPT_OFFSET_INTR_STATUS);
}
/* Busy wait for a door bell to be read by IOC */
static int
mpt_wait_db_ack(struct mpt_softc *mpt)
{
int i;
for (i=0; i < MPT_MAX_WAIT; i++) {
if (!MPT_DB_IS_BUSY(mpt_rd_intr(mpt))) {
maxwait_ack = i > maxwait_ack ? i : maxwait_ack;
return (MPT_OK);
}
DELAY(200);
}
return (MPT_FAIL);
}
/* Busy wait for a door bell interrupt */
static int
mpt_wait_db_int(struct mpt_softc *mpt)
{
int i;
for (i = 0; i < MPT_MAX_WAIT; i++) {
if (MPT_DB_INTR(mpt_rd_intr(mpt))) {
maxwait_int = i > maxwait_int ? i : maxwait_int;
return MPT_OK;
}
DELAY(100);
}
return (MPT_FAIL);
}
/* Wait for IOC to transition to a give state */
void
mpt_check_doorbell(struct mpt_softc *mpt)
{
uint32_t db = mpt_rd_db(mpt);
if (MPT_STATE(db) != MPT_DB_STATE_RUNNING) {
mpt_prt(mpt, "Device not running\n");
mpt_print_db(db);
}
}
/* Wait for IOC to transition to a give state */
static int
mpt_wait_state(struct mpt_softc *mpt, enum DB_STATE_BITS state)
{
int i;
for (i = 0; i < MPT_MAX_WAIT; i++) {
uint32_t db = mpt_rd_db(mpt);
if (MPT_STATE(db) == state) {
maxwait_state = i > maxwait_state ? i : maxwait_state;
return (MPT_OK);
}
DELAY(100);
}
return (MPT_FAIL);
}
/************************* Intialization/Configuration ************************/
static int mpt_download_fw(struct mpt_softc *mpt);
/* Issue the reset COMMAND to the IOC */
static int
mpt_soft_reset(struct mpt_softc *mpt)
{
mpt_lprt(mpt, MPT_PRT_DEBUG, "soft reset\n");
/* Have to use hard reset if we are not in Running state */
if (MPT_STATE(mpt_rd_db(mpt)) != MPT_DB_STATE_RUNNING) {
mpt_prt(mpt, "soft reset failed: device not running\n");
return (MPT_FAIL);
}
/* If door bell is in use we don't have a chance of getting
* a word in since the IOC probably crashed in message
* processing. So don't waste our time.
*/
if (MPT_DB_IS_IN_USE(mpt_rd_db(mpt))) {
mpt_prt(mpt, "soft reset failed: doorbell wedged\n");
return (MPT_FAIL);
}
/* Send the reset request to the IOC */
mpt_write(mpt, MPT_OFFSET_DOORBELL,
MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET << MPI_DOORBELL_FUNCTION_SHIFT);
if (mpt_wait_db_ack(mpt) != MPT_OK) {
mpt_prt(mpt, "soft reset failed: ack timeout\n");
return (MPT_FAIL);
}
/* Wait for the IOC to reload and come out of reset state */
if (mpt_wait_state(mpt, MPT_DB_STATE_READY) != MPT_OK) {
mpt_prt(mpt, "soft reset failed: device did not restart\n");
return (MPT_FAIL);
}
return MPT_OK;
}
static int
mpt_enable_diag_mode(struct mpt_softc *mpt)
{
int try;
try = 20;
while (--try) {
if ((mpt_read(mpt, MPT_OFFSET_DIAGNOSTIC) & MPI_DIAG_DRWE) != 0)
break;
/* Enable diagnostic registers */
mpt_write(mpt, MPT_OFFSET_SEQUENCE, 0xFF);
mpt_write(mpt, MPT_OFFSET_SEQUENCE, MPI_WRSEQ_1ST_KEY_VALUE);
mpt_write(mpt, MPT_OFFSET_SEQUENCE, MPI_WRSEQ_2ND_KEY_VALUE);
mpt_write(mpt, MPT_OFFSET_SEQUENCE, MPI_WRSEQ_3RD_KEY_VALUE);
mpt_write(mpt, MPT_OFFSET_SEQUENCE, MPI_WRSEQ_4TH_KEY_VALUE);
mpt_write(mpt, MPT_OFFSET_SEQUENCE, MPI_WRSEQ_5TH_KEY_VALUE);
DELAY(100000);
}
if (try == 0)
return (EIO);
return (0);
}
static void
mpt_disable_diag_mode(struct mpt_softc *mpt)
{
mpt_write(mpt, MPT_OFFSET_SEQUENCE, 0xFFFFFFFF);
}
/* This is a magic diagnostic reset that resets all the ARM
* processors in the chip.
*/
static void
mpt_hard_reset(struct mpt_softc *mpt)
{
int error;
int wait;
uint32_t diagreg;
mpt_lprt(mpt, MPT_PRT_DEBUG, "hard reset\n");
if (mpt->is_1078) {
mpt_write(mpt, MPT_OFFSET_RESET_1078, 0x07);
DELAY(1000);
return;
}
error = mpt_enable_diag_mode(mpt);
if (error) {
mpt_prt(mpt, "WARNING - Could not enter diagnostic mode !\n");
mpt_prt(mpt, "Trying to reset anyway.\n");
}
diagreg = mpt_read(mpt, MPT_OFFSET_DIAGNOSTIC);
/*
* This appears to be a workaround required for some
* firmware or hardware revs.
*/
mpt_write(mpt, MPT_OFFSET_DIAGNOSTIC, diagreg | MPI_DIAG_DISABLE_ARM);
DELAY(1000);
/* Diag. port is now active so we can now hit the reset bit */
mpt_write(mpt, MPT_OFFSET_DIAGNOSTIC, diagreg | MPI_DIAG_RESET_ADAPTER);
/*
* Ensure that the reset has finished. We delay 1ms
* prior to reading the register to make sure the chip
* has sufficiently completed its reset to handle register
* accesses.
*/
wait = 5000;
do {
DELAY(1000);
diagreg = mpt_read(mpt, MPT_OFFSET_DIAGNOSTIC);
} while (--wait && (diagreg & MPI_DIAG_RESET_ADAPTER) == 0);
if (wait == 0) {
mpt_prt(mpt, "WARNING - Failed hard reset! "
"Trying to initialize anyway.\n");
}
/*
* If we have firmware to download, it must be loaded before
* the controller will become operational. Do so now.
*/
if (mpt->fw_image != NULL) {
error = mpt_download_fw(mpt);
if (error) {
mpt_prt(mpt, "WARNING - Firmware Download Failed!\n");
mpt_prt(mpt, "Trying to initialize anyway.\n");
}
}
/*
* Reseting the controller should have disabled write
* access to the diagnostic registers, but disable
* manually to be sure.
*/
mpt_disable_diag_mode(mpt);
}
static void
mpt_core_ioc_reset(struct mpt_softc *mpt, int type)
{
/*
* Complete all pending requests with a status
* appropriate for an IOC reset.
*/
mpt_complete_request_chain(mpt, &mpt->request_pending_list,
MPI_IOCSTATUS_INVALID_STATE);
}
/*
* Reset the IOC when needed. Try software command first then if needed
* poke at the magic diagnostic reset. Note that a hard reset resets
* *both* IOCs on dual function chips (FC929 && LSI1030) as well as
* fouls up the PCI configuration registers.
*/
int
mpt_reset(struct mpt_softc *mpt, int reinit)
{
struct mpt_personality *pers;
int ret;
int retry_cnt = 0;
/*
* Try a soft reset. If that fails, get out the big hammer.
*/
again:
if ((ret = mpt_soft_reset(mpt)) != MPT_OK) {
int cnt;
for (cnt = 0; cnt < 5; cnt++) {
/* Failed; do a hard reset */
mpt_hard_reset(mpt);
/*
* Wait for the IOC to reload
* and come out of reset state
*/
ret = mpt_wait_state(mpt, MPT_DB_STATE_READY);
if (ret == MPT_OK) {
break;
}
/*
* Okay- try to check again...
*/
ret = mpt_wait_state(mpt, MPT_DB_STATE_READY);
if (ret == MPT_OK) {
break;
}
mpt_prt(mpt, "mpt_reset: failed hard reset (%d:%d)\n",
retry_cnt, cnt);
}
}
if (retry_cnt == 0) {
/*
* Invoke reset handlers. We bump the reset count so
* that mpt_wait_req() understands that regardless of
* the specified wait condition, it should stop its wait.
*/
mpt->reset_cnt++;
MPT_PERS_FOREACH(mpt, pers)
pers->reset(mpt, ret);
}
if (reinit) {
ret = mpt_enable_ioc(mpt, 1);
if (ret == MPT_OK) {
mpt_enable_ints(mpt);
}
}
if (ret != MPT_OK && retry_cnt++ < 2) {
goto again;
}
return ret;
}
/* Return a command buffer to the free queue */
void
mpt_free_request(struct mpt_softc *mpt, request_t *req)
{
request_t *nxt;
struct mpt_evtf_record *record;
uint32_t offset, reply_baddr;
if (req == NULL || req != &mpt->request_pool[req->index]) {
panic("mpt_free_request: bad req ptr");
}
if ((nxt = req->chain) != NULL) {
req->chain = NULL;
mpt_free_request(mpt, nxt); /* NB: recursion */
}
KASSERT(req->state != REQ_STATE_FREE, ("freeing free request"));
KASSERT(!(req->state & REQ_STATE_LOCKED), ("freeing locked request"));
MPT_LOCK_ASSERT(mpt);
KASSERT(mpt_req_on_free_list(mpt, req) == 0,
("mpt_free_request: req %p:%u func %x already on freelist",
req, req->serno, ((MSG_REQUEST_HEADER *)req->req_vbuf)->Function));
KASSERT(mpt_req_on_pending_list(mpt, req) == 0,
("mpt_free_request: req %p:%u func %x on pending list",
req, req->serno, ((MSG_REQUEST_HEADER *)req->req_vbuf)->Function));
#ifdef INVARIANTS
mpt_req_not_spcl(mpt, req, "mpt_free_request", __LINE__);
#endif
req->ccb = NULL;
if (LIST_EMPTY(&mpt->ack_frames)) {
/*
* Insert free ones at the tail
*/
req->serno = 0;
req->state = REQ_STATE_FREE;
#ifdef INVARIANTS
memset(req->req_vbuf, 0xff, sizeof (MSG_REQUEST_HEADER));
#endif
TAILQ_INSERT_TAIL(&mpt->request_free_list, req, links);
if (mpt->getreqwaiter != 0) {
mpt->getreqwaiter = 0;
wakeup(&mpt->request_free_list);
}
return;
}
/*
* Process an ack frame deferred due to resource shortage.
*/
record = LIST_FIRST(&mpt->ack_frames);
LIST_REMOVE(record, links);
req->state = REQ_STATE_ALLOCATED;
mpt_assign_serno(mpt, req);
mpt_send_event_ack(mpt, req, &record->reply, record->context);
offset = (uint32_t)((uint8_t *)record - mpt->reply);
reply_baddr = offset + (mpt->reply_phys & 0xFFFFFFFF);
bus_dmamap_sync_range(mpt->reply_dmat, mpt->reply_dmap, offset,
MPT_REPLY_SIZE, BUS_DMASYNC_PREREAD);
mpt_free_reply(mpt, reply_baddr);
}
/* Get a command buffer from the free queue */
request_t *
mpt_get_request(struct mpt_softc *mpt, int sleep_ok)
{
request_t *req;
retry:
MPT_LOCK_ASSERT(mpt);
req = TAILQ_FIRST(&mpt->request_free_list);
if (req != NULL) {
KASSERT(req == &mpt->request_pool[req->index],
("mpt_get_request: corrupted request free list"));
KASSERT(req->state == REQ_STATE_FREE,
("req %p:%u not free on free list %x index %d function %x",
req, req->serno, req->state, req->index,
((MSG_REQUEST_HEADER *)req->req_vbuf)->Function));
TAILQ_REMOVE(&mpt->request_free_list, req, links);
req->state = REQ_STATE_ALLOCATED;
req->chain = NULL;
mpt_assign_serno(mpt, req);
} else if (sleep_ok != 0) {
mpt->getreqwaiter = 1;
mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0);
goto retry;
}
return (req);
}
/* Pass the command to the IOC */
void
mpt_send_cmd(struct mpt_softc *mpt, request_t *req)
{
if (mpt->verbose > MPT_PRT_DEBUG2) {
mpt_dump_request(mpt, req);
}
bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap,
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
req->state |= REQ_STATE_QUEUED;
KASSERT(mpt_req_on_free_list(mpt, req) == 0,
("req %p:%u func %x on freelist list in mpt_send_cmd",
req, req->serno, ((MSG_REQUEST_HEADER *)req->req_vbuf)->Function));
KASSERT(mpt_req_on_pending_list(mpt, req) == 0,
("req %p:%u func %x already on pending list in mpt_send_cmd",
req, req->serno, ((MSG_REQUEST_HEADER *)req->req_vbuf)->Function));
TAILQ_INSERT_HEAD(&mpt->request_pending_list, req, links);
mpt_write(mpt, MPT_OFFSET_REQUEST_Q, (uint32_t) req->req_pbuf);
}
/*
* Wait for a request to complete.
*
* Inputs:
* mpt softc of controller executing request
* req request to wait for
* sleep_ok nonzero implies may sleep in this context
* time_ms timeout in ms. 0 implies no timeout.
*
* Return Values:
* 0 Request completed
* non-0 Timeout fired before request completion.
*/
int
mpt_wait_req(struct mpt_softc *mpt, request_t *req,
mpt_req_state_t state, mpt_req_state_t mask,
int sleep_ok, int time_ms)
{
int timeout;
u_int saved_cnt;
sbintime_t sbt;
/*
* time_ms is in ms, 0 indicates infinite wait.
* Convert to sbintime_t or 500us units depending on
* our sleep mode.
*/
if (sleep_ok != 0) {
sbt = SBT_1MS * time_ms;
/* Set timeout as well so final timeout check works. */
timeout = time_ms;
} else {
sbt = 0; /* Squelch bogus gcc warning. */
timeout = time_ms * 2;
}
req->state |= REQ_STATE_NEED_WAKEUP;
mask &= ~REQ_STATE_NEED_WAKEUP;
saved_cnt = mpt->reset_cnt;
while ((req->state & mask) != state && mpt->reset_cnt == saved_cnt) {
if (sleep_ok != 0) {
if (mpt_sleep(mpt, req, PUSER, "mptreq", sbt) ==
EWOULDBLOCK) {
timeout = 0;
break;
}
} else {
if (time_ms != 0 && --timeout == 0) {
break;
}
DELAY(500);
mpt_intr(mpt);
}
}
req->state &= ~REQ_STATE_NEED_WAKEUP;
if (mpt->reset_cnt != saved_cnt) {
return (EIO);
}
if (time_ms && timeout <= 0) {
MSG_REQUEST_HEADER *msg_hdr = req->req_vbuf;
req->state |= REQ_STATE_TIMEDOUT;
mpt_prt(mpt, "mpt_wait_req(%x) timed out\n", msg_hdr->Function);
return (ETIMEDOUT);
}
return (0);
}
/*
* Send a command to the IOC via the handshake register.
*
* Only done at initialization time and for certain unusual
* commands such as device/bus reset as specified by LSI.
*/
int
mpt_send_handshake_cmd(struct mpt_softc *mpt, size_t len, void *cmd)
{
int i;
uint32_t data, *data32;
/* Check condition of the IOC */
data = mpt_rd_db(mpt);
if ((MPT_STATE(data) != MPT_DB_STATE_READY
&& MPT_STATE(data) != MPT_DB_STATE_RUNNING
&& MPT_STATE(data) != MPT_DB_STATE_FAULT)
|| MPT_DB_IS_IN_USE(data)) {
mpt_prt(mpt, "handshake aborted - invalid doorbell state\n");
mpt_print_db(data);
return (EBUSY);
}
/* We move things in 32 bit chunks */
len = (len + 3) >> 2;
data32 = cmd;
/* Clear any left over pending doorbell interrupts */
if (MPT_DB_INTR(mpt_rd_intr(mpt)))
mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0);
/*
* Tell the handshake reg. we are going to send a command
* and how long it is going to be.
*/
data = (MPI_FUNCTION_HANDSHAKE << MPI_DOORBELL_FUNCTION_SHIFT) |
(len << MPI_DOORBELL_ADD_DWORDS_SHIFT);
mpt_write(mpt, MPT_OFFSET_DOORBELL, data);
/* Wait for the chip to notice */
if (mpt_wait_db_int(mpt) != MPT_OK) {
mpt_prt(mpt, "mpt_send_handshake_cmd: db ignored\n");
return (ETIMEDOUT);
}
/* Clear the interrupt */
mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0);
if (mpt_wait_db_ack(mpt) != MPT_OK) {
mpt_prt(mpt, "mpt_send_handshake_cmd: db ack timed out\n");
return (ETIMEDOUT);
}
/* Send the command */
for (i = 0; i < len; i++) {
mpt_write(mpt, MPT_OFFSET_DOORBELL, htole32(*data32++));
if (mpt_wait_db_ack(mpt) != MPT_OK) {
mpt_prt(mpt,
"mpt_send_handshake_cmd: timeout @ index %d\n", i);
return (ETIMEDOUT);
}
}
return MPT_OK;
}
/* Get the response from the handshake register */
int
mpt_recv_handshake_reply(struct mpt_softc *mpt, size_t reply_len, void *reply)
{
int left, reply_left;
u_int16_t *data16;
uint32_t data;
MSG_DEFAULT_REPLY *hdr;
/* We move things out in 16 bit chunks */
reply_len >>= 1;
data16 = (u_int16_t *)reply;
hdr = (MSG_DEFAULT_REPLY *)reply;
/* Get first word */
if (mpt_wait_db_int(mpt) != MPT_OK) {
mpt_prt(mpt, "mpt_recv_handshake_cmd timeout1\n");
return ETIMEDOUT;
}
data = mpt_read(mpt, MPT_OFFSET_DOORBELL);
*data16++ = le16toh(data & MPT_DB_DATA_MASK);
mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0);
/* Get Second Word */
if (mpt_wait_db_int(mpt) != MPT_OK) {
mpt_prt(mpt, "mpt_recv_handshake_cmd timeout2\n");
return ETIMEDOUT;
}
data = mpt_read(mpt, MPT_OFFSET_DOORBELL);
*data16++ = le16toh(data & MPT_DB_DATA_MASK);
mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0);
/*
* With the second word, we can now look at the length.
* Warn about a reply that's too short (except for IOC FACTS REPLY)
*/
if ((reply_len >> 1) != hdr->MsgLength &&
(hdr->Function != MPI_FUNCTION_IOC_FACTS)){
mpt_prt(mpt, "reply length does not match message length: "
"got %x; expected %zx for function %x\n",
hdr->MsgLength << 2, reply_len << 1, hdr->Function);
}
/* Get rest of the reply; but don't overflow the provided buffer */
left = (hdr->MsgLength << 1) - 2;
reply_left = reply_len - 2;
while (left--) {
u_int16_t datum;
if (mpt_wait_db_int(mpt) != MPT_OK) {
mpt_prt(mpt, "mpt_recv_handshake_cmd timeout3\n");
return ETIMEDOUT;
}
data = mpt_read(mpt, MPT_OFFSET_DOORBELL);
datum = le16toh(data & MPT_DB_DATA_MASK);
if (reply_left-- > 0)
*data16++ = datum;
mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0);
}
/* One more wait & clear at the end */
if (mpt_wait_db_int(mpt) != MPT_OK) {
mpt_prt(mpt, "mpt_recv_handshake_cmd timeout4\n");
return ETIMEDOUT;
}
mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0);
if ((hdr->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) {
if (mpt->verbose >= MPT_PRT_TRACE)
mpt_print_reply(hdr);
return (MPT_FAIL | hdr->IOCStatus);
}
return (0);
}
static int
mpt_get_iocfacts(struct mpt_softc *mpt, MSG_IOC_FACTS_REPLY *freplp)
{
MSG_IOC_FACTS f_req;
int error;
memset(&f_req, 0, sizeof f_req);
f_req.Function = MPI_FUNCTION_IOC_FACTS;
f_req.MsgContext = htole32(MPT_REPLY_HANDLER_HANDSHAKE);
error = mpt_send_handshake_cmd(mpt, sizeof f_req, &f_req);
if (error) {
return(error);
}
error = mpt_recv_handshake_reply(mpt, sizeof (*freplp), freplp);
return (error);
}
static int
mpt_get_portfacts(struct mpt_softc *mpt, U8 port, MSG_PORT_FACTS_REPLY *freplp)
{
MSG_PORT_FACTS f_req;
int error;
memset(&f_req, 0, sizeof f_req);
f_req.Function = MPI_FUNCTION_PORT_FACTS;
f_req.PortNumber = port;
f_req.MsgContext = htole32(MPT_REPLY_HANDLER_HANDSHAKE);
error = mpt_send_handshake_cmd(mpt, sizeof f_req, &f_req);
if (error) {
return(error);
}
error = mpt_recv_handshake_reply(mpt, sizeof (*freplp), freplp);
return (error);
}
/*
* Send the initialization request. This is where we specify how many
* SCSI busses and how many devices per bus we wish to emulate.
* This is also the command that specifies the max size of the reply
* frames from the IOC that we will be allocating.
*/
static int
mpt_send_ioc_init(struct mpt_softc *mpt, uint32_t who)
{
int error = 0;
MSG_IOC_INIT init;
MSG_IOC_INIT_REPLY reply;
memset(&init, 0, sizeof init);
init.WhoInit = who;
init.Function = MPI_FUNCTION_IOC_INIT;
init.MaxDevices = 0; /* at least 256 devices per bus */
init.MaxBuses = 16; /* at least 16 busses */
init.MsgVersion = htole16(MPI_VERSION);
init.HeaderVersion = htole16(MPI_HEADER_VERSION);
init.ReplyFrameSize = htole16(MPT_REPLY_SIZE);
init.MsgContext = htole32(MPT_REPLY_HANDLER_HANDSHAKE);
if ((error = mpt_send_handshake_cmd(mpt, sizeof init, &init)) != 0) {
return(error);
}
error = mpt_recv_handshake_reply(mpt, sizeof reply, &reply);
return (error);
}
/*
* Utiltity routine to read configuration headers and pages
*/
int
mpt_issue_cfg_req(struct mpt_softc *mpt, request_t *req, cfgparms_t *params,
bus_addr_t addr, bus_size_t len, int sleep_ok, int timeout_ms)
{
MSG_CONFIG *cfgp;
SGE_SIMPLE32 *se;
cfgp = req->req_vbuf;
memset(cfgp, 0, sizeof *cfgp);
cfgp->Action = params->Action;
cfgp->Function = MPI_FUNCTION_CONFIG;
cfgp->Header.PageVersion = params->PageVersion;
cfgp->Header.PageNumber = params->PageNumber;
cfgp->PageAddress = htole32(params->PageAddress);
if ((params->PageType & MPI_CONFIG_PAGETYPE_MASK) ==
MPI_CONFIG_PAGETYPE_EXTENDED) {
cfgp->Header.PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
cfgp->Header.PageLength = 0;
cfgp->ExtPageLength = htole16(params->ExtPageLength);
cfgp->ExtPageType = params->ExtPageType;
} else {
cfgp->Header.PageType = params->PageType;
cfgp->Header.PageLength = params->PageLength;
}
se = (SGE_SIMPLE32 *)&cfgp->PageBufferSGE;
se->Address = htole32(addr);
MPI_pSGE_SET_LENGTH(se, len);
MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT |
MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER |
MPI_SGE_FLAGS_END_OF_LIST |
((params->Action == MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT
|| params->Action == MPI_CONFIG_ACTION_PAGE_WRITE_NVRAM)
? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)));
se->FlagsLength = htole32(se->FlagsLength);
cfgp->MsgContext = htole32(req->index | MPT_REPLY_HANDLER_CONFIG);
mpt_check_doorbell(mpt);
mpt_send_cmd(mpt, req);
return (mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE,
sleep_ok, timeout_ms));
}
int
mpt_read_extcfg_header(struct mpt_softc *mpt, int PageVersion, int PageNumber,
uint32_t PageAddress, int ExtPageType,
CONFIG_EXTENDED_PAGE_HEADER *rslt,
int sleep_ok, int timeout_ms)
{
request_t *req;
cfgparms_t params;
MSG_CONFIG_REPLY *cfgp;
int error;
req = mpt_get_request(mpt, sleep_ok);
if (req == NULL) {
mpt_prt(mpt, "mpt_extread_cfg_header: Get request failed!\n");
return (ENOMEM);
}
params.Action = MPI_CONFIG_ACTION_PAGE_HEADER;
params.PageVersion = PageVersion;
params.PageLength = 0;
params.PageNumber = PageNumber;
params.PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
params.PageAddress = PageAddress;
params.ExtPageType = ExtPageType;
params.ExtPageLength = 0;
error = mpt_issue_cfg_req(mpt, req, ¶ms, /*addr*/0, /*len*/0,
sleep_ok, timeout_ms);
if (error != 0) {
/*
* Leave the request. Without resetting the chip, it's
* still owned by it and we'll just get into trouble
* freeing it now. Mark it as abandoned so that if it
* shows up later it can be freed.
*/
mpt_prt(mpt, "read_extcfg_header timed out\n");
return (ETIMEDOUT);
}
switch (req->IOCStatus & MPI_IOCSTATUS_MASK) {
case MPI_IOCSTATUS_SUCCESS:
cfgp = req->req_vbuf;
rslt->PageVersion = cfgp->Header.PageVersion;
rslt->PageNumber = cfgp->Header.PageNumber;
rslt->PageType = cfgp->Header.PageType;
rslt->ExtPageLength = le16toh(cfgp->ExtPageLength);
rslt->ExtPageType = cfgp->ExtPageType;
error = 0;
break;
case MPI_IOCSTATUS_CONFIG_INVALID_PAGE:
mpt_lprt(mpt, MPT_PRT_DEBUG,
"Invalid Page Type %d Number %d Addr 0x%0x\n",
MPI_CONFIG_PAGETYPE_EXTENDED, PageNumber, PageAddress);
error = EINVAL;
break;
default:
mpt_prt(mpt, "mpt_read_extcfg_header: Config Info Status %x\n",
req->IOCStatus);
error = EIO;
break;
}
mpt_free_request(mpt, req);
return (error);
}
int
mpt_read_extcfg_page(struct mpt_softc *mpt, int Action, uint32_t PageAddress,
CONFIG_EXTENDED_PAGE_HEADER *hdr, void *buf, size_t len,
int sleep_ok, int timeout_ms)
{
request_t *req;
cfgparms_t params;
int error;
req = mpt_get_request(mpt, sleep_ok);
if (req == NULL) {
mpt_prt(mpt, "mpt_read_extcfg_page: Get request failed!\n");
return (-1);
}
params.Action = Action;
params.PageVersion = hdr->PageVersion;
params.PageLength = 0;
params.PageNumber = hdr->PageNumber;
params.PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
params.PageAddress = PageAddress;
params.ExtPageType = hdr->ExtPageType;
params.ExtPageLength = hdr->ExtPageLength;
error = mpt_issue_cfg_req(mpt, req, ¶ms,
req->req_pbuf + MPT_RQSL(mpt),
len, sleep_ok, timeout_ms);
if (error != 0) {
mpt_prt(mpt, "read_extcfg_page(%d) timed out\n", Action);
return (-1);
}
if ((req->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) {
mpt_prt(mpt, "mpt_read_extcfg_page: Config Info Status %x\n",
req->IOCStatus);
mpt_free_request(mpt, req);
return (-1);
}
memcpy(buf, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len);
mpt_free_request(mpt, req);
return (0);
}
int
mpt_read_cfg_header(struct mpt_softc *mpt, int PageType, int PageNumber,
uint32_t PageAddress, CONFIG_PAGE_HEADER *rslt,
int sleep_ok, int timeout_ms)
{
request_t *req;
cfgparms_t params;
MSG_CONFIG *cfgp;
int error;
req = mpt_get_request(mpt, sleep_ok);
if (req == NULL) {
mpt_prt(mpt, "mpt_read_cfg_header: Get request failed!\n");
return (ENOMEM);
}
params.Action = MPI_CONFIG_ACTION_PAGE_HEADER;
params.PageVersion = 0;
params.PageLength = 0;
params.PageNumber = PageNumber;
params.PageType = PageType;
params.PageAddress = PageAddress;
error = mpt_issue_cfg_req(mpt, req, ¶ms, /*addr*/0, /*len*/0,
sleep_ok, timeout_ms);
if (error != 0) {
/*
* Leave the request. Without resetting the chip, it's
* still owned by it and we'll just get into trouble
* freeing it now. Mark it as abandoned so that if it
* shows up later it can be freed.
*/
mpt_prt(mpt, "read_cfg_header timed out\n");
return (ETIMEDOUT);
}
switch (req->IOCStatus & MPI_IOCSTATUS_MASK) {
case MPI_IOCSTATUS_SUCCESS:
cfgp = req->req_vbuf;
bcopy(&cfgp->Header, rslt, sizeof(*rslt));
error = 0;
break;
case MPI_IOCSTATUS_CONFIG_INVALID_PAGE:
mpt_lprt(mpt, MPT_PRT_DEBUG,
"Invalid Page Type %d Number %d Addr 0x%0x\n",
PageType, PageNumber, PageAddress);
error = EINVAL;
break;
default:
mpt_prt(mpt, "mpt_read_cfg_header: Config Info Status %x\n",
req->IOCStatus);
error = EIO;
break;
}
mpt_free_request(mpt, req);
return (error);
}
int
mpt_read_cfg_page(struct mpt_softc *mpt, int Action, uint32_t PageAddress,
CONFIG_PAGE_HEADER *hdr, size_t len, int sleep_ok,
int timeout_ms)
{
request_t *req;
cfgparms_t params;
int error;
req = mpt_get_request(mpt, sleep_ok);
if (req == NULL) {
mpt_prt(mpt, "mpt_read_cfg_page: Get request failed!\n");
return (-1);
}
params.Action = Action;
params.PageVersion = hdr->PageVersion;
params.PageLength = hdr->PageLength;
params.PageNumber = hdr->PageNumber;
params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK;
params.PageAddress = PageAddress;
error = mpt_issue_cfg_req(mpt, req, ¶ms,
req->req_pbuf + MPT_RQSL(mpt),
len, sleep_ok, timeout_ms);
if (error != 0) {
mpt_prt(mpt, "read_cfg_page(%d) timed out\n", Action);
return (-1);
}
if ((req->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) {
mpt_prt(mpt, "mpt_read_cfg_page: Config Info Status %x\n",
req->IOCStatus);
mpt_free_request(mpt, req);
return (-1);
}
memcpy(hdr, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len);
mpt_free_request(mpt, req);
return (0);
}
int
mpt_write_cfg_page(struct mpt_softc *mpt, int Action, uint32_t PageAddress,
CONFIG_PAGE_HEADER *hdr, size_t len, int sleep_ok,
int timeout_ms)
{
request_t *req;
cfgparms_t params;
u_int hdr_attr;
int error;
hdr_attr = hdr->PageType & MPI_CONFIG_PAGEATTR_MASK;
if (hdr_attr != MPI_CONFIG_PAGEATTR_CHANGEABLE &&
hdr_attr != MPI_CONFIG_PAGEATTR_PERSISTENT) {
mpt_prt(mpt, "page type 0x%x not changeable\n",
hdr->PageType & MPI_CONFIG_PAGETYPE_MASK);
return (-1);
}
#if 0
/*
* We shouldn't mask off other bits here.
*/
hdr->PageType &= MPI_CONFIG_PAGETYPE_MASK;
#endif
req = mpt_get_request(mpt, sleep_ok);
if (req == NULL)
return (-1);
memcpy(((caddr_t)req->req_vbuf) + MPT_RQSL(mpt), hdr, len);
/*
* There isn't any point in restoring stripped out attributes
* if you then mask them going down to issue the request.
*/
params.Action = Action;
params.PageVersion = hdr->PageVersion;
params.PageLength = hdr->PageLength;
params.PageNumber = hdr->PageNumber;
params.PageAddress = PageAddress;
#if 0
/* Restore stripped out attributes */
hdr->PageType |= hdr_attr;
params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK;
#else
params.PageType = hdr->PageType;
#endif
error = mpt_issue_cfg_req(mpt, req, ¶ms,
req->req_pbuf + MPT_RQSL(mpt),
len, sleep_ok, timeout_ms);
if (error != 0) {
mpt_prt(mpt, "mpt_write_cfg_page timed out\n");
return (-1);
}
if ((req->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) {
mpt_prt(mpt, "mpt_write_cfg_page: Config Info Status %x\n",
req->IOCStatus);
mpt_free_request(mpt, req);
return (-1);
}
mpt_free_request(mpt, req);
return (0);
}
/*
* Read IOC configuration information
*/
static int
mpt_read_config_info_ioc(struct mpt_softc *mpt)
{
CONFIG_PAGE_HEADER hdr;
struct mpt_raid_volume *mpt_raid;
int rv;
int i;
size_t len;
rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_IOC,
2, 0, &hdr, FALSE, 5000);
/*
* If it's an invalid page, so what? Not a supported function....
*/
if (rv == EINVAL) {
return (0);
}
if (rv) {
return (rv);
}
mpt_lprt(mpt, MPT_PRT_DEBUG,
"IOC Page 2 Header: Version %x len %x PageNumber %x PageType %x\n",
hdr.PageVersion, hdr.PageLength << 2,
hdr.PageNumber, hdr.PageType);
len = hdr.PageLength * sizeof(uint32_t);
mpt->ioc_page2 = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (mpt->ioc_page2 == NULL) {
mpt_prt(mpt, "unable to allocate memory for IOC page 2\n");
mpt_raid_free_mem(mpt);
return (ENOMEM);
}
memcpy(&mpt->ioc_page2->Header, &hdr, sizeof(hdr));
rv = mpt_read_cur_cfg_page(mpt, 0,
&mpt->ioc_page2->Header, len, FALSE, 5000);
if (rv) {
mpt_prt(mpt, "failed to read IOC Page 2\n");
mpt_raid_free_mem(mpt);
return (EIO);
}
mpt2host_config_page_ioc2(mpt->ioc_page2);
if (mpt->ioc_page2->CapabilitiesFlags != 0) {
uint32_t mask;
mpt_prt(mpt, "Capabilities: (");
for (mask = 1; mask != 0; mask <<= 1) {
if ((mpt->ioc_page2->CapabilitiesFlags & mask) == 0) {
continue;
}
switch (mask) {
case MPI_IOCPAGE2_CAP_FLAGS_IS_SUPPORT:
mpt_prtc(mpt, " RAID-0");
break;
case MPI_IOCPAGE2_CAP_FLAGS_IME_SUPPORT:
mpt_prtc(mpt, " RAID-1E");
break;
case MPI_IOCPAGE2_CAP_FLAGS_IM_SUPPORT:
mpt_prtc(mpt, " RAID-1");
break;
case MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT:
mpt_prtc(mpt, " SES");
break;
case MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT:
mpt_prtc(mpt, " SAFTE");
break;
case MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT:
mpt_prtc(mpt, " Multi-Channel-Arrays");
default:
break;
}
}
mpt_prtc(mpt, " )\n");
if ((mpt->ioc_page2->CapabilitiesFlags
& (MPI_IOCPAGE2_CAP_FLAGS_IS_SUPPORT
| MPI_IOCPAGE2_CAP_FLAGS_IME_SUPPORT
| MPI_IOCPAGE2_CAP_FLAGS_IM_SUPPORT)) != 0) {
mpt_prt(mpt, "%d Active Volume%s(%d Max)\n",
mpt->ioc_page2->NumActiveVolumes,
mpt->ioc_page2->NumActiveVolumes != 1
? "s " : " ",
mpt->ioc_page2->MaxVolumes);
mpt_prt(mpt, "%d Hidden Drive Member%s(%d Max)\n",
mpt->ioc_page2->NumActivePhysDisks,
mpt->ioc_page2->NumActivePhysDisks != 1
? "s " : " ",
mpt->ioc_page2->MaxPhysDisks);
}
}
len = mpt->ioc_page2->MaxVolumes * sizeof(struct mpt_raid_volume);
mpt->raid_volumes = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (mpt->raid_volumes == NULL) {
mpt_prt(mpt, "Could not allocate RAID volume data\n");
mpt_raid_free_mem(mpt);
return (ENOMEM);
}
/*
* Copy critical data out of ioc_page2 so that we can
* safely refresh the page without windows of unreliable
* data.
*/
mpt->raid_max_volumes = mpt->ioc_page2->MaxVolumes;
len = sizeof(*mpt->raid_volumes->config_page) +
(sizeof (RAID_VOL0_PHYS_DISK) * (mpt->ioc_page2->MaxPhysDisks - 1));
for (i = 0; i < mpt->ioc_page2->MaxVolumes; i++) {
mpt_raid = &mpt->raid_volumes[i];
mpt_raid->config_page =
malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (mpt_raid->config_page == NULL) {
mpt_prt(mpt, "Could not allocate RAID page data\n");
mpt_raid_free_mem(mpt);
return (ENOMEM);
}
}
mpt->raid_page0_len = len;
len = mpt->ioc_page2->MaxPhysDisks * sizeof(struct mpt_raid_disk);
mpt->raid_disks = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (mpt->raid_disks == NULL) {
mpt_prt(mpt, "Could not allocate RAID disk data\n");
mpt_raid_free_mem(mpt);
return (ENOMEM);
}
mpt->raid_max_disks = mpt->ioc_page2->MaxPhysDisks;
/*
* Load page 3.
*/
rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_IOC,
3, 0, &hdr, FALSE, 5000);
if (rv) {
mpt_raid_free_mem(mpt);
return (EIO);
}
mpt_lprt(mpt, MPT_PRT_DEBUG, "IOC Page 3 Header: %x %x %x %x\n",
hdr.PageVersion, hdr.PageLength, hdr.PageNumber, hdr.PageType);
len = hdr.PageLength * sizeof(uint32_t);
mpt->ioc_page3 = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (mpt->ioc_page3 == NULL) {
mpt_prt(mpt, "unable to allocate memory for IOC page 3\n");
mpt_raid_free_mem(mpt);
return (ENOMEM);
}
memcpy(&mpt->ioc_page3->Header, &hdr, sizeof(hdr));
rv = mpt_read_cur_cfg_page(mpt, 0,
&mpt->ioc_page3->Header, len, FALSE, 5000);
if (rv) {
mpt_raid_free_mem(mpt);
return (EIO);
}
mpt2host_config_page_ioc3(mpt->ioc_page3);
mpt_raid_wakeup(mpt);
return (0);
}
/*
* Enable IOC port
*/
static int
mpt_send_port_enable(struct mpt_softc *mpt, int port)
{
request_t *req;
MSG_PORT_ENABLE *enable_req;
int error;
req = mpt_get_request(mpt, /*sleep_ok*/FALSE);
if (req == NULL)
return (-1);
enable_req = req->req_vbuf;
memset(enable_req, 0, MPT_RQSL(mpt));
enable_req->Function = MPI_FUNCTION_PORT_ENABLE;
enable_req->MsgContext = htole32(req->index | MPT_REPLY_HANDLER_CONFIG);
enable_req->PortNumber = port;
mpt_check_doorbell(mpt);
mpt_lprt(mpt, MPT_PRT_DEBUG, "enabling port %d\n", port);
mpt_send_cmd(mpt, req);
error = mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE,
FALSE, (mpt->is_sas || mpt->is_fc)? 300000 : 30000);
if (error != 0) {
mpt_prt(mpt, "port %d enable timed out\n", port);
return (-1);
}
mpt_free_request(mpt, req);
mpt_lprt(mpt, MPT_PRT_DEBUG, "enabled port %d\n", port);
return (0);
}
/*
* Enable/Disable asynchronous event reporting.
*/
static int
mpt_send_event_request(struct mpt_softc *mpt, int onoff)
{
request_t *req;
MSG_EVENT_NOTIFY *enable_req;
req = mpt_get_request(mpt, FALSE);
if (req == NULL) {
return (ENOMEM);
}
enable_req = req->req_vbuf;
memset(enable_req, 0, sizeof *enable_req);
enable_req->Function = MPI_FUNCTION_EVENT_NOTIFICATION;
enable_req->MsgContext = htole32(req->index | MPT_REPLY_HANDLER_EVENTS);
enable_req->Switch = onoff;
mpt_check_doorbell(mpt);
mpt_lprt(mpt, MPT_PRT_DEBUG, "%sabling async events\n",
onoff ? "en" : "dis");
/*
* Send the command off, but don't wait for it.
*/
mpt_send_cmd(mpt, req);
return (0);
}
/*
* Un-mask the interrupts on the chip.
*/
void
mpt_enable_ints(struct mpt_softc *mpt)
{
/* Unmask every thing except door bell int */
mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_DB_MASK);
}
/*
* Mask the interrupts on the chip.
*/
void
mpt_disable_ints(struct mpt_softc *mpt)
{
/* Mask all interrupts */
mpt_write(mpt, MPT_OFFSET_INTR_MASK,
MPT_INTR_REPLY_MASK | MPT_INTR_DB_MASK);
}
static void
mpt_sysctl_attach(struct mpt_softc *mpt)
{
struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev);
struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev);
SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
"debug", CTLFLAG_RW, &mpt->verbose, 0,
"Debugging/Verbose level");
SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
"role", CTLFLAG_RD, &mpt->role, 0,
"HBA role");
#ifdef MPT_TEST_MULTIPATH
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
"failure_id", CTLFLAG_RW, &mpt->failure_id, -1,
"Next Target to Fail");
#endif
}
int
mpt_attach(struct mpt_softc *mpt)
{
struct mpt_personality *pers;
int i;
int error;
mpt_core_attach(mpt);
mpt_core_enable(mpt);
TAILQ_INSERT_TAIL(&mpt_tailq, mpt, links);
for (i = 0; i < MPT_MAX_PERSONALITIES; i++) {
pers = mpt_personalities[i];
if (pers == NULL) {
continue;
}
if (pers->probe(mpt) == 0) {
error = pers->attach(mpt);
if (error != 0) {
mpt_detach(mpt);
return (error);
}
mpt->mpt_pers_mask |= (0x1 << pers->id);
pers->use_count++;
}
}
/*
* Now that we've attached everything, do the enable function
* for all of the personalities. This allows the personalities
* to do setups that are appropriate for them prior to enabling
* any ports.
*/
for (i = 0; i < MPT_MAX_PERSONALITIES; i++) {
pers = mpt_personalities[i];
if (pers != NULL && MPT_PERS_ATTACHED(pers, mpt) != 0) {
error = pers->enable(mpt);
if (error != 0) {
mpt_prt(mpt, "personality %s attached but would"
" not enable (%d)\n", pers->name, error);
mpt_detach(mpt);
return (error);
}
}
}
return (0);
}
int
mpt_shutdown(struct mpt_softc *mpt)
{
struct mpt_personality *pers;
MPT_PERS_FOREACH_REVERSE(mpt, pers) {
pers->shutdown(mpt);
}
return (0);
}
int
mpt_detach(struct mpt_softc *mpt)
{
struct mpt_personality *pers;
MPT_PERS_FOREACH_REVERSE(mpt, pers) {
pers->detach(mpt);
mpt->mpt_pers_mask &= ~(0x1 << pers->id);
pers->use_count--;
}
TAILQ_REMOVE(&mpt_tailq, mpt, links);
return (0);
}
static int
mpt_core_load(struct mpt_personality *pers)
{
int i;
/*
* Setup core handlers and insert the default handler
* into all "empty slots".
*/
for (i = 0; i < MPT_NUM_REPLY_HANDLERS; i++) {
mpt_reply_handlers[i] = mpt_default_reply_handler;
}
mpt_reply_handlers[MPT_CBI(MPT_REPLY_HANDLER_EVENTS)] =
mpt_event_reply_handler;
mpt_reply_handlers[MPT_CBI(MPT_REPLY_HANDLER_CONFIG)] =
mpt_config_reply_handler;
mpt_reply_handlers[MPT_CBI(MPT_REPLY_HANDLER_HANDSHAKE)] =
mpt_handshake_reply_handler;
return (0);
}
/*
* Initialize per-instance driver data and perform
* initial controller configuration.
*/
static int
mpt_core_attach(struct mpt_softc *mpt)
{
int val, error;
LIST_INIT(&mpt->ack_frames);
/* Put all request buffers on the free list */
TAILQ_INIT(&mpt->request_pending_list);
TAILQ_INIT(&mpt->request_free_list);
TAILQ_INIT(&mpt->request_timeout_list);
for (val = 0; val < MPT_MAX_LUNS; val++) {
STAILQ_INIT(&mpt->trt[val].atios);
STAILQ_INIT(&mpt->trt[val].inots);
}
STAILQ_INIT(&mpt->trt_wildcard.atios);
STAILQ_INIT(&mpt->trt_wildcard.inots);
#ifdef MPT_TEST_MULTIPATH
mpt->failure_id = -1;
#endif
mpt->scsi_tgt_handler_id = MPT_HANDLER_ID_NONE;
mpt_sysctl_attach(mpt);
mpt_lprt(mpt, MPT_PRT_DEBUG, "doorbell req = %s\n",
mpt_ioc_diag(mpt_read(mpt, MPT_OFFSET_DOORBELL)));
MPT_LOCK(mpt);
error = mpt_configure_ioc(mpt, 0, 0);
MPT_UNLOCK(mpt);
return (error);
}
static int
mpt_core_enable(struct mpt_softc *mpt)
{
/*
* We enter with the IOC enabled, but async events
* not enabled, ports not enabled and interrupts
* not enabled.
*/
MPT_LOCK(mpt);
/*
* Enable asynchronous event reporting- all personalities
* have attached so that they should be able to now field
* async events.
*/
mpt_send_event_request(mpt, 1);
/*
* Catch any pending interrupts
*
* This seems to be crucial- otherwise
* the portenable below times out.
*/
mpt_intr(mpt);
/*
* Enable Interrupts
*/
mpt_enable_ints(mpt);
/*
* Catch any pending interrupts
*
* This seems to be crucial- otherwise
* the portenable below times out.
*/
mpt_intr(mpt);
/*
* Enable the port.
*/
if (mpt_send_port_enable(mpt, 0) != MPT_OK) {
mpt_prt(mpt, "failed to enable port 0\n");
MPT_UNLOCK(mpt);
return (ENXIO);
}
MPT_UNLOCK(mpt);
return (0);
}
static void
mpt_core_shutdown(struct mpt_softc *mpt)
{
mpt_disable_ints(mpt);
}
static void
mpt_core_detach(struct mpt_softc *mpt)
{
int val;
/*
* XXX: FREE MEMORY
*/
mpt_disable_ints(mpt);
/* Make sure no request has pending timeouts. */
for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) {
request_t *req = &mpt->request_pool[val];
mpt_callout_drain(mpt, &req->callout);
}
mpt_dma_buf_free(mpt);
}
static int
mpt_core_unload(struct mpt_personality *pers)
{
/* Unload is always successful. */
return (0);
}
#define FW_UPLOAD_REQ_SIZE \
(sizeof(MSG_FW_UPLOAD) - sizeof(SGE_MPI_UNION) \
+ sizeof(FW_UPLOAD_TCSGE) + sizeof(SGE_SIMPLE32))
static int
mpt_upload_fw(struct mpt_softc *mpt)
{
uint8_t fw_req_buf[FW_UPLOAD_REQ_SIZE];
MSG_FW_UPLOAD_REPLY fw_reply;
MSG_FW_UPLOAD *fw_req;
FW_UPLOAD_TCSGE *tsge;
SGE_SIMPLE32 *sge;
uint32_t flags;
int error;
memset(&fw_req_buf, 0, sizeof(fw_req_buf));
fw_req = (MSG_FW_UPLOAD *)fw_req_buf;
fw_req->ImageType = MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM;
fw_req->Function = MPI_FUNCTION_FW_UPLOAD;
fw_req->MsgContext = htole32(MPT_REPLY_HANDLER_HANDSHAKE);
tsge = (FW_UPLOAD_TCSGE *)&fw_req->SGL;
tsge->DetailsLength = 12;
tsge->Flags = MPI_SGE_FLAGS_TRANSACTION_ELEMENT;
tsge->ImageSize = htole32(mpt->fw_image_size);
sge = (SGE_SIMPLE32 *)(tsge + 1);
flags = (MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER
| MPI_SGE_FLAGS_END_OF_LIST | MPI_SGE_FLAGS_SIMPLE_ELEMENT
| MPI_SGE_FLAGS_32_BIT_ADDRESSING | MPI_SGE_FLAGS_IOC_TO_HOST);
flags <<= MPI_SGE_FLAGS_SHIFT;
sge->FlagsLength = htole32(flags | mpt->fw_image_size);
sge->Address = htole32(mpt->fw_phys);
bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREREAD);
error = mpt_send_handshake_cmd(mpt, sizeof(fw_req_buf), &fw_req_buf);
if (error)
return(error);
error = mpt_recv_handshake_reply(mpt, sizeof(fw_reply), &fw_reply);
bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTREAD);
return (error);
}
static void
mpt_diag_outsl(struct mpt_softc *mpt, uint32_t addr,
uint32_t *data, bus_size_t len)
{
uint32_t *data_end;
data_end = data + (roundup2(len, sizeof(uint32_t)) / 4);
if (mpt->is_sas) {
pci_enable_io(mpt->dev, SYS_RES_IOPORT);
}
mpt_pio_write(mpt, MPT_OFFSET_DIAG_ADDR, addr);
while (data != data_end) {
mpt_pio_write(mpt, MPT_OFFSET_DIAG_DATA, *data);
data++;
}
if (mpt->is_sas) {
pci_disable_io(mpt->dev, SYS_RES_IOPORT);
}
}
static int
mpt_download_fw(struct mpt_softc *mpt)
{
MpiFwHeader_t *fw_hdr;
int error;
uint32_t ext_offset;
uint32_t data;
if (mpt->pci_pio_reg == NULL) {
mpt_prt(mpt, "No PIO resource!\n");
return (ENXIO);
}
mpt_prt(mpt, "Downloading Firmware - Image Size %d\n",
mpt->fw_image_size);
error = mpt_enable_diag_mode(mpt);
if (error != 0) {
mpt_prt(mpt, "Could not enter diagnostic mode!\n");
return (EIO);
}
mpt_write(mpt, MPT_OFFSET_DIAGNOSTIC,
MPI_DIAG_RW_ENABLE|MPI_DIAG_DISABLE_ARM);
fw_hdr = (MpiFwHeader_t *)mpt->fw_image;
bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREWRITE);
mpt_diag_outsl(mpt, fw_hdr->LoadStartAddress, (uint32_t*)fw_hdr,
fw_hdr->ImageSize);
bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTWRITE);
ext_offset = fw_hdr->NextImageHeaderOffset;
while (ext_offset != 0) {
MpiExtImageHeader_t *ext;
ext = (MpiExtImageHeader_t *)((uintptr_t)fw_hdr + ext_offset);
ext_offset = ext->NextImageHeaderOffset;
bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap,
BUS_DMASYNC_PREWRITE);
mpt_diag_outsl(mpt, ext->LoadStartAddress, (uint32_t*)ext,
ext->ImageSize);
bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap,
BUS_DMASYNC_POSTWRITE);
}
if (mpt->is_sas) {
pci_enable_io(mpt->dev, SYS_RES_IOPORT);
}
/* Setup the address to jump to on reset. */
mpt_pio_write(mpt, MPT_OFFSET_DIAG_ADDR, fw_hdr->IopResetRegAddr);
mpt_pio_write(mpt, MPT_OFFSET_DIAG_DATA, fw_hdr->IopResetVectorValue);
/*
* The controller sets the "flash bad" status after attempting
* to auto-boot from flash. Clear the status so that the controller
* will continue the boot process with our newly installed firmware.
*/
mpt_pio_write(mpt, MPT_OFFSET_DIAG_ADDR, MPT_DIAG_MEM_CFG_BASE);
data = mpt_pio_read(mpt, MPT_OFFSET_DIAG_DATA) | MPT_DIAG_MEM_CFG_BADFL;
mpt_pio_write(mpt, MPT_OFFSET_DIAG_ADDR, MPT_DIAG_MEM_CFG_BASE);
mpt_pio_write(mpt, MPT_OFFSET_DIAG_DATA, data);
if (mpt->is_sas) {
pci_disable_io(mpt->dev, SYS_RES_IOPORT);
}
/*
* Re-enable the processor and clear the boot halt flag.
*/
data = mpt_read(mpt, MPT_OFFSET_DIAGNOSTIC);
data &= ~(MPI_DIAG_PREVENT_IOC_BOOT|MPI_DIAG_DISABLE_ARM);
mpt_write(mpt, MPT_OFFSET_DIAGNOSTIC, data);
mpt_disable_diag_mode(mpt);
return (0);
}
static int
mpt_dma_buf_alloc(struct mpt_softc *mpt)
{
struct mpt_map_info mi;
uint8_t *vptr;
uint32_t pptr, end;
int i, error;
/* Create a child tag for data buffers */
if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1,
0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
NULL, NULL, (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE,
mpt->max_cam_seg_cnt, BUS_SPACE_MAXSIZE_32BIT, 0,
&mpt->buffer_dmat) != 0) {
mpt_prt(mpt, "cannot create a dma tag for data buffers\n");
return (1);
}
/* Create a child tag for request buffers */
if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0,
&mpt->request_dmat) != 0) {
mpt_prt(mpt, "cannot create a dma tag for requests\n");
return (1);
}
/* Allocate some DMA accessible memory for requests */
if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) {
mpt_prt(mpt, "cannot allocate %d bytes of request memory\n",
MPT_REQ_MEM_SIZE(mpt));
return (1);
}
mi.mpt = mpt;
mi.error = 0;
/* Load and lock it into "bus space" */
bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request,
MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0);
if (mi.error) {
mpt_prt(mpt, "error %d loading dma map for DMA request queue\n",
mi.error);
return (1);
}
mpt->request_phys = mi.phys;
/*
* Now create per-request dma maps
*/
i = 0;
pptr = mpt->request_phys;
vptr = mpt->request;
end = pptr + MPT_REQ_MEM_SIZE(mpt);
while(pptr < end) {
request_t *req = &mpt->request_pool[i];
req->index = i++;
/* Store location of Request Data */
req->req_pbuf = pptr;
req->req_vbuf = vptr;
pptr += MPT_REQUEST_AREA;
vptr += MPT_REQUEST_AREA;
req->sense_pbuf = (pptr - MPT_SENSE_SIZE);
req->sense_vbuf = (vptr - MPT_SENSE_SIZE);
error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap);
if (error) {
mpt_prt(mpt, "error %d creating per-cmd DMA maps\n",
error);
return (1);
}
}
return (0);
}
static void
mpt_dma_buf_free(struct mpt_softc *mpt)
{
int i;
if (mpt->request_dmat == 0) {
mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n");
return;
}
for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) {
bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap);
}
bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap);
bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap);
bus_dma_tag_destroy(mpt->request_dmat);
mpt->request_dmat = 0;
bus_dma_tag_destroy(mpt->buffer_dmat);
}
/*
* Allocate/Initialize data structures for the controller. Called
* once at instance startup.
*/
static int
mpt_configure_ioc(struct mpt_softc *mpt, int tn, int needreset)
{
PTR_MSG_PORT_FACTS_REPLY pfp;
int error, port, val;
size_t len;
if (tn == MPT_MAX_TRYS) {
return (-1);
}
/*
* No need to reset if the IOC is already in the READY state.
*
* Force reset if initialization failed previously.
* Note that a hard_reset of the second channel of a '929
* will stop operation of the first channel. Hopefully, if the
* first channel is ok, the second will not require a hard
* reset.
*/
if (needreset || MPT_STATE(mpt_rd_db(mpt)) != MPT_DB_STATE_READY) {
if (mpt_reset(mpt, FALSE) != MPT_OK) {
return (mpt_configure_ioc(mpt, tn++, 1));
}
needreset = 0;
}
if (mpt_get_iocfacts(mpt, &mpt->ioc_facts) != MPT_OK) {
mpt_prt(mpt, "mpt_get_iocfacts failed\n");
return (mpt_configure_ioc(mpt, tn++, 1));
}
mpt2host_iocfacts_reply(&mpt->ioc_facts);
mpt_prt(mpt, "MPI Version=%d.%d.%d.%d\n",
mpt->ioc_facts.MsgVersion >> 8,
mpt->ioc_facts.MsgVersion & 0xFF,
mpt->ioc_facts.HeaderVersion >> 8,
mpt->ioc_facts.HeaderVersion & 0xFF);
/*
* Now that we know request frame size, we can calculate
* the actual (reasonable) segment limit for read/write I/O.
*
* This limit is constrained by:
*
* + The size of each area we allocate per command (and how
* many chain segments we can fit into it).
* + The total number of areas we've set up.
* + The actual chain depth the card will allow.
*
* The first area's segment count is limited by the I/O request
* at the head of it. We cannot allocate realistically more
* than MPT_MAX_REQUESTS areas. Therefore, to account for both
* conditions, we'll just start out with MPT_MAX_REQUESTS-2.
*
*/
/* total number of request areas we (can) allocate */
mpt->max_seg_cnt = MPT_MAX_REQUESTS(mpt) - 2;
/* converted to the number of chain areas possible */
mpt->max_seg_cnt *= MPT_NRFM(mpt);
/* limited by the number of chain areas the card will support */
if (mpt->max_seg_cnt > mpt->ioc_facts.MaxChainDepth) {
mpt_lprt(mpt, MPT_PRT_INFO,
"chain depth limited to %u (from %u)\n",
mpt->ioc_facts.MaxChainDepth, mpt->max_seg_cnt);
mpt->max_seg_cnt = mpt->ioc_facts.MaxChainDepth;
}
/* converted to the number of simple sges in chain segments. */
mpt->max_seg_cnt *= (MPT_NSGL(mpt) - 1);
/*
* Use this as the basis for reporting the maximum I/O size to CAM.
*/
mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1);
error = mpt_dma_buf_alloc(mpt);
if (error != 0) {
mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n");
return (EIO);
}
for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) {
request_t *req = &mpt->request_pool[val];
req->state = REQ_STATE_ALLOCATED;
mpt_callout_init(mpt, &req->callout);
mpt_free_request(mpt, req);
}
mpt_lprt(mpt, MPT_PRT_INFO, "Maximum Segment Count: %u, Maximum "
"CAM Segment Count: %u\n", mpt->max_seg_cnt,
mpt->max_cam_seg_cnt);
mpt_lprt(mpt, MPT_PRT_INFO, "MsgLength=%u IOCNumber = %d\n",
mpt->ioc_facts.MsgLength, mpt->ioc_facts.IOCNumber);
mpt_lprt(mpt, MPT_PRT_INFO,
"IOCFACTS: GlobalCredits=%d BlockSize=%u bytes "
"Request Frame Size %u bytes Max Chain Depth %u\n",
mpt->ioc_facts.GlobalCredits, mpt->ioc_facts.BlockSize,
mpt->ioc_facts.RequestFrameSize << 2,
mpt->ioc_facts.MaxChainDepth);
mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: Num Ports %d, FWImageSize %d, "
"Flags=%#x\n", mpt->ioc_facts.NumberOfPorts,
mpt->ioc_facts.FWImageSize, mpt->ioc_facts.Flags);
len = mpt->ioc_facts.NumberOfPorts * sizeof (MSG_PORT_FACTS_REPLY);
mpt->port_facts = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (mpt->port_facts == NULL) {
mpt_prt(mpt, "unable to allocate memory for port facts\n");
return (ENOMEM);
}
if ((mpt->ioc_facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) &&
(mpt->fw_uploaded == 0)) {
struct mpt_map_info mi;
/*
* In some configurations, the IOC's firmware is
* stored in a shared piece of system NVRAM that
* is only accessible via the BIOS. In this
* case, the firmware keeps a copy of firmware in
* RAM until the OS driver retrieves it. Once
* retrieved, we are responsible for re-downloading
* the firmware after any hard-reset.
*/
mpt->fw_image_size = mpt->ioc_facts.FWImageSize;
error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
mpt->fw_image_size, 1, mpt->fw_image_size, 0,
&mpt->fw_dmat);
if (error != 0) {
mpt_prt(mpt, "cannot create firmware dma tag\n");
return (ENOMEM);
}
error = bus_dmamem_alloc(mpt->fw_dmat,
(void **)&mpt->fw_image, BUS_DMA_NOWAIT |
BUS_DMA_COHERENT, &mpt->fw_dmap);
if (error != 0) {
mpt_prt(mpt, "cannot allocate firmware memory\n");
bus_dma_tag_destroy(mpt->fw_dmat);
return (ENOMEM);
}
mi.mpt = mpt;
mi.error = 0;
bus_dmamap_load(mpt->fw_dmat, mpt->fw_dmap,
mpt->fw_image, mpt->fw_image_size, mpt_map_rquest, &mi, 0);
mpt->fw_phys = mi.phys;
error = mpt_upload_fw(mpt);
if (error != 0) {
mpt_prt(mpt, "firmware upload failed.\n");
bus_dmamap_unload(mpt->fw_dmat, mpt->fw_dmap);
bus_dmamem_free(mpt->fw_dmat, mpt->fw_image,
mpt->fw_dmap);
bus_dma_tag_destroy(mpt->fw_dmat);
mpt->fw_image = NULL;
return (EIO);
}
mpt->fw_uploaded = 1;
}
for (port = 0; port < mpt->ioc_facts.NumberOfPorts; port++) {
pfp = &mpt->port_facts[port];
error = mpt_get_portfacts(mpt, 0, pfp);
if (error != MPT_OK) {
mpt_prt(mpt,
"mpt_get_portfacts on port %d failed\n", port);
free(mpt->port_facts, M_DEVBUF);
mpt->port_facts = NULL;
return (mpt_configure_ioc(mpt, tn++, 1));
}
mpt2host_portfacts_reply(pfp);
if (port > 0) {
error = MPT_PRT_INFO;
} else {
error = MPT_PRT_DEBUG;
}
mpt_lprt(mpt, error,
"PORTFACTS[%d]: Type %x PFlags %x IID %d MaxDev %d\n",
port, pfp->PortType, pfp->ProtocolFlags, pfp->PortSCSIID,
pfp->MaxDevices);
}
/*
* XXX: Not yet supporting more than port 0
*/
pfp = &mpt->port_facts[0];
if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_FC) {
mpt->is_fc = 1;
mpt->is_sas = 0;
mpt->is_spi = 0;
} else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_SAS) {
mpt->is_fc = 0;
mpt->is_sas = 1;
mpt->is_spi = 0;
} else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_SCSI) {
mpt->is_fc = 0;
mpt->is_sas = 0;
mpt->is_spi = 1;
if (mpt->mpt_ini_id == MPT_INI_ID_NONE)
mpt->mpt_ini_id = pfp->PortSCSIID;
} else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_ISCSI) {
mpt_prt(mpt, "iSCSI not supported yet\n");
return (ENXIO);
} else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_INACTIVE) {
mpt_prt(mpt, "Inactive Port\n");
return (ENXIO);
} else {
mpt_prt(mpt, "unknown Port Type %#x\n", pfp->PortType);
return (ENXIO);
}
/*
* Set our role with what this port supports.
*
* Note this might be changed later in different modules
* if this is different from what is wanted.
*/
mpt->role = MPT_ROLE_NONE;
if (pfp->ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
mpt->role |= MPT_ROLE_INITIATOR;
}
if (pfp->ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {
mpt->role |= MPT_ROLE_TARGET;
}
/*
* Enable the IOC
*/
if (mpt_enable_ioc(mpt, 1) != MPT_OK) {
mpt_prt(mpt, "unable to initialize IOC\n");
return (ENXIO);
}
/*
* Read IOC configuration information.
*
* We need this to determine whether or not we have certain
* settings for Integrated Mirroring (e.g.).
*/
mpt_read_config_info_ioc(mpt);
return (0);
}
static int
mpt_enable_ioc(struct mpt_softc *mpt, int portenable)
{
uint32_t pptr;
int val;
if (mpt_send_ioc_init(mpt, MPI_WHOINIT_HOST_DRIVER) != MPT_OK) {
mpt_prt(mpt, "mpt_send_ioc_init failed\n");
return (EIO);
}
mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_send_ioc_init ok\n");
if (mpt_wait_state(mpt, MPT_DB_STATE_RUNNING) != MPT_OK) {
mpt_prt(mpt, "IOC failed to go to run state\n");
return (ENXIO);
}
mpt_lprt(mpt, MPT_PRT_DEBUG, "IOC now at RUNSTATE\n");
/*
* Give it reply buffers
*
* Do *not* exceed global credits.
*/
for (val = 0, pptr = mpt->reply_phys;
(pptr + MPT_REPLY_SIZE) < (mpt->reply_phys + PAGE_SIZE);
pptr += MPT_REPLY_SIZE) {
mpt_free_reply(mpt, pptr);
if (++val == mpt->ioc_facts.GlobalCredits - 1)
break;
}
/*
* Enable the port if asked. This is only done if we're resetting
* the IOC after initial startup.
*/
if (portenable) {
/*
* Enable asynchronous event reporting
*/
mpt_send_event_request(mpt, 1);
if (mpt_send_port_enable(mpt, 0) != MPT_OK) {
mpt_prt(mpt, "%s: failed to enable port 0\n", __func__);
return (ENXIO);
}
}
return (MPT_OK);
}
/*
* Endian Conversion Functions- only used on Big Endian machines
*/
#if _BYTE_ORDER == _BIG_ENDIAN
void
mpt2host_sge_simple_union(SGE_SIMPLE_UNION *sge)
{
MPT_2_HOST32(sge, FlagsLength);
MPT_2_HOST32(sge, u.Address64.Low);
MPT_2_HOST32(sge, u.Address64.High);
}
void
mpt2host_iocfacts_reply(MSG_IOC_FACTS_REPLY *rp)
{
MPT_2_HOST16(rp, MsgVersion);
MPT_2_HOST16(rp, HeaderVersion);
MPT_2_HOST32(rp, MsgContext);
MPT_2_HOST16(rp, IOCExceptions);
MPT_2_HOST16(rp, IOCStatus);
MPT_2_HOST32(rp, IOCLogInfo);
MPT_2_HOST16(rp, ReplyQueueDepth);
MPT_2_HOST16(rp, RequestFrameSize);
MPT_2_HOST16(rp, Reserved_0101_FWVersion);
MPT_2_HOST16(rp, ProductID);
MPT_2_HOST32(rp, CurrentHostMfaHighAddr);
MPT_2_HOST16(rp, GlobalCredits);
MPT_2_HOST32(rp, CurrentSenseBufferHighAddr);
MPT_2_HOST16(rp, CurReplyFrameSize);
MPT_2_HOST32(rp, FWImageSize);
MPT_2_HOST32(rp, IOCCapabilities);
MPT_2_HOST32(rp, FWVersion.Word);
MPT_2_HOST16(rp, HighPriorityQueueDepth);
MPT_2_HOST16(rp, Reserved2);
mpt2host_sge_simple_union(&rp->HostPageBufferSGE);
MPT_2_HOST32(rp, ReplyFifoHostSignalingAddr);
}
void
mpt2host_portfacts_reply(MSG_PORT_FACTS_REPLY *pfp)
{
MPT_2_HOST16(pfp, Reserved);
MPT_2_HOST16(pfp, Reserved1);
MPT_2_HOST32(pfp, MsgContext);
MPT_2_HOST16(pfp, Reserved2);
MPT_2_HOST16(pfp, IOCStatus);
MPT_2_HOST32(pfp, IOCLogInfo);
MPT_2_HOST16(pfp, MaxDevices);
MPT_2_HOST16(pfp, PortSCSIID);
MPT_2_HOST16(pfp, ProtocolFlags);
MPT_2_HOST16(pfp, MaxPostedCmdBuffers);
MPT_2_HOST16(pfp, MaxPersistentIDs);
MPT_2_HOST16(pfp, MaxLanBuckets);
MPT_2_HOST16(pfp, Reserved4);
MPT_2_HOST32(pfp, Reserved5);
}
void
mpt2host_config_page_ioc2(CONFIG_PAGE_IOC_2 *ioc2)
{
int i;
MPT_2_HOST32(ioc2, CapabilitiesFlags);
for (i = 0; i < MPI_IOC_PAGE_2_RAID_VOLUME_MAX; i++) {
MPT_2_HOST16(ioc2, RaidVolume[i].Reserved3);
}
}
void
mpt2host_config_page_ioc3(CONFIG_PAGE_IOC_3 *ioc3)
{
MPT_2_HOST16(ioc3, Reserved2);
}
void
mpt2host_config_page_scsi_port_0(CONFIG_PAGE_SCSI_PORT_0 *sp0)
{
MPT_2_HOST32(sp0, Capabilities);
MPT_2_HOST32(sp0, PhysicalInterface);
}
void
mpt2host_config_page_scsi_port_1(CONFIG_PAGE_SCSI_PORT_1 *sp1)
{
MPT_2_HOST32(sp1, Configuration);
MPT_2_HOST32(sp1, OnBusTimerValue);
MPT_2_HOST16(sp1, IDConfig);
}
void
host2mpt_config_page_scsi_port_1(CONFIG_PAGE_SCSI_PORT_1 *sp1)
{
HOST_2_MPT32(sp1, Configuration);
HOST_2_MPT32(sp1, OnBusTimerValue);
HOST_2_MPT16(sp1, IDConfig);
}
void
mpt2host_config_page_scsi_port_2(CONFIG_PAGE_SCSI_PORT_2 *sp2)
{
int i;
MPT_2_HOST32(sp2, PortFlags);
MPT_2_HOST32(sp2, PortSettings);
for (i = 0; i < sizeof(sp2->DeviceSettings) /
sizeof(*sp2->DeviceSettings); i++) {
MPT_2_HOST16(sp2, DeviceSettings[i].DeviceFlags);
}
}
void
mpt2host_config_page_scsi_device_0(CONFIG_PAGE_SCSI_DEVICE_0 *sd0)
{
MPT_2_HOST32(sd0, NegotiatedParameters);
MPT_2_HOST32(sd0, Information);
}
void
mpt2host_config_page_scsi_device_1(CONFIG_PAGE_SCSI_DEVICE_1 *sd1)
{
MPT_2_HOST32(sd1, RequestedParameters);
MPT_2_HOST32(sd1, Reserved);
MPT_2_HOST32(sd1, Configuration);
}
void
host2mpt_config_page_scsi_device_1(CONFIG_PAGE_SCSI_DEVICE_1 *sd1)
{
HOST_2_MPT32(sd1, RequestedParameters);
HOST_2_MPT32(sd1, Reserved);
HOST_2_MPT32(sd1, Configuration);
}
void
mpt2host_config_page_fc_port_0(CONFIG_PAGE_FC_PORT_0 *fp0)
{
MPT_2_HOST32(fp0, Flags);
MPT_2_HOST32(fp0, PortIdentifier);
MPT_2_HOST32(fp0, WWNN.Low);
MPT_2_HOST32(fp0, WWNN.High);
MPT_2_HOST32(fp0, WWPN.Low);
MPT_2_HOST32(fp0, WWPN.High);
MPT_2_HOST32(fp0, SupportedServiceClass);
MPT_2_HOST32(fp0, SupportedSpeeds);
MPT_2_HOST32(fp0, CurrentSpeed);
MPT_2_HOST32(fp0, MaxFrameSize);
MPT_2_HOST32(fp0, FabricWWNN.Low);
MPT_2_HOST32(fp0, FabricWWNN.High);
MPT_2_HOST32(fp0, FabricWWPN.Low);
MPT_2_HOST32(fp0, FabricWWPN.High);
MPT_2_HOST32(fp0, DiscoveredPortsCount);
MPT_2_HOST32(fp0, MaxInitiators);
}
void
mpt2host_config_page_fc_port_1(CONFIG_PAGE_FC_PORT_1 *fp1)
{
MPT_2_HOST32(fp1, Flags);
MPT_2_HOST32(fp1, NoSEEPROMWWNN.Low);
MPT_2_HOST32(fp1, NoSEEPROMWWNN.High);
MPT_2_HOST32(fp1, NoSEEPROMWWPN.Low);
MPT_2_HOST32(fp1, NoSEEPROMWWPN.High);
}
void
host2mpt_config_page_fc_port_1(CONFIG_PAGE_FC_PORT_1 *fp1)
{
HOST_2_MPT32(fp1, Flags);
HOST_2_MPT32(fp1, NoSEEPROMWWNN.Low);
HOST_2_MPT32(fp1, NoSEEPROMWWNN.High);
HOST_2_MPT32(fp1, NoSEEPROMWWPN.Low);
HOST_2_MPT32(fp1, NoSEEPROMWWPN.High);
}
void
mpt2host_config_page_raid_vol_0(CONFIG_PAGE_RAID_VOL_0 *volp)
{
int i;
MPT_2_HOST16(volp, VolumeStatus.Reserved);
MPT_2_HOST16(volp, VolumeSettings.Settings);
MPT_2_HOST32(volp, MaxLBA);
MPT_2_HOST32(volp, MaxLBAHigh);
MPT_2_HOST32(volp, StripeSize);
MPT_2_HOST32(volp, Reserved2);
MPT_2_HOST32(volp, Reserved3);
for (i = 0; i < MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX; i++) {
MPT_2_HOST16(volp, PhysDisk[i].Reserved);
}
}
void
mpt2host_config_page_raid_phys_disk_0(CONFIG_PAGE_RAID_PHYS_DISK_0 *rpd0)
{
MPT_2_HOST32(rpd0, Reserved1);
MPT_2_HOST16(rpd0, PhysDiskStatus.Reserved);
MPT_2_HOST32(rpd0, MaxLBA);
MPT_2_HOST16(rpd0, ErrorData.Reserved);
MPT_2_HOST16(rpd0, ErrorData.ErrorCount);
MPT_2_HOST16(rpd0, ErrorData.SmartCount);
}
void
mpt2host_mpi_raid_vol_indicator(MPI_RAID_VOL_INDICATOR *vi)
{
MPT_2_HOST16(vi, TotalBlocks.High);
MPT_2_HOST16(vi, TotalBlocks.Low);
MPT_2_HOST16(vi, BlocksRemaining.High);
MPT_2_HOST16(vi, BlocksRemaining.Low);
}
#endif
| bsd-3-clause |
RobotLocomotion/director | src/app/ddDrakeWrapper.cpp | 1 | 2505 | #include "ddDrakeWrapper.h"
#include "ddSharedPtr.h"
#include <drake/systems/plants/RigidBodyTree.h>
#include <drake/util/convexHull.h>
#include <drake/systems/plants/ForceTorqueMeasurement.h>
#include <vector>
#include <string>
#include <sstream>
#include <boost/shared_ptr.hpp>
#include <math.h>
using std::vector;
using namespace Eigen;
//-----------------------------------------------------------------------------
ddDrakeWrapper::ddDrakeWrapper(QObject* parent) : QObject(parent)
{
}
//-----------------------------------------------------------------------------
ddDrakeWrapper::~ddDrakeWrapper()
{
}
//-----------------------------------------------------------------------------
QVector<double> ddDrakeWrapper::resolveCenterOfPressure(const ddDrakeModel& ddModel,
const QVector<int>& ft_frame_ids,
const QVector<double> & ft_in,
const QVector<double> & normal_in,
const QVector<double> & point_on_contact_plane_in) const
{
// Assumes size of ft_in = size of ft_frame_inds*6, in order (one wrench at a time)
// returns a 4-vector, which is packed output of RBM resolveCOP, with vector first
ddSharedPtr<RigidBodyTree> model = ddModel.getDrakeRBM();
Vector3d normal; for (int i=0; i<normal_in.size(); i++) normal[i] = normal_in[i];
Vector3d point_on_contact_plane; for (int i=0; i<point_on_contact_plane_in.size(); i++) point_on_contact_plane[i] = point_on_contact_plane_in[i];
std::vector<ForceTorqueMeasurement> force_torque_measurements;
for (int i=0; i<ft_frame_ids.size(); i++){
ForceTorqueMeasurement ft;
ft.frame_idx = ft_frame_ids[i];
ft.wrench = Eigen::Matrix<double, 6, 1>();
for (int j=0; j<6; j++) ft.wrench[j] = ft_in[i*6+j];
force_torque_measurements.push_back(ft);
}
std::pair<Eigen::Vector3d, double> ret_eigen= model->resolveCenterOfPressure(*ddModel.getKinematicsCache(), force_torque_measurements, normal, point_on_contact_plane);
QVector<double> ret; for (int i=0; i<3; i++) ret << ret_eigen.first[i];
ret << ret_eigen.second;
return ret;
}
//-----------------------------------------------------------------------------
double ddDrakeWrapper::drakeSignedDistanceInsideConvexHull(int num_pts, const QVector<double>& pts_in, const QVector<double> & q_in) const
{
Matrix<double, 2, Eigen::Dynamic> pts(2, num_pts);
for (int i=0; i<num_pts; i++){
pts(0,i) = pts_in[i*2];
pts(1,i) = pts_in[i*2+1];
}
Vector2d q; q[0] = q_in[0]; q[1] = q_in[1];
return signedDistanceInsideConvexHull(pts, q);
}
| bsd-3-clause |
IntwineConnect/cta2045-wifi-modules | Aztec/Assert.c | 1 | 1432 | /********************************************************************************
* Add Intwine information here
********************************************************************************/
// This file contains device-specific data information
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdio.h>
#include <string.h>
#else
#include "HardwareProfile.h"
// #include "Metrics.h"
#include <stdio.h>
#include <string.h>
#endif
void Assert(int flag, char *file, unsigned long line, char *msg);
void Assert(int flag, char *file, unsigned long line, char *msg)
{
char *just_the_file_please;
if(flag == 0)
{
just_the_file_please = strrchr(file, '\\');
if(just_the_file_please != NULL)
{
// Add 1 to get past the actual character
printf("Assert in File: %s, Line: %ld, Problem: %s\n", just_the_file_please+1, line);
}
else
{
// Not found, just show the entire file information
printf("Assert in File: %s, Line: %ld, Problem: %s\n", file, line);
}
// IncrementMetrics(WATCHDOG_ASSERT);
// RadioReset();
while(1);
}
}
void AssertInt(int flag, char *file, unsigned long line, char *msg, int intval)
{
if(flag == 0)
{
// IncrementMetrics(intval);
Assert(flag, file, line, msg);
}
}
| bsd-3-clause |
liangpengcheng/tng | dep/uv/test/benchmark-getaddrinfo.c | 1 | 2503 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "uv.h"
#include "task.h"
#include <stdlib.h>
#define CONCURRENT_CALLS 10
#define TOTAL_CALLS 10000
const char* name = "localhost";
static uv_loop_t* loop;
static uv_getaddrinfo_t handles[CONCURRENT_CALLS];
static int calls_initiated = 0;
static int calls_completed = 0;
static int64_t start_time;
static int64_t end_time;
static void getaddrinfo_initiate(uv_getaddrinfo_t* handle);
static void getaddrinfo_cb(uv_getaddrinfo_t* handle, int status,
struct addrinfo* res) {
ASSERT(status == 0);
calls_completed++;
if (calls_initiated < TOTAL_CALLS) {
getaddrinfo_initiate(handle);
}
uv_freeaddrinfo(res);
}
static void getaddrinfo_initiate(uv_getaddrinfo_t* handle) {
int r;
calls_initiated++;
r = uv_getaddrinfo(loop, handle, &getaddrinfo_cb, name, NULL, NULL);
ASSERT(r == 0);
}
BENCHMARK_IMPL(getaddrinfo) {
int i;
loop = uv_default_loop();
uv_update_time(loop);
start_time = uv_now(loop);
for (i = 0; i < CONCURRENT_CALLS; i++) {
getaddrinfo_initiate(&handles[i]);
}
uv_run(loop);
uv_update_time(loop);
end_time = uv_now(loop);
ASSERT(calls_initiated == TOTAL_CALLS);
ASSERT(calls_completed == TOTAL_CALLS);
LOGF("getaddrinfo: %.0f req/s\n",
(double) calls_completed / (double) (end_time - start_time) * 1000.0);
MAKE_VALGRIND_HAPPY();
return 0;
}
| bsd-3-clause |
ekawahyu/MSP430Ware | examples/MSP430i2xx/eusci_a_uart/eusci_a_uart_ex1_loopback115200Baud.c | 1 | 6065 | /* --COPYRIGHT--,BSD
* Copyright (c) 2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/
/*******************************************************************************
* MSP430i2xx EUSCI_A UART - Loopback at 115200 Baud
*
* Description: In this example, the UART RX and TX pins are connected to
* create a loopback of communication data. The example shows how to properly
* initialize UART communication at baud rate of 115200 using SMCLK as the
* source. After the byte is put into the buffer to send the device goes into
* LPM until it has received the sent byte. If data corruption occurs then
* the LED will be turned on indicating a problem.
*
*
* MSP430i2041
* ------------------
* /|\| |
* | | P1.4|--->LED
* --|RST |
* | P1.2/UCA0RXD|----|
* | | |
* | | |
* | P1.3/UCA0TXD|----|
* | |
*
* Author: Zack Lalanne
******************************************************************************/
#include "driverlib.h"
volatile uint8_t TXData = 1;
volatile uint8_t RXData = 0;
int main(void)
{
// Configuration for 115200 UART with SMCLK at 16384000
// These values were generated using the online tool available at:
// http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
EUSCI_A_UART_initParam uartConfig = {
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
8, // BRDIV = 8
14, // UCxBRF = 14
34, // UCxBRS = 34
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_MSB_FIRST, // MSB First
EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
EUSCI_A_UART_MODE, // UART mode
EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling Baudrate
};
WDT_hold(WDT_BASE);
// Setting the DCO to use the internal resistor. DCO will be at 16.384MHz
CS_setupDCO(CS_INTERNAL_RESISTOR);
// SMCLK should be same speed as DCO. SMCLK = 16.384MHz
CS_clockSignalInit(CS_SMCLK, CS_CLOCK_DIVIDER_1);
// Settings P1.2 and P1.3 as UART pins. P1.4 as LED output
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
GPIO_PIN2 | GPIO_PIN3,
GPIO_PRIMARY_MODULE_FUNCTION);
GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN4);
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN4);
// Configure and enable the UART peripheral
EUSCI_A_UART_init(EUSCI_A0_BASE, &uartConfig);
EUSCI_A_UART_enable(EUSCI_A0_BASE);
EUSCI_A_UART_enableInterrupt(EUSCI_A0_BASE,
EUSCI_A_UART_RECEIVE_INTERRUPT);
while (1) {
EUSCI_A_UART_transmitData(EUSCI_A0_BASE, TXData);
// Go to sleep and wait for LPM exit
__bis_SR_register(LPM0_bits | GIE);
}
}
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt
#elif defined(__GNUC__)
__attribute__((interrupt(USCI_A0_VECTOR)))
#endif
void USCI_A0_ISR(void)
{
switch (__even_in_range(UCA0IV, USCI_UART_UCTXCPTIFG)) {
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
RXData = EUSCI_A_UART_receiveData(EUSCI_A0_BASE);
// Check if data got corrupted
if (RXData != TXData) {
GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN4);
while (1) ;
}
TXData++;
// Leave LPM so next byte can be sent
__bic_SR_register_on_exit(LPM0_bits);
break;
case USCI_UART_UCTXIFG: break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
default: break;
}
}
| bsd-3-clause |
gaoxiaojun/symphony | ref/sqlite/src/mutex_unix.c | 1 | 12273 | /*
** 2007 August 28
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains the C functions that implement mutexes for pthreads
*/
#include "sqliteInt.h"
/*
** The code in this file is only used if we are compiling threadsafe
** under unix with pthreads.
**
** Note that this implementation requires a version of pthreads that
** supports recursive mutexes.
*/
#ifdef SQLITE_MUTEX_PTHREADS
#include <pthread.h>
/*
** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields
** are necessary under two condidtions: (1) Debug builds and (2) using
** home-grown mutexes. Encapsulate these conditions into a single #define.
*/
#if defined(SQLITE_DEBUG) || defined(SQLITE_HOMEGROWN_RECURSIVE_MUTEX)
# define SQLITE_MUTEX_NREF 1
#else
# define SQLITE_MUTEX_NREF 0
#endif
/*
** Each recursive mutex is an instance of the following structure.
*/
struct sqlite3_mutex {
pthread_mutex_t mutex; /* Mutex controlling the lock */
#if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
int id; /* Mutex type */
#endif
#if SQLITE_MUTEX_NREF
volatile int nRef; /* Number of entrances */
volatile pthread_t owner; /* Thread that is within this mutex */
int trace; /* True to trace changes */
#endif
};
#if SQLITE_MUTEX_NREF
#define SQLITE3_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0, (pthread_t)0, 0 }
#else
#define SQLITE3_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
#endif
/*
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
** intended for use only inside assert() statements. On some platforms,
** there might be race conditions that can cause these routines to
** deliver incorrect results. In particular, if pthread_equal() is
** not an atomic operation, then these routines might delivery
** incorrect results. On most platforms, pthread_equal() is a
** comparison of two integers and is therefore atomic. But we are
** told that HPUX is not such a platform. If so, then these routines
** will not always work correctly on HPUX.
**
** On those platforms where pthread_equal() is not atomic, SQLite
** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to
** make sure no assert() statements are evaluated and hence these
** routines are never called.
*/
#if !defined(NDEBUG) || defined(SQLITE_DEBUG)
static int pthreadMutexHeld(sqlite3_mutex *p){
return (p->nRef!=0 && pthread_equal(p->owner, pthread_self()));
}
static int pthreadMutexNotheld(sqlite3_mutex *p){
return p->nRef==0 || pthread_equal(p->owner, pthread_self())==0;
}
#endif
/*
** Try to provide a memory barrier operation, needed for initialization
** and also for the implementation of xShmBarrier in the VFS in cases
** where SQLite is compiled without mutexes.
*/
void sqlite3MemoryBarrier(void){
#if defined(SQLITE_MEMORY_BARRIER)
SQLITE_MEMORY_BARRIER;
#elif defined(__GNUC__) && GCC_VERSION>=4001000
__sync_synchronize();
#endif
}
/*
** Initialize and deinitialize the mutex subsystem.
*/
static int pthreadMutexInit(void){ return SQLITE_OK; }
static int pthreadMutexEnd(void){ return SQLITE_OK; }
/*
** The sqlite3_mutex_alloc() routine allocates a new
** mutex and returns a pointer to it. If it returns NULL
** that means that a mutex could not be allocated. SQLite
** will unwind its stack and return an error. The argument
** to sqlite3_mutex_alloc() is one of these integer constants:
**
** <ul>
** <li> SQLITE_MUTEX_FAST
** <li> SQLITE_MUTEX_RECURSIVE
** <li> SQLITE_MUTEX_STATIC_MASTER
** <li> SQLITE_MUTEX_STATIC_MEM
** <li> SQLITE_MUTEX_STATIC_OPEN
** <li> SQLITE_MUTEX_STATIC_PRNG
** <li> SQLITE_MUTEX_STATIC_LRU
** <li> SQLITE_MUTEX_STATIC_PMEM
** <li> SQLITE_MUTEX_STATIC_APP1
** <li> SQLITE_MUTEX_STATIC_APP2
** <li> SQLITE_MUTEX_STATIC_APP3
** <li> SQLITE_MUTEX_STATIC_VFS1
** <li> SQLITE_MUTEX_STATIC_VFS2
** <li> SQLITE_MUTEX_STATIC_VFS3
** </ul>
**
** The first two constants cause sqlite3_mutex_alloc() to create
** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
** is used but not necessarily so when SQLITE_MUTEX_FAST is used.
** The mutex implementation does not need to make a distinction
** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
** not want to. But SQLite will only request a recursive mutex in
** cases where it really needs one. If a faster non-recursive mutex
** implementation is available on the host platform, the mutex subsystem
** might return such a mutex in response to SQLITE_MUTEX_FAST.
**
** The other allowed parameters to sqlite3_mutex_alloc() each return
** a pointer to a static preexisting mutex. Six static mutexes are
** used by the current version of SQLite. Future versions of SQLite
** may add additional static mutexes. Static mutexes are for internal
** use by SQLite only. Applications that use SQLite mutexes should
** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or
** SQLITE_MUTEX_RECURSIVE.
**
** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
** returns a different mutex on every call. But for the static
** mutex types, the same mutex is returned on every call that has
** the same type number.
*/
static sqlite3_mutex *pthreadMutexAlloc(int iType){
static sqlite3_mutex staticMutexes[] = {
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER,
SQLITE3_MUTEX_INITIALIZER
};
sqlite3_mutex *p;
switch( iType ){
case SQLITE_MUTEX_RECURSIVE: {
p = sqlite3MallocZero( sizeof(*p) );
if( p ){
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
/* If recursive mutexes are not available, we will have to
** build our own. See below. */
pthread_mutex_init(&p->mutex, 0);
#else
/* Use a recursive mutex if it is available */
pthread_mutexattr_t recursiveAttr;
pthread_mutexattr_init(&recursiveAttr);
pthread_mutexattr_settype(&recursiveAttr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&p->mutex, &recursiveAttr);
pthread_mutexattr_destroy(&recursiveAttr);
#endif
}
break;
}
case SQLITE_MUTEX_FAST: {
p = sqlite3MallocZero( sizeof(*p) );
if( p ){
pthread_mutex_init(&p->mutex, 0);
}
break;
}
default: {
#ifdef SQLITE_ENABLE_API_ARMOR
if( iType-2<0 || iType-2>=ArraySize(staticMutexes) ){
(void)SQLITE_MISUSE_BKPT;
return 0;
}
#endif
p = &staticMutexes[iType-2];
break;
}
}
#if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
if( p ) p->id = iType;
#endif
return p;
}
/*
** This routine deallocates a previously
** allocated mutex. SQLite is careful to deallocate every
** mutex that it allocates.
*/
static void pthreadMutexFree(sqlite3_mutex *p){
assert( p->nRef==0 );
#if SQLITE_ENABLE_API_ARMOR
if( p->id==SQLITE_MUTEX_FAST || p->id==SQLITE_MUTEX_RECURSIVE )
#endif
{
pthread_mutex_destroy(&p->mutex);
sqlite3_free(p);
}
#ifdef SQLITE_ENABLE_API_ARMOR
else{
(void)SQLITE_MISUSE_BKPT;
}
#endif
}
/*
** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
** to enter a mutex. If another thread is already within the mutex,
** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK
** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can
** be entered multiple times by the same thread. In such cases the,
** mutex must be exited an equal number of times before another thread
** can enter. If the same thread tries to enter any other kind of mutex
** more than once, the behavior is undefined.
*/
static void pthreadMutexEnter(sqlite3_mutex *p){
assert( p->id==SQLITE_MUTEX_RECURSIVE || pthreadMutexNotheld(p) );
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
/* If recursive mutexes are not available, then we have to grow
** our own. This implementation assumes that pthread_equal()
** is atomic - that it cannot be deceived into thinking self
** and p->owner are equal if p->owner changes between two values
** that are not equal to self while the comparison is taking place.
** This implementation also assumes a coherent cache - that
** separate processes cannot read different values from the same
** address at the same time. If either of these two conditions
** are not met, then the mutexes will fail and problems will result.
*/
{
pthread_t self = pthread_self();
if( p->nRef>0 && pthread_equal(p->owner, self) ){
p->nRef++;
}else{
pthread_mutex_lock(&p->mutex);
assert( p->nRef==0 );
p->owner = self;
p->nRef = 1;
}
}
#else
/* Use the built-in recursive mutexes if they are available.
*/
pthread_mutex_lock(&p->mutex);
#if SQLITE_MUTEX_NREF
assert( p->nRef>0 || p->owner==0 );
p->owner = pthread_self();
p->nRef++;
#endif
#endif
#ifdef SQLITE_DEBUG
if( p->trace ){
printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef);
}
#endif
}
static int pthreadMutexTry(sqlite3_mutex *p){
int rc;
assert( p->id==SQLITE_MUTEX_RECURSIVE || pthreadMutexNotheld(p) );
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
/* If recursive mutexes are not available, then we have to grow
** our own. This implementation assumes that pthread_equal()
** is atomic - that it cannot be deceived into thinking self
** and p->owner are equal if p->owner changes between two values
** that are not equal to self while the comparison is taking place.
** This implementation also assumes a coherent cache - that
** separate processes cannot read different values from the same
** address at the same time. If either of these two conditions
** are not met, then the mutexes will fail and problems will result.
*/
{
pthread_t self = pthread_self();
if( p->nRef>0 && pthread_equal(p->owner, self) ){
p->nRef++;
rc = SQLITE_OK;
}else if( pthread_mutex_trylock(&p->mutex)==0 ){
assert( p->nRef==0 );
p->owner = self;
p->nRef = 1;
rc = SQLITE_OK;
}else{
rc = SQLITE_BUSY;
}
}
#else
/* Use the built-in recursive mutexes if they are available.
*/
if( pthread_mutex_trylock(&p->mutex)==0 ){
#if SQLITE_MUTEX_NREF
p->owner = pthread_self();
p->nRef++;
#endif
rc = SQLITE_OK;
}else{
rc = SQLITE_BUSY;
}
#endif
#ifdef SQLITE_DEBUG
if( rc==SQLITE_OK && p->trace ){
printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef);
}
#endif
return rc;
}
/*
** The sqlite3_mutex_leave() routine exits a mutex that was
** previously entered by the same thread. The behavior
** is undefined if the mutex is not currently entered or
** is not currently allocated. SQLite will never do either.
*/
static void pthreadMutexLeave(sqlite3_mutex *p){
assert( pthreadMutexHeld(p) );
#if SQLITE_MUTEX_NREF
p->nRef--;
if( p->nRef==0 ) p->owner = 0;
#endif
assert( p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE );
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
if( p->nRef==0 ){
pthread_mutex_unlock(&p->mutex);
}
#else
pthread_mutex_unlock(&p->mutex);
#endif
#ifdef SQLITE_DEBUG
if( p->trace ){
printf("leave mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef);
}
#endif
}
sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
static const sqlite3_mutex_methods sMutex = {
pthreadMutexInit,
pthreadMutexEnd,
pthreadMutexAlloc,
pthreadMutexFree,
pthreadMutexEnter,
pthreadMutexTry,
pthreadMutexLeave,
#ifdef SQLITE_DEBUG
pthreadMutexHeld,
pthreadMutexNotheld
#else
0,
0
#endif
};
return &sMutex;
}
#endif /* SQLITE_MUTEX_PTHREADS */
| bsd-3-clause |
JianpingZeng/xcc | xcc/test/juliet/testcases/CWE789_Uncontrolled_Mem_Alloc/s01/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54c.c | 2 | 1894 | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54c.c
Label Definition File: CWE789_Uncontrolled_Mem_Alloc__malloc.label.xml
Template File: sources-sinks-54c.tmpl.c
*/
/*
* @description
* CWE: 789 Uncontrolled Memory Allocation
* BadSource: rand Set data to result of rand(), which may be zero
* GoodSource: Small number greater than zero
* Sinks:
* GoodSink: Allocate memory with malloc() and check the size of the memory to be allocated
* BadSink : Allocate memory with malloc(), but incorrectly check the size of the memory to be allocated
* Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files
*
* */
#include "std_testcase.h"
#ifndef _WIN32
#include <wchar.h>
#endif
#define HELLO_STRING L"hello"
#ifndef OMITBAD
/* bad function declaration */
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54d_badSink(size_t data);
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54c_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54d_badSink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54d_goodG2BSink(size_t data);
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54c_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54d_goodG2BSink(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54d_goodB2GSink(size_t data);
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54c_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_54d_goodB2GSink(data);
}
#endif /* OMITGOOD */
| bsd-3-clause |
JianpingZeng/xcc | xcc/test/juliet/testcases/CWE690_NULL_Deref_From_Return/s02/CWE690_NULL_Deref_From_Return__w32_wfopen_65b.c | 2 | 1109 | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE690_NULL_Deref_From_Return__w32_wfopen_65b.c
Label Definition File: CWE690_NULL_Deref_From_Return.fclose.label.xml
Template File: source-sinks-65b.tmpl.c
*/
/*
* @description
* CWE: 690 Unchecked Return Value To NULL Pointer
* BadSource: w32_wfopen Open data with wfopen()
* Sinks: 0
* GoodSink: Check data for NULL
* BadSink : Do not check data for NULL
* Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a different source file called via a function pointer
*
* */
#include "std_testcase.h"
#ifndef OMITBAD
void CWE690_NULL_Deref_From_Return__w32_wfopen_65b_badSink(FILE * data)
{
/* FLAW: if the fopen failed, data will be NULL here */
fclose(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodB2G uses the BadSource with the GoodSink */
void CWE690_NULL_Deref_From_Return__w32_wfopen_65b_goodB2GSink(FILE * data)
{
/* FIX: check the return value */
if (data != NULL)
{
fclose(data);
}
}
#endif /* OMITGOOD */
| bsd-3-clause |
bucricket/projectMASlst | source/include/hdf.f90 | 2 | 17275 | !****************************************************************************
!* NCSA HDF *
!* Software Development Group *
!* National Center for Supercomputing Applications *
!* University of Illinois at Urbana-Champaign *
!* 605 E. Springfield, Champaign IL 61820 *
!* *
!* For conditions of distribution and use, see the accompanying *
!* hdf/COPYING file. *
!* *
!****************************************************************************
!
! $Id: hdf.f90,v 1.1 2007/08/24 18:19:53 mmerritt Exp $
!
! *-----------------------------------------------------------------------------
! * File: hdf.inc
! * Purpose: Fortran header file for HDF routines
! * Contents:
! * Tag definitions
! * Error return codes
! * Logical constants
! * Remarks: This file can be included with Fortran user programs. As a
! * general rule, don't use DFNT constants that don't include a
! * number in their name. E.g., don't use DFNT_FLOAT, use
! * DFNT_FLOAT32 or DFNT_FLOAT64. The DFNT constants that don't
! * include numbers are for backward compatibility only. Also,
! * there are no current plans to support 128-bit number types.
! * For more information about constants in this file, see the
! * equivalent constant declarations in the C include file 'hdf.h'
! *------------------------------------------------------------------------
! Error Return Codes
integer DFE_NOERROR, DFE_NONE, DFE_FNF
integer DFE_DENIED, DFE_ALROPEN, DFE_TOOMANY
integer DFE_BADNAME, DFE_BADACC, DFE_BADOPEN
integer DFE_NOTOPEN, DFE_CANTCLOSE, DFE_DFNULL
integer DFE_ILLTYPE, DFE_UNSUPPORTED, DFE_BADDDLIST
integer DFE_NOTDFFILE, DFE_SEEDTWICE, DFE_NOSPACE
integer DFE_NOSUCHTAG, DFE_READERROR
parameter(DFE_NOERROR = 0)
parameter(DFE_NONE = 0)
parameter(DFE_FNF = -1)
parameter(DFE_DENIED = -2)
parameter(DFE_ALROPEN = -3)
parameter(DFE_TOOMANY = -4)
parameter(DFE_BADNAME = -5)
parameter(DFE_BADACC = -6)
parameter(DFE_BADOPEN = -7)
parameter(DFE_NOTOPEN = -8)
parameter(DFE_CANTCLOSE = -9)
parameter(DFE_DFNULL = -10)
parameter(DFE_ILLTYPE = -11)
parameter(DFE_UNSUPPORTED = -12)
parameter(DFE_BADDDLIST = -13)
parameter(DFE_NOTDFFILE = -14)
parameter(DFE_SEEDTWICE = -15)
parameter(DFE_NOSPACE = -16)
parameter(DFE_NOSUCHTAG = -17)
parameter(DFE_READERROR = -18)
integer DFE_WRITEERROR, DFE_SEEKERROR, DFE_NOFREEDD
integer DFE_BADTAG, DFE_BADREF, DFE_RDONLY
integer DFE_BADCALL, DFE_BADPTR, DFE_BADLEN
integer DFE_BADSEEK, DFE_NOMATCH, DFE_NOTINSET
integer DFE_BADDIM, DFE_BADOFFSET, DFE_BADSCHEME
integer DFE_NODIM, DFE_NOTENOUGH, DFE_NOVALS
integer DFE_CORRUPT, DFE_BADFP
parameter(DFE_WRITEERROR = -19)
parameter(DFE_SEEKERROR = -20)
parameter(DFE_NOFREEDD = -21)
parameter(DFE_BADTAG = -22)
parameter(DFE_BADREF = -23)
parameter(DFE_RDONLY = -24)
parameter(DFE_BADCALL = -25)
parameter(DFE_BADPTR = -26)
parameter(DFE_BADLEN = -27)
parameter(DFE_BADSEEK = -28)
parameter(DFE_NOMATCH = -29)
parameter(DFE_NOTINSET = -30)
parameter(DFE_BADDIM = -31)
parameter(DFE_BADOFFSET = -32)
parameter(DFE_BADSCHEME = -33)
parameter(DFE_NODIM = -34)
parameter(DFE_NOTENOUGH = -35)
parameter(DFE_NOVALS = -36)
parameter(DFE_CORRUPT = -37)
parameter(DFE_BADFP = -38)
integer DFE_NOREF, DFE_BADDATATYPE, DFE_BADMCTYPE
integer DFE_BADNUMTYPE, DFE_BADORDER, DFE_ARGS
integer DFE_INTERNAL, DFE_DUPDD, DFE_CANTMOD
integer DFE_RANGE, DFE_BADTABLE, DFE_BADSDG
integer DFE_BADNDG, DFE_BADFIELDS, DFE_NORESET
integer DFE_NOVS, DFE_VGSIZE, DFE_DIFFFILES
integer DFE_VTAB, DFE_BADAID
parameter(DFE_NOREF = -39)
parameter(DFE_BADDATATYPE = -40)
parameter(DFE_BADMCTYPE = -41)
parameter(DFE_BADNUMTYPE = -42)
parameter(DFE_BADORDER = -43)
parameter(DFE_ARGS = -44)
parameter(DFE_INTERNAL = -45)
parameter(DFE_DUPDD = -46)
parameter(DFE_CANTMOD = -47)
parameter(DFE_RANGE = -48)
parameter(DFE_BADTABLE = -49)
parameter(DFE_BADSDG = -50)
parameter(DFE_BADNDG = -51)
parameter(DFE_BADFIELDS = -52)
parameter(DFE_NORESET = -53)
parameter(DFE_NOVS = -54)
parameter(DFE_VGSIZE = -55)
parameter(DFE_DIFFFILES = -56)
parameter(DFE_VTAB = -57)
parameter(DFE_BADAID = -58)
integer DFE_OPENAID, DFE_BADCONV, DFE_GENAPP, DFE_CANTFLUSH
integer DFE_BADTYPE, DFE_SYMSIZE, DFE_BADATTACH
integer DFE_CANTDETACH
parameter(DFE_OPENAID = -59)
parameter(DFE_BADCONV = -60)
parameter(DFE_GENAPP = -61)
parameter(DFE_CANTFLUSH = -62)
parameter(DFE_BADTYPE = -63)
parameter(DFE_SYMSIZE = -64)
parameter(DFE_BADATTACH = -65)
parameter(DFE_CANTDETACH = -66)
! internal file access codes
integer DFACC_READ, DFACC_WRITE, DFACC_CREATE, DFACC_ALL
integer DFACC_RDONLY, DFACC_RDWR, DFACC_CLOBBER
parameter(DFACC_READ = 1)
parameter(DFACC_WRITE = 2)
parameter(DFACC_CREATE = 4)
parameter(DFACC_ALL = 7)
parameter(DFACC_RDONLY = 1)
parameter(DFACC_RDWR = 3)
parameter(DFACC_CLOBBER = 4)
! Access types for SDsetaccesstype
integer DFACC_DEFAULT, DFACC_SERIAL, DFACC_PARALLEL
parameter(DFACC_DEFAULT = 0)
parameter(DFACC_SERIAL = 1)
parameter(DFACC_PARALLEL = 9)
! Constants for DFSDsetorder
integer DFO_FORTRAN, DFO_C
parameter(DFO_FORTRAN = 1)
parameter(DFO_C = 2)
! Definitions of storage convention
integer DFNTF_IEEE, DFNTF_VAX, DFNTF_CRAY, DFNTF_PC
integer DFNTF_CONVEX, DFNTF_VP
parameter(DFNTF_IEEE = 1)
parameter(DFNTF_VAX = 2)
parameter(DFNTF_CRAY = 3)
parameter(DFNTF_PC = 4)
parameter(DFNTF_CONVEX = 5)
parameter(DFNTF_VP = 6)
! Masks for types
integer DFNT_HDF, DFNT_NATIVE, DFNT_CUSTOM, DFNT_LITEND
parameter(DFNT_HDF = 0)
parameter(DFNT_NATIVE = 4096)
parameter(DFNT_CUSTOM = 8192)
parameter(DFNT_LITEND = 16384)
! Number type info codes
integer DFNT_NONE, DFNT_QUERY, DFNT_VERSION
parameter(DFNT_NONE = 0)
parameter(DFNT_QUERY = 0)
parameter(DFNT_VERSION = 1)
integer DFNT_FLOAT32, DFNT_FLOAT, DFNT_FLOAT64
integer DFNT_DOUBLE, DFNT_FLOAT128
parameter(DFNT_FLOAT32 = 5)
parameter(DFNT_FLOAT = 5)
parameter(DFNT_FLOAT64 = 6)
parameter(DFNT_DOUBLE = 6)
parameter(DFNT_FLOAT128 = 7)
integer DFNT_INT8, DFNT_UINT8
integer DFNT_INT16, DFNT_UINT16
integer DFNT_INT32, DFNT_UINT32
integer DFNT_INT64, DFNT_UINT64
integer DFNT_INT128,DFNT_UINT128
parameter(DFNT_INT8 = 20)
parameter(DFNT_UINT8 = 21)
parameter(DFNT_INT16 = 22)
parameter(DFNT_UINT16 = 23)
parameter(DFNT_INT32 = 24)
parameter(DFNT_UINT32 = 25)
parameter(DFNT_INT64 = 26)
parameter(DFNT_UINT64 = 27)
parameter(DFNT_INT128 = 28)
parameter(DFNT_UINT128 = 29)
integer DFNT_UCHAR8, DFNT_UCHAR, DFNT_CHAR8
integer DFNT_CHAR, DFNT_CHAR16, DFNT_UCHAR16
parameter(DFNT_UCHAR8 = 3)
parameter(DFNT_UCHAR = 3)
parameter(DFNT_CHAR8 = 4)
parameter(DFNT_CHAR = 4)
parameter(DFNT_CHAR16 = 42)
parameter(DFNT_UCHAR16 = 43)
integer DFNT_NFLOAT32, DFNT_NFLOAT, DFNT_NFLOAT64
integer DFNT_NDOUBLE, DFNT_NFLOAT128
parameter(DFNT_NFLOAT32 = 4101)
parameter(DFNT_NFLOAT = 4101)
parameter(DFNT_NFLOAT64 = 4102)
parameter(DFNT_NDOUBLE = 4102)
parameter(DFNT_NFLOAT128 = 4103)
integer DFNT_NINT8, DFNT_NUINT8
integer DFNT_NINT16, DFNT_NUINT16
integer DFNT_NINT32, DFNT_NUINT32
integer DFNT_NINT64, DFNT_NUINT64
integer DFNT_NINT128,DFNT_NUINT128
parameter(DFNT_NINT8 = 4116)
parameter(DFNT_NUINT8 = 4117)
parameter(DFNT_NINT16 = 4118)
parameter(DFNT_NUINT16 = 4119)
parameter(DFNT_NINT32 = 4120)
parameter(DFNT_NUINT32 = 4121)
parameter(DFNT_NINT64 = 4122)
parameter(DFNT_NUINT64 = 4123)
parameter(DFNT_NINT128 = 4124)
parameter(DFNT_NUINT128 = 4125)
integer DFNT_NUCHAR8, DFNT_NUCHAR, DFNT_NCHAR8
integer DFNT_NCHAR, DFNT_NCHAR16, DFNT_NUCHAR16
parameter(DFNT_NUCHAR8 = 4099)
parameter(DFNT_NUCHAR = 4099)
parameter(DFNT_NCHAR8 = 4100)
parameter(DFNT_NCHAR = 4100)
parameter(DFNT_NCHAR16 = 4138)
parameter(DFNT_NUCHAR16 = 4139)
integer DFNT_LFLOAT32, DFNT_LFLOAT, DFNT_LFLOAT64
integer DFNT_LDOUBLE, DFNT_LFLOAT128
parameter(DFNT_LFLOAT32 = 16389)
parameter(DFNT_LFLOAT = 16389)
parameter(DFNT_LFLOAT64 = 16390)
parameter(DFNT_LDOUBLE = 16390)
parameter(DFNT_LFLOAT128 = 16391)
integer DFNT_LINT8,DFNT_LUINT8,DFNT_LINT16,DFNT_LUINT16
integer DFNT_LINT32,DFNT_LUINT32,DFNT_LINT64,DFNT_LUINT64
integer DFNT_LINT128,DFNT_LUINT128
parameter(DFNT_LINT8 = 16404)
parameter(DFNT_LUINT8 = 16405)
parameter(DFNT_LINT16 = 16406)
parameter(DFNT_LUINT16 = 16407)
parameter(DFNT_LINT32 = 16408)
parameter(DFNT_LUINT32 = 16409)
parameter(DFNT_LINT64 = 16410)
parameter(DFNT_LUINT64 = 16411)
parameter(DFNT_LINT128 = 16412)
parameter(DFNT_LUINT128 = 16413)
integer DFNT_LUCHAR8, DFNT_LUCHAR, DFNT_LCHAR8
integer DFNT_LCHAR, DFNT_LCHAR16, DFNT_LUCHAR16
parameter(DFNT_LUCHAR8 = 16387)
parameter(DFNT_LUCHAR = 16387)
parameter(DFNT_LCHAR8 = 16388)
parameter(DFNT_LCHAR = 16388)
parameter(DFNT_LCHAR16 = 16426)
parameter(DFNT_LUCHAR16 = 16427)
! tags and refs
integer DFREF_WILDCARD, DFTAG_WILDCARD, DFTAG_NULL
integer DFTAG_LINKED, DFTAG_VERSION, DFTAG_COMPRESSED
parameter(DFREF_WILDCARD = 0, DFTAG_WILDCARD = 0)
parameter(DFTAG_NULL = 1, DFTAG_LINKED = 20)
parameter(DFTAG_VERSION = 30,DFTAG_COMPRESSED = 40)
! utility set
integer DFTAG_FID, DFTAG_FD, DFTAG_TID, DFTAG_TD
integer DFTAG_DIL, DFTAG_DIA, DFTAG_NT, DFTAG_MT
parameter(DFTAG_FID = 100, DFTAG_FD = 101)
parameter(DFTAG_TID = 102, DFTAG_TD = 103)
parameter(DFTAG_DIL = 104, DFTAG_DIA = 105)
parameter(DFTAG_NT = 106, DFTAG_MT = 107)
! raster-8 set
integer DFTAG_ID8, DFTAG_IP8, DFTAG_RI8
integer DFTAG_CI8, DFTAG_II8
parameter(DFTAG_ID8 = 200, DFTAG_IP8 = 201)
parameter(DFTAG_RI8 = 202, DFTAG_CI8 = 203)
parameter(DFTAG_II8 = 204)
! Raster Image set
integer DFTAG_ID, DFTAG_LUT, DFTAG_RI, DFTAG_CI
parameter(DFTAG_ID = 300, DFTAG_LUT = 301)
parameter(DFTAG_RI = 302, DFTAG_CI = 303)
integer DFTAG_RIG, DFTAG_LD, DFTAG_MD, DFTAG_MA
integer DFTAG_CCN, DFTAG_CFM, DFTAG_AR
parameter(DFTAG_RIG = 306, DFTAG_LD = 307)
parameter(DFTAG_MD = 308, DFTAG_MA = 309)
parameter(DFTAG_CCN = 310, DFTAG_CFM = 311)
parameter(DFTAG_AR = 312)
integer DFTAG_DRAW, DFTAG_RUN, DFTAG_XYP, DFTAG_MTO
parameter(DFTAG_DRAW = 400, DFTAG_RUN = 401)
parameter(DFTAG_XYP = 500, DFTAG_MTO = 501)
! Tektronix
integer DFTAG_T14, DFTAG_T105
parameter(DFTAG_T14 = 602, DFTAG_T105 = 603)
! Scientific Data set
integer DFTAG_SDG, DFTAG_SDD, DFTAG_SD, DFTAG_SDS, DFTAG_SDL
integer DFTAG_SDU, DFTAG_SDF, DFTAG_SDM, DFTAG_SDC
integer DFTAG_SDT,DFTAG_SDLNK,DFTAG_NDG
integer DFTAG_BREQ,DFTAG_EREQ,DFTAG_CAL, DFTAG_FV
parameter(DFTAG_SDG = 700, DFTAG_SDD = 701)
parameter(DFTAG_SD = 702, DFTAG_SDS = 703)
parameter(DFTAG_SDL = 704, DFTAG_SDU = 705)
parameter(DFTAG_SDF = 706, DFTAG_SDM = 707)
parameter(DFTAG_SDC = 708, DFTAG_SDT = 709)
parameter(DFTAG_SDLNK = 710, DFTAG_NDG = 720)
parameter(DFTAG_CAL = 731, DFTAG_FV = 732)
parameter(DFTAG_BREQ = 799, DFTAG_EREQ = 780)
! VSets
integer DFTAG_VG, DFTAG_VH, DFTAG_VS
parameter(DFTAG_VG = 1965, DFTAG_VH = 1962)
parameter(DFTAG_VS = 1963)
! compression schemes
integer DFTAG_RLE, DFTAG_IMC, DFTAG_IMCOMP, DFTAG_JPEG
integer DFTAG_GREYJPEG
parameter(DFTAG_RLE =11, DFTAG_IMC =12)
parameter(DFTAG_IMCOMP =12, DFTAG_JPEG =13)
parameter(DFTAG_GREYJPEG =14)
! SPECIAL CODES
integer SPECIAL_LINKED, SPECIAL_EXT
parameter(SPECIAL_LINKED = 1, SPECIAL_EXT = 2)
! PARAMETERS
integer DF_MAXFNLEN
integer SD_UNLIMITED
integer SD_DIMVAL_BW_COMP
integer SD_DIMVAL_BW_INCOMP
integer SD_FILL
integer SD_NOFILL
parameter(DF_MAXFNLEN = 256, SD_UNLIMITED = 0)
parameter(SD_DIMVAL_BW_COMP = 1, SD_DIMVAL_BW_INCOMP = 0)
parameter(SD_FILL = 0, SD_NOFILL = 256)
integer HDF_VDATA
parameter(HDF_VDATA = -1)
! Standard return codes
integer SUCCEED, FAIL
parameter(SUCCEED = 0, FAIL = -1)
! Compression Types
integer COMP_NONE, COMP_RLE, COMP_IMCOMP, COMP_JPEG
parameter(COMP_NONE = 0, COMP_RLE = 11)
parameter(COMP_IMCOMP = 12, COMP_JPEG = 2)
!
! Fortran chunking (SD and GR interfaces) and compression routines use
! the following compression types:
!
integer COMP_CODE_NONE, COMP_CODE_RLE, COMP_CODE_NBIT
integer COMP_CODE_SKPHUFF, COMP_CODE_DEFLATE
integer COMP_CODE_JPEG
integer COMP_CODE_SZIP
integer SZ_EC_OPTION_MASK, SZ_NN_OPTION_MASK
integer COMP_DECODER_ENABLED, COMP_ENCODER_ENABLED
parameter (COMP_CODE_NONE = 0)
parameter (COMP_CODE_RLE = 1)
parameter (COMP_CODE_NBIT = 2)
parameter (COMP_CODE_SKPHUFF = 3)
parameter (COMP_CODE_DEFLATE = 4)
parameter (COMP_CODE_SZIP = 5)
parameter (COMP_CODE_JPEG = 6)
!
! SZIP parameters
!
parameter (SZ_EC_OPTION_MASK = 4)
parameter (SZ_NN_OPTION_MASK = 32)
parameter (COMP_DECODER_ENABLED = 1)
parameter (COMP_ENCODER_ENABLED = 2)
!
! Interlace Types
integer MFGR_INTERLACE_PIXEL, MFGR_INTERLACE_LINE
integer MFGR_INTERLACE_COMPONENT
parameter(MFGR_INTERLACE_PIXEL = 0)
parameter(MFGR_INTERLACE_LINE = 1)
parameter(MFGR_INTERLACE_COMPONENT= 2)
integer FULL_INTERLACE, NO_INTERLACE
parameter(FULL_INTERLACE = 0, NO_INTERLACE = 1)
! Vdata fields packing types
integer HDF_VSPACK, HDF_VSUNPACK
parameter (HDF_VSPACK = 0, HDF_VSUNPACK = 1)
! Multi-file Annotation types
integer AN_DATA_LABEL, AN_DATA_DESC, AN_FILE_LABEL, AN_FILE_DESC
parameter(AN_DATA_LABEL = 0, AN_DATA_DESC = 1)
parameter(AN_FILE_LABEL = 2, AN_FILE_DESC = 3)
!******************End of hdf.inc***************************
| bsd-3-clause |
chenbaihu/grpc | test/core/network_benchmarks/low_level_ping_pong.c | 3 | 19732 | /*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Basic I/O ping-pong benchmarks.
The goal here is to establish lower bounds on how fast the stack could get by
measuring the cost of using various I/O strategies to do a basic
request-response loop.
*/
#include <errno.h>
#include <netinet/ip.h>
#include <poll.h>
#include <stdio.h>
#include <string.h>
#ifdef __linux__
#include <sys/epoll.h>
#endif
#include <sys/socket.h>
#include "src/core/iomgr/socket_utils_posix.h"
#include <grpc/support/cmdline.h>
#include <grpc/support/histogram.h>
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
typedef struct fd_pair {
int read_fd;
int write_fd;
} fd_pair;
typedef struct thread_args {
fd_pair fds;
size_t msg_size;
int (*read_bytes)(struct thread_args *args, char *buf);
int (*write_bytes)(struct thread_args *args, char *buf);
int (*setup)(struct thread_args *args);
int epoll_fd;
char *strategy_name;
} thread_args;
/*
Read strategies
There are a number of read strategies, each of which has a blocking and
non-blocking version.
*/
/* Basic call to read() */
static int read_bytes(int fd, char *buf, size_t read_size, int spin) {
int bytes_read = 0;
int err;
do {
err = read(fd, buf + bytes_read, read_size - bytes_read);
if (err < 0) {
if (errno == EINTR) {
continue;
} else {
if (errno == EAGAIN && spin == 1) {
continue;
}
gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
return -1;
}
} else {
bytes_read += err;
}
} while (bytes_read < read_size);
return 0;
}
static int blocking_read_bytes(thread_args *args, char *buf) {
return read_bytes(args->fds.read_fd, buf, args->msg_size, 0);
}
static int spin_read_bytes(thread_args *args, char *buf) {
return read_bytes(args->fds.read_fd, buf, args->msg_size, 1);
}
/* Call poll() to monitor a non-blocking fd */
static int poll_read_bytes(int fd, char *buf, size_t read_size, int spin) {
struct pollfd pfd;
size_t bytes_read = 0;
int err;
pfd.fd = fd;
pfd.events = POLLIN;
do {
err = poll(&pfd, 1, spin ? 0 : -1);
if (err < 0) {
if (errno == EINTR) {
continue;
} else {
gpr_log(GPR_ERROR, "Poll failed: %s", strerror(errno));
return -1;
}
}
if (err == 0 && spin) continue;
GPR_ASSERT(err == 1);
GPR_ASSERT(pfd.revents == POLLIN);
do {
err = read(fd, buf + bytes_read, read_size - bytes_read);
} while (err < 0 && errno == EINTR);
if (err < 0 && errno != EAGAIN) {
gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
return -1;
}
bytes_read += err;
} while (bytes_read < read_size);
return 0;
}
static int poll_read_bytes_blocking(struct thread_args *args, char *buf) {
return poll_read_bytes(args->fds.read_fd, buf, args->msg_size, 0);
}
static int poll_read_bytes_spin(struct thread_args *args, char *buf) {
return poll_read_bytes(args->fds.read_fd, buf, args->msg_size, 1);
}
#ifdef __linux__
/* Call epoll_wait() to monitor a non-blocking fd */
static int epoll_read_bytes(struct thread_args *args, char *buf, int spin) {
struct epoll_event ev;
size_t bytes_read = 0;
int err;
size_t read_size = args->msg_size;
do {
err = epoll_wait(args->epoll_fd, &ev, 1, spin ? 0 : -1);
if (err < 0) {
if (errno == EINTR) continue;
gpr_log(GPR_ERROR, "epoll_wait failed: %s", strerror(errno));
return -1;
}
if (err == 0 && spin) continue;
GPR_ASSERT(err == 1);
GPR_ASSERT(ev.events & EPOLLIN);
GPR_ASSERT(ev.data.fd == args->fds.read_fd);
do {
do {
err = read(args->fds.read_fd, buf + bytes_read, read_size - bytes_read);
} while (err < 0 && errno == EINTR);
if (errno == EAGAIN) break;
bytes_read += err;
/* TODO(klempner): This should really be doing an extra call after we are
done to ensure we see an EAGAIN */
} while (bytes_read < read_size);
} while (bytes_read < read_size);
GPR_ASSERT(bytes_read == read_size);
return 0;
}
static int epoll_read_bytes_blocking(struct thread_args *args, char *buf) {
return epoll_read_bytes(args, buf, 0);
}
static int epoll_read_bytes_spin(struct thread_args *args, char *buf) {
return epoll_read_bytes(args, buf, 1);
}
#endif /* __linux__ */
/* Write out bytes.
At this point we only have one strategy, since in the common case these
writes go directly out to the kernel.
*/
static int blocking_write_bytes(struct thread_args *args, char *buf) {
int bytes_written = 0;
int err;
size_t write_size = args->msg_size;
do {
err = write(args->fds.write_fd, buf + bytes_written,
write_size - bytes_written);
if (err < 0) {
if (errno == EINTR) {
continue;
} else {
gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
return -1;
}
} else {
bytes_written += err;
}
} while (bytes_written < write_size);
return 0;
}
/*
Initialization code
These are called at the beginning of the client and server thread, depending
on the scenario we're using.
*/
static int set_socket_nonblocking(thread_args *args) {
if (!grpc_set_socket_nonblocking(args->fds.read_fd, 1)) {
gpr_log(GPR_ERROR, "Unable to set socket nonblocking: %s", strerror(errno));
return -1;
}
if (!grpc_set_socket_nonblocking(args->fds.write_fd, 1)) {
gpr_log(GPR_ERROR, "Unable to set socket nonblocking: %s", strerror(errno));
return -1;
}
return 0;
}
static int do_nothing(thread_args *args) { return 0; }
/* Special case for epoll, where we need to create the fd ahead of time. */
static int epoll_setup(thread_args *args) {
int epoll_fd;
struct epoll_event ev;
set_socket_nonblocking(args);
epoll_fd = epoll_create(1);
if (epoll_fd < 0) {
gpr_log(GPR_ERROR, "epoll_create: %s", strerror(errno));
return -1;
}
args->epoll_fd = epoll_fd;
ev.events = EPOLLIN | EPOLLET;
ev.data.fd = args->fds.read_fd;
if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, args->fds.read_fd, &ev) < 0) {
gpr_log(GPR_ERROR, "epoll_ctl: %s", strerror(errno));
}
return 0;
}
static void server_thread(thread_args *args) {
char *buf = malloc(args->msg_size);
if (args->setup(args) < 0) {
gpr_log(GPR_ERROR, "Setup failed");
}
for (;;) {
if (args->read_bytes(args, buf) < 0) {
gpr_log(GPR_ERROR, "Server read failed");
free(buf);
return;
}
if (args->write_bytes(args, buf) < 0) {
gpr_log(GPR_ERROR, "Server write failed");
free(buf);
return;
}
}
}
static void server_thread_wrap(void *arg) {
thread_args *args = arg;
server_thread(args);
}
static void print_histogram(gpr_histogram *histogram) {
/* TODO(klempner): Print more detailed information, such as detailed histogram
buckets */
gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f",
gpr_histogram_percentile(histogram, 50),
gpr_histogram_percentile(histogram, 95),
gpr_histogram_percentile(histogram, 99),
gpr_histogram_percentile(histogram, 99.9));
}
static double now(void) {
gpr_timespec tv = gpr_now();
return 1e9 * tv.tv_sec + tv.tv_nsec;
}
static void client_thread(thread_args *args) {
char *buf = calloc(args->msg_size, sizeof(char));
gpr_histogram *histogram = gpr_histogram_create(0.01, 60e9);
double start_time;
double end_time;
double interval;
const int kNumIters = 100000;
int i;
if (args->setup(args) < 0) {
gpr_log(GPR_ERROR, "Setup failed");
}
for (i = 0; i < kNumIters; ++i) {
start_time = now();
if (args->write_bytes(args, buf) < 0) {
gpr_log(GPR_ERROR, "Client write failed");
goto error;
}
if (args->read_bytes(args, buf) < 0) {
gpr_log(GPR_ERROR, "Client read failed");
goto error;
}
end_time = now();
if (i > kNumIters / 2) {
interval = end_time - start_time;
gpr_histogram_add(histogram, interval);
}
}
print_histogram(histogram);
error:
free(buf);
gpr_histogram_destroy(histogram);
}
/* This roughly matches tcp_server's create_listening_socket */
static int create_listening_socket(struct sockaddr *port, socklen_t len) {
int fd = socket(port->sa_family, SOCK_STREAM, 0);
if (fd < 0) {
gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
goto error;
}
if (!grpc_set_socket_cloexec(fd, 1) || !grpc_set_socket_low_latency(fd, 1) ||
!grpc_set_socket_reuse_addr(fd, 1)) {
gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd,
strerror(errno));
goto error;
}
if (bind(fd, port, len) < 0) {
gpr_log(GPR_ERROR, "bind: %s", strerror(errno));
goto error;
}
if (listen(fd, 1) < 0) {
gpr_log(GPR_ERROR, "listen: %s", strerror(errno));
goto error;
}
if (getsockname(fd, port, &len) < 0) {
gpr_log(GPR_ERROR, "getsockname: %s", strerror(errno));
goto error;
}
return fd;
error:
if (fd >= 0) {
close(fd);
}
return -1;
}
static int connect_client(struct sockaddr *addr, int len) {
int fd = socket(addr->sa_family, SOCK_STREAM, 0);
int err;
if (fd < 0) {
gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
goto error;
}
if (!grpc_set_socket_cloexec(fd, 1) || !grpc_set_socket_low_latency(fd, 1)) {
gpr_log(GPR_ERROR, "Failed to configure socket");
goto error;
}
do {
err = connect(fd, addr, len);
} while (err < 0 && errno == EINTR);
if (err < 0) {
gpr_log(GPR_ERROR, "connect error: %s", strerror(errno));
goto error;
}
return fd;
error:
if (fd >= 0) {
close(fd);
}
return -1;
}
static int accept_server(int listen_fd) {
int fd = accept(listen_fd, NULL, NULL);
if (fd < 0) {
gpr_log(GPR_ERROR, "Accept failed: %s", strerror(errno));
return -1;
}
return fd;
}
static int create_sockets_tcp(fd_pair *client_fds, fd_pair *server_fds) {
int listen_fd = -1;
int client_fd = -1;
int server_fd = -1;
struct sockaddr_in port;
struct sockaddr *sa_port = (struct sockaddr *)&port;
port.sin_family = AF_INET;
port.sin_port = 0;
port.sin_addr.s_addr = INADDR_ANY;
listen_fd = create_listening_socket(sa_port, sizeof(port));
if (listen_fd == -1) {
gpr_log(GPR_ERROR, "Listen failed");
goto error;
}
client_fd = connect_client(sa_port, sizeof(port));
if (client_fd == -1) {
gpr_log(GPR_ERROR, "Connect failed");
goto error;
}
server_fd = accept_server(listen_fd);
if (server_fd == -1) {
gpr_log(GPR_ERROR, "Accept failed");
goto error;
}
client_fds->read_fd = client_fd;
client_fds->write_fd = client_fd;
server_fds->read_fd = server_fd;
server_fds->write_fd = server_fd;
close(listen_fd);
return 0;
error:
if (listen_fd != -1) {
close(listen_fd);
}
if (client_fd != -1) {
close(client_fd);
}
if (server_fd != -1) {
close(server_fd);
}
return -1;
}
static int create_sockets_socketpair(fd_pair *client_fds, fd_pair *server_fds) {
int fds[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
gpr_log(GPR_ERROR, "socketpair: %s", strerror(errno));
return -1;
}
client_fds->read_fd = fds[0];
client_fds->write_fd = fds[0];
server_fds->read_fd = fds[1];
server_fds->write_fd = fds[1];
return 0;
}
static int create_sockets_pipe(fd_pair *client_fds, fd_pair *server_fds) {
int cfds[2];
int sfds[2];
if (pipe(cfds) < 0) {
gpr_log(GPR_ERROR, "pipe: %s", strerror(errno));
return -1;
}
if (pipe(sfds) < 0) {
gpr_log(GPR_ERROR, "pipe: %s", strerror(errno));
return -1;
}
client_fds->read_fd = cfds[0];
client_fds->write_fd = cfds[1];
server_fds->read_fd = sfds[0];
server_fds->write_fd = sfds[1];
return 0;
}
static const char *read_strategy_usage =
"Strategy for doing reads, which is one of:\n"
" blocking: blocking read calls\n"
" same_thread_poll: poll() call on same thread \n"
#ifdef __linux__
" same_thread_epoll: epoll_wait() on same thread \n"
#endif
" spin_read: spinning non-blocking read() calls \n"
" spin_poll: spinning 0 timeout poll() calls \n"
#ifdef __linux__
" spin_epoll: spinning 0 timeout epoll_wait() calls \n"
#endif
"";
static const char *socket_type_usage =
"Type of socket used, one of:\n"
" tcp: fds are endpoints of a TCP connection\n"
" socketpair: fds come from socketpair()\n"
" pipe: fds come from pipe()\n";
void print_usage(char *argv0) {
fprintf(stderr, "%s usage:\n\n", argv0);
fprintf(stderr, "%s read_strategy socket_type msg_size\n\n", argv0);
fprintf(stderr, "where read_strategy is one of:\n");
fprintf(stderr, " blocking: blocking read calls\n");
fprintf(stderr, " same_thread_poll: poll() call on same thread \n");
#ifdef __linux__
fprintf(stderr, " same_thread_epoll: epoll_wait() on same thread \n");
#endif
fprintf(stderr, " spin_read: spinning non-blocking read() calls \n");
fprintf(stderr, " spin_poll: spinning 0 timeout poll() calls \n");
#ifdef __linux__
fprintf(stderr, " spin_epoll: spinning 0 timeout epoll_wait() calls \n");
#endif
fprintf(stderr, "and socket_type is one of:\n");
fprintf(stderr, " tcp: fds are endpoints of a TCP connection\n");
fprintf(stderr, " socketpair: fds come from socketpair()\n");
fprintf(stderr, " pipe: fds come from pipe()\n");
}
typedef struct test_strategy {
char *name;
int (*read_strategy)(struct thread_args *args, char *buf);
int (*setup)(struct thread_args *args);
} test_strategy;
static test_strategy test_strategies[] = {
{"blocking", blocking_read_bytes, do_nothing},
{"same_thread_poll", poll_read_bytes_blocking, set_socket_nonblocking},
#ifdef __linux__
{"same_thread_epoll", epoll_read_bytes_blocking, epoll_setup},
{"spin_epoll", epoll_read_bytes_spin, epoll_setup},
#endif /* __linux__ */
{"spin_read", spin_read_bytes, set_socket_nonblocking},
{"spin_poll", poll_read_bytes_spin, set_socket_nonblocking}};
static char *socket_types[] = {"tcp", "socketpair", "pipe"};
int create_socket(char *socket_type, fd_pair *client_fds, fd_pair *server_fds) {
if (strcmp(socket_type, "tcp") == 0) {
create_sockets_tcp(client_fds, server_fds);
} else if (strcmp(socket_type, "socketpair") == 0) {
create_sockets_socketpair(client_fds, server_fds);
} else if (strcmp(socket_type, "pipe") == 0) {
create_sockets_pipe(client_fds, server_fds);
} else {
fprintf(stderr, "Invalid socket type %s\n", socket_type);
return -1;
}
return 0;
}
static int run_benchmark(char *socket_type, thread_args *client_args,
thread_args *server_args) {
gpr_thd_id tid;
int rv = 0;
rv = create_socket(socket_type, &client_args->fds, &server_args->fds);
if (rv < 0) {
return rv;
}
gpr_log(GPR_INFO, "Starting test %s %s %d", client_args->strategy_name,
socket_type, client_args->msg_size);
gpr_thd_new(&tid, server_thread_wrap, server_args, NULL);
client_thread(client_args);
return 0;
}
static int run_all_benchmarks(int msg_size) {
int error = 0;
int i;
for (i = 0; i < GPR_ARRAY_SIZE(test_strategies); ++i) {
test_strategy *test_strategy = &test_strategies[i];
int j;
for (j = 0; j < GPR_ARRAY_SIZE(socket_types); ++j) {
thread_args *client_args = malloc(sizeof(thread_args));
thread_args *server_args = malloc(sizeof(thread_args));
char *socket_type = socket_types[j];
client_args->read_bytes = test_strategy->read_strategy;
client_args->write_bytes = blocking_write_bytes;
client_args->setup = test_strategy->setup;
client_args->msg_size = msg_size;
client_args->strategy_name = test_strategy->name;
server_args->read_bytes = test_strategy->read_strategy;
server_args->write_bytes = blocking_write_bytes;
server_args->setup = test_strategy->setup;
server_args->msg_size = msg_size;
server_args->strategy_name = test_strategy->name;
error = run_benchmark(socket_type, client_args, server_args);
if (error < 0) {
return error;
}
}
}
return error;
}
int main(int argc, char **argv) {
thread_args *client_args = malloc(sizeof(thread_args));
thread_args *server_args = malloc(sizeof(thread_args));
int msg_size = -1;
char *read_strategy = NULL;
char *socket_type = NULL;
int i;
const test_strategy *test_strategy = NULL;
int error = 0;
gpr_cmdline *cmdline =
gpr_cmdline_create("low_level_ping_pong network benchmarking tool");
gpr_cmdline_add_int(cmdline, "msg_size", "Size of sent messages", &msg_size);
gpr_cmdline_add_string(cmdline, "read_strategy", read_strategy_usage,
&read_strategy);
gpr_cmdline_add_string(cmdline, "socket_type", socket_type_usage,
&socket_type);
gpr_cmdline_parse(cmdline, argc, argv);
if (msg_size == -1) {
msg_size = 50;
}
if (read_strategy == NULL) {
gpr_log(GPR_INFO, "No strategy specified, running all benchmarks");
return run_all_benchmarks(msg_size);
}
if (socket_type == NULL) {
socket_type = "tcp";
}
if (msg_size <= 0) {
fprintf(stderr, "msg_size must be > 0\n");
print_usage(argv[0]);
return -1;
}
for (i = 0; i < GPR_ARRAY_SIZE(test_strategies); ++i) {
if (!strcmp(test_strategies[i].name, read_strategy)) {
test_strategy = &test_strategies[i];
}
}
if (test_strategy == NULL) {
fprintf(stderr, "Invalid read strategy %s\n", read_strategy);
return -1;
}
client_args->read_bytes = test_strategy->read_strategy;
client_args->write_bytes = blocking_write_bytes;
client_args->setup = test_strategy->setup;
client_args->msg_size = msg_size;
client_args->strategy_name = read_strategy;
server_args->read_bytes = test_strategy->read_strategy;
server_args->write_bytes = blocking_write_bytes;
server_args->setup = test_strategy->setup;
server_args->msg_size = msg_size;
server_args->strategy_name = read_strategy;
error = run_benchmark(socket_type, client_args, server_args);
gpr_cmdline_destroy(cmdline);
return error;
}
| bsd-3-clause |
endlessm/chromium-browser | third_party/llvm/llvm/lib/DebugInfo/PDB/Native/NativeTypeUDT.cpp | 3 | 7101 | //===- NativeTypeUDT.cpp - info about class/struct type ---------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/PDB/Native/NativeTypeUDT.h"
#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
#include <cassert>
using namespace llvm;
using namespace llvm::codeview;
using namespace llvm::pdb;
NativeTypeUDT::NativeTypeUDT(NativeSession &Session, SymIndexId Id,
codeview::TypeIndex TI, codeview::ClassRecord CR)
: NativeRawSymbol(Session, PDB_SymType::UDT, Id), Index(TI),
Class(std::move(CR)), Tag(Class.getPointer()) {}
NativeTypeUDT::NativeTypeUDT(NativeSession &Session, SymIndexId Id,
codeview::TypeIndex TI, codeview::UnionRecord UR)
: NativeRawSymbol(Session, PDB_SymType::UDT, Id), Index(TI),
Union(std::move(UR)), Tag(Union.getPointer()) {}
NativeTypeUDT::NativeTypeUDT(NativeSession &Session, SymIndexId Id,
NativeTypeUDT &UnmodifiedType,
codeview::ModifierRecord Modifier)
: NativeRawSymbol(Session, PDB_SymType::UDT, Id),
UnmodifiedType(&UnmodifiedType), Modifiers(std::move(Modifier)) {}
NativeTypeUDT::~NativeTypeUDT() {}
void NativeTypeUDT::dump(raw_ostream &OS, int Indent,
PdbSymbolIdField ShowIdFields,
PdbSymbolIdField RecurseIdFields) const {
NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
dumpSymbolField(OS, "name", getName(), Indent);
dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
PdbSymbolIdField::LexicalParent, ShowIdFields,
RecurseIdFields);
if (Modifiers.hasValue())
dumpSymbolIdField(OS, "unmodifiedTypeId", getUnmodifiedTypeId(), Indent,
Session, PdbSymbolIdField::UnmodifiedType, ShowIdFields,
RecurseIdFields);
if (getUdtKind() != PDB_UdtType::Union)
dumpSymbolField(OS, "virtualTableShapeId", getVirtualTableShapeId(),
Indent);
dumpSymbolField(OS, "length", getLength(), Indent);
dumpSymbolField(OS, "udtKind", getUdtKind(), Indent);
dumpSymbolField(OS, "constructor", hasConstructor(), Indent);
dumpSymbolField(OS, "constType", isConstType(), Indent);
dumpSymbolField(OS, "hasAssignmentOperator", hasAssignmentOperator(), Indent);
dumpSymbolField(OS, "hasCastOperator", hasCastOperator(), Indent);
dumpSymbolField(OS, "hasNestedTypes", hasNestedTypes(), Indent);
dumpSymbolField(OS, "overloadedOperator", hasOverloadedOperator(), Indent);
dumpSymbolField(OS, "isInterfaceUdt", isInterfaceUdt(), Indent);
dumpSymbolField(OS, "intrinsic", isIntrinsic(), Indent);
dumpSymbolField(OS, "nested", isNested(), Indent);
dumpSymbolField(OS, "packed", isPacked(), Indent);
dumpSymbolField(OS, "isRefUdt", isRefUdt(), Indent);
dumpSymbolField(OS, "scoped", isScoped(), Indent);
dumpSymbolField(OS, "unalignedType", isUnalignedType(), Indent);
dumpSymbolField(OS, "isValueUdt", isValueUdt(), Indent);
dumpSymbolField(OS, "volatileType", isVolatileType(), Indent);
}
std::string NativeTypeUDT::getName() const {
if (UnmodifiedType)
return UnmodifiedType->getName();
return std::string(Tag->getName());
}
SymIndexId NativeTypeUDT::getLexicalParentId() const { return 0; }
SymIndexId NativeTypeUDT::getUnmodifiedTypeId() const {
if (UnmodifiedType)
return UnmodifiedType->getSymIndexId();
return 0;
}
SymIndexId NativeTypeUDT::getVirtualTableShapeId() const {
if (UnmodifiedType)
return UnmodifiedType->getVirtualTableShapeId();
if (Class)
return Session.getSymbolCache().findSymbolByTypeIndex(Class->VTableShape);
return 0;
}
uint64_t NativeTypeUDT::getLength() const {
if (UnmodifiedType)
return UnmodifiedType->getLength();
if (Class)
return Class->getSize();
return Union->getSize();
}
PDB_UdtType NativeTypeUDT::getUdtKind() const {
if (UnmodifiedType)
return UnmodifiedType->getUdtKind();
switch (Tag->Kind) {
case TypeRecordKind::Class:
return PDB_UdtType::Class;
case TypeRecordKind::Union:
return PDB_UdtType::Union;
case TypeRecordKind::Struct:
return PDB_UdtType::Struct;
case TypeRecordKind::Interface:
return PDB_UdtType::Interface;
default:
llvm_unreachable("Unexected udt kind");
}
}
bool NativeTypeUDT::hasConstructor() const {
if (UnmodifiedType)
return UnmodifiedType->hasConstructor();
return (Tag->Options & ClassOptions::HasConstructorOrDestructor) !=
ClassOptions::None;
}
bool NativeTypeUDT::isConstType() const {
if (!Modifiers)
return false;
return (Modifiers->Modifiers & ModifierOptions::Const) !=
ModifierOptions::None;
}
bool NativeTypeUDT::hasAssignmentOperator() const {
if (UnmodifiedType)
return UnmodifiedType->hasAssignmentOperator();
return (Tag->Options & ClassOptions::HasOverloadedAssignmentOperator) !=
ClassOptions::None;
}
bool NativeTypeUDT::hasCastOperator() const {
if (UnmodifiedType)
return UnmodifiedType->hasCastOperator();
return (Tag->Options & ClassOptions::HasConversionOperator) !=
ClassOptions::None;
}
bool NativeTypeUDT::hasNestedTypes() const {
if (UnmodifiedType)
return UnmodifiedType->hasNestedTypes();
return (Tag->Options & ClassOptions::ContainsNestedClass) !=
ClassOptions::None;
}
bool NativeTypeUDT::hasOverloadedOperator() const {
if (UnmodifiedType)
return UnmodifiedType->hasOverloadedOperator();
return (Tag->Options & ClassOptions::HasOverloadedOperator) !=
ClassOptions::None;
}
bool NativeTypeUDT::isInterfaceUdt() const { return false; }
bool NativeTypeUDT::isIntrinsic() const {
if (UnmodifiedType)
return UnmodifiedType->isIntrinsic();
return (Tag->Options & ClassOptions::Intrinsic) != ClassOptions::None;
}
bool NativeTypeUDT::isNested() const {
if (UnmodifiedType)
return UnmodifiedType->isNested();
return (Tag->Options & ClassOptions::Nested) != ClassOptions::None;
}
bool NativeTypeUDT::isPacked() const {
if (UnmodifiedType)
return UnmodifiedType->isPacked();
return (Tag->Options & ClassOptions::Packed) != ClassOptions::None;
}
bool NativeTypeUDT::isRefUdt() const { return false; }
bool NativeTypeUDT::isScoped() const {
if (UnmodifiedType)
return UnmodifiedType->isScoped();
return (Tag->Options & ClassOptions::Scoped) != ClassOptions::None;
}
bool NativeTypeUDT::isValueUdt() const { return false; }
bool NativeTypeUDT::isUnalignedType() const {
if (!Modifiers)
return false;
return (Modifiers->Modifiers & ModifierOptions::Unaligned) !=
ModifierOptions::None;
}
bool NativeTypeUDT::isVolatileType() const {
if (!Modifiers)
return false;
return (Modifiers->Modifiers & ModifierOptions::Volatile) !=
ModifierOptions::None;
}
| bsd-3-clause |
openthread/ot-rtos | third_party/freertos/repo/FreeRTOS/Demo/CORTEX_M4F_CEC_MEC_17xx_51xx_Keil_GCC/peripheral_library/system_internal.c | 3 | 4598 | /**************************************************************************//**
* @file system_internal.c
* @brief CMSIS Device System Source File for
* Microchip ARMCM4F Device Series
* @version V1.09
* @date 27. August 2014
*
* @note
*
******************************************************************************/
/* Copyright (c) 2011 - 2014 ARM LIMITED
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of ARM nor the names of its contributors may be used
to endorse or promote products derived from this software without
specific prior written permission.
*
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND 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.
---------------------------------------------------------------------------*/
/*
* Device CMSIS header file
*/
#include "common_lib.h"
#include "MCHP_device_header.h"
/*----------------------------------------------------------------------------
Define clocks
*----------------------------------------------------------------------------*/
#define __HSI ( 48000000UL)
#define __XTAL ( 48000000UL) /* Oscillator frequency */
/*
* Core system clock is 48MHz derived from an internal oscillator
* It may be divided down using the PCR Processor Clock Control register.
* Supported dividers are: 1, 2, 3, 4, 16, and 48.
* Power on default is 4.
*/
#define __SYSTEM_CLOCK (__XTAL)
/* !!!! Define EC_INIT_CLK_DIV for the clock divider you
* want the ARM CM4F core to run at !!!!
*/
#ifndef EC_INIT_CLK_DIV
#define EC_INIT_CLK_DIV (1u)
#endif
/*----------------------------------------------------------------------------
System Core Clock Variable
*----------------------------------------------------------------------------*/
uint32_t SystemCoreClock = __SYSTEM_CLOCK;/* System Core Clock Frequency */
/**
* Update SystemCoreClock variable
*
* @param none
* @return none
*
* @brief Updates the SystemCoreClock with current core Clock
* retrieved from cpu registers.
* @note Read the EC core clock divider from the PCR block's processor
* clock control register. Actual EC core frequency is 48MHz / proc_clock_control[7:0].
*/
void SystemCoreClockUpdate (void)
{
uint32_t cpu_clk_div;
SystemCoreClock = __SYSTEM_CLOCK;
cpu_clk_div = PCR->PROC_CLK_CNTRL;
if (cpu_clk_div) {
SystemCoreClock = __SYSTEM_CLOCK / cpu_clk_div;
}
}
/**
* Initialize the system
*
* @param none
* @return none
*
* @brief Setup the microcontroller system.
* Initialize the System.
* @note SystemInit is usually called from early startup code before
* C/C++ library initialization. It is used for early hardware initialization
* such as clocks, FPU, debug hardware, etc.
*/
void SystemInit (void)
{
#if (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2) | /* set CP10 Full Access */
(3UL << 11*2) ); /* set CP11 Full Access */
#endif
#ifdef UNALIGNED_SUPPORT_DISABLE
SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
#endif
/* Program device PCR Processor Clock Control divider to set the EC core clock */
PCR->PROC_CLK_CNTRL = (EC_INIT_CLK_DIV);
SystemCoreClock = ( __SYSTEM_CLOCK / (EC_INIT_CLK_DIV) );
}
| bsd-3-clause |
iot-chalmers/a2-synchrotron | a2-synchrotron-contiki/examples/z1/test-relay-phidget.c | 3 | 2648 | /*
* Copyright (c) 2011, Zolertia(TM) is a trademark of Advancare,SL
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE 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.
*
* This file is part of the Contiki operating system.
*
*/
/**
* \file
* A quick program for testing a generic relay device connected in the
* phidget port
* \author
* Antonio Lignan <alinan@zolertia.com>
*/
#include <stdio.h>
#include "contiki.h"
#include "dev/relay-phidget.h"
#if 1
#define PRINTF(...) printf(__VA_ARGS__)
#else
#define PRINTF(...)
#endif
#if 0
#define PRINTFDEBUG(...) printf(__VA_ARGS__)
#else
#define PRINTFDEBUG(...)
#endif
#define RELAY_INTERVAL (CLOCK_SECOND)
PROCESS(test_process, "Relay test process");
AUTOSTART_PROCESSES(&test_process);
/*---------------------------------------------------------------------------*/
static struct etimer et;
static int8_t status;
PROCESS_THREAD(test_process, ev, data)
{
PROCESS_BEGIN();
/* Selects P6.7 as control pin of the relay module */
relay_enable(7);
while(1) {
etimer_set(&et, RELAY_INTERVAL);
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
status = relay_toggle();
PRINTF("Relay [%d]\n", status);
}
PROCESS_END();
}
| bsd-3-clause |
dai1741/forked_from_MikuMikuDroid | MikuMikuDroid/jni/bullet/MiniCL/MiniCLTaskScheduler.cpp | 4 | 15732 | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
//#define __CELLOS_LV2__ 1
#define __BT_SKIP_UINT64_H 1
#define USE_SAMPLE_PROCESS 1
#ifdef USE_SAMPLE_PROCESS
#include "MiniCLTaskScheduler.h"
#include <stdio.h>
#ifdef __SPU__
void SampleThreadFunc(void* userPtr,void* lsMemory)
{
//do nothing
printf("hello world\n");
}
void* SamplelsMemoryFunc()
{
//don't create local store memory, just return 0
return 0;
}
#else
#include "BulletMultiThreaded/btThreadSupportInterface.h"
//# include "SPUAssert.h"
#include <string.h>
#include "MiniCL/cl_platform.h"
extern "C" {
extern char SPU_SAMPLE_ELF_SYMBOL[];
}
MiniCLTaskScheduler::MiniCLTaskScheduler(btThreadSupportInterface* threadInterface, int maxNumOutstandingTasks)
:m_threadInterface(threadInterface),
m_maxNumOutstandingTasks(maxNumOutstandingTasks)
{
m_taskBusy.resize(m_maxNumOutstandingTasks);
m_spuSampleTaskDesc.resize(m_maxNumOutstandingTasks);
m_kernels.resize(0);
for (int i = 0; i < m_maxNumOutstandingTasks; i++)
{
m_taskBusy[i] = false;
}
m_numBusyTasks = 0;
m_currentTask = 0;
m_initialized = false;
m_threadInterface->startSPU();
}
MiniCLTaskScheduler::~MiniCLTaskScheduler()
{
m_threadInterface->stopSPU();
}
void MiniCLTaskScheduler::initialize()
{
#ifdef DEBUG_SPU_TASK_SCHEDULING
printf("MiniCLTaskScheduler::initialize()\n");
#endif //DEBUG_SPU_TASK_SCHEDULING
for (int i = 0; i < m_maxNumOutstandingTasks; i++)
{
m_taskBusy[i] = false;
}
m_numBusyTasks = 0;
m_currentTask = 0;
m_initialized = true;
}
void MiniCLTaskScheduler::issueTask(int firstWorkUnit, int lastWorkUnit, MiniCLKernel* kernel)
{
#ifdef DEBUG_SPU_TASK_SCHEDULING
printf("MiniCLTaskScheduler::issueTask (m_currentTask= %d\)n", m_currentTask);
#endif //DEBUG_SPU_TASK_SCHEDULING
m_taskBusy[m_currentTask] = true;
m_numBusyTasks++;
MiniCLTaskDesc& taskDesc = m_spuSampleTaskDesc[m_currentTask];
{
// send task description in event message
taskDesc.m_firstWorkUnit = firstWorkUnit;
taskDesc.m_lastWorkUnit = lastWorkUnit;
taskDesc.m_kernel = kernel;
//some bookkeeping to recognize finished tasks
taskDesc.m_taskId = m_currentTask;
// for (int i=0;i<MINI_CL_MAX_ARG;i++)
for (unsigned int i=0; i < kernel->m_numArgs; i++)
{
taskDesc.m_argSizes[i] = kernel->m_argSizes[i];
if (taskDesc.m_argSizes[i])
{
taskDesc.m_argData[i] = kernel->m_argData[i];
// memcpy(&taskDesc.m_argData[i],&argData[MINICL_MAX_ARGLENGTH*i],taskDesc.m_argSizes[i]);
}
}
}
m_threadInterface->sendRequest(1, (ppu_address_t) &taskDesc, m_currentTask);
// if all tasks busy, wait for spu event to clear the task.
if (m_numBusyTasks >= m_maxNumOutstandingTasks)
{
unsigned int taskId;
unsigned int outputSize;
for (int i=0;i<m_maxNumOutstandingTasks;i++)
{
if (m_taskBusy[i])
{
taskId = i;
break;
}
}
m_threadInterface->waitForResponse(&taskId, &outputSize);
//printf("PPU: after issue, received event: %u %d\n", taskId, outputSize);
postProcess(taskId, outputSize);
m_taskBusy[taskId] = false;
m_numBusyTasks--;
}
// find new task buffer
for (int i = 0; i < m_maxNumOutstandingTasks; i++)
{
if (!m_taskBusy[i])
{
m_currentTask = i;
break;
}
}
}
///Optional PPU-size post processing for each task
void MiniCLTaskScheduler::postProcess(int taskId, int outputSize)
{
}
void MiniCLTaskScheduler::flush()
{
#ifdef DEBUG_SPU_TASK_SCHEDULING
printf("\nSpuCollisionTaskProcess::flush()\n");
#endif //DEBUG_SPU_TASK_SCHEDULING
// all tasks are issued, wait for all tasks to be complete
while(m_numBusyTasks > 0)
{
// Consolidating SPU code
unsigned int taskId;
unsigned int outputSize;
for (int i=0;i<m_maxNumOutstandingTasks;i++)
{
if (m_taskBusy[i])
{
taskId = i;
break;
}
}
{
m_threadInterface->waitForResponse(&taskId, &outputSize);
}
//printf("PPU: flushing, received event: %u %d\n", taskId, outputSize);
postProcess(taskId, outputSize);
m_taskBusy[taskId] = false;
m_numBusyTasks--;
}
}
typedef void (*MiniCLKernelLauncher0)(int);
typedef void (*MiniCLKernelLauncher1)(void*, int);
typedef void (*MiniCLKernelLauncher2)(void*, void*, int);
typedef void (*MiniCLKernelLauncher3)(void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher4)(void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher5)(void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher6)(void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher7)(void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher8)(void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher9)(void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher10)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher11)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher12)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher13)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher14)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher15)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
typedef void (*MiniCLKernelLauncher16)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int);
static void kernelLauncher0(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher0)(taskDesc->m_kernel->m_launcher))(guid);
}
static void kernelLauncher1(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher1)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
guid);
}
static void kernelLauncher2(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher2)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
guid);
}
static void kernelLauncher3(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher3)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
guid);
}
static void kernelLauncher4(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher4)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
guid);
}
static void kernelLauncher5(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher5)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
guid);
}
static void kernelLauncher6(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher6)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
guid);
}
static void kernelLauncher7(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher7)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
guid);
}
static void kernelLauncher8(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher8)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
guid);
}
static void kernelLauncher9(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher9)(taskDesc->m_kernel->m_pCode))( taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
guid);
}
static void kernelLauncher10(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher10)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
guid);
}
static void kernelLauncher11(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher11)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
taskDesc->m_argData[10],
guid);
}
static void kernelLauncher12(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher12)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
taskDesc->m_argData[10],
taskDesc->m_argData[11],
guid);
}
static void kernelLauncher13(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher13)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
taskDesc->m_argData[10],
taskDesc->m_argData[11],
taskDesc->m_argData[12],
guid);
}
static void kernelLauncher14(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher14)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
taskDesc->m_argData[10],
taskDesc->m_argData[11],
taskDesc->m_argData[12],
taskDesc->m_argData[13],
guid);
}
static void kernelLauncher15(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher15)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
taskDesc->m_argData[10],
taskDesc->m_argData[11],
taskDesc->m_argData[12],
taskDesc->m_argData[13],
taskDesc->m_argData[14],
guid);
}
static void kernelLauncher16(MiniCLTaskDesc* taskDesc, int guid)
{
((MiniCLKernelLauncher16)(taskDesc->m_kernel->m_pCode))(taskDesc->m_argData[0],
taskDesc->m_argData[1],
taskDesc->m_argData[2],
taskDesc->m_argData[3],
taskDesc->m_argData[4],
taskDesc->m_argData[5],
taskDesc->m_argData[6],
taskDesc->m_argData[7],
taskDesc->m_argData[8],
taskDesc->m_argData[9],
taskDesc->m_argData[10],
taskDesc->m_argData[11],
taskDesc->m_argData[12],
taskDesc->m_argData[13],
taskDesc->m_argData[14],
taskDesc->m_argData[15],
guid);
}
static kernelLauncherCB spLauncherList[MINI_CL_MAX_ARG+1] =
{
kernelLauncher0,
kernelLauncher1,
kernelLauncher2,
kernelLauncher3,
kernelLauncher4,
kernelLauncher5,
kernelLauncher6,
kernelLauncher7,
kernelLauncher8,
kernelLauncher9,
kernelLauncher10,
kernelLauncher11,
kernelLauncher12,
kernelLauncher13,
kernelLauncher14,
kernelLauncher15,
kernelLauncher16
};
void MiniCLKernel::updateLauncher()
{
m_launcher = spLauncherList[m_numArgs];
}
struct MiniCLKernelDescEntry
{
void* pCode;
char* pName;
};
static MiniCLKernelDescEntry spKernelDesc[256];
static int sNumKernelDesc = 0;
MiniCLKernelDesc::MiniCLKernelDesc(void* pCode, char* pName)
{
for(int i = 0; i < sNumKernelDesc; i++)
{
if(!strcmp(pName, spKernelDesc[i].pName))
{ // already registered
btAssert(spKernelDesc[i].pCode == pCode);
return;
}
}
spKernelDesc[sNumKernelDesc].pCode = pCode;
spKernelDesc[sNumKernelDesc].pName = pName;
sNumKernelDesc++;
}
MiniCLKernel* MiniCLKernel::registerSelf()
{
m_scheduler->registerKernel(this);
for(int i = 0; i < sNumKernelDesc; i++)
{
if(!strcmp(m_name, spKernelDesc[i].pName))
{
m_pCode = spKernelDesc[i].pCode;
return this;
}
}
return NULL;
}
#endif
#endif //USE_SAMPLE_PROCESS
| bsd-3-clause |
NDManh/numbbo | code-experiments/test/unit-test/test_mo_generics.c | 4 | 1787 | #include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include "cmocka.h"
#include "coco.h"
/**
* Tests the function mo_get_norm.
*/
static void test_mo_get_norm(void **state) {
double norm = 0;
double first[40] = { 0.51, 0.51, 0.53, 0.54, 0.63, 0.83, 0.25, 0.05, 0.60, 0.30, 0.01, 0.97, 0.55, 0.39,
0.85, 0.49, 0.86, 0.63, 0.85, 0.63, 0.73, 0.49, 0.09, 0.40, 0.66, 0.45, 0.99, 0.83, 0.92, 0.42, 0.29,
0.18, 0.75, 0.81, 0.57, 0.11, 0.89, 0.61, 0.03, 0.40 };
double second[40] = { 0.46, 0.11, 0.47, 0.51, 0.05, 0.18, 0.41, 0.03, 0.62, 0.54, 0.30, 0.21, 0.13, 0.47,
0.23, 0.39, 0.93, 0.52, 0.21, 0.38, 0.14, 0.54, 0.67, 0.02, 0.73, 0.89, 0.32, 0.77, 0.99, 0.76, 0.18,
0.53, 0.84, 0.94, 0.78, 0.38, 0.78, 0.58, 0.27, 0.57 };
norm = mo_get_norm(first, second, 1);
assert(norm >= 0.04999); assert(norm <= 0.05001);
norm = mo_get_norm(first, second, 2);
assert(norm >= 0.40310); assert(norm <= 0.40312);
norm = mo_get_norm(first, second, 3);
assert(norm >= 0.40754); assert(norm <= 0.40756);
norm = mo_get_norm(first, second, 4);
assert(norm >= 0.40865); assert(norm <= 0.40867);
norm = mo_get_norm(first, second, 5);
assert(norm >= 0.70950); assert(norm <= 0.70952);
norm = mo_get_norm(first, second, 10);
assert(norm >= 1.00493); assert(norm <= 1.00495);
norm = mo_get_norm(first, second, 20);
assert(norm >= 1.65465); assert(norm <= 1.65467);
norm = mo_get_norm(first, second, 40);
assert(norm >= 2.17183); assert(norm <= 2.17185);
(void)state; /* unused */
}
static int test_all_mo_generics(void) {
const struct CMUnitTest tests[] = {
cmocka_unit_test(test_mo_get_norm)
};
return cmocka_run_group_tests(tests, NULL, NULL);
}
| bsd-3-clause |
JakubBrachTieto/openthread | examples/platforms/kw41z/uart.c | 5 | 5896 | /*
* Copyright (c) 2017, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file implements the OpenThread platform abstraction for UART communication.
*
*/
#include <stdint.h>
#include "fsl_device_registers.h"
#include <stddef.h>
#include <stdint.h>
#include <utils/code_utils.h>
#include "openthread/types.h"
#include "openthread/platform/uart.h"
#include "fsl_clock.h"
#include "fsl_port.h"
#include "fsl_lpuart.h"
enum
{
kPlatformClock = 32000000,
kBaudRate = 115200,
kReceiveBufferSize = 256,
};
static void processReceive();
static void processTransmit();
static const uint8_t *sTransmitBuffer = NULL;
static uint16_t sTransmitLength = 0;
static bool sTransmitDone = false;
typedef struct RecvBuffer
{
// The data buffer
uint8_t mBuffer[kReceiveBufferSize];
// The offset of the first item written to the list.
uint16_t mHead;
// The offset of the next item to be written to the list.
uint16_t mTail;
} RecvBuffer;
static RecvBuffer sReceive;
otError otPlatUartEnable(void)
{
lpuart_config_t config;
sReceive.mHead = 0;
sReceive.mTail = 0;
/* Pin MUX */
CLOCK_EnableClock(kCLOCK_PortC);
PORT_SetPinMux(PORTC, 6, kPORT_MuxAlt4);
PORT_SetPinMux(PORTC, 7, kPORT_MuxAlt4);
/* Set OSCERCLK as LPUART Rx/Tx clock */
CLOCK_SetLpuartClock(2);
LPUART_GetDefaultConfig(&config);
config.enableRx = 1;
config.enableTx = 1;
config.baudRate_Bps = kBaudRate;
LPUART_Init(LPUART0, &config, kPlatformClock);
LPUART_EnableInterrupts(LPUART0, kLPUART_RxDataRegFullInterruptEnable);
NVIC_ClearPendingIRQ(LPUART0_IRQn);
NVIC_EnableIRQ(LPUART0_IRQn);
return OT_ERROR_NONE;
}
otError otPlatUartDisable(void)
{
NVIC_DisableIRQ(LPUART0_IRQn);
return OT_ERROR_NONE;
}
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
{
otError error = OT_ERROR_NONE;
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
sTransmitBuffer = aBuf + 1;
sTransmitLength = aBufLength - 1;
sTransmitDone = false;
LPUART_WriteByte(LPUART0, *aBuf);
LPUART_ClearStatusFlags(LPUART0, kLPUART_TxDataRegEmptyFlag);
LPUART_EnableInterrupts(LPUART0, kLPUART_TxDataRegEmptyInterruptEnable);
exit:
return error;
}
static void processTransmit(void)
{
if (sTransmitBuffer && sTransmitDone)
{
sTransmitDone = false;
sTransmitBuffer = NULL;
otPlatUartSendDone();
}
return;
}
void kw41zUartProcess(void)
{
processReceive();
processTransmit();
}
static void processReceive(void)
{
// Copy tail to prevent multiple reads
uint16_t tail = sReceive.mTail;
if (sReceive.mHead > tail)
{
otPlatUartReceived(sReceive.mBuffer + sReceive.mHead, kReceiveBufferSize - sReceive.mHead);
// Reset the buffer mHead back to zero
sReceive.mHead = 0;
}
if (sReceive.mHead != tail)
{
otPlatUartReceived(sReceive.mBuffer + sReceive.mHead, tail - sReceive.mHead);
// Set mHead to the local tail we have cached
sReceive.mHead = tail;
}
}
void LPUART0_IRQHandler(void)
{
uint32_t interrupts = LPUART_GetEnabledInterrupts(LPUART0);
uint8_t rx_data;
/* Check if data was received */
while (LPUART_GetStatusFlags(LPUART0) & (kLPUART_RxDataRegFullFlag))
{
rx_data = LPUART_ReadByte(LPUART0);
LPUART_ClearStatusFlags(LPUART0, kLPUART_RxDataRegFullFlag);
if (sReceive.mHead != (sReceive.mTail + 1) % kReceiveBufferSize)
{
sReceive.mBuffer[sReceive.mTail] = rx_data;
sReceive.mTail = (sReceive.mTail + 1) % kReceiveBufferSize;
}
}
/* Check if data Tx has end */
if ((LPUART_GetStatusFlags(LPUART0) & kLPUART_TxDataRegEmptyFlag) &&
(interrupts & kLPUART_TxDataRegEmptyInterruptEnable))
{
if (sTransmitLength)
{
sTransmitLength--;
LPUART_WriteByte(LPUART0, *sTransmitBuffer++);
}
else if (!sTransmitDone)
{
sTransmitDone = true;
LPUART_DisableInterrupts(LPUART0, kLPUART_TxDataRegEmptyInterruptEnable);
}
}
if (LPUART_GetStatusFlags(LPUART0) & kLPUART_RxOverrunFlag)
{
LPUART_ClearStatusFlags(LPUART0, kLPUART_RxOverrunFlag);
}
}
| bsd-3-clause |
buffer51/OpenBLAS | lapack-netlib/SRC/dla_lin_berr.f | 5 | 4490 | *> \brief \b DLA_LIN_BERR computes a component-wise relative backward error.
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download DLA_LIN_BERR + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dla_lin_berr.f">
*> [TGZ]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dla_lin_berr.f">
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dla_lin_berr.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
*
* SUBROUTINE DLA_LIN_BERR ( N, NZ, NRHS, RES, AYB, BERR )
*
* .. Scalar Arguments ..
* INTEGER N, NZ, NRHS
* ..
* .. Array Arguments ..
* DOUBLE PRECISION AYB( N, NRHS ), BERR( NRHS )
* DOUBLE PRECISION RES( N, NRHS )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> DLA_LIN_BERR computes component-wise relative backward error from
*> the formula
*> max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
*> where abs(Z) is the component-wise absolute value of the matrix
*> or vector Z.
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The number of linear equations, i.e., the order of the
*> matrix A. N >= 0.
*> \endverbatim
*>
*> \param[in] NZ
*> \verbatim
*> NZ is INTEGER
*> We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to
*> guard against spuriously zero residuals. Default value is N.
*> \endverbatim
*>
*> \param[in] NRHS
*> \verbatim
*> NRHS is INTEGER
*> The number of right hand sides, i.e., the number of columns
*> of the matrices AYB, RES, and BERR. NRHS >= 0.
*> \endverbatim
*>
*> \param[in] RES
*> \verbatim
*> RES is DOUBLE PRECISION array, dimension (N,NRHS)
*> The residual matrix, i.e., the matrix R in the relative backward
*> error formula above.
*> \endverbatim
*>
*> \param[in] AYB
*> \verbatim
*> AYB is DOUBLE PRECISION array, dimension (N, NRHS)
*> The denominator in the relative backward error formula above, i.e.,
*> the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B
*> are from iterative refinement (see dla_gerfsx_extended.f).
*> \endverbatim
*>
*> \param[out] BERR
*> \verbatim
*> BERR is DOUBLE PRECISION array, dimension (NRHS)
*> The component-wise relative backward error from the formula above.
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date December 2016
*
*> \ingroup doubleOTHERcomputational
*
* =====================================================================
SUBROUTINE DLA_LIN_BERR ( N, NZ, NRHS, RES, AYB, BERR )
*
* -- LAPACK computational routine (version 3.7.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* December 2016
*
* .. Scalar Arguments ..
INTEGER N, NZ, NRHS
* ..
* .. Array Arguments ..
DOUBLE PRECISION AYB( N, NRHS ), BERR( NRHS )
DOUBLE PRECISION RES( N, NRHS )
* ..
*
* =====================================================================
*
* .. Local Scalars ..
DOUBLE PRECISION TMP
INTEGER I, J
* ..
* .. Intrinsic Functions ..
INTRINSIC ABS, MAX
* ..
* .. External Functions ..
EXTERNAL DLAMCH
DOUBLE PRECISION DLAMCH
DOUBLE PRECISION SAFE1
* ..
* .. Executable Statements ..
*
* Adding SAFE1 to the numerator guards against spuriously zero
* residuals. A similar safeguard is in the SLA_yyAMV routine used
* to compute AYB.
*
SAFE1 = DLAMCH( 'Safe minimum' )
SAFE1 = (NZ+1)*SAFE1
DO J = 1, NRHS
BERR(J) = 0.0D+0
DO I = 1, N
IF (AYB(I,J) .NE. 0.0D+0) THEN
TMP = (SAFE1+ABS(RES(I,J)))/AYB(I,J)
BERR(J) = MAX( BERR(J), TMP )
END IF
*
* If AYB is exactly 0.0 (and if computed by SLA_yyAMV), then we know
* the true residual also must be exactly 0.0.
*
END DO
END DO
END
| bsd-3-clause |
PKRoma/redis | src/childinfo.c | 7 | 7169 | /*
* Copyright (c) 2016, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "server.h"
#include <unistd.h>
#include <fcntl.h>
typedef struct {
size_t keys;
size_t cow;
monotime cow_updated;
double progress;
childInfoType information_type; /* Type of information */
} child_info_data;
/* Open a child-parent channel used in order to move information about the
* RDB / AOF saving process from the child to the parent (for instance
* the amount of copy on write memory used) */
void openChildInfoPipe(void) {
if (anetPipe(server.child_info_pipe, O_NONBLOCK, 0) == -1) {
/* On error our two file descriptors should be still set to -1,
* but we call anyway closeChildInfoPipe() since can't hurt. */
closeChildInfoPipe();
} else {
server.child_info_nread = 0;
}
}
/* Close the pipes opened with openChildInfoPipe(). */
void closeChildInfoPipe(void) {
if (server.child_info_pipe[0] != -1 ||
server.child_info_pipe[1] != -1)
{
close(server.child_info_pipe[0]);
close(server.child_info_pipe[1]);
server.child_info_pipe[0] = -1;
server.child_info_pipe[1] = -1;
server.child_info_nread = 0;
}
}
/* Send save data to parent. */
void sendChildInfoGeneric(childInfoType info_type, size_t keys, double progress, char *pname) {
if (server.child_info_pipe[1] == -1) return;
static monotime cow_updated = 0;
static uint64_t cow_update_cost = 0;
static size_t cow = 0;
static size_t peak_cow = 0;
static size_t update_count = 0;
static unsigned long long sum_cow = 0;
child_info_data data = {0}; /* zero everything, including padding to satisfy valgrind */
/* When called to report current info, we need to throttle down CoW updates as they
* can be very expensive. To do that, we measure the time it takes to get a reading
* and schedule the next reading to happen not before time*CHILD_COW_COST_FACTOR
* passes. */
monotime now = getMonotonicUs();
if (info_type != CHILD_INFO_TYPE_CURRENT_INFO ||
!cow_updated ||
now - cow_updated > cow_update_cost * CHILD_COW_DUTY_CYCLE)
{
cow = zmalloc_get_private_dirty(-1);
cow_updated = getMonotonicUs();
cow_update_cost = cow_updated - now;
if (cow > peak_cow) peak_cow = cow;
sum_cow += cow;
update_count++;
int cow_info = (info_type != CHILD_INFO_TYPE_CURRENT_INFO);
if (cow || cow_info) {
serverLog(cow_info ? LL_NOTICE : LL_VERBOSE,
"Fork CoW for %s: current %zu MB, peak %zu MB, average %llu MB",
pname, cow>>20, peak_cow>>20, (sum_cow/update_count)>>20);
}
}
data.information_type = info_type;
data.keys = keys;
data.cow = cow;
data.cow_updated = cow_updated;
data.progress = progress;
ssize_t wlen = sizeof(data);
if (write(server.child_info_pipe[1], &data, wlen) != wlen) {
/* Nothing to do on error, this will be detected by the other side. */
}
}
/* Update Child info. */
void updateChildInfo(childInfoType information_type, size_t cow, monotime cow_updated, size_t keys, double progress) {
if (cow > server.stat_current_cow_peak) server.stat_current_cow_peak = cow;
if (information_type == CHILD_INFO_TYPE_CURRENT_INFO) {
server.stat_current_cow_bytes = cow;
server.stat_current_cow_updated = cow_updated;
server.stat_current_save_keys_processed = keys;
if (progress != -1) server.stat_module_progress = progress;
} else if (information_type == CHILD_INFO_TYPE_AOF_COW_SIZE) {
server.stat_aof_cow_bytes = server.stat_current_cow_peak;
} else if (information_type == CHILD_INFO_TYPE_RDB_COW_SIZE) {
server.stat_rdb_cow_bytes = server.stat_current_cow_peak;
} else if (information_type == CHILD_INFO_TYPE_MODULE_COW_SIZE) {
server.stat_module_cow_bytes = server.stat_current_cow_peak;
}
}
/* Read child info data from the pipe.
* if complete data read into the buffer,
* data is stored into *buffer, and returns 1.
* otherwise, the partial data is left in the buffer, waiting for the next read, and returns 0. */
int readChildInfo(childInfoType *information_type, size_t *cow, monotime *cow_updated, size_t *keys, double* progress) {
/* We are using here a static buffer in combination with the server.child_info_nread to handle short reads */
static child_info_data buffer;
ssize_t wlen = sizeof(buffer);
/* Do not overlap */
if (server.child_info_nread == wlen) server.child_info_nread = 0;
int nread = read(server.child_info_pipe[0], (char *)&buffer + server.child_info_nread, wlen - server.child_info_nread);
if (nread > 0) {
server.child_info_nread += nread;
}
/* We have complete child info */
if (server.child_info_nread == wlen) {
*information_type = buffer.information_type;
*cow = buffer.cow;
*cow_updated = buffer.cow_updated;
*keys = buffer.keys;
*progress = buffer.progress;
return 1;
} else {
return 0;
}
}
/* Receive info data from child. */
void receiveChildInfo(void) {
if (server.child_info_pipe[0] == -1) return;
size_t cow;
monotime cow_updated;
size_t keys;
double progress;
childInfoType information_type;
/* Drain the pipe and update child info so that we get the final message. */
while (readChildInfo(&information_type, &cow, &cow_updated, &keys, &progress)) {
updateChildInfo(information_type, cow, cow_updated, keys, progress);
}
}
| bsd-3-clause |
RabadanLab/MITKats | Modules/IGT/Testing/mitkNavigationDataObjectVisualizationFilterTest.cpp | 7 | 22338 | /*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "mitkNavigationDataObjectVisualizationFilter.h"
#include "mitkNavigationData.h"
#include "mitkTestingMacros.h"
#include <mitkTestingConfig.h>
#include <mitkTestFixture.h>
#include <vtkTransform.h>
#include <iostream>
#include "mitkSurface.h"
/**Documentation
* test for the class "NavigationDataObjectVisualizationFilter".
*/
class mitkNavigationDataObjectVisualizationFilterTestSuite : public mitk::TestFixture
{
// List of Tests
CPPUNIT_TEST_SUITE(mitkNavigationDataObjectVisualizationFilterTestSuite);
//Constructor
MITK_TEST(TestInitialize);
MITK_TEST(TestInput);
MITK_TEST(TestOutput);
MITK_TEST(TestRepresentationObjects);
MITK_TEST(TestTransforms);
MITK_TEST(TestMessWithRepresentationObjects);
MITK_TEST(TestThirdInput);
MITK_TEST(TestSetTransformPosition);
MITK_TEST(TestSetTransformOrientation);
MITK_TEST(TestConvenienceSetTransformOrientation);
MITK_TEST(TestUpdateOrientation);
CPPUNIT_TEST_SUITE_END();
// Used Variables
private:
mitk::NavigationDataObjectVisualizationFilter::Pointer myFilter;
mitk::NavigationData::PositionType initialPos1, initialPos2;
mitk::NavigationData::OrientationType initialOri1;
mitk::NavigationData::OrientationType initialOri2;
mitk::ScalarType initialError1;
mitk::ScalarType initialError2;
bool initialValid1;
bool initialValid2;
mitk::NavigationData::Pointer nd1;
mitk::NavigationData::Pointer nd2;
// Test setting BaseData
mitk::Surface::Pointer mitkToolData1 ;
mitk::Surface::Pointer mitkToolData2 ;
//dummy for test; will not be set but used to test find
mitk::Surface::Pointer mitkToolDataDummy ;
//and the Dummy NavigationData for this
mitk::NavigationData::OrientationType initialOriDummy;
mitk::NavigationData::PositionType initialPosDummy;
mitk::ScalarType initialErrorDummy;
bool initialValidDummy;
mitk::NavigationData::Pointer ndDummy ;
mitk::NavigationData* output;
mitk::AffineTransform3D::Pointer affineTransform1;
mitk::AffineTransform3D::OutputVectorType offset1;
mitk::AffineTransform3D::Pointer affineTransform2;
mitk::AffineTransform3D::OutputVectorType offset2;
mitk::AffineTransform3D::MatrixType::InternalMatrixType m1;
mitk::AffineTransform3D::MatrixType::InternalMatrixType m2;
public:
// Set up for variables
void setUp() override
{
// -------------- Setup for Filter ---------------------------
/* create helper objects: navigation data with position as origin, zero quaternion, zero error and data valid */
myFilter = mitk::NavigationDataObjectVisualizationFilter::New();
mitk::FillVector3D(initialPos1, 1.1, 2.2, 3.3);
mitk::FillVector3D(initialPos2, 5.0, 6.0, 7.0);
mitk::FillVector4D(initialOri1, 0.1, 0.2, 0.3, 0.4);
mitk::FillVector4D(initialOri2,0.5, 0.6, 0.7, 0.8);
initialError1=0.0;
initialError2=5.0;
initialValid1 = true;
initialValid2 = true;
//Set Navigation Data
nd1 = mitk::NavigationData::New();
nd1->SetPosition(initialPos1);
nd1->SetOrientation(initialOri1);
nd1->SetPositionAccuracy(initialError1);
nd1->SetDataValid(initialValid1);
nd2 = mitk::NavigationData::New();
nd2->SetPosition(initialPos2);
nd2->SetOrientation(initialOri2);
nd2->SetPositionAccuracy(initialError2);
nd2->SetDataValid(initialValid2);
//Set Input
myFilter->SetInput(nd1);
myFilter->SetInput(1, nd2);
output = myFilter->GetOutput();
// -------------------------- Setup for TestData ----------------------
// Test setting BaseData
mitkToolData1 = mitk::Surface::New();
mitkToolData2 = mitk::Surface::New();
//dummy for test; will not be set but used to test find
mitkToolDataDummy = mitk::Surface::New();
//and the Dummy NavigationData for this
mitk::FillVector3D(initialPosDummy, 8.8, 9.9, 10.10);
mitk::FillVector4D(initialOriDummy,1.1, 2.2, 3.3, 4.4);
initialErrorDummy=10.0;
initialValidDummy=true;
ndDummy = mitk::NavigationData::New();
ndDummy->SetPosition(initialPosDummy);
ndDummy->SetOrientation(initialOriDummy);
ndDummy->SetPositionAccuracy(initialErrorDummy);
ndDummy->SetDataValid(initialValidDummy);
//now we have ndDummy and mitkToolDataDummy to test with
}
void tearDown() override
{
}
// Test functions
void TestInitialize(){
// first test: did this work?
CPPUNIT_ASSERT_MESSAGE("Testing instantiation", myFilter.IsNotNull());
}
void TestInput(){
//testing the input
CPPUNIT_ASSERT_MESSAGE("Testing Set-/GetInput() input 1 without index",myFilter->GetInput() == nd1);
CPPUNIT_ASSERT_MESSAGE("Testing Set-/GetInput() input 1", myFilter->GetInput(0) == nd1);
CPPUNIT_ASSERT_MESSAGE( "Testing Set-/GetInput() input 2", myFilter->GetInput(1) == nd2);
CPPUNIT_ASSERT_MESSAGE("Testing GetNumberOfToolRepresentations()", myFilter->GetNumberOfToolRepresentations() == 0);
}
void TestOutput(){
//testing getting the output
CPPUNIT_ASSERT_MESSAGE("Testing GetOutput()", output != NULL);
CPPUNIT_ASSERT_MESSAGE("Testing GetOutput() == GetOutput()", output == myFilter->GetOutput());
CPPUNIT_ASSERT_MESSAGE("Testing GetOutput() != GetOutput(1)", output != myFilter->GetOutput(1));
}
void TestRepresentationObjects(){
//setting nodes
myFilter->SetRepresentationObject(0, mitkToolData1);
CPPUNIT_ASSERT_MESSAGE( "Testing SetRepresentationObject()/GetRepresentationObject() node 1", myFilter->GetRepresentationObject(0) == mitkToolData1);
CPPUNIT_ASSERT_MESSAGE("Testing GetNumberOfToolRepresentations() after adding first tool", myFilter->GetNumberOfToolRepresentations() == 1);
myFilter->SetRepresentationObject(1, mitkToolData2);
CPPUNIT_ASSERT_MESSAGE( "Testing SetRepresentationObject() node 2", myFilter->GetRepresentationObject(1) == mitkToolData2);
CPPUNIT_ASSERT_MESSAGE( "Testing GetNumberOfToolRepresentations() after adding second tool", myFilter->GetNumberOfToolRepresentations() == 2);
//getting nodes
CPPUNIT_ASSERT_MESSAGE("Testing GetRepresentationObject() node 1", myFilter->GetRepresentationObject(0) == mitkToolData1);
CPPUNIT_ASSERT_MESSAGE( "Testing GetRepresentationObject() != Dummy node", myFilter->GetRepresentationObject(0) != mitkToolDataDummy);
CPPUNIT_ASSERT_MESSAGE( "Testing GetRepresentationObject() node 2", myFilter->GetRepresentationObject(1) == mitkToolData2);
CPPUNIT_ASSERT_MESSAGE( "Testing GetRepresentationObject() != Dummy node", myFilter->GetRepresentationObject(1) != mitkToolDataDummy);
CPPUNIT_ASSERT_MESSAGE("Testing GetRepresentationObject() with out of range parameter", myFilter->GetRepresentationObject(111) == NULL);
}
void TestTransforms(){
myFilter->SetRepresentationObject(0, mitkToolData1);
myFilter->SetRepresentationObject(1, mitkToolData2);
//Process
myFilter->Update();
affineTransform1 = mitkToolData1->GetGeometry()->GetIndexToWorldTransform();
offset1 = affineTransform1->GetOffset();
affineTransform2 = mitkToolData2->GetGeometry()->GetIndexToWorldTransform();
offset2 = affineTransform2->GetOffset();
m1 = affineTransform1->GetMatrix().GetVnlMatrix();
m2 = affineTransform2->GetMatrix().GetVnlMatrix();
//now check it there are data connected to the nodes with the according orientation and offsets
CPPUNIT_ASSERT_MESSAGE("Testing Offset position 1", offset1.GetVnlVector()==initialPos1.GetVnlVector());
CPPUNIT_ASSERT_MESSAGE("Testing Offset position 2", offset2.GetVnlVector()==initialPos2.GetVnlVector());
MITK_TEST_OUTPUT( << "\n initOrient1="<<initialOri1<<" affineTransform1->GetVnlMatrix():\n "<< m1);
MITK_TEST_OUTPUT( << "\n initOrient2=" << initialOri2 << " affineTransform2->GetVnlMatrix():\n " << m2);
}
void TestMessWithRepresentationObjects(){
myFilter->SetRepresentationObject(0, mitkToolData1);
myFilter->SetRepresentationObject(1, mitkToolData2);
//Process
myFilter->Update();
affineTransform1 = mitkToolData1->GetGeometry()->GetIndexToWorldTransform();
offset1 = affineTransform1->GetOffset();
affineTransform2 = mitkToolData2->GetGeometry()->GetIndexToWorldTransform();
offset2 = affineTransform2->GetOffset();
m1 = affineTransform1->GetMatrix().GetVnlMatrix();
m2 = affineTransform2->GetMatrix().GetVnlMatrix();
//messing with SetRepresentationObject
//setting nodes
myFilter->SetRepresentationObject(0, mitkToolData2);
CPPUNIT_ASSERT_MESSAGE("Twisting mitkToolData by using SetRepresentationObject() NavigationData 1 with ToolData 2", myFilter->GetRepresentationObject(0) == mitkToolData2);
CPPUNIT_ASSERT_MESSAGE( "Testing GetNumberOfToolRepresentations() == 1", myFilter->GetNumberOfToolRepresentations() == 2);
myFilter->SetRepresentationObject(1, mitkToolData1);
CPPUNIT_ASSERT_MESSAGE("Twisting mitkToolData by using SetRepresentationObject() NavigationData 2 with ToolData 1", myFilter->GetRepresentationObject(1) == mitkToolData1);
CPPUNIT_ASSERT_MESSAGE( "Testing GetNumberOfToolRepresentations() == 2", myFilter->GetNumberOfToolRepresentations() == 2);
//getting nodes
CPPUNIT_ASSERT_MESSAGE("Testing switched BaseData of NavigationData 1 ", myFilter->GetRepresentationObject(0) == mitkToolData2);
CPPUNIT_ASSERT_MESSAGE("Testing GetRepresentationObject() != Dummy node", myFilter->GetRepresentationObject(0) != mitkToolDataDummy);
CPPUNIT_ASSERT_MESSAGE("Testing switched BaseData NavigationData 2", myFilter->GetRepresentationObject(1) == mitkToolData1);
CPPUNIT_ASSERT_MESSAGE("Testing GetRepresentationObject() != Dummy node", myFilter->GetRepresentationObject(1) != mitkToolDataDummy);
//processing update through pipeline
myFilter->Update();
//now check it there are data connected to the nodes with the according orientation and offsets
mitk::AffineTransform3D::Pointer affineTransform1Second = mitkToolData1->GetGeometry()->GetIndexToWorldTransform();
CPPUNIT_ASSERT_MESSAGE( "Testing affineTransform1 after second update", affineTransform1 == affineTransform1Second);
mitk::AffineTransform3D::OutputVectorType offset1Second = affineTransform1->GetOffset();
CPPUNIT_ASSERT_MESSAGE( "Testing offset1 after second update", offset1 == offset1Second);
CPPUNIT_ASSERT_MESSAGE("Testing offset1 equals first update", offset1Second.GetVnlVector()==offset1.GetVnlVector());
mitk::AffineTransform3D::Pointer affineTransform2Second = mitkToolData2->GetGeometry()->GetIndexToWorldTransform();
CPPUNIT_ASSERT_MESSAGE("Testing affineTransform2 after second update", affineTransform2 == affineTransform2Second);
mitk::AffineTransform3D::OutputVectorType offset2Second = affineTransform2->GetOffset();
CPPUNIT_ASSERT_MESSAGE("Testing offset2 after second update", offset2 == offset2Second);
CPPUNIT_ASSERT_MESSAGE("Testing offset2 equals first update", offset2Second.GetVnlVector()==offset2.GetVnlVector());
mitk::AffineTransform3D::MatrixType::InternalMatrixType m1Second= affineTransform1Second->GetMatrix().GetVnlMatrix();
MITK_TEST_OUTPUT( <<"\n after second update initOrient1="<<initialOri1<<" affineTransform1->GetVnlMatrix():\n "<< m1Second);
mitk::AffineTransform3D::MatrixType::InternalMatrixType m2Second= affineTransform2Second->GetMatrix().GetVnlMatrix();
MITK_TEST_OUTPUT( << "\n after second update initOrient2="<<initialOri2<<" affineTransform2->GetVnlMatrix():\n "<< m2Second);
}
void TestThirdInput(){
myFilter->SetRepresentationObject(0, mitkToolData1);
myFilter->SetRepresentationObject(1, mitkToolData2);
//Process
myFilter->Update();
//testing adding a third input
myFilter->SetInput(2,ndDummy);
CPPUNIT_ASSERT_MESSAGE("Adding new input and testing GetNumberOfInputs == 3", myFilter->GetNumberOfInputs() == 3);
CPPUNIT_ASSERT_MESSAGE("testing GetNumberOfOutputs == 3", myFilter->GetNumberOfOutputs() == 3);
CPPUNIT_ASSERT_MESSAGE("Testing Input == newly added input", myFilter->GetInput(2) == ndDummy);
CPPUNIT_ASSERT_MESSAGE("Testing GetOutput(2) != NULL", myFilter->GetOutput(2) != NULL);
CPPUNIT_ASSERT_MESSAGE( "Testing GetOutput(2) != GetOutput(1)", myFilter->GetOutput(2) != myFilter->GetOutput(1));
myFilter->SetRepresentationObject(2, mitkToolDataDummy);
CPPUNIT_ASSERT_MESSAGE("Testing GetNumberOfToolRepresentations() after adding latest tool", myFilter->GetNumberOfToolRepresentations() == 3);
CPPUNIT_ASSERT_MESSAGE("Testing Set-/GetRepresentationObject() equals was set", myFilter->GetRepresentationObject(2) == mitkToolDataDummy);
//last time processing update through pipeline
myFilter->Update();
//now check for the new values
mitk::AffineTransform3D::Pointer affineTransformDummy = mitkToolDataDummy->GetGeometry()->GetIndexToWorldTransform();
mitk::AffineTransform3D::OutputVectorType offsetDummy = affineTransformDummy->GetOffset();
CPPUNIT_ASSERT_MESSAGE("Testing Offset latest added tool", offsetDummy.GetVnlVector()==initialPosDummy.GetVnlVector());
mitk::AffineTransform3D::MatrixType::InternalMatrixType m1Latest= affineTransformDummy->GetMatrix().GetVnlMatrix();
MITK_TEST_OUTPUT( << "\n latest initOrient="<<initialOriDummy<<" latest affineTransform->GetVnlMatrix():\n "<< m1Latest);
mitk::Surface::Pointer anotherSurface = mitk::Surface::New();
myFilter->SetRepresentationObject(0, anotherSurface);
CPPUNIT_ASSERT_MESSAGE("Overwriting BaseData index 0", myFilter->GetRepresentationObject(0) == anotherSurface);
}
void TestSetTransformPosition(){
// test Set/GetTransformPosition()
myFilter->SetTransformPosition(0,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(0,true)", myFilter->GetTransformPosition(0)==true);
myFilter->SetTransformPosition(1,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(1,true)", myFilter->GetTransformPosition(1)==true);
myFilter->SetTransformPosition(2,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(2,true)", myFilter->GetTransformPosition(2)==true);
myFilter->SetTransformPosition(3,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(3,true)", myFilter->GetTransformPosition(3)==true);
myFilter->SetTransformPosition(0,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(0,false)", myFilter->GetTransformPosition(0)==false);
myFilter->SetTransformPosition(1,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(1,false)", myFilter->GetTransformPosition(1)==false);
myFilter->SetTransformPosition(2,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(2,false)", myFilter->GetTransformPosition(2)==false);
myFilter->SetTransformPosition(3,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformPosition(3,false)", myFilter->GetTransformPosition(3)==false);
}
void TestSetTransformOrientation(){
// test Set/GetTransformOrientation()
myFilter->SetTransformOrientation(0,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(0,true)", myFilter->GetTransformOrientation(0)==true);
myFilter->SetTransformOrientation(1,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(1,true)", myFilter->GetTransformOrientation(1)==true);
myFilter->SetTransformOrientation(2,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(2,true)", myFilter->GetTransformOrientation(2)==true);
myFilter->SetTransformOrientation(3,true);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(3,true)", myFilter->GetTransformOrientation(3)==true);
myFilter->SetTransformOrientation(0,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(0,false)", myFilter->GetTransformOrientation(0)==false);
myFilter->SetTransformOrientation(1,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(1,false)", myFilter->GetTransformOrientation(1)==false);
myFilter->SetTransformOrientation(2,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(2,false)", myFilter->GetTransformOrientation(2)==false);
myFilter->SetTransformOrientation(3,false);
CPPUNIT_ASSERT_MESSAGE("test Set/GetTransformOrientation(3,false)", myFilter->GetTransformOrientation(3)==false);
}
void TestConvenienceSetTransformOrientation(){
// test the convenience methods to set/getTransformOrientation/Position
myFilter->TransformOrientationOn(0);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOn()", myFilter->GetTransformOrientation(0)==true);
myFilter->TransformOrientationOff(0);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOff()", myFilter->GetTransformOrientation(0)==false);
myFilter->TransformOrientationOff(1);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOff()", myFilter->GetTransformOrientation(1)==false);
myFilter->TransformOrientationOn(1);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOn()", myFilter->GetTransformOrientation(1)==true);
myFilter->TransformOrientationOn(2);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOn()", myFilter->GetTransformOrientation(2)==true);
myFilter->TransformOrientationOff(2);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOff()", myFilter->GetTransformOrientation(2)==false);
myFilter->TransformOrientationOn(3);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOn()", myFilter->GetTransformOrientation(3)==true);
myFilter->TransformOrientationOff(3);
CPPUNIT_ASSERT_MESSAGE("test TransformOrientationOff()", myFilter->GetTransformOrientation(3)==false);
myFilter->TransformPositionOn(0);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOn()", myFilter->GetTransformPosition(0)==true);
myFilter->TransformPositionOff(0);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOff()", myFilter->GetTransformPosition(0)==false);
myFilter->TransformPositionOff(1);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOff()", myFilter->GetTransformPosition(1)==false);
myFilter->TransformPositionOn(1);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOn()", myFilter->GetTransformPosition(1)==true);
myFilter->TransformPositionOn(2);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOn()", myFilter->GetTransformPosition(2)==true);
myFilter->TransformPositionOff(2);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOff()", myFilter->GetTransformPosition(2)==false);
myFilter->TransformPositionOn(3);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOn()", myFilter->GetTransformPosition(3)==true);
myFilter->TransformPositionOff(3);
CPPUNIT_ASSERT_MESSAGE("test TransformPositionOff()", myFilter->GetTransformPosition(3)==false);
}
void TestUpdateOrientation(){
// update position and orientation
mitk::NavigationData::PositionType updatedPos1, updatedPos2, zero;
mitk::FillVector3D(updatedPos1, 3.2, 1.5, 2.8);
mitk::FillVector3D(updatedPos2, 4.3, 5.2, 6.0);
mitk::FillVector3D(zero, 0.0, 0.0, 0.0);
mitk::NavigationData::OrientationType updatedOri1(0.7, 0.5, 0.1, 0.4);
mitk::NavigationData::OrientationType updatedOri2(0.2, 0.7, 0.6, 0.1);
updatedOri1.normalize();
updatedOri2.normalize();
nd1->SetPosition(updatedPos1);
nd1->SetOrientation(updatedOri1);
nd2->SetPosition(updatedPos2);
nd2->SetOrientation(updatedOri2);
myFilter->SetRepresentationObject(0,mitkToolData1);
myFilter->SetRepresentationObject(1,mitkToolData2);
myFilter->TransformPositionOn(0);
myFilter->TransformOrientationOff(0);
myFilter->TransformPositionOff(1);
myFilter->TransformOrientationOn(1);
myFilter->Update();
// test positions and orientations
mitk::AffineTransform3D::Pointer updatedAffineTransform1 = mitkToolData1->GetGeometry()->GetIndexToWorldTransform();
mitk::AffineTransform3D::OutputVectorType updatedOffset1 = updatedAffineTransform1->GetOffset();
CPPUNIT_ASSERT_MESSAGE("Testing updated position 1", mitk::Equal(updatedOffset1.GetVnlVector(),updatedPos1.GetVnlVector()));
mitk::AffineTransform3D::Pointer updatedAffineTransform2 = mitkToolData2->GetGeometry()->GetIndexToWorldTransform();
mitk::AffineTransform3D::OutputVectorType updatedOffset2 = updatedAffineTransform2->GetOffset();
CPPUNIT_ASSERT_MESSAGE( "Testing updated position 2", mitk::Equal(updatedOffset2.GetVnlVector(),zero.GetVnlVector()));
mitk::AffineTransform3D::Pointer identityTransform = mitk::AffineTransform3D::New();
identityTransform->SetIdentity();
mitk::AffineTransform3D::MatrixType identityMatrix = identityTransform->GetMatrix();
mitk::AffineTransform3D::MatrixType uM1 = updatedAffineTransform1->GetMatrix();
CPPUNIT_ASSERT_MESSAGE( "Testing updated orientation 1", mitk::MatrixEqualElementWise(uM1, identityMatrix));
mitk::AffineTransform3D::MatrixType::InternalMatrixType uM2 = updatedAffineTransform2->GetMatrix().GetVnlMatrix();
mitk::AffineTransform3D::MatrixType::InternalMatrixType updatedOriTransform2 = updatedOri2.rotation_matrix_transpose().transpose();
CPPUNIT_ASSERT_MESSAGE("Testing updated orientation 2", mitk::MatrixEqualElementWise(uM2,updatedOriTransform2));
// Test that the second RepresentationObject is updated properly even when
// the first RepresentationObject is invalid
nd2->Modified();
myFilter->SetRepresentationObject(0, NULL);
mitkToolData2->GetGeometry()->SetIdentity();
myFilter->Update();
CPPUNIT_ASSERT_MESSAGE( "Test that the second repr object is updated correctly when the first repr object is invalid",
mitk::MatrixEqualElementWise(mitkToolData2->GetGeometry()->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix(),
updatedOri2.rotation_matrix_transpose().transpose()));
}
};//end class mitkNavigationDataObjectVisualizationFilterTestSuite
MITK_TEST_SUITE_REGISTRATION(mitkNavigationDataObjectVisualizationFilter)
| bsd-3-clause |
csulmone/skia | src/effects/gradients/SkRadialGradient.cpp | 8 | 21467 |
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkRadialGradient.h"
#include "SkRadialGradient_Table.h"
#define kSQRT_TABLE_BITS 11
#define kSQRT_TABLE_SIZE (1 << kSQRT_TABLE_BITS)
#if defined(SK_BUILD_FOR_WIN32) && defined(SK_DEBUG)
#include <stdio.h>
void SkRadialGradient_BuildTable() {
// build it 0..127 x 0..127, so we use 2^15 - 1 in the numerator for our "fixed" table
FILE* file = ::fopen("SkRadialGradient_Table.h", "w");
SkASSERT(file);
::fprintf(file, "static const uint8_t gSqrt8Table[] = {\n");
for (int i = 0; i < kSQRT_TABLE_SIZE; i++) {
if ((i & 15) == 0) {
::fprintf(file, "\t");
}
uint8_t value = SkToU8(SkFixedSqrt(i * SK_Fixed1 / kSQRT_TABLE_SIZE) >> 8);
::fprintf(file, "0x%02X", value);
if (i < kSQRT_TABLE_SIZE-1) {
::fprintf(file, ", ");
}
if ((i & 15) == 15) {
::fprintf(file, "\n");
}
}
::fprintf(file, "};\n");
::fclose(file);
}
#endif
namespace {
void rad_to_unit_matrix(const SkPoint& center, SkScalar radius,
SkMatrix* matrix) {
SkScalar inv = SkScalarInvert(radius);
matrix->setTranslate(-center.fX, -center.fY);
matrix->postScale(inv, inv);
}
typedef void (* RadialShade16Proc)(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
uint16_t* dstC, const uint16_t* cache,
int toggle, int count);
void shadeSpan16_radial_clamp(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
uint16_t* SK_RESTRICT dstC, const uint16_t* SK_RESTRICT cache,
int toggle, int count) {
const uint8_t* SK_RESTRICT sqrt_table = gSqrt8Table;
/* knock these down so we can pin against +- 0x7FFF, which is an
immediate load, rather than 0xFFFF which is slower. This is a
compromise, since it reduces our precision, but that appears
to be visually OK. If we decide this is OK for all of our cases,
we could (it seems) put this scale-down into fDstToIndex,
to avoid having to do these extra shifts each time.
*/
SkFixed fx = SkScalarToFixed(sfx) >> 1;
SkFixed dx = SkScalarToFixed(sdx) >> 1;
SkFixed fy = SkScalarToFixed(sfy) >> 1;
SkFixed dy = SkScalarToFixed(sdy) >> 1;
// might perform this check for the other modes,
// but the win will be a smaller % of the total
if (dy == 0) {
fy = SkPin32(fy, -0xFFFF >> 1, 0xFFFF >> 1);
fy *= fy;
do {
unsigned xx = SkPin32(fx, -0xFFFF >> 1, 0xFFFF >> 1);
unsigned fi = (xx * xx + fy) >> (14 + 16 - kSQRT_TABLE_BITS);
fi = SkFastMin32(fi, 0xFFFF >> (16 - kSQRT_TABLE_BITS));
fx += dx;
*dstC++ = cache[toggle +
(sqrt_table[fi] >> SkGradientShaderBase::kSqrt16Shift)];
toggle = next_dither_toggle16(toggle);
} while (--count != 0);
} else {
do {
unsigned xx = SkPin32(fx, -0xFFFF >> 1, 0xFFFF >> 1);
unsigned fi = SkPin32(fy, -0xFFFF >> 1, 0xFFFF >> 1);
fi = (xx * xx + fi * fi) >> (14 + 16 - kSQRT_TABLE_BITS);
fi = SkFastMin32(fi, 0xFFFF >> (16 - kSQRT_TABLE_BITS));
fx += dx;
fy += dy;
*dstC++ = cache[toggle +
(sqrt_table[fi] >> SkGradientShaderBase::kSqrt16Shift)];
toggle = next_dither_toggle16(toggle);
} while (--count != 0);
}
}
void shadeSpan16_radial_mirror(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
uint16_t* SK_RESTRICT dstC, const uint16_t* SK_RESTRICT cache,
int toggle, int count) {
do {
#ifdef SK_SCALAR_IS_FLOAT
float fdist = sk_float_sqrt(sfx*sfx + sfy*sfy);
SkFixed dist = SkFloatToFixed(fdist);
#else
SkFixed magnitudeSquared = SkFixedSquare(sfx) +
SkFixedSquare(sfy);
if (magnitudeSquared < 0) // Overflow.
magnitudeSquared = SK_FixedMax;
SkFixed dist = SkFixedSqrt(magnitudeSquared);
#endif
unsigned fi = mirror_tileproc(dist);
SkASSERT(fi <= 0xFFFF);
*dstC++ = cache[toggle + (fi >> SkGradientShaderBase::kCache16Shift)];
toggle = next_dither_toggle16(toggle);
sfx += sdx;
sfy += sdy;
} while (--count != 0);
}
void shadeSpan16_radial_repeat(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
uint16_t* SK_RESTRICT dstC, const uint16_t* SK_RESTRICT cache,
int toggle, int count) {
SkFixed fx = SkScalarToFixed(sfx);
SkFixed dx = SkScalarToFixed(sdx);
SkFixed fy = SkScalarToFixed(sfy);
SkFixed dy = SkScalarToFixed(sdy);
do {
SkFixed dist = SkFixedSqrt(SkFixedSquare(fx) + SkFixedSquare(fy));
unsigned fi = repeat_tileproc(dist);
SkASSERT(fi <= 0xFFFF);
fx += dx;
fy += dy;
*dstC++ = cache[toggle + (fi >> SkGradientShaderBase::kCache16Shift)];
toggle = next_dither_toggle16(toggle);
} while (--count != 0);
}
}
/////////////////////////////////////////////////////////////////////
SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius,
const SkColor colors[], const SkScalar pos[], int colorCount,
SkShader::TileMode mode, SkUnitMapper* mapper)
: SkGradientShaderBase(colors, pos, colorCount, mode, mapper),
fCenter(center),
fRadius(radius)
{
// make sure our table is insync with our current #define for kSQRT_TABLE_SIZE
SkASSERT(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE);
rad_to_unit_matrix(center, radius, &fPtsToUnit);
}
void SkRadialGradient::shadeSpan16(int x, int y, uint16_t* dstCParam,
int count) {
SkASSERT(count > 0);
uint16_t* SK_RESTRICT dstC = dstCParam;
SkPoint srcPt;
SkMatrix::MapXYProc dstProc = fDstToIndexProc;
TileProc proc = fTileProc;
const uint16_t* SK_RESTRICT cache = this->getCache16();
int toggle = init_dither_toggle16(x, y);
if (fDstToIndexClass != kPerspective_MatrixClass) {
dstProc(fDstToIndex, SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, &srcPt);
SkScalar sdx = fDstToIndex.getScaleX();
SkScalar sdy = fDstToIndex.getSkewY();
if (fDstToIndexClass == kFixedStepInX_MatrixClass) {
SkFixed storage[2];
(void)fDstToIndex.fixedStepInX(SkIntToScalar(y),
&storage[0], &storage[1]);
sdx = SkFixedToScalar(storage[0]);
sdy = SkFixedToScalar(storage[1]);
} else {
SkASSERT(fDstToIndexClass == kLinear_MatrixClass);
}
RadialShade16Proc shadeProc = shadeSpan16_radial_repeat;
if (SkShader::kClamp_TileMode == fTileMode) {
shadeProc = shadeSpan16_radial_clamp;
} else if (SkShader::kMirror_TileMode == fTileMode) {
shadeProc = shadeSpan16_radial_mirror;
} else {
SkASSERT(SkShader::kRepeat_TileMode == fTileMode);
}
(*shadeProc)(srcPt.fX, sdx, srcPt.fY, sdy, dstC,
cache, toggle, count);
} else { // perspective case
SkScalar dstX = SkIntToScalar(x);
SkScalar dstY = SkIntToScalar(y);
do {
dstProc(fDstToIndex, dstX, dstY, &srcPt);
unsigned fi = proc(SkScalarToFixed(srcPt.length()));
SkASSERT(fi <= 0xFFFF);
int index = fi >> (16 - kCache16Bits);
*dstC++ = cache[toggle + index];
toggle = next_dither_toggle16(toggle);
dstX += SK_Scalar1;
} while (--count != 0);
}
}
SkShader::BitmapType SkRadialGradient::asABitmap(SkBitmap* bitmap,
SkMatrix* matrix, SkShader::TileMode* xy) const {
if (bitmap) {
this->getGradientTableBitmap(bitmap);
}
if (matrix) {
matrix->setScale(SkIntToScalar(kCache32Count),
SkIntToScalar(kCache32Count));
matrix->preConcat(fPtsToUnit);
}
if (xy) {
xy[0] = fTileMode;
xy[1] = kClamp_TileMode;
}
return kRadial_BitmapType;
}
SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const {
if (info) {
commonAsAGradient(info);
info->fPoint[0] = fCenter;
info->fRadius[0] = fRadius;
}
return kRadial_GradientType;
}
SkRadialGradient::SkRadialGradient(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer),
fCenter(buffer.readPoint()),
fRadius(buffer.readScalar()) {
}
void SkRadialGradient::flatten(SkFlattenableWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writePoint(fCenter);
buffer.writeScalar(fRadius);
}
namespace {
inline bool radial_completely_pinned(int fx, int dx, int fy, int dy) {
// fast, overly-conservative test: checks unit square instead
// of unit circle
bool xClamped = (fx >= SK_FixedHalf && dx >= 0) ||
(fx <= -SK_FixedHalf && dx <= 0);
bool yClamped = (fy >= SK_FixedHalf && dy >= 0) ||
(fy <= -SK_FixedHalf && dy <= 0);
return xClamped || yClamped;
}
// Return true if (fx * fy) is always inside the unit circle
// SkPin32 is expensive, but so are all the SkFixedMul in this test,
// so it shouldn't be run if count is small.
inline bool no_need_for_radial_pin(int fx, int dx,
int fy, int dy, int count) {
SkASSERT(count > 0);
if (SkAbs32(fx) > 0x7FFF || SkAbs32(fy) > 0x7FFF) {
return false;
}
if (fx*fx + fy*fy > 0x7FFF*0x7FFF) {
return false;
}
fx += (count - 1) * dx;
fy += (count - 1) * dy;
if (SkAbs32(fx) > 0x7FFF || SkAbs32(fy) > 0x7FFF) {
return false;
}
return fx*fx + fy*fy <= 0x7FFF*0x7FFF;
}
#define UNPINNED_RADIAL_STEP \
fi = (fx * fx + fy * fy) >> (14 + 16 - kSQRT_TABLE_BITS); \
*dstC++ = cache[toggle + \
(sqrt_table[fi] >> SkGradientShaderBase::kSqrt32Shift)]; \
toggle = next_dither_toggle(toggle); \
fx += dx; \
fy += dy;
typedef void (* RadialShadeProc)(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
SkPMColor* dstC, const SkPMColor* cache,
int count, int toggle);
// On Linux, this is faster with SkPMColor[] params than SkPMColor* SK_RESTRICT
void shadeSpan_radial_clamp(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
SkPMColor* SK_RESTRICT dstC, const SkPMColor* SK_RESTRICT cache,
int count, int toggle) {
// Floating point seems to be slower than fixed point,
// even when we have float hardware.
const uint8_t* SK_RESTRICT sqrt_table = gSqrt8Table;
SkFixed fx = SkScalarToFixed(sfx) >> 1;
SkFixed dx = SkScalarToFixed(sdx) >> 1;
SkFixed fy = SkScalarToFixed(sfy) >> 1;
SkFixed dy = SkScalarToFixed(sdy) >> 1;
if ((count > 4) && radial_completely_pinned(fx, dx, fy, dy)) {
unsigned fi = SkGradientShaderBase::kCache32Count - 1;
sk_memset32_dither(dstC,
cache[toggle + fi],
cache[next_dither_toggle(toggle) + fi],
count);
} else if ((count > 4) &&
no_need_for_radial_pin(fx, dx, fy, dy, count)) {
unsigned fi;
// 4x unroll appears to be no faster than 2x unroll on Linux
while (count > 1) {
UNPINNED_RADIAL_STEP;
UNPINNED_RADIAL_STEP;
count -= 2;
}
if (count) {
UNPINNED_RADIAL_STEP;
}
} else {
// Specializing for dy == 0 gains us 25% on Skia benchmarks
if (dy == 0) {
unsigned yy = SkPin32(fy, -0xFFFF >> 1, 0xFFFF >> 1);
yy *= yy;
do {
unsigned xx = SkPin32(fx, -0xFFFF >> 1, 0xFFFF >> 1);
unsigned fi = (xx * xx + yy) >> (14 + 16 - kSQRT_TABLE_BITS);
fi = SkFastMin32(fi, 0xFFFF >> (16 - kSQRT_TABLE_BITS));
*dstC++ = cache[toggle + (sqrt_table[fi] >>
SkGradientShaderBase::kSqrt32Shift)];
toggle = next_dither_toggle(toggle);
fx += dx;
} while (--count != 0);
} else {
do {
unsigned xx = SkPin32(fx, -0xFFFF >> 1, 0xFFFF >> 1);
unsigned fi = SkPin32(fy, -0xFFFF >> 1, 0xFFFF >> 1);
fi = (xx * xx + fi * fi) >> (14 + 16 - kSQRT_TABLE_BITS);
fi = SkFastMin32(fi, 0xFFFF >> (16 - kSQRT_TABLE_BITS));
*dstC++ = cache[toggle + (sqrt_table[fi] >>
SkGradientShaderBase::kSqrt32Shift)];
toggle = next_dither_toggle(toggle);
fx += dx;
fy += dy;
} while (--count != 0);
}
}
}
// Unrolling this loop doesn't seem to help (when float); we're stalling to
// get the results of the sqrt (?), and don't have enough extra registers to
// have many in flight.
void shadeSpan_radial_mirror(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
SkPMColor* SK_RESTRICT dstC, const SkPMColor* SK_RESTRICT cache,
int count, int toggle) {
do {
#ifdef SK_SCALAR_IS_FLOAT
float fdist = sk_float_sqrt(sfx*sfx + sfy*sfy);
SkFixed dist = SkFloatToFixed(fdist);
#else
SkFixed magnitudeSquared = SkFixedSquare(sfx) +
SkFixedSquare(sfy);
if (magnitudeSquared < 0) // Overflow.
magnitudeSquared = SK_FixedMax;
SkFixed dist = SkFixedSqrt(magnitudeSquared);
#endif
unsigned fi = mirror_tileproc(dist);
SkASSERT(fi <= 0xFFFF);
*dstC++ = cache[toggle + (fi >> SkGradientShaderBase::kCache32Shift)];
toggle = next_dither_toggle(toggle);
sfx += sdx;
sfy += sdy;
} while (--count != 0);
}
void shadeSpan_radial_repeat(SkScalar sfx, SkScalar sdx,
SkScalar sfy, SkScalar sdy,
SkPMColor* SK_RESTRICT dstC, const SkPMColor* SK_RESTRICT cache,
int count, int toggle) {
SkFixed fx = SkScalarToFixed(sfx);
SkFixed dx = SkScalarToFixed(sdx);
SkFixed fy = SkScalarToFixed(sfy);
SkFixed dy = SkScalarToFixed(sdy);
do {
SkFixed magnitudeSquared = SkFixedSquare(fx) +
SkFixedSquare(fy);
if (magnitudeSquared < 0) // Overflow.
magnitudeSquared = SK_FixedMax;
SkFixed dist = SkFixedSqrt(magnitudeSquared);
unsigned fi = repeat_tileproc(dist);
SkASSERT(fi <= 0xFFFF);
*dstC++ = cache[toggle + (fi >> SkGradientShaderBase::kCache32Shift)];
toggle = next_dither_toggle(toggle);
fx += dx;
fy += dy;
} while (--count != 0);
}
}
void SkRadialGradient::shadeSpan(int x, int y,
SkPMColor* SK_RESTRICT dstC, int count) {
SkASSERT(count > 0);
SkPoint srcPt;
SkMatrix::MapXYProc dstProc = fDstToIndexProc;
TileProc proc = fTileProc;
const SkPMColor* SK_RESTRICT cache = this->getCache32();
int toggle = init_dither_toggle(x, y);
if (fDstToIndexClass != kPerspective_MatrixClass) {
dstProc(fDstToIndex, SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, &srcPt);
SkScalar sdx = fDstToIndex.getScaleX();
SkScalar sdy = fDstToIndex.getSkewY();
if (fDstToIndexClass == kFixedStepInX_MatrixClass) {
SkFixed storage[2];
(void)fDstToIndex.fixedStepInX(SkIntToScalar(y),
&storage[0], &storage[1]);
sdx = SkFixedToScalar(storage[0]);
sdy = SkFixedToScalar(storage[1]);
} else {
SkASSERT(fDstToIndexClass == kLinear_MatrixClass);
}
RadialShadeProc shadeProc = shadeSpan_radial_repeat;
if (SkShader::kClamp_TileMode == fTileMode) {
shadeProc = shadeSpan_radial_clamp;
} else if (SkShader::kMirror_TileMode == fTileMode) {
shadeProc = shadeSpan_radial_mirror;
} else {
SkASSERT(SkShader::kRepeat_TileMode == fTileMode);
}
(*shadeProc)(srcPt.fX, sdx, srcPt.fY, sdy, dstC, cache, count, toggle);
} else { // perspective case
SkScalar dstX = SkIntToScalar(x);
SkScalar dstY = SkIntToScalar(y);
do {
dstProc(fDstToIndex, dstX, dstY, &srcPt);
unsigned fi = proc(SkScalarToFixed(srcPt.length()));
SkASSERT(fi <= 0xFFFF);
*dstC++ = cache[fi >> SkGradientShaderBase::kCache32Shift];
dstX += SK_Scalar1;
} while (--count != 0);
}
}
/////////////////////////////////////////////////////////////////////
#if SK_SUPPORT_GPU
#include "GrTBackendEffectFactory.h"
class GrGLRadialGradient : public GrGLGradientEffect {
public:
GrGLRadialGradient(const GrBackendEffectFactory& factory,
const GrDrawEffect&) : INHERITED (factory) { }
virtual ~GrGLRadialGradient() { }
virtual void emitCode(GrGLShaderBuilder*,
const GrDrawEffect&,
EffectKey,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray&) SK_OVERRIDE;
static EffectKey GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) {
return GenMatrixKey(drawEffect);
}
private:
typedef GrGLGradientEffect INHERITED;
};
/////////////////////////////////////////////////////////////////////
class GrRadialGradient : public GrGradientEffect {
public:
static GrEffectRef* Create(GrContext* ctx,
const SkRadialGradient& shader,
const SkMatrix& matrix,
SkShader::TileMode tm) {
AutoEffectUnref effect(SkNEW_ARGS(GrRadialGradient, (ctx, shader, matrix, tm)));
return CreateEffectRef(effect);
}
virtual ~GrRadialGradient() { }
static const char* Name() { return "Radial Gradient"; }
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE {
return GrTBackendEffectFactory<GrRadialGradient>::getInstance();
}
typedef GrGLRadialGradient GLEffect;
private:
GrRadialGradient(GrContext* ctx,
const SkRadialGradient& shader,
const SkMatrix& matrix,
SkShader::TileMode tm)
: INHERITED(ctx, shader, matrix, tm) {
}
GR_DECLARE_EFFECT_TEST;
typedef GrGradientEffect INHERITED;
};
/////////////////////////////////////////////////////////////////////
GR_DEFINE_EFFECT_TEST(GrRadialGradient);
GrEffectRef* GrRadialGradient::TestCreate(SkMWCRandom* random,
GrContext* context,
const GrDrawTargetCaps&,
GrTexture**) {
SkPoint center = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius = random->nextUScalar1();
SkColor colors[kMaxRandomGradientColors];
SkScalar stopsArray[kMaxRandomGradientColors];
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(random, colors, &stops, &tm);
SkAutoTUnref<SkShader> shader(SkGradientShader::CreateRadial(center, radius,
colors, stops, colorCount,
tm));
SkPaint paint;
return shader->asNewEffect(context, paint);
}
/////////////////////////////////////////////////////////////////////
void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder,
const GrDrawEffect&,
EffectKey key,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
this->emitYCoordUniform(builder);
const char* coords;
this->setupMatrix(builder, key, &coords);
SkString t("length(");
t.append(coords);
t.append(")");
this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplers[0]);
}
/////////////////////////////////////////////////////////////////////
GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&) const {
SkASSERT(NULL != context);
SkMatrix matrix;
if (!this->getLocalMatrix().invert(&matrix)) {
return NULL;
}
matrix.postConcat(fPtsToUnit);
return GrRadialGradient::Create(context, *this, matrix, fTileMode);
}
#else
GrEffectRef* SkRadialGradient::asNewEffect(GrContext*, const SkPaint&) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return NULL;
}
#endif
#ifdef SK_DEVELOPER
void SkRadialGradient::toString(SkString* str) const {
str->append("SkRadialGradient: (");
str->append("center: (");
str->appendScalar(fCenter.fX);
str->append(", ");
str->appendScalar(fCenter.fY);
str->append(") radius: ");
str->appendScalar(fRadius);
str->append(" ");
this->INHERITED::toString(str);
str->append(")");
}
#endif
| bsd-3-clause |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/skia/tests/Time.cpp | 11 | 1352 | /*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkTime.h"
#include "Test.h"
// Sanity checks for the GetDateTime function.
DEF_TEST(Time_GetDateTime, r) {
SkTime::DateTime dateTime;
SkTime::GetDateTime(&dateTime);
// TODO(future generation): update these values.
const uint16_t kMinimumSaneYear = 1964;
const uint16_t kMaximumSaneYear = 2064;
if (dateTime.fYear < kMinimumSaneYear) {
ERRORF(r,
"SkTime::GetDateTime: %u (CurrentYear) < %u (MinimumSaneYear)",
static_cast<unsigned>(dateTime.fYear),
static_cast<unsigned>(kMinimumSaneYear));
}
if (dateTime.fYear > kMaximumSaneYear) {
ERRORF(r,
"SkTime::GetDateTime: %u (CurrentYear) > %u (MaximumSaneYear)",
static_cast<unsigned>(dateTime.fYear),
static_cast<unsigned>(kMaximumSaneYear));
}
REPORTER_ASSERT(r, dateTime.fMonth >= 1);
REPORTER_ASSERT(r, dateTime.fMonth <= 12);
REPORTER_ASSERT(r, dateTime.fDay >= 1);
REPORTER_ASSERT(r, dateTime.fDay <= 31);
REPORTER_ASSERT(r, dateTime.fHour <= 23);
REPORTER_ASSERT(r, dateTime.fMinute <= 59);
REPORTER_ASSERT(r, dateTime.fSecond <= 60); // leap seconds are 23:59:60
}
| bsd-3-clause |
hannespetur/SeqAnHTS | tests/graph_types/test_graph_types_derived.cpp | 12 | 6333 | // ==========================================================================
// SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2015, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of Knut Reinert or the FU Berlin nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN 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 <seqan/basic.h>
#include <seqan/graph_types.h>
using namespace seqan;
SEQAN_DEFINE_TEST(test_graph_types_derived_oracle)
{
Graph<Automaton<char> > g;
createOracleOnReverse(g, "announce");
SEQAN_ASSERT(parseString(g, 0, "e") == 1);
SEQAN_ASSERT(parseString(g, 0, "ec") == 2);
SEQAN_ASSERT(parseString(g, 0, "n") == 3);
SEQAN_ASSERT(parseString(g, 0, "a") == 8);
SEQAN_ASSERT(parseString(g, 0, "nn") == 7);
Graph<Automaton<Dna> > g2;
createOracle(g2, "ATATA");
SEQAN_ASSERT(parseString(g2, 0, "A") == 1);
SEQAN_ASSERT(parseString(g2, 0, "T") == 2);
SEQAN_ASSERT(parseString(g2, 0, "AT") == 2);
}
SEQAN_DEFINE_TEST(test_graph_types_derived_trie)
{
typedef Position<String<char> >::Type TPosition;
Graph<Automaton<char> > g;
String<String<TPosition> > pos;
String<String<char> > keywords;
appendValue(keywords, String<char>("announce"));
appendValue(keywords, String<char>("annual"));
appendValue(keywords, String<char>("annually"));
createTrie(g, pos, keywords);
SEQAN_ASSERT(parseString(g, 0, "a") == 1);
SEQAN_ASSERT(parseString(g, 0, "an") == 2);
SEQAN_ASSERT(parseString(g, 0, "ann") == 3);
SEQAN_ASSERT(parseString(g, 0, "anno") == 4);
SEQAN_ASSERT(parseString(g, 0, "annu") == 9);
SEQAN_ASSERT(getProperty(pos, 11) == (unsigned int) 1); // In vertex 11 keyword 1 ends
SEQAN_ASSERT(getProperty(pos, 13) == (unsigned int) 2);
SEQAN_ASSERT(getProperty(pos, 8) == (unsigned int) 0);
clear(g);
clear(pos);
createTrieOnReverse(g, pos, keywords);
SEQAN_ASSERT(parseString(g, 0, "e") == 1);
SEQAN_ASSERT(parseString(g, 0, "l") == 9);
SEQAN_ASSERT(parseString(g, 0, "y") == 15);
SEQAN_ASSERT(parseString(g, 0, "ec") == 2);
SEQAN_ASSERT(getProperty(pos, 8) == (unsigned int) 0); // In vertex 8 keyword 0 ends
SEQAN_ASSERT(getProperty(pos, 14) == (unsigned int) 1);
SEQAN_ASSERT(getProperty(pos, 22) == (unsigned int) 2);
Graph<Automaton<Dna> > gDna;
clear(pos);
String<String<Dna> > keyw;
appendValue(keyw, String<Dna>("ATATATA"));
appendValue(keyw, String<Dna>("TATAT"));
appendValue(keyw, String<Dna>("ACGATAT"));
createTrie(gDna, pos, keyw);
SEQAN_ASSERT(parseString(gDna, 0, "A") == 1);
SEQAN_ASSERT(parseString(gDna, 0, "T") == 8);
SEQAN_ASSERT(parseString(gDna, 0, "AT") == 2);
SEQAN_ASSERT(parseString(gDna, 0, "AC") == 13);
SEQAN_ASSERT(getProperty(pos, 7) == (unsigned int) 0); // In vertex 7 keyword 0 ends
SEQAN_ASSERT(getProperty(pos, 18) == (unsigned int) 2);
SEQAN_ASSERT(getProperty(pos, 12) == (unsigned int) 1);
//createSuffixTrie
clear(g);
clear(pos);
char * str = (char *) "ABABBA";
char * strend = end(str);
char * it;
typedef VertexDescriptor<Graph<Automaton<char> > >::Type TVertexDescriptor;
TVertexDescriptor v;
createSuffixTrie(g, pos, str);
for (unsigned int i = 0; i < length(str); ++i)
{
v = parseString(g, 0, it = str + i, strend);
SEQAN_ASSERT(it == strend);
SEQAN_ASSERT(getProperty(pos, v) == i);
}
SEQAN_ASSERT(canParseString(g, "ABBA"));
SEQAN_ASSERT(canParseString(g, "BAB"));
SEQAN_ASSERT(!canParseString(g, "AA"));
SEQAN_ASSERT(!canParseString(g, "BAC"));
SEQAN_ASSERT(!canParseString(g, "C"));
SEQAN_ASSERT(canParseString(g, ""));
}
SEQAN_DEFINE_TEST(test_graph_types_derived_set_oracle)
{
typedef Position<String<char> >::Type TPosition;
Graph<Automaton<char> > g;
String<String<TPosition> > pos;
String<String<char> > keywords;
appendValue(keywords, String<char>("announce"));
appendValue(keywords, String<char>("annual"));
appendValue(keywords, String<char>("annually"));
createSetOracle(g, pos, keywords);
for (unsigned int i = 0; i < length(keywords); ++i)
{
String<char> & str = keywords[i];
for (unsigned int j = 0; j < length(str); ++j)
{
SEQAN_ASSERT(canParseString(g, prefix(str, i)));
}
}
SEQAN_ASSERT(!canParseString(g, "d"));
SEQAN_ASSERT(!canParseString(g, "annly"));
SEQAN_ASSERT(canParseString(g, ""));
}
SEQAN_BEGIN_TESTSUITE(test_graph_types_derived)
{
SEQAN_CALL_TEST(test_graph_types_derived_set_oracle);
SEQAN_CALL_TEST(test_graph_types_derived_trie);
SEQAN_CALL_TEST(test_graph_types_derived_oracle);
}
SEQAN_END_TESTSUITE
| bsd-3-clause |
DARKPOP/external_chromium_org_third_party_WebKit | Source/core/animation/InterpolableValue.cpp | 13 | 2327 | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "core/animation/InterpolableValue.h"
namespace blink {
DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(InterpolableValue);
PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableNumber::interpolate(const InterpolableValue &to, const double progress) const
{
const InterpolableNumber& toNumber = toInterpolableNumber(to);
if (!progress)
return create(m_value);
if (progress == 1)
return create(toNumber.m_value);
return create(m_value * (1 - progress) + toNumber.m_value * progress);
}
PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableBool::interpolate(const InterpolableValue &to, const double progress) const
{
if (progress < 0.5) {
return clone();
}
return to.clone();
}
PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableList::interpolate(const InterpolableValue &to, const double progress) const
{
const InterpolableList& toList = toInterpolableList(to);
ASSERT(toList.m_size == m_size);
if (!progress) {
return create(*this);
}
if (progress == 1) {
return InterpolableList::create(toList);
}
OwnPtrWillBeRawPtr<InterpolableList> result = create(m_size);
for (size_t i = 0; i < m_size; i++) {
ASSERT(m_values[i]);
ASSERT(toList.m_values[i]);
result->set(i, m_values[i]->interpolate(*(toList.m_values[i]), progress));
}
return result.release();
}
void InterpolableList::trace(Visitor* visitor)
{
#if ENABLE_OILPAN
visitor->trace(m_values);
#endif
InterpolableValue::trace(visitor);
}
PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableAnimatableValue::interpolate(const InterpolableValue &other, const double percentage) const
{
const InterpolableAnimatableValue& otherValue = toInterpolableAnimatableValue(other);
if (!percentage)
return create(m_value);
if (percentage == 1)
return create(otherValue.m_value);
return create(AnimatableValue::interpolate(m_value.get(), otherValue.m_value.get(), percentage));
}
void InterpolableAnimatableValue::trace(Visitor* visitor)
{
visitor->trace(m_value);
InterpolableValue::trace(visitor);
}
}
| bsd-3-clause |
novaquark/eigen | lapack/iladlc.f | 272 | 2952 | *> \brief \b ILADLC
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download ILADLC + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/iladlc.f">
*> [TGZ]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/iladlc.f">
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/iladlc.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
*
* INTEGER FUNCTION ILADLC( M, N, A, LDA )
*
* .. Scalar Arguments ..
* INTEGER M, N, LDA
* ..
* .. Array Arguments ..
* DOUBLE PRECISION A( LDA, * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> ILADLC scans A for its last non-zero column.
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] M
*> \verbatim
*> M is INTEGER
*> The number of rows of the matrix A.
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The number of columns of the matrix A.
*> \endverbatim
*>
*> \param[in] A
*> \verbatim
*> A is DOUBLE PRECISION array, dimension (LDA,N)
*> The m by n matrix A.
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*> LDA is INTEGER
*> The leading dimension of the array A. LDA >= max(1,M).
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date November 2011
*
*> \ingroup auxOTHERauxiliary
*
* =====================================================================
INTEGER FUNCTION ILADLC( M, N, A, LDA )
*
* -- LAPACK auxiliary routine (version 3.4.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2011
*
* .. Scalar Arguments ..
INTEGER M, N, LDA
* ..
* .. Array Arguments ..
DOUBLE PRECISION A( LDA, * )
* ..
*
* =====================================================================
*
* .. Parameters ..
DOUBLE PRECISION ZERO
PARAMETER ( ZERO = 0.0D+0 )
* ..
* .. Local Scalars ..
INTEGER I
* ..
* .. Executable Statements ..
*
* Quick test for the common case where one corner is non-zero.
IF( N.EQ.0 ) THEN
ILADLC = N
ELSE IF( A(1, N).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
ILADLC = N
ELSE
* Now scan each column from the end, returning with the first non-zero.
DO ILADLC = N, 1, -1
DO I = 1, M
IF( A(I, ILADLC).NE.ZERO ) RETURN
END DO
END DO
END IF
RETURN
END
| bsd-3-clause |
kzhong1991/Flight-AR.Drone-2 | src/3rdparty/Qt4.8.4/src/corelib/tools/qsimd.cpp | 17 | 10246 | /****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qsimd_p.h"
#include <QByteArray>
#include <stdio.h>
#if defined(Q_OS_WINCE)
#include <windows.h>
#endif
#if defined(Q_OS_WIN64) && !defined(Q_CC_GNU)
#include <intrin.h>
#endif
#if defined(Q_OS_LINUX) && defined(__arm__)
#include "private/qcore_unix_p.h"
// the kernel header definitions for HWCAP_*
// (the ones we need/may need anyway)
// copied from <asm/hwcap.h> (ARM)
#define HWCAP_IWMMXT 512
#define HWCAP_CRUNCH 1024
#define HWCAP_THUMBEE 2048
#define HWCAP_NEON 4096
#define HWCAP_VFPv3 8192
#define HWCAP_VFPv3D16 16384
// copied from <linux/auxvec.h>
#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
#endif
QT_BEGIN_NAMESPACE
#if defined (Q_OS_NACL)
static inline uint detectProcessorFeatures()
{
return 0;
}
#elif defined (Q_OS_WINCE)
static inline uint detectProcessorFeatures()
{
uint features = 0;
#if defined (ARM)
if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) {
features = IWMMXT;
return features;
}
#elif defined(_X86_)
features = 0;
#if defined QT_HAVE_MMX
if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE))
features |= MMX;
#endif
#if defined QT_HAVE_3DNOW
if (IsProcessorFeaturePresent(PF_3DNOW_INSTRUCTIONS_AVAILABLE))
features |= MMX3DNOW;
#endif
return features;
#endif
features = 0;
return features;
}
#elif defined(__arm__) || defined(__arm) || defined(QT_HAVE_IWMMXT) || defined(QT_HAVE_NEON)
static inline uint detectProcessorFeatures()
{
uint features = 0;
#if defined(Q_OS_LINUX)
int auxv = ::qt_safe_open("/proc/self/auxv", O_RDONLY);
if (auxv != -1) {
unsigned long vector[64];
int nread;
while (features == 0) {
nread = ::qt_safe_read(auxv, (char *)vector, sizeof vector);
if (nread <= 0) {
// EOF or error
break;
}
int max = nread / (sizeof vector[0]);
for (int i = 0; i < max; i += 2)
if (vector[i] == AT_HWCAP) {
if (vector[i+1] & HWCAP_IWMMXT)
features |= IWMMXT;
if (vector[i+1] & HWCAP_NEON)
features |= NEON;
break;
}
}
::qt_safe_close(auxv);
return features;
}
// fall back if /proc/self/auxv wasn't found
#endif
#if defined(QT_HAVE_IWMMXT)
// runtime detection only available when running as a previlegied process
features = IWMMXT;
#elif defined(QT_ALWAYS_HAVE_NEON)
features = NEON;
#endif
return features;
}
#elif defined(__i386__) || defined(_M_IX86)
static inline uint detectProcessorFeatures()
{
uint features = 0;
unsigned int extended_result = 0;
unsigned int feature_result = 0;
uint result = 0;
/* see p. 118 of amd64 instruction set manual Vol3 */
#if defined(Q_CC_GNU)
long cpuid_supported, tmp1;
asm ("pushf\n"
"pop %0\n"
"mov %0, %1\n"
"xor $0x00200000, %0\n"
"push %0\n"
"popf\n"
"pushf\n"
"pop %0\n"
"xor %1, %0\n" // %eax is now 0 if CPUID is not supported
: "=a" (cpuid_supported), "=r" (tmp1)
);
if (cpuid_supported) {
asm ("xchg %%ebx, %2\n"
"cpuid\n"
"xchg %%ebx, %2\n"
: "=c" (feature_result), "=d" (result), "=&r" (tmp1)
: "a" (1));
asm ("xchg %%ebx, %1\n"
"cpuid\n"
"cmp $0x80000000, %%eax\n"
"jnbe 1f\n"
"xor %0, %0\n"
"jmp 2f\n"
"1:\n"
"mov $0x80000001, %%eax\n"
"cpuid\n"
"2:\n"
"xchg %%ebx, %1\n"
: "=d" (extended_result), "=&r" (tmp1)
: "a" (0x80000000)
: "%ecx"
);
}
#elif defined (Q_OS_WIN)
_asm {
push eax
push ebx
push ecx
push edx
pushfd
pop eax
mov ebx, eax
xor eax, 00200000h
push eax
popfd
pushfd
pop eax
mov edx, 0
xor eax, ebx
jz skip
mov eax, 1
cpuid
mov result, edx
mov feature_result, ecx
skip:
pop edx
pop ecx
pop ebx
pop eax
}
_asm {
push eax
push ebx
push ecx
push edx
pushfd
pop eax
mov ebx, eax
xor eax, 00200000h
push eax
popfd
pushfd
pop eax
mov edx, 0
xor eax, ebx
jz skip2
mov eax, 80000000h
cpuid
cmp eax, 80000000h
jbe skip2
mov eax, 80000001h
cpuid
mov extended_result, edx
skip2:
pop edx
pop ecx
pop ebx
pop eax
}
#endif
// result now contains the standard feature bits
if (result & (1u << 15))
features |= CMOV;
if (result & (1u << 23))
features |= MMX;
if (extended_result & (1u << 22))
features |= MMXEXT;
if (extended_result & (1u << 31))
features |= MMX3DNOW;
if (extended_result & (1u << 30))
features |= MMX3DNOWEXT;
if (result & (1u << 25))
features |= SSE;
if (result & (1u << 26))
features |= SSE2;
if (feature_result & (1u))
features |= SSE3;
if (feature_result & (1u << 9))
features |= SSSE3;
if (feature_result & (1u << 19))
features |= SSE4_1;
if (feature_result & (1u << 20))
features |= SSE4_2;
if (feature_result & (1u << 28))
features |= AVX;
return features;
}
#elif defined(__x86_64) || defined(Q_OS_WIN64)
static inline uint detectProcessorFeatures()
{
uint features = MMX|SSE|SSE2|CMOV;
uint feature_result = 0;
#if defined (Q_OS_WIN64)
{
int info[4];
__cpuid(info, 1);
feature_result = info[2];
}
#elif defined(Q_CC_GNU)
quint64 tmp;
asm ("xchg %%rbx, %1\n"
"cpuid\n"
"xchg %%rbx, %1\n"
: "=c" (feature_result), "=&r" (tmp)
: "a" (1)
: "%edx"
);
#endif
if (feature_result & (1u))
features |= SSE3;
if (feature_result & (1u << 9))
features |= SSSE3;
if (feature_result & (1u << 19))
features |= SSE4_1;
if (feature_result & (1u << 20))
features |= SSE4_2;
if (feature_result & (1u << 28))
features |= AVX;
return features;
}
#elif defined(__ia64__)
static inline uint detectProcessorFeatures()
{
return MMX|SSE|SSE2;
}
#else
static inline uint detectProcessorFeatures()
{
return 0;
}
#endif
/*
* Use kdesdk/scripts/generate_string_table.pl to update the table below.
* Here's the data (don't forget the ONE leading space):
mmx
mmxext
mmx3dnow
mmx3dnowext
sse
sse2
cmov
iwmmxt
neon
sse3
ssse3
sse4.1
sse4.2
avx
*/
// begin generated
static const char features_string[] =
" mmx\0"
" mmxext\0"
" mmx3dnow\0"
" mmx3dnowext\0"
" sse\0"
" sse2\0"
" cmov\0"
" iwmmxt\0"
" neon\0"
" sse3\0"
" ssse3\0"
" sse4.1\0"
" sse4.2\0"
" avx\0"
"\0";
static const int features_indices[] = {
0, 5, 13, 23, 36, 41, 47, 53,
61, 67, 73, 80, 88, 96, -1
};
// end generated
const int features_count = (sizeof features_indices - 1) / (sizeof features_indices[0]);
uint qDetectCPUFeatures()
{
static QBasicAtomicInt features = Q_BASIC_ATOMIC_INITIALIZER(-1);
if (features != -1)
return features;
uint f = detectProcessorFeatures();
QByteArray disable = qgetenv("QT_NO_CPU_FEATURE");
if (!disable.isEmpty()) {
disable.prepend(' ');
for (int i = 0; i < features_count; ++i) {
if (disable.contains(features_string + features_indices[i]))
f &= ~(1 << i);
}
}
features = f;
return features;
}
void qDumpCPUFeatures()
{
uint features = qDetectCPUFeatures();
printf("Processor features: ");
for (int i = 0; i < features_count; ++i) {
if (features & (1 << i))
printf("%s", features_string + features_indices[i]);
}
puts("");
}
QT_END_NAMESPACE
| bsd-3-clause |
wdv4758h/blaze-lib | blazetest/src/mathtest/dmatsmatmult/AliasingTest.cpp | 19 | 48535 | //=================================================================================================
/*!
// \file src/mathtest/dmatsmatmult/AliasingTest.cpp
// \brief Source file for the dense matrix/dense matrix multiplication aliasing test
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blazetest/mathtest/dmatsmatmult/AliasingTest.h>
namespace blazetest {
namespace mathtest {
namespace dmatsmatmult {
//=================================================================================================
//
// CONSTRUCTORS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Constructor for the aliasing test class.
//
// \exception std::runtime_error Operation error detected.
*/
AliasingTest::AliasingTest()
: dA3x4_ ( 3UL, 4UL )
, dB4x3_ ( 4UL, 3UL )
, dC3x3_ ( 3UL, 3UL )
, dD3x3_ ( 3UL, 3UL )
, tdA3x4_( 3UL, 4UL )
, tdB4x3_( 4UL, 3UL )
, tdC3x3_( 3UL, 3UL )
, tdD3x3_( 3UL, 3UL )
, sA3x4_ ( 3UL, 4UL )
, sB4x3_ ( 4UL, 3UL )
, sC3x3_ ( 3UL, 3UL )
, sD3x3_ ( 3UL, 3UL )
, tsA3x4_( 3UL, 4UL )
, tsB4x3_( 4UL, 3UL )
, tsC3x3_( 3UL, 3UL )
, tsD3x3_( 3UL, 3UL )
{
testDMatSMatMult ();
testDMatTSMatMult ();
testTDMatSMatMult ();
testTDMatTSMatMult();
}
//*************************************************************************************************
//=================================================================================================
//
// TEST FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Test of the dense matrix/dense matrix multiplication.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs aliasing tests for the dense matrix/dense matrix multiplication.
// In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void AliasingTest::testDMatSMatMult()
{
//=====================================================================================
// Multiplication
//=====================================================================================
// Assignment to left-hand side operand
{
test_ = "DMatSMatMult - Assignment to left-hand side operand";
initialize();
result_ = dA3x4_ * sB4x3_;
dA3x4_ = dA3x4_ * sB4x3_;
checkResult( dA3x4_, result_ );
}
// Assignment to first operand of left-hand side compound
{
test_ = "DMatSMatMult - Assignment to first operand of left-hand side compound";
initialize();
result_ = ( dA3x4_ * dB4x3_ ) * sC3x3_;
dA3x4_ = ( dA3x4_ * dB4x3_ ) * sC3x3_;
checkResult( dA3x4_, result_ );
}
// Assignment to second operand of left-hand side compound
{
test_ = "DMatSMatMult - Assignment to first operand of left-hand side compound";
initialize();
result_ = ( dA3x4_ * dB4x3_ ) * sC3x3_;
dB4x3_ = ( dA3x4_ * dB4x3_ ) * sC3x3_;
checkResult( dB4x3_, result_ );
}
// Assignment to right-hand side operand
{
test_ = "DMatSMatMult - Assignment to right-hand side operand";
initialize();
result_ = dA3x4_ * sB4x3_;
sB4x3_ = dA3x4_ * sB4x3_;
checkResult( sB4x3_, result_ );
}
// Assignment to first operand of right-hand side compound
{
test_ = "DMatSMatMult - Assignment to first operand of right-hand side compound";
initialize();
result_ = dC3x3_ * ( sA3x4_ * sB4x3_ );
sA3x4_ = dC3x3_ * ( sA3x4_ * sB4x3_ );
checkResult( sA3x4_, result_ );
}
// Assignment to second operand of right-hand side compound
{
test_ = "DMatSMatMult - Assignment to second operand of right-hand side compound";
initialize();
result_ = dC3x3_ * ( sA3x4_ * sB4x3_ );
sB4x3_ = dC3x3_ * ( sA3x4_ * sB4x3_ );
checkResult( sB4x3_, result_ );
}
//=====================================================================================
// Multiplication with addition assignment
//=====================================================================================
// Addition assignment to left-hand side operand
{
test_ = "DMatSMatMult - Addition assignment to left-hand side operand";
initialize();
result_ = dC3x3_;
result_ += dC3x3_ * sC3x3_;
dC3x3_ += dC3x3_ * sC3x3_;
checkResult( dC3x3_, result_ );
}
// Addition assignment to first operand of left-hand side compound
{
test_ = "DMatSMatMult - Addition assignment to first operand of left-hand side compound";
initialize();
result_ = dC3x3_;
result_ += ( dC3x3_ * dD3x3_ ) * sC3x3_;
dC3x3_ += ( dC3x3_ * dD3x3_ ) * sC3x3_;
checkResult( dC3x3_, result_ );
}
// Addition assignment to second operand of left-hand side compound
{
test_ = "DMatSMatMult - Addition assignment to second operand of left-hand side compound";
initialize();
result_ = dD3x3_;
result_ += ( dC3x3_ * dD3x3_ ) * sC3x3_;
dD3x3_ += ( dC3x3_ * dD3x3_ ) * sC3x3_;
checkResult( dD3x3_, result_ );
}
// Addition assignment to right-hand side operand
{
test_ = "DMatSMatMult - Addition assignment to right-hand side operand";
initialize();
result_ = sC3x3_;
result_ += dC3x3_ * sC3x3_;
sC3x3_ += dC3x3_ * sC3x3_;
checkResult( sC3x3_, result_ );
}
// Addition assignment to first operand of right-hand side compound
{
test_ = "DMatSMatMult - Addition assignment to first operand of right-hand side compound";
initialize();
result_ = sC3x3_;
result_ += dC3x3_ * ( sC3x3_ * sD3x3_ );
sC3x3_ += dC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sC3x3_, result_ );
}
// Addition assignment to second operand of right-hand side compound
{
test_ = "DMatSMatMult - Addition assignment to second operand of right-hand side compound";
initialize();
result_ = sD3x3_;
result_ += dC3x3_ * ( sC3x3_ * sD3x3_ );
sD3x3_ += dC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sD3x3_, result_ );
}
//=====================================================================================
// Multiplication with subtraction assignment
//=====================================================================================
// Subtraction assignment to left-hand side operand
{
test_ = "DMatSMatMult - Subtraction assignment to left-hand side operand";
initialize();
result_ = dC3x3_;
result_ -= dC3x3_ * sC3x3_;
dC3x3_ -= dC3x3_ * sC3x3_;
checkResult( dC3x3_, result_ );
}
// Subtraction assignment to first operand of left-hand side compound
{
test_ = "DMatSMatMult - Subtraction assignment to first operand of left-hand side compound";
initialize();
result_ = dC3x3_;
result_ -= ( dC3x3_ * dD3x3_ ) * sC3x3_;
dC3x3_ -= ( dC3x3_ * dD3x3_ ) * sC3x3_;
checkResult( dC3x3_, result_ );
}
// Subtraction assignment to second operand of left-hand side compound
{
test_ = "DMatSMatMult - Subtraction assignment to second operand of left-hand side compound";
initialize();
result_ = dD3x3_;
result_ -= ( dC3x3_ * dD3x3_ ) * sC3x3_;
dD3x3_ -= ( dC3x3_ * dD3x3_ ) * sC3x3_;
checkResult( dD3x3_, result_ );
}
// Subtraction assignment to right-hand side operand
{
test_ = "DMatSMatMult - Subtraction assignment to right-hand side operand";
initialize();
result_ = sC3x3_;
result_ -= dC3x3_ * sC3x3_;
sC3x3_ -= dC3x3_ * sC3x3_;
checkResult( sC3x3_, result_ );
}
// Subtraction assignment to first operand of right-hand side compound
{
test_ = "DMatSMatMult - Subtraction assignment to first operand of right-hand side compound";
initialize();
result_ = sC3x3_;
result_ -= dC3x3_ * ( sC3x3_ * sD3x3_ );
sC3x3_ -= dC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sC3x3_, result_ );
}
// Subtraction assignment to second operand of right-hand side compound
{
test_ = "DMatSMatMult - Subtraction assignment to second operand of right-hand side compound";
initialize();
result_ = sD3x3_;
result_ -= dC3x3_ * ( sC3x3_ * sD3x3_ );
sD3x3_ -= dC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sD3x3_, result_ );
}
//=====================================================================================
// Multiplication with multiplication assignment
//=====================================================================================
// Multiplication assignment to left-hand side operand
{
test_ = "DMatSMatMult - Multiplication assignment to left-hand side operand";
initialize();
result_ = dC3x3_;
result_ *= dC3x3_ * sC3x3_;
dC3x3_ *= dC3x3_ * sC3x3_;
checkResult( dC3x3_, result_ );
}
// Multiplication assignment to first operand of left-hand side compound
{
test_ = "DMatSMatMult - Multiplication assignment to first operand of left-hand side compound";
initialize();
result_ = dC3x3_;
result_ *= ( dC3x3_ * dD3x3_ ) * sC3x3_;
dC3x3_ *= ( dC3x3_ * dD3x3_ ) * sC3x3_;
checkResult( dC3x3_, result_ );
}
// Multiplication assignment to second operand of left-hand side compound
{
test_ = "DMatSMatMult - Multiplication assignment to second operand of left-hand side compound";
initialize();
result_ = dD3x3_;
result_ *= ( dC3x3_ * dD3x3_ ) * sC3x3_;
dD3x3_ *= ( dC3x3_ * dD3x3_ ) * sC3x3_;
checkResult( dD3x3_, result_ );
}
// Multiplication assignment to right-hand side operand
{
test_ = "DMatSMatMult - Multiplication assignment to right-hand side operand";
initialize();
result_ = sC3x3_;
result_ *= dC3x3_ * sC3x3_;
sC3x3_ *= dC3x3_ * sC3x3_;
checkResult( sC3x3_, result_ );
}
// Multiplication assignment to first operand of right-hand side compound
{
test_ = "DMatSMatMult - Multiplication assignment to first operand of right-hand side compound";
initialize();
result_ = sC3x3_;
result_ *= dC3x3_ * ( sC3x3_ * sD3x3_ );
sC3x3_ *= dC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sC3x3_, result_ );
}
// Multiplication assignment to second operand of right-hand side compound
{
test_ = "DMatSMatMult - Multiplication assignment to second operand of right-hand side compound";
initialize();
result_ = sD3x3_;
result_ *= dC3x3_ * ( sC3x3_ * sD3x3_ );
sD3x3_ *= dC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sD3x3_, result_ );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the dense matrix/transpose dense matrix multiplication.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs aliasing tests for the dense matrix/transpose dense matrix
// multiplication. In case an error is detected, a \a std::runtime_error exception is
// thrown.
*/
void AliasingTest::testDMatTSMatMult()
{
//=====================================================================================
// Multiplication
//=====================================================================================
// Assignment to left-hand side operand
{
test_ = "DMatTSMatMult - Assignment to left-hand side operand";
initialize();
result_ = dA3x4_ * tsB4x3_;
dA3x4_ = dA3x4_ * tsB4x3_;
checkResult( dA3x4_, result_ );
}
// Assignment to first operand of left-hand side compound
{
test_ = "DMatTSMatMult - Assignment to first operand of left-hand side compound";
initialize();
result_ = ( dA3x4_ * dB4x3_ ) * tsC3x3_;
dA3x4_ = ( dA3x4_ * dB4x3_ ) * tsC3x3_;
checkResult( dA3x4_, result_ );
}
// Assignment to second operand of left-hand side compound
{
test_ = "DMatTSMatMult - Assignment to first operand of left-hand side compound";
initialize();
result_ = ( dA3x4_ * dB4x3_ ) * tsC3x3_;
dB4x3_ = ( dA3x4_ * dB4x3_ ) * tsC3x3_;
checkResult( dB4x3_, result_ );
}
// Assignment to right-hand side operand
{
test_ = "DMatTSMatMult - Assignment to right-hand side operand";
initialize();
result_ = dA3x4_ * tsB4x3_;
tsB4x3_ = dA3x4_ * tsB4x3_;
checkResult( tsB4x3_, result_ );
}
// Assignment to first operand of right-hand side compound
{
test_ = "DMatTSMatMult - Assignment to first operand of right-hand side compound";
initialize();
result_ = dC3x3_ * ( tsA3x4_ * tsB4x3_ );
tsA3x4_ = dC3x3_ * ( tsA3x4_ * tsB4x3_ );
checkResult( tsA3x4_, result_ );
}
// Assignment to second operand of right-hand side compound
{
test_ = "DMatTSMatMult - Assignment to second operand of right-hand side compound";
initialize();
result_ = dC3x3_ * ( tsA3x4_ * tsB4x3_ );
tsB4x3_ = dC3x3_ * ( tsA3x4_ * tsB4x3_ );
checkResult( tsB4x3_, result_ );
}
//=====================================================================================
// Multiplication with addition assignment
//=====================================================================================
// Addition assignment to left-hand side operand
{
test_ = "DMatTSMatMult - Addition assignment to left-hand side operand";
initialize();
result_ = dC3x3_;
result_ += dC3x3_ * tsC3x3_;
dC3x3_ += dC3x3_ * tsC3x3_;
checkResult( dC3x3_, result_ );
}
// Addition assignment to first operand of left-hand side compound
{
test_ = "DMatTSMatMult - Addition assignment to first operand of left-hand side compound";
initialize();
result_ = dC3x3_;
result_ += ( dC3x3_ * dD3x3_ ) * tsC3x3_;
dC3x3_ += ( dC3x3_ * dD3x3_ ) * tsC3x3_;
checkResult( dC3x3_, result_ );
}
// Addition assignment to second operand of left-hand side compound
{
test_ = "DMatTSMatMult - Addition assignment to second operand of left-hand side compound";
initialize();
result_ = dD3x3_;
result_ += ( dC3x3_ * dD3x3_ ) * tsC3x3_;
dD3x3_ += ( dC3x3_ * dD3x3_ ) * tsC3x3_;
checkResult( dD3x3_, result_ );
}
// Addition assignment to right-hand side operand
{
test_ = "DMatTSMatMult - Addition assignment to right-hand side operand";
initialize();
result_ = tsC3x3_;
result_ += dC3x3_ * tsC3x3_;
tsC3x3_ += dC3x3_ * tsC3x3_;
checkResult( tsC3x3_, result_ );
}
// Addition assignment to first operand of right-hand side compound
{
test_ = "DMatTSMatMult - Addition assignment to first operand of right-hand side compound";
initialize();
result_ = tsC3x3_;
result_ += dC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsC3x3_ += dC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsC3x3_, result_ );
}
// Addition assignment to second operand of right-hand side compound
{
test_ = "DMatTSMatMult - Addition assignment to second operand of right-hand side compound";
initialize();
result_ = tsD3x3_;
result_ += dC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsD3x3_ += dC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsD3x3_, result_ );
}
//=====================================================================================
// Multiplication with subtraction assignment
//=====================================================================================
// Subtraction assignment to left-hand side operand
{
test_ = "DMatTSMatMult - Subtraction assignment to left-hand side operand";
initialize();
result_ = dC3x3_;
result_ -= dC3x3_ * tsC3x3_;
dC3x3_ -= dC3x3_ * tsC3x3_;
checkResult( dC3x3_, result_ );
}
// Subtraction assignment to first operand of left-hand side compound
{
test_ = "DMatTSMatMult - Subtraction assignment to first operand of left-hand side compound";
initialize();
result_ = dC3x3_;
result_ -= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
dC3x3_ -= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
checkResult( dC3x3_, result_ );
}
// Subtraction assignment to second operand of left-hand side compound
{
test_ = "DMatTSMatMult - Subtraction assignment to second operand of left-hand side compound";
initialize();
result_ = dD3x3_;
result_ -= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
dD3x3_ -= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
checkResult( dD3x3_, result_ );
}
// Subtraction assignment to right-hand side operand
{
test_ = "DMatTSMatMult - Subtraction assignment to right-hand side operand";
initialize();
result_ = tsC3x3_;
result_ -= dC3x3_ * tsC3x3_;
tsC3x3_ -= dC3x3_ * tsC3x3_;
checkResult( tsC3x3_, result_ );
}
// Subtraction assignment to first operand of right-hand side compound
{
test_ = "DMatTSMatMult - Subtraction assignment to first operand of right-hand side compound";
initialize();
result_ = tsC3x3_;
result_ -= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsC3x3_ -= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsC3x3_, result_ );
}
// Subtraction assignment to second operand of right-hand side compound
{
test_ = "DMatTSMatMult - Subtraction assignment to second operand of right-hand side compound";
initialize();
result_ = tsD3x3_;
result_ -= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsD3x3_ -= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsD3x3_, result_ );
}
//=====================================================================================
// Multiplication with multiplication assignment
//=====================================================================================
// Multiplication assignment to left-hand side operand
{
test_ = "DMatTSMatMult - Multiplication assignment to left-hand side operand";
initialize();
result_ = dC3x3_;
result_ *= dC3x3_ * tsC3x3_;
dC3x3_ *= dC3x3_ * tsC3x3_;
checkResult( dC3x3_, result_ );
}
// Multiplication assignment to first operand of left-hand side compound
{
test_ = "DMatTSMatMult - Multiplication assignment to first operand of left-hand side compound";
initialize();
result_ = dC3x3_;
result_ *= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
dC3x3_ *= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
checkResult( dC3x3_, result_ );
}
// Multiplication assignment to second operand of left-hand side compound
{
test_ = "DMatTSMatMult - Multiplication assignment to second operand of left-hand side compound";
initialize();
result_ = dD3x3_;
result_ *= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
dD3x3_ *= ( dC3x3_ * dD3x3_ ) * tsC3x3_;
checkResult( dD3x3_, result_ );
}
// Multiplication assignment to right-hand side operand
{
test_ = "DMatTSMatMult - Multiplication assignment to right-hand side operand";
initialize();
result_ = tsC3x3_;
result_ *= dC3x3_ * tsC3x3_;
tsC3x3_ *= dC3x3_ * tsC3x3_;
checkResult( tsC3x3_, result_ );
}
// Multiplication assignment to first operand of right-hand side compound
{
test_ = "DMatTSMatMult - Multiplication assignment to first operand of right-hand side compound";
initialize();
result_ = tsC3x3_;
result_ *= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsC3x3_ *= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsC3x3_, result_ );
}
// Multiplication assignment to second operand of right-hand side compound
{
test_ = "DMatTSMatMult - Multiplication assignment to second operand of right-hand side compound";
initialize();
result_ = tsD3x3_;
result_ *= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsD3x3_ *= dC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsD3x3_, result_ );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the transpose dense matrix/dense matrix multiplication.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs aliasing tests for the transpose dense matrix/dense matrix
// multiplication. In case an error is detected, a \a std::runtime_error exception is
// thrown.
*/
void AliasingTest::testTDMatSMatMult()
{
//=====================================================================================
// Multiplication
//=====================================================================================
// Assignment to left-hand side operand
{
test_ = "TDMatSMatMult - Assignment to left-hand side operand";
initialize();
result_ = tdA3x4_ * sB4x3_;
tdA3x4_ = tdA3x4_ * sB4x3_;
checkResult( tdA3x4_, result_ );
}
// Assignment to first operand of left-hand side compound
{
test_ = "TDMatSMatMult - Assignment to first operand of left-hand side compound";
initialize();
result_ = ( tdA3x4_ * tdB4x3_ ) * sC3x3_;
tdA3x4_ = ( tdA3x4_ * tdB4x3_ ) * sC3x3_;
checkResult( tdA3x4_, result_ );
}
// Assignment to second operand of left-hand side compound
{
test_ = "TDMatSMatMult - Assignment to second operand of left-hand side compound";
initialize();
result_ = ( tdA3x4_ * tdB4x3_ ) * sC3x3_;
tdB4x3_ = ( tdA3x4_ * tdB4x3_ ) * sC3x3_;
checkResult( tdB4x3_, result_ );
}
// Assignment to right-hand side operand
{
test_ = "TDMatSMatMult - Assignment to right-hand side operand";
initialize();
result_ = tdA3x4_ * sB4x3_;
sB4x3_ = tdA3x4_ * sB4x3_;
checkResult( sB4x3_, result_ );
}
// Assignment to first operand of right-hand side compound
{
test_ = "TDMatSMatMult - Assignment to first operand of right-hand side compound";
initialize();
result_ = tdC3x3_ * ( sA3x4_ * sB4x3_ );
sA3x4_ = tdC3x3_ * ( sA3x4_ * sB4x3_ );
checkResult( sA3x4_, result_ );
}
// Assignment to second operand of right-hand side compound
{
test_ = "TDMatSMatMult - Assignment to second operand of right-hand side compound";
initialize();
result_ = tdC3x3_ * ( sA3x4_ * sB4x3_ );
sB4x3_ = tdC3x3_ * ( sA3x4_ * sB4x3_ );
checkResult( sB4x3_, result_ );
}
//=====================================================================================
// Multiplication with addition assignment
//=====================================================================================
// Addition assignment to left-hand side operand
{
test_ = "TDMatSMatMult - Addition assignment to left-hand side operand";
initialize();
result_ = tdC3x3_;
result_ += tdC3x3_ * sC3x3_;
tdC3x3_ += tdC3x3_ * sC3x3_;
checkResult( tdC3x3_, result_ );
}
// Addition assignment to first operand of left-hand side compound
{
test_ = "TDMatSMatMult - Addition assignment to first operand of left-hand side compound";
initialize();
result_ = tdC3x3_;
result_ += ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
tdC3x3_ += ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
checkResult( tdC3x3_, result_ );
}
// Addition assignment to second operand of left-hand side compound
{
test_ = "TDMatSMatMult - Addition assignment to second operand of left-hand side compound";
initialize();
result_ = tdD3x3_;
result_ += ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
tdD3x3_ += ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
checkResult( tdD3x3_, result_ );
}
// Addition assignment to right-hand side operand
{
test_ = "TDMatSMatMult - Addition assignment to right-hand side operand";
initialize();
result_ = sC3x3_;
result_ += tdC3x3_ * sC3x3_;
sC3x3_ += tdC3x3_ * sC3x3_;
checkResult( sC3x3_, result_ );
}
// Addition assignment to first operand of right-hand side compound
{
test_ = "TDMatSMatMult - Addition assignment to first operand of right-hand side compound";
initialize();
result_ = sC3x3_;
result_ += tdC3x3_ * ( sC3x3_ * sD3x3_ );
sC3x3_ += tdC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sC3x3_, result_ );
}
// Addition assignment to second operand of right-hand side compound
{
test_ = "TDMatSMatMult - Addition assignment to second operand of right-hand side compound";
initialize();
result_ = sD3x3_;
result_ += tdC3x3_ * ( sC3x3_ * sD3x3_ );
sD3x3_ += tdC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sD3x3_, result_ );
}
//=====================================================================================
// Multiplication with subtraction assignment
//=====================================================================================
// Subtraction assignment to left-hand side operand
{
test_ = "TDMatSMatMult - Subtraction assignment to left-hand side operand";
initialize();
result_ = tdC3x3_;
result_ -= tdC3x3_ * sC3x3_;
tdC3x3_ -= tdC3x3_ * sC3x3_;
checkResult( tdC3x3_, result_ );
}
// Subtraction assignment to first operand of left-hand side compound
{
test_ = "TDMatSMatMult - Subtraction assignment to first operand of left-hand side compound";
initialize();
result_ = tdC3x3_;
result_ -= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
tdC3x3_ -= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
checkResult( tdC3x3_, result_ );
}
// Subtraction assignment to second operand of left-hand side compound
{
test_ = "TDMatSMatMult - Subtraction assignment to second operand of left-hand side compound";
initialize();
result_ = tdD3x3_;
result_ -= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
tdD3x3_ -= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
checkResult( tdD3x3_, result_ );
}
// Subtraction assignment to right-hand side operand
{
test_ = "TDMatSMatMult - Subtraction assignment to right-hand side operand";
initialize();
result_ = sC3x3_;
result_ -= tdC3x3_ * sC3x3_;
sC3x3_ -= tdC3x3_ * sC3x3_;
checkResult( sC3x3_, result_ );
}
// Subtraction assignment to first operand of right-hand side compound
{
test_ = "TDMatSMatMult - Subtraction assignment to first operand of right-hand side compound";
initialize();
result_ = sC3x3_;
result_ -= tdC3x3_ * ( sC3x3_ * sD3x3_ );
sC3x3_ -= tdC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sC3x3_, result_ );
}
// Subtraction assignment to second operand of right-hand side compound
{
test_ = "TDMatSMatMult - Subtraction assignment to second operand of right-hand side compound";
initialize();
result_ = sD3x3_;
result_ -= tdC3x3_ * ( sC3x3_ * sD3x3_ );
sD3x3_ -= tdC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sD3x3_, result_ );
}
//=====================================================================================
// Multiplication with multiplication assignment
//=====================================================================================
// Multiplication assignment to left-hand side operand
{
test_ = "TDMatSMatMult - Multiplication assignment to left-hand side operand";
initialize();
result_ = tdC3x3_;
result_ *= tdC3x3_ * sC3x3_;
tdC3x3_ *= tdC3x3_ * sC3x3_;
checkResult( tdC3x3_, result_ );
}
// Multiplication assignment to first operand of left-hand side compound
{
test_ = "TDMatSMatMult - Multiplication assignment to first operand of left-hand side compound";
initialize();
result_ = tdC3x3_;
result_ *= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
tdC3x3_ *= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
checkResult( tdC3x3_, result_ );
}
// Multiplication assignment to second operand of left-hand side compound
{
test_ = "TDMatSMatMult - Multiplication assignment to first operand of left-hand side compound";
initialize();
result_ = tdD3x3_;
result_ *= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
tdD3x3_ *= ( tdC3x3_ * tdD3x3_ ) * sC3x3_;
checkResult( tdD3x3_, result_ );
}
// Multiplication assignment to right-hand side operand
{
test_ = "TDMatSMatMult - Multiplication assignment to right-hand side operand";
initialize();
result_ = sC3x3_;
result_ *= tdC3x3_ * sC3x3_;
sC3x3_ *= tdC3x3_ * sC3x3_;
checkResult( sC3x3_, result_ );
}
// Multiplication assignment to first operand of right-hand side compound
{
test_ = "TDMatSMatMult - Multiplication assignment to first operand of right-hand side compound";
initialize();
result_ = sC3x3_;
result_ *= tdC3x3_ * ( sC3x3_ * sD3x3_ );
sC3x3_ *= tdC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sC3x3_, result_ );
}
// Multiplication assignment to second operand of right-hand side compound
{
test_ = "TDMatSMatMult - Multiplication assignment to second operand of right-hand side compound";
initialize();
result_ = sD3x3_;
result_ *= tdC3x3_ * ( sC3x3_ * sD3x3_ );
sD3x3_ *= tdC3x3_ * ( sC3x3_ * sD3x3_ );
checkResult( sD3x3_, result_ );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the transpose dense matrix/transpose dense matrix multiplication.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs aliasing tests for the transpose dense matrix/transpose dense
// matrix multiplication. In case an error is detected, a \a std::runtime_error exception
// is thrown.
*/
void AliasingTest::testTDMatTSMatMult()
{
//=====================================================================================
// Multiplication
//=====================================================================================
// Assignment to left-hand side operand
{
test_ = "TDMatTSMatMult - Assignment to left-hand side operand";
initialize();
result_ = tdA3x4_ * tsB4x3_;
tdA3x4_ = tdA3x4_ * tsB4x3_;
checkResult( tdA3x4_, result_ );
}
// Assignment to first operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Assignment to first operand of left-hand side compound";
initialize();
result_ = ( tdA3x4_ * tdB4x3_ ) * tsC3x3_;
tdA3x4_ = ( tdA3x4_ * tdB4x3_ ) * tsC3x3_;
checkResult( tdA3x4_, result_ );
}
// Assignment to second operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Assignment to second operand of left-hand side compound";
initialize();
result_ = ( tdA3x4_ * tdB4x3_ ) * tsC3x3_;
tdB4x3_ = ( tdA3x4_ * tdB4x3_ ) * tsC3x3_;
checkResult( tdB4x3_, result_ );
}
// Assignment to right-hand side operand
{
test_ = "TDMatTSMatMult - Assignment to right-hand side operand";
initialize();
result_ = tdA3x4_ * tsB4x3_;
tsB4x3_ = tdA3x4_ * tsB4x3_;
checkResult( tsB4x3_, result_ );
}
// Assignment to first operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Assignment to first operand of right-hand side compound";
initialize();
result_ = tdC3x3_ * ( tsA3x4_ * tsB4x3_ );
tsA3x4_ = tdC3x3_ * ( tsA3x4_ * tsB4x3_ );
checkResult( tsA3x4_, result_ );
}
// Assignment to second operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Assignment to second operand of right-hand side compound";
initialize();
result_ = tdC3x3_ * ( tsA3x4_ * tsB4x3_ );
tsB4x3_ = tdC3x3_ * ( tsA3x4_ * tsB4x3_ );
checkResult( tsB4x3_, result_ );
}
//=====================================================================================
// Multiplication with addition assignment
//=====================================================================================
// Addition assignment to left-hand side operand
{
test_ = "TDMatTSMatMult - Addition assignment to left-hand side operand";
initialize();
result_ = tdC3x3_;
result_ += tdC3x3_ * tsC3x3_;
tdC3x3_ += tdC3x3_ * tsC3x3_;
checkResult( tdC3x3_, result_ );
}
// Addition assignment to first operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Addition assignment to first operand of left-hand side compound";
initialize();
result_ = tdC3x3_;
result_ += ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
tdC3x3_ += ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
checkResult( tdC3x3_, result_ );
}
// Addition assignment to second operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Addition assignment to second operand of left-hand side compound";
initialize();
result_ = tdD3x3_;
result_ += ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
tdD3x3_ += ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
checkResult( tdD3x3_, result_ );
}
// Addition assignment to right-hand side operand
{
test_ = "TDMatTSMatMult - Addition assignment to right-hand side operand";
initialize();
result_ = tsC3x3_;
result_ += tdC3x3_ * tsC3x3_;
tsC3x3_ += tdC3x3_ * tsC3x3_;
checkResult( tsC3x3_, result_ );
}
// Addition assignment to first operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Addition assignment to first operand of right-hand side compound";
initialize();
result_ = tsC3x3_;
result_ += tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsC3x3_ += tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsC3x3_, result_ );
}
// Addition assignment to second operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Addition assignment to second operand of right-hand side compound";
initialize();
result_ = tsD3x3_;
result_ += tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsD3x3_ += tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsD3x3_, result_ );
}
//=====================================================================================
// Multiplication with subtraction assignment
//=====================================================================================
// Subtraction assignment to left-hand side operand
{
test_ = "TDMatTSMatMult - Subtraction assignment to left-hand side operand";
initialize();
result_ = tdC3x3_;
result_ -= tdC3x3_ * tsC3x3_;
tdC3x3_ -= tdC3x3_ * tsC3x3_;
checkResult( tdC3x3_, result_ );
}
// Subtraction assignment to first operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Subtraction assignment to first operand of left-hand side compound";
initialize();
result_ = tdC3x3_;
result_ -= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
tdC3x3_ -= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
checkResult( tdC3x3_, result_ );
}
// Subtraction assignment to second operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Subtraction assignment to second operand of left-hand side compound";
initialize();
result_ = tdD3x3_;
result_ -= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
tdD3x3_ -= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
checkResult( tdD3x3_, result_ );
}
// Subtraction assignment to right-hand side operand
{
test_ = "TDMatTSMatMult - Subtraction assignment to right-hand side operand";
initialize();
result_ = tsC3x3_;
result_ -= tdC3x3_ * tsC3x3_;
tsC3x3_ -= tdC3x3_ * tsC3x3_;
checkResult( tsC3x3_, result_ );
}
// Subtraction assignment to first operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Subtraction assignment to first operand of right-hand side compound";
initialize();
result_ = tsC3x3_;
result_ -= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsC3x3_ -= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsC3x3_, result_ );
}
// Subtraction assignment to second operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Subtraction assignment to second operand of right-hand side compound";
initialize();
result_ = tsD3x3_;
result_ -= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsD3x3_ -= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsD3x3_, result_ );
}
//=====================================================================================
// Multiplication with multiplication assignment
//=====================================================================================
// Multiplication assignment to left-hand side operand
{
test_ = "TDMatTSMatMult - Multiplication assignment to left-hand side operand";
initialize();
result_ = tdC3x3_;
result_ *= tdC3x3_ * tsC3x3_;
tdC3x3_ *= tdC3x3_ * tsC3x3_;
checkResult( tdC3x3_, result_ );
}
// Multiplication assignment to first operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Multiplication assignment to first operand of left-hand side compound";
initialize();
result_ = tdC3x3_;
result_ *= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
tdC3x3_ *= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
checkResult( tdC3x3_, result_ );
}
// Multiplication assignment to second operand of left-hand side compound
{
test_ = "TDMatTSMatMult - Multiplication assignment to second operand of left-hand side compound";
initialize();
result_ = tdD3x3_;
result_ *= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
tdD3x3_ *= ( tdC3x3_ * tdD3x3_ ) * tsC3x3_;
checkResult( tdD3x3_, result_ );
}
// Multiplication assignment to right-hand side operand
{
test_ = "TDMatTSMatMult - Multiplication assignment to right-hand side operand";
initialize();
result_ = tsC3x3_;
result_ *= tdC3x3_ * tsC3x3_;
tsC3x3_ *= tdC3x3_ * tsC3x3_;
checkResult( tsC3x3_, result_ );
}
// Multiplication assignment to first operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Multiplication assignment to first operand of right-hand side compound";
initialize();
result_ = tsC3x3_;
result_ *= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsC3x3_ *= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsC3x3_, result_ );
}
// Multiplication assignment to second operand of right-hand side compound
{
test_ = "TDMatTSMatMult - Multiplication assignment to second operand of right-hand side compound";
initialize();
result_ = tsD3x3_;
result_ *= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
tsD3x3_ *= tdC3x3_ * ( tsC3x3_ * tsD3x3_ );
checkResult( tsD3x3_, result_ );
}
}
//*************************************************************************************************
//=================================================================================================
//
// UTILITY FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Initialization of all member vectors and matrices.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function initializes all member vectors and matrices to specific predetermined values.
*/
void AliasingTest::initialize()
{
//=====================================================================================
// Initialization of the dense matrices
//=====================================================================================
// Initializing the first row-major dense matrix
dA3x4_.resize( 3UL, 4UL, false );
dA3x4_(0,0) = -1;
dA3x4_(0,1) = 0;
dA3x4_(0,2) = -2;
dA3x4_(0,3) = 0;
dA3x4_(1,0) = 0;
dA3x4_(1,1) = 2;
dA3x4_(1,2) = -3;
dA3x4_(1,3) = 1;
dA3x4_(2,0) = 0;
dA3x4_(2,1) = 1;
dA3x4_(2,2) = 2;
dA3x4_(2,3) = 2;
// Initializing the second row-major dense matrix
dB4x3_.resize( 4UL, 3UL, false );
dB4x3_(0,0) = 1;
dB4x3_(0,1) = 0;
dB4x3_(0,2) = -3;
dB4x3_(1,0) = 0;
dB4x3_(1,1) = -1;
dB4x3_(1,2) = 0;
dB4x3_(2,0) = 0;
dB4x3_(2,1) = 2;
dB4x3_(2,2) = 1;
dB4x3_(3,0) = 2;
dB4x3_(3,1) = 1;
dB4x3_(3,2) = -2;
// Initializing the third row-major dense matrix
dC3x3_.resize( 3UL, 3UL, false );
dC3x3_(0,0) = 1;
dC3x3_(0,1) = 0;
dC3x3_(0,2) = 2;
dC3x3_(1,0) = 0;
dC3x3_(1,1) = 3;
dC3x3_(1,2) = -1;
dC3x3_(2,0) = -1;
dC3x3_(2,1) = 0;
dC3x3_(2,2) = 2;
// Initializing the fourth row-major dense matrix
dD3x3_.resize( 3UL, 3UL, false );
dD3x3_(0,0) = 0;
dD3x3_(0,1) = -1;
dD3x3_(0,2) = 0;
dD3x3_(1,0) = 1;
dD3x3_(1,1) = -2;
dD3x3_(1,2) = 2;
dD3x3_(2,0) = 0;
dD3x3_(2,1) = 0;
dD3x3_(2,2) = -3;
// Initializing the first column-major dense matrix
tdA3x4_.resize( 3UL, 4UL, false );
tdA3x4_.resize( 3UL, 4UL, false );
tdA3x4_(0,0) = -1;
tdA3x4_(0,1) = 0;
tdA3x4_(0,2) = -2;
tdA3x4_(0,3) = 0;
tdA3x4_(1,0) = 0;
tdA3x4_(1,1) = 2;
tdA3x4_(1,2) = -3;
tdA3x4_(1,3) = 1;
tdA3x4_(2,0) = 0;
tdA3x4_(2,1) = 1;
tdA3x4_(2,2) = 2;
tdA3x4_(2,3) = 2;
// Initializing the second column-major dense matrix
tdB4x3_.resize( 4UL, 3UL, false );
tdB4x3_(0,0) = 1;
tdB4x3_(0,1) = 0;
tdB4x3_(0,2) = -3;
tdB4x3_(1,0) = 0;
tdB4x3_(1,1) = -1;
tdB4x3_(1,2) = 0;
tdB4x3_(2,0) = 0;
tdB4x3_(2,1) = 2;
tdB4x3_(2,2) = 1;
tdB4x3_(3,0) = 2;
tdB4x3_(3,1) = 1;
tdB4x3_(3,2) = -2;
// Initializing the third column-major dense matrix
tdC3x3_.resize( 3UL, 3UL, false );
tdC3x3_(0,0) = 1;
tdC3x3_(0,1) = 0;
tdC3x3_(0,2) = 2;
tdC3x3_(1,0) = 0;
tdC3x3_(1,1) = 3;
tdC3x3_(1,2) = -1;
tdC3x3_(2,0) = -1;
tdC3x3_(2,1) = 0;
tdC3x3_(2,2) = 2;
// Initializing the fourth column-major dense matrix
tdD3x3_.resize( 3UL, 3UL, false );
tdD3x3_(0,0) = 0;
tdD3x3_(0,1) = -1;
tdD3x3_(0,2) = 0;
tdD3x3_(1,0) = 1;
tdD3x3_(1,1) = -2;
tdD3x3_(1,2) = 2;
tdD3x3_(2,0) = 0;
tdD3x3_(2,1) = 0;
tdD3x3_(2,2) = -3;
//=====================================================================================
// Initialization of the sparse matrices
//=====================================================================================
// Initializing the first row-major dense matrix
sA3x4_.resize( 3UL, 4UL, false );
sA3x4_.reset();
sA3x4_(0,0) = -1;
sA3x4_(0,2) = -2;
sA3x4_(1,1) = 2;
sA3x4_(1,2) = -3;
sA3x4_(1,3) = 1;
sA3x4_(2,1) = 1;
sA3x4_(2,2) = 2;
sA3x4_(2,3) = 2;
// Initializing the second row-major dense matrix
sB4x3_.resize( 4UL, 3UL, false );
sB4x3_.reset();
sB4x3_(0,0) = 1;
sB4x3_(0,2) = -3;
sB4x3_(1,1) = -1;
sB4x3_(2,1) = 2;
sB4x3_(2,2) = 1;
sB4x3_(3,0) = 2;
sB4x3_(3,1) = 1;
sB4x3_(3,2) = -2;
// Initializing the third row-major dense matrix
sC3x3_.resize( 3UL, 3UL, false );
sC3x3_.reset();
sC3x3_(0,0) = 1;
sC3x3_(0,2) = 2;
sC3x3_(1,1) = 3;
sC3x3_(1,2) = -1;
sC3x3_(2,0) = -1;
sC3x3_(2,2) = 2;
// Initializing the fourth row-major dense matrix
sD3x3_.resize( 3UL, 3UL, false );
sD3x3_.reset();
sD3x3_(0,1) = -1;
sD3x3_(1,0) = 1;
sD3x3_(1,1) = -2;
sD3x3_(1,2) = 2;
sD3x3_(2,2) = -3;
// Initializing the first column-major dense matrix
tsA3x4_.resize( 3UL, 4UL, false );
tsA3x4_.reset();
tsA3x4_(0,0) = -1;
tsA3x4_(0,2) = -2;
tsA3x4_(1,1) = 2;
tsA3x4_(1,2) = -3;
tsA3x4_(1,3) = 1;
tsA3x4_(2,1) = 1;
tsA3x4_(2,2) = 2;
tsA3x4_(2,3) = 2;
// Initializing the second column-major dense matrix
tsB4x3_.resize( 4UL, 3UL, false );
tsB4x3_.reset();
tsB4x3_(0,0) = 1;
tsB4x3_(0,2) = -3;
tsB4x3_(1,1) = -1;
tsB4x3_(2,1) = 2;
tsB4x3_(2,2) = 1;
tsB4x3_(3,0) = 2;
tsB4x3_(3,1) = 1;
tsB4x3_(3,2) = -2;
// Initializing the third column-major dense matrix
tsC3x3_.resize( 3UL, 3UL, false );
tsC3x3_.reset();
tsC3x3_(0,0) = 1;
tsC3x3_(0,2) = 2;
tsC3x3_(1,1) = 3;
tsC3x3_(1,2) = -1;
tsC3x3_(2,0) = -1;
tsC3x3_(2,2) = 2;
// Initializing the fourth column-major dense matrix
tsD3x3_.resize( 3UL, 3UL, false );
tsD3x3_.reset();
tsD3x3_(0,1) = -1;
tsD3x3_(1,0) = 1;
tsD3x3_(1,1) = -2;
tsD3x3_(1,2) = 2;
tsD3x3_(2,2) = -3;
}
//*************************************************************************************************
} // namespace dmatsmatmult
} // namespace mathtest
} // namespace blazetest
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running aliasing test..." << std::endl;
try
{
RUN_DMATSMATMULT_ALIASING_TEST;
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during aliasing test:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
| bsd-3-clause |
xianyi/OpenBLAS | driver/level2/trsv_L.c | 22 | 4026 | /*********************************************************************/
/* Copyright 2009, 2010 The University of Texas at Austin. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* 1. Redistributions of source code must retain the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/* The views and conclusions contained in the software and */
/* documentation are those of the authors and should not be */
/* interpreted as representing official policies, either expressed */
/* or implied, of The University of Texas at Austin. */
/*********************************************************************/
#include <stdio.h>
#include <ctype.h>
#include "common.h"
const static FLOAT dm1 = -1.;
#undef GEMV_UNROLL
#define GEMV_UNROLL DTB_ENTRIES
int CNAME(BLASLONG m, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG incb, void *buffer){
BLASLONG i, is, min_i;
FLOAT *gemvbuffer = (FLOAT *)buffer;
FLOAT *B = b;
if (incb != 1) {
B = buffer;
gemvbuffer = (FLOAT *)(((BLASLONG)buffer + m * sizeof(FLOAT) + 4095) & ~4095);
COPY_K(m, b, incb, buffer, 1);
}
for (is = 0; is < m; is += GEMV_UNROLL){
min_i = MIN(m - is, GEMV_UNROLL);
#ifdef TRANSA
if (is > 0){
GEMV_T(is, min_i, 0, dm1,
a + is * lda , lda,
B, 1,
B + is, 1, gemvbuffer);
}
#endif
for (i = 0; i < min_i; i++) {
FLOAT *AA = a + is + (i + is) * lda;
FLOAT *BB = B + is;
#ifdef TRANSA
if (i > 0) BB[i] -= DOTU_K(i, AA, 1, BB, 1);
#endif
#ifndef UNIT
BB[i] /= AA[i];
#endif
#ifndef TRANSA
if (i < min_i - 1) {
AXPYU_K(min_i - i - 1 , 0, 0, - BB[i],
AA + i + 1, 1, BB + i + 1, 1, NULL, 0);
}
#endif
}
#ifndef TRANSA
if (m - is > min_i){
GEMV_N(m - is - min_i, min_i, 0, dm1,
a + is + min_i + is * lda, lda,
B + is, 1,
B + (is + min_i), 1, gemvbuffer);
}
#endif
}
if (incb != 1) {
COPY_K(m, buffer, 1, b, incb);
}
return 0;
}
| bsd-3-clause |
devoncarew/sky_engine | third_party/txt/src/minikin/LayoutUtils.cpp | 23 | 2717 | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "Minikin"
#include "LayoutUtils.h"
namespace minikin {
const uint16_t CHAR_NBSP = 0x00A0;
/*
* Determine whether the code unit is a word space for the purposes of
* justification.
*/
bool isWordSpace(uint16_t code_unit) {
return code_unit == ' ' || code_unit == CHAR_NBSP;
}
/**
* For the purpose of layout, a word break is a boundary with no
* kerning or complex script processing. This is necessarily a
* heuristic, but should be accurate most of the time.
*/
static bool isWordBreakAfter(uint16_t c) {
if (isWordSpace(c) || (c >= 0x2000 && c <= 0x200a) || c == 0x3000) {
// spaces
return true;
}
// Note: kana is not included, as sophisticated fonts may kern kana
return false;
}
static bool isWordBreakBefore(uint16_t c) {
// CJK ideographs (and yijing hexagram symbols)
return isWordBreakAfter(c) || (c >= 0x3400 && c <= 0x9fff);
}
/**
* Return offset of previous word break. It is either < offset or == 0.
*/
size_t getPrevWordBreakForCache(const uint16_t* chars,
size_t offset,
size_t len) {
if (offset == 0)
return 0;
if (offset > len)
offset = len;
if (isWordBreakBefore(chars[offset - 1])) {
return offset - 1;
}
for (size_t i = offset - 1; i > 0; i--) {
if (isWordBreakBefore(chars[i]) || isWordBreakAfter(chars[i - 1])) {
return i;
}
}
return 0;
}
/**
* Return offset of next word break. It is either > offset or == len.
*/
size_t getNextWordBreakForCache(const uint16_t* chars,
size_t offset,
size_t len) {
if (offset >= len)
return len;
if (isWordBreakAfter(chars[offset])) {
return offset + 1;
}
for (size_t i = offset + 1; i < len; i++) {
// No need to check isWordBreakAfter(chars[i - 1]) since it is checked
// in previous iteration. Note that isWordBreakBefore returns true
// whenever isWordBreakAfter returns true.
if (isWordBreakBefore(chars[i])) {
return i;
}
}
return len;
}
} // namespace minikin
| bsd-3-clause |
bsergean/angle | src/compiler/translator/ValidateSwitch.cpp | 26 | 5835 | //
// Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "compiler/translator/ValidateSwitch.h"
#include "compiler/translator/ParseContext.h"
bool ValidateSwitch::validate(TBasicType switchType, TParseContext *context,
TIntermAggregate *statementList, const TSourceLoc &loc)
{
ValidateSwitch validate(switchType, context);
ASSERT(statementList);
statementList->traverse(&validate);
return validate.validateInternal(loc);
}
ValidateSwitch::ValidateSwitch(TBasicType switchType, TParseContext *context)
: TIntermTraverser(true, false, true),
mSwitchType(switchType),
mContext(context),
mCaseTypeMismatch(false),
mFirstCaseFound(false),
mStatementBeforeCase(false),
mLastStatementWasCase(false),
mControlFlowDepth(0),
mCaseInsideControlFlow(false),
mDefaultCount(0),
mDuplicateCases(false)
{}
void ValidateSwitch::visitSymbol(TIntermSymbol *)
{
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
}
void ValidateSwitch::visitConstantUnion(TIntermConstantUnion *)
{
// Conditions of case labels are not traversed, so this is some other constant
// Could be just a statement like "0;"
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
}
bool ValidateSwitch::visitBinary(Visit, TIntermBinary *)
{
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
return true;
}
bool ValidateSwitch::visitUnary(Visit, TIntermUnary *)
{
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
return true;
}
bool ValidateSwitch::visitSelection(Visit visit, TIntermSelection *)
{
if (visit == PreVisit)
++mControlFlowDepth;
if (visit == PostVisit)
--mControlFlowDepth;
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
return true;
}
bool ValidateSwitch::visitSwitch(Visit, TIntermSwitch *)
{
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
// Don't go into nested switch statements
return false;
}
bool ValidateSwitch::visitCase(Visit, TIntermCase *node)
{
const char *nodeStr = node->hasCondition() ? "case" : "default";
if (mControlFlowDepth > 0)
{
mContext->error(node->getLine(), "label statement nested inside control flow", nodeStr);
mCaseInsideControlFlow = true;
}
mFirstCaseFound = true;
mLastStatementWasCase = true;
if (!node->hasCondition())
{
++mDefaultCount;
if (mDefaultCount > 1)
{
mContext->error(node->getLine(), "duplicate default label", nodeStr);
}
}
else
{
TIntermConstantUnion *condition = node->getCondition()->getAsConstantUnion();
if (condition == nullptr)
{
// This can happen in error cases.
return false;
}
TBasicType conditionType = condition->getBasicType();
if (conditionType != mSwitchType)
{
mContext->error(condition->getLine(),
"case label type does not match switch init-expression type", nodeStr);
mCaseTypeMismatch = true;
}
if (conditionType == EbtInt)
{
int iConst = condition->getIConst(0);
if (mCasesSigned.find(iConst) != mCasesSigned.end())
{
mContext->error(condition->getLine(), "duplicate case label", nodeStr);
mDuplicateCases = true;
}
else
{
mCasesSigned.insert(iConst);
}
}
else if (conditionType == EbtUInt)
{
unsigned int uConst = condition->getUConst(0);
if (mCasesUnsigned.find(uConst) != mCasesUnsigned.end())
{
mContext->error(condition->getLine(), "duplicate case label", nodeStr);
mDuplicateCases = true;
}
else
{
mCasesUnsigned.insert(uConst);
}
}
// Other types are possible only in error cases, where the error has already been generated
// when parsing the case statement.
}
// Don't traverse the condition of the case statement
return false;
}
bool ValidateSwitch::visitAggregate(Visit visit, TIntermAggregate *)
{
if (getParentNode() != nullptr)
{
// This is not the statementList node, but some other node.
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
}
return true;
}
bool ValidateSwitch::visitLoop(Visit visit, TIntermLoop *)
{
if (visit == PreVisit)
++mControlFlowDepth;
if (visit == PostVisit)
--mControlFlowDepth;
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
return true;
}
bool ValidateSwitch::visitBranch(Visit, TIntermBranch *)
{
if (!mFirstCaseFound)
mStatementBeforeCase = true;
mLastStatementWasCase = false;
return true;
}
bool ValidateSwitch::validateInternal(const TSourceLoc &loc)
{
if (mStatementBeforeCase)
{
mContext->error(loc,
"statement before the first label", "switch");
}
if (mLastStatementWasCase)
{
mContext->error(loc,
"no statement between the last label and the end of the switch statement", "switch");
}
return !mStatementBeforeCase && !mLastStatementWasCase && !mCaseInsideControlFlow &&
!mCaseTypeMismatch && mDefaultCount <= 1 && !mDuplicateCases;
}
| bsd-3-clause |
Pluto-tv/blink-crosswalk | Source/web/WebSpeechRecognitionResult.cpp | 26 | 2496 | /*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "public/web/WebSpeechRecognitionResult.h"
#include "modules/speech/SpeechRecognitionAlternative.h"
#include "modules/speech/SpeechRecognitionResult.h"
#include "platform/heap/Handle.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RawPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
namespace blink {
void WebSpeechRecognitionResult::assign(const WebSpeechRecognitionResult& other)
{
m_private = other.m_private;
}
void WebSpeechRecognitionResult::assign(const WebVector<WebString>& transcripts, const WebVector<float>& confidences, bool final)
{
ASSERT(transcripts.size() == confidences.size());
HeapVector<Member<SpeechRecognitionAlternative>> alternatives(transcripts.size());
for (size_t i = 0; i < transcripts.size(); ++i)
alternatives[i] = SpeechRecognitionAlternative::create(transcripts[i], confidences[i]);
m_private = SpeechRecognitionResult::create(alternatives, final);
}
void WebSpeechRecognitionResult::reset()
{
m_private.reset();
}
WebSpeechRecognitionResult::operator SpeechRecognitionResult*() const
{
return m_private.get();
}
} // namespace blink
| bsd-3-clause |
Acidburn0zzz/webm.libvpx | vp9/encoder/x86/vp9_highbd_quantize_intrin_sse2.c | 26 | 6673 | /*
* Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <emmintrin.h>
#include "vp9/common/vp9_common.h"
#if CONFIG_VP9_HIGHBITDEPTH
// from vp9_idct.h: typedef int32_t tran_low_t;
void vp9_highbd_quantize_b_sse2(const tran_low_t *coeff_ptr,
intptr_t count,
int skip_block,
const int16_t *zbin_ptr,
const int16_t *round_ptr,
const int16_t *quant_ptr,
const int16_t *quant_shift_ptr,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
const int16_t *dequant_ptr,
uint16_t *eob_ptr,
const int16_t *scan,
const int16_t *iscan) {
int i, j, non_zero_regs = (int)count / 4, eob_i = -1;
__m128i zbins[2];
__m128i nzbins[2];
zbins[0] = _mm_set_epi32((int)zbin_ptr[1],
(int)zbin_ptr[1],
(int)zbin_ptr[1],
(int)zbin_ptr[0]);
zbins[1] = _mm_set1_epi32((int)zbin_ptr[1]);
nzbins[0] = _mm_setzero_si128();
nzbins[1] = _mm_setzero_si128();
nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]);
nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]);
(void)scan;
vpx_memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr));
vpx_memset(dqcoeff_ptr, 0, count * sizeof(*dqcoeff_ptr));
if (!skip_block) {
// Pre-scan pass
for (i = ((int)count / 4) - 1; i >= 0; i--) {
__m128i coeffs, cmp1, cmp2;
int test;
coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4));
cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]);
cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]);
cmp1 = _mm_and_si128(cmp1, cmp2);
test = _mm_movemask_epi8(cmp1);
if (test == 0xffff)
non_zero_regs--;
else
break;
}
// Quantization pass:
for (i = 0; i < non_zero_regs; i++) {
__m128i coeffs, coeffs_sign, tmp1, tmp2;
int test;
int abs_coeff[4];
int coeff_sign[4];
coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4));
coeffs_sign = _mm_srai_epi32(coeffs, 31);
coeffs = _mm_sub_epi32(
_mm_xor_si128(coeffs, coeffs_sign), coeffs_sign);
tmp1 = _mm_cmpgt_epi32(coeffs, zbins[i != 0]);
tmp2 = _mm_cmpeq_epi32(coeffs, zbins[i != 0]);
tmp1 = _mm_or_si128(tmp1, tmp2);
test = _mm_movemask_epi8(tmp1);
_mm_storeu_si128((__m128i*)abs_coeff, coeffs);
_mm_storeu_si128((__m128i*)coeff_sign, coeffs_sign);
for (j = 0; j < 4; j++) {
if (test & (1 << (4 * j))) {
int k = 4 * i + j;
int64_t tmp = clamp(abs_coeff[j] + round_ptr[k != 0],
INT32_MIN, INT32_MAX);
tmp = ((((tmp * quant_ptr[k != 0]) >> 16) + tmp) *
quant_shift_ptr[k != 0]) >> 16; // quantization
qcoeff_ptr[k] = (tmp ^ coeff_sign[j]) - coeff_sign[j];
dqcoeff_ptr[k] = qcoeff_ptr[k] * dequant_ptr[k != 0];
if (tmp)
eob_i = iscan[k] > eob_i ? iscan[k] : eob_i;
}
}
}
}
*eob_ptr = eob_i + 1;
}
void vp9_highbd_quantize_b_32x32_sse2(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t *zbin_ptr,
const int16_t *round_ptr,
const int16_t *quant_ptr,
const int16_t *quant_shift_ptr,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
const int16_t *dequant_ptr,
uint16_t *eob_ptr,
const int16_t *scan,
const int16_t *iscan) {
__m128i zbins[2];
__m128i nzbins[2];
int idx = 0;
int idx_arr[1024];
int i, eob = -1;
const int zbin0_tmp = ROUND_POWER_OF_TWO(zbin_ptr[0], 1);
const int zbin1_tmp = ROUND_POWER_OF_TWO(zbin_ptr[1], 1);
(void)scan;
zbins[0] = _mm_set_epi32(zbin1_tmp,
zbin1_tmp,
zbin1_tmp,
zbin0_tmp);
zbins[1] = _mm_set1_epi32(zbin1_tmp);
nzbins[0] = _mm_setzero_si128();
nzbins[1] = _mm_setzero_si128();
nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]);
nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]);
vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
if (!skip_block) {
// Pre-scan pass
for (i = 0; i < n_coeffs / 4; i++) {
__m128i coeffs, cmp1, cmp2;
int test;
coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4));
cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]);
cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]);
cmp1 = _mm_and_si128(cmp1, cmp2);
test = _mm_movemask_epi8(cmp1);
if (!(test & 0xf))
idx_arr[idx++] = i * 4;
if (!(test & 0xf0))
idx_arr[idx++] = i * 4 + 1;
if (!(test & 0xf00))
idx_arr[idx++] = i * 4 + 2;
if (!(test & 0xf000))
idx_arr[idx++] = i * 4 + 3;
}
// Quantization pass: only process the coefficients selected in
// pre-scan pass. Note: idx can be zero.
for (i = 0; i < idx; i++) {
const int rc = idx_arr[i];
const int coeff = coeff_ptr[rc];
const int coeff_sign = (coeff >> 31);
int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
int64_t tmp = clamp(abs_coeff +
ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1),
INT32_MIN, INT32_MAX);
tmp = ((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) *
quant_shift_ptr[rc != 0]) >> 15;
qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2;
if (tmp)
eob = iscan[idx_arr[i]] > eob ? iscan[idx_arr[i]] : eob;
}
}
*eob_ptr = eob + 1;
}
#endif
| bsd-3-clause |
UCSantaCruzComputationalGenomicsLab/clapack | SRC/dlapmt.c | 26 | 3739 | /* dlapmt.f -- translated by f2c (version 20061008).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include "f2c.h"
#include "blaswrap.h"
/* Subroutine */ int dlapmt_(logical *forwrd, integer *m, integer *n,
doublereal *x, integer *ldx, integer *k)
{
/* System generated locals */
integer x_dim1, x_offset, i__1, i__2;
/* Local variables */
integer i__, j, ii, in;
doublereal temp;
/* -- LAPACK auxiliary routine (version 3.2) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* .. Array Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* DLAPMT rearranges the columns of the M by N matrix X as specified */
/* by the permutation K(1),K(2),...,K(N) of the integers 1,...,N. */
/* If FORWRD = .TRUE., forward permutation: */
/* X(*,K(J)) is moved X(*,J) for J = 1,2,...,N. */
/* If FORWRD = .FALSE., backward permutation: */
/* X(*,J) is moved to X(*,K(J)) for J = 1,2,...,N. */
/* Arguments */
/* ========= */
/* FORWRD (input) LOGICAL */
/* = .TRUE., forward permutation */
/* = .FALSE., backward permutation */
/* M (input) INTEGER */
/* The number of rows of the matrix X. M >= 0. */
/* N (input) INTEGER */
/* The number of columns of the matrix X. N >= 0. */
/* X (input/output) DOUBLE PRECISION array, dimension (LDX,N) */
/* On entry, the M by N matrix X. */
/* On exit, X contains the permuted matrix X. */
/* LDX (input) INTEGER */
/* The leading dimension of the array X, LDX >= MAX(1,M). */
/* K (input/output) INTEGER array, dimension (N) */
/* On entry, K contains the permutation vector. K is used as */
/* internal workspace, but reset to its original value on */
/* output. */
/* ===================================================================== */
/* .. Local Scalars .. */
/* .. */
/* .. Executable Statements .. */
/* Parameter adjustments */
x_dim1 = *ldx;
x_offset = 1 + x_dim1;
x -= x_offset;
--k;
/* Function Body */
if (*n <= 1) {
return 0;
}
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
k[i__] = -k[i__];
/* L10: */
}
if (*forwrd) {
/* Forward permutation */
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
if (k[i__] > 0) {
goto L40;
}
j = i__;
k[j] = -k[j];
in = k[j];
L20:
if (k[in] > 0) {
goto L40;
}
i__2 = *m;
for (ii = 1; ii <= i__2; ++ii) {
temp = x[ii + j * x_dim1];
x[ii + j * x_dim1] = x[ii + in * x_dim1];
x[ii + in * x_dim1] = temp;
/* L30: */
}
k[in] = -k[in];
j = in;
in = k[in];
goto L20;
L40:
/* L50: */
;
}
} else {
/* Backward permutation */
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
if (k[i__] > 0) {
goto L80;
}
k[i__] = -k[i__];
j = k[i__];
L60:
if (j == i__) {
goto L80;
}
i__2 = *m;
for (ii = 1; ii <= i__2; ++ii) {
temp = x[ii + i__ * x_dim1];
x[ii + i__ * x_dim1] = x[ii + j * x_dim1];
x[ii + j * x_dim1] = temp;
/* L70: */
}
k[j] = -k[j];
j = k[j];
goto L60;
L80:
/* L90: */
;
}
}
return 0;
/* End of DLAPMT */
} /* dlapmt_ */
| bsd-3-clause |
CVML/OpenBLAS | lapack-netlib/SRC/ssytrs.f | 29 | 12401 | *> \brief \b SSYTRS
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download SSYTRS + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ssytrs.f">
*> [TGZ]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ssytrs.f">
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssytrs.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
*
* SUBROUTINE SSYTRS( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO )
*
* .. Scalar Arguments ..
* CHARACTER UPLO
* INTEGER INFO, LDA, LDB, N, NRHS
* ..
* .. Array Arguments ..
* INTEGER IPIV( * )
* REAL A( LDA, * ), B( LDB, * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> SSYTRS solves a system of linear equations A*X = B with a real
*> symmetric matrix A using the factorization A = U*D*U**T or
*> A = L*D*L**T computed by SSYTRF.
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] UPLO
*> \verbatim
*> UPLO is CHARACTER*1
*> Specifies whether the details of the factorization are stored
*> as an upper or lower triangular matrix.
*> = 'U': Upper triangular, form is A = U*D*U**T;
*> = 'L': Lower triangular, form is A = L*D*L**T.
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The order of the matrix A. N >= 0.
*> \endverbatim
*>
*> \param[in] NRHS
*> \verbatim
*> NRHS is INTEGER
*> The number of right hand sides, i.e., the number of columns
*> of the matrix B. NRHS >= 0.
*> \endverbatim
*>
*> \param[in] A
*> \verbatim
*> A is REAL array, dimension (LDA,N)
*> The block diagonal matrix D and the multipliers used to
*> obtain the factor U or L as computed by SSYTRF.
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*> LDA is INTEGER
*> The leading dimension of the array A. LDA >= max(1,N).
*> \endverbatim
*>
*> \param[in] IPIV
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> Details of the interchanges and the block structure of D
*> as determined by SSYTRF.
*> \endverbatim
*>
*> \param[in,out] B
*> \verbatim
*> B is REAL array, dimension (LDB,NRHS)
*> On entry, the right hand side matrix B.
*> On exit, the solution matrix X.
*> \endverbatim
*>
*> \param[in] LDB
*> \verbatim
*> LDB is INTEGER
*> The leading dimension of the array B. LDB >= max(1,N).
*> \endverbatim
*>
*> \param[out] INFO
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th argument had an illegal value
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date November 2011
*
*> \ingroup realSYcomputational
*
* =====================================================================
SUBROUTINE SSYTRS( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO )
*
* -- LAPACK computational routine (version 3.4.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2011
*
* .. Scalar Arguments ..
CHARACTER UPLO
INTEGER INFO, LDA, LDB, N, NRHS
* ..
* .. Array Arguments ..
INTEGER IPIV( * )
REAL A( LDA, * ), B( LDB, * )
* ..
*
* =====================================================================
*
* .. Parameters ..
REAL ONE
PARAMETER ( ONE = 1.0E+0 )
* ..
* .. Local Scalars ..
LOGICAL UPPER
INTEGER J, K, KP
REAL AK, AKM1, AKM1K, BK, BKM1, DENOM
* ..
* .. External Functions ..
LOGICAL LSAME
EXTERNAL LSAME
* ..
* .. External Subroutines ..
EXTERNAL SGEMV, SGER, SSCAL, SSWAP, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX
* ..
* .. Executable Statements ..
*
INFO = 0
UPPER = LSAME( UPLO, 'U' )
IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
INFO = -1
ELSE IF( N.LT.0 ) THEN
INFO = -2
ELSE IF( NRHS.LT.0 ) THEN
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -8
END IF
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'SSYTRS', -INFO )
RETURN
END IF
*
* Quick return if possible
*
IF( N.EQ.0 .OR. NRHS.EQ.0 )
$ RETURN
*
IF( UPPER ) THEN
*
* Solve A*X = B, where A = U*D*U**T.
*
* First solve U*D*X = B, overwriting B with X.
*
* K is the main loop index, decreasing from N to 1 in steps of
* 1 or 2, depending on the size of the diagonal blocks.
*
K = N
10 CONTINUE
*
* If K < 1, exit from loop.
*
IF( K.LT.1 )
$ GO TO 30
*
IF( IPIV( K ).GT.0 ) THEN
*
* 1 x 1 diagonal block
*
* Interchange rows K and IPIV(K).
*
KP = IPIV( K )
IF( KP.NE.K )
$ CALL SSWAP( NRHS, B( K, 1 ), LDB, B( KP, 1 ), LDB )
*
* Multiply by inv(U(K)), where U(K) is the transformation
* stored in column K of A.
*
CALL SGER( K-1, NRHS, -ONE, A( 1, K ), 1, B( K, 1 ), LDB,
$ B( 1, 1 ), LDB )
*
* Multiply by the inverse of the diagonal block.
*
CALL SSCAL( NRHS, ONE / A( K, K ), B( K, 1 ), LDB )
K = K - 1
ELSE
*
* 2 x 2 diagonal block
*
* Interchange rows K-1 and -IPIV(K).
*
KP = -IPIV( K )
IF( KP.NE.K-1 )
$ CALL SSWAP( NRHS, B( K-1, 1 ), LDB, B( KP, 1 ), LDB )
*
* Multiply by inv(U(K)), where U(K) is the transformation
* stored in columns K-1 and K of A.
*
CALL SGER( K-2, NRHS, -ONE, A( 1, K ), 1, B( K, 1 ), LDB,
$ B( 1, 1 ), LDB )
CALL SGER( K-2, NRHS, -ONE, A( 1, K-1 ), 1, B( K-1, 1 ),
$ LDB, B( 1, 1 ), LDB )
*
* Multiply by the inverse of the diagonal block.
*
AKM1K = A( K-1, K )
AKM1 = A( K-1, K-1 ) / AKM1K
AK = A( K, K ) / AKM1K
DENOM = AKM1*AK - ONE
DO 20 J = 1, NRHS
BKM1 = B( K-1, J ) / AKM1K
BK = B( K, J ) / AKM1K
B( K-1, J ) = ( AK*BKM1-BK ) / DENOM
B( K, J ) = ( AKM1*BK-BKM1 ) / DENOM
20 CONTINUE
K = K - 2
END IF
*
GO TO 10
30 CONTINUE
*
* Next solve U**T *X = B, overwriting B with X.
*
* K is the main loop index, increasing from 1 to N in steps of
* 1 or 2, depending on the size of the diagonal blocks.
*
K = 1
40 CONTINUE
*
* If K > N, exit from loop.
*
IF( K.GT.N )
$ GO TO 50
*
IF( IPIV( K ).GT.0 ) THEN
*
* 1 x 1 diagonal block
*
* Multiply by inv(U**T(K)), where U(K) is the transformation
* stored in column K of A.
*
CALL SGEMV( 'Transpose', K-1, NRHS, -ONE, B, LDB, A( 1, K ),
$ 1, ONE, B( K, 1 ), LDB )
*
* Interchange rows K and IPIV(K).
*
KP = IPIV( K )
IF( KP.NE.K )
$ CALL SSWAP( NRHS, B( K, 1 ), LDB, B( KP, 1 ), LDB )
K = K + 1
ELSE
*
* 2 x 2 diagonal block
*
* Multiply by inv(U**T(K+1)), where U(K+1) is the transformation
* stored in columns K and K+1 of A.
*
CALL SGEMV( 'Transpose', K-1, NRHS, -ONE, B, LDB, A( 1, K ),
$ 1, ONE, B( K, 1 ), LDB )
CALL SGEMV( 'Transpose', K-1, NRHS, -ONE, B, LDB,
$ A( 1, K+1 ), 1, ONE, B( K+1, 1 ), LDB )
*
* Interchange rows K and -IPIV(K).
*
KP = -IPIV( K )
IF( KP.NE.K )
$ CALL SSWAP( NRHS, B( K, 1 ), LDB, B( KP, 1 ), LDB )
K = K + 2
END IF
*
GO TO 40
50 CONTINUE
*
ELSE
*
* Solve A*X = B, where A = L*D*L**T.
*
* First solve L*D*X = B, overwriting B with X.
*
* K is the main loop index, increasing from 1 to N in steps of
* 1 or 2, depending on the size of the diagonal blocks.
*
K = 1
60 CONTINUE
*
* If K > N, exit from loop.
*
IF( K.GT.N )
$ GO TO 80
*
IF( IPIV( K ).GT.0 ) THEN
*
* 1 x 1 diagonal block
*
* Interchange rows K and IPIV(K).
*
KP = IPIV( K )
IF( KP.NE.K )
$ CALL SSWAP( NRHS, B( K, 1 ), LDB, B( KP, 1 ), LDB )
*
* Multiply by inv(L(K)), where L(K) is the transformation
* stored in column K of A.
*
IF( K.LT.N )
$ CALL SGER( N-K, NRHS, -ONE, A( K+1, K ), 1, B( K, 1 ),
$ LDB, B( K+1, 1 ), LDB )
*
* Multiply by the inverse of the diagonal block.
*
CALL SSCAL( NRHS, ONE / A( K, K ), B( K, 1 ), LDB )
K = K + 1
ELSE
*
* 2 x 2 diagonal block
*
* Interchange rows K+1 and -IPIV(K).
*
KP = -IPIV( K )
IF( KP.NE.K+1 )
$ CALL SSWAP( NRHS, B( K+1, 1 ), LDB, B( KP, 1 ), LDB )
*
* Multiply by inv(L(K)), where L(K) is the transformation
* stored in columns K and K+1 of A.
*
IF( K.LT.N-1 ) THEN
CALL SGER( N-K-1, NRHS, -ONE, A( K+2, K ), 1, B( K, 1 ),
$ LDB, B( K+2, 1 ), LDB )
CALL SGER( N-K-1, NRHS, -ONE, A( K+2, K+1 ), 1,
$ B( K+1, 1 ), LDB, B( K+2, 1 ), LDB )
END IF
*
* Multiply by the inverse of the diagonal block.
*
AKM1K = A( K+1, K )
AKM1 = A( K, K ) / AKM1K
AK = A( K+1, K+1 ) / AKM1K
DENOM = AKM1*AK - ONE
DO 70 J = 1, NRHS
BKM1 = B( K, J ) / AKM1K
BK = B( K+1, J ) / AKM1K
B( K, J ) = ( AK*BKM1-BK ) / DENOM
B( K+1, J ) = ( AKM1*BK-BKM1 ) / DENOM
70 CONTINUE
K = K + 2
END IF
*
GO TO 60
80 CONTINUE
*
* Next solve L**T *X = B, overwriting B with X.
*
* K is the main loop index, decreasing from N to 1 in steps of
* 1 or 2, depending on the size of the diagonal blocks.
*
K = N
90 CONTINUE
*
* If K < 1, exit from loop.
*
IF( K.LT.1 )
$ GO TO 100
*
IF( IPIV( K ).GT.0 ) THEN
*
* 1 x 1 diagonal block
*
* Multiply by inv(L**T(K)), where L(K) is the transformation
* stored in column K of A.
*
IF( K.LT.N )
$ CALL SGEMV( 'Transpose', N-K, NRHS, -ONE, B( K+1, 1 ),
$ LDB, A( K+1, K ), 1, ONE, B( K, 1 ), LDB )
*
* Interchange rows K and IPIV(K).
*
KP = IPIV( K )
IF( KP.NE.K )
$ CALL SSWAP( NRHS, B( K, 1 ), LDB, B( KP, 1 ), LDB )
K = K - 1
ELSE
*
* 2 x 2 diagonal block
*
* Multiply by inv(L**T(K-1)), where L(K-1) is the transformation
* stored in columns K-1 and K of A.
*
IF( K.LT.N ) THEN
CALL SGEMV( 'Transpose', N-K, NRHS, -ONE, B( K+1, 1 ),
$ LDB, A( K+1, K ), 1, ONE, B( K, 1 ), LDB )
CALL SGEMV( 'Transpose', N-K, NRHS, -ONE, B( K+1, 1 ),
$ LDB, A( K+1, K-1 ), 1, ONE, B( K-1, 1 ),
$ LDB )
END IF
*
* Interchange rows K and -IPIV(K).
*
KP = -IPIV( K )
IF( KP.NE.K )
$ CALL SSWAP( NRHS, B( K, 1 ), LDB, B( KP, 1 ), LDB )
K = K - 2
END IF
*
GO TO 90
100 CONTINUE
END IF
*
RETURN
*
* End of SSYTRS
*
END
| bsd-3-clause |
codenote/chromium-test | third_party/mesa/MesaLib/src/mesa/drivers/dri/unichrome/via_context.c | 32 | 28197 | /*
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/**
* \file via_context.c
*
* \author John Sheng (presumably of either VIA Technologies or S3 Graphics)
* \author Others at VIA Technologies?
* \author Others at S3 Graphics?
*/
#include "main/glheader.h"
#include "main/context.h"
#include "main/formats.h"
#include "main/simple_list.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
#include "vbo/vbo.h"
#include "tnl/t_pipeline.h"
#include "drivers/common/driverfuncs.h"
#include "via_screen.h"
#include "via_dri.h"
#include "via_state.h"
#include "via_tex.h"
#include "via_span.h"
#include "via_tris.h"
#include "via_ioctl.h"
#include "via_fb.h"
#include <stdio.h>
#include "main/macros.h"
#include "drirenderbuffer.h"
#define need_GL_ARB_point_parameters
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "main/remap_helper.h"
#define DRIVER_DATE "20060710"
#include "vblank.h"
#include "utils.h"
GLuint VIA_DEBUG = 0;
/**
* Return various strings for \c glGetString.
*
* \sa glGetString
*/
static const GLubyte *viaGetString(GLcontext *ctx, GLenum name)
{
static char buffer[128];
unsigned offset;
switch (name) {
case GL_VENDOR:
return (GLubyte *)"VIA Technology";
case GL_RENDERER: {
static const char * const chipset_names[] = {
"UniChrome",
"CastleRock (CLE266)",
"UniChrome (KM400)",
"UniChrome (K8M800)",
"UniChrome (PM8x0/CN400)",
};
struct via_context *vmesa = VIA_CONTEXT(ctx);
unsigned id = vmesa->viaScreen->deviceID;
offset = driGetRendererString( buffer,
chipset_names[(id > VIA_PM800) ? 0 : id],
DRIVER_DATE, 0 );
return (GLubyte *)buffer;
}
default:
return NULL;
}
}
/**
* Calculate a width that satisfies the hardware's alignment requirements.
* On the Unichrome hardware, each scanline must be aligned to a multiple of
* 16 pixels.
*
* \param width Minimum buffer width, in pixels.
*
* \returns A pixel width that meets the alignment requirements.
*/
static INLINE unsigned
buffer_align( unsigned width )
{
return (width + 0x0f) & ~0x0f;
}
static void
viaDeleteRenderbuffer(struct gl_renderbuffer *rb)
{
/* Don't free() since we're contained in via_context struct. */
}
static GLboolean
viaRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
return GL_TRUE;
}
static void
viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format,
__DRIdrawable *dPriv)
{
const GLuint name = 0;
struct gl_renderbuffer *rb = & vrb->Base;
vrb->dPriv = dPriv;
_mesa_init_renderbuffer(rb, name);
/* Make sure we're using a null-valued GetPointer routine */
assert(rb->GetPointer(NULL, rb, 0, 0) == NULL);
rb->InternalFormat = format;
if (format == GL_RGBA) {
/* Color */
rb->_BaseFormat = GL_RGBA;
rb->Format = MESA_FORMAT_ARGB8888;
rb->DataType = GL_UNSIGNED_BYTE;
}
else if (format == GL_DEPTH_COMPONENT16) {
/* Depth */
rb->_BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
rb->Format = MESA_FORMAT_Z16;
rb->DataType = GL_UNSIGNED_INT;
}
else if (format == GL_DEPTH_COMPONENT24) {
/* Depth */
rb->_BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
rb->Format = MESA_FORMAT_Z32;
rb->DataType = GL_UNSIGNED_INT;
}
else {
/* Stencil */
ASSERT(format == GL_STENCIL_INDEX8_EXT);
rb->_BaseFormat = GL_STENCIL_INDEX;
rb->Format = MESA_FORMAT_S8;
rb->DataType = GL_UNSIGNED_BYTE;
}
rb->Delete = viaDeleteRenderbuffer;
rb->AllocStorage = viaRenderbufferStorage;
}
/**
* Calculate the framebuffer parameters for all buffers (front, back, depth,
* and stencil) associated with the specified context.
*
* \warning
* This function also calls \c AllocateBuffer to actually allocate the
* buffers.
*
* \sa AllocateBuffer
*/
static GLboolean
calculate_buffer_parameters(struct via_context *vmesa,
struct gl_framebuffer *fb,
__DRIdrawable *dPriv)
{
const unsigned shift = vmesa->viaScreen->bitsPerPixel / 16;
const unsigned extra = 32;
unsigned w;
unsigned h;
/* Normally, the renderbuffer would be added to the framebuffer just once
* when the framebuffer was created. The VIA driver is a bit funny
* though in that the front/back/depth renderbuffers are in the per-context
* state!
* That should be fixed someday.
*/
if (!vmesa->front.Base.InternalFormat) {
/* do one-time init for the renderbuffers */
viaInitRenderbuffer(&vmesa->front, GL_RGBA, dPriv);
viaSetSpanFunctions(&vmesa->front, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &vmesa->front.Base);
if (fb->Visual.doubleBufferMode) {
viaInitRenderbuffer(&vmesa->back, GL_RGBA, dPriv);
viaSetSpanFunctions(&vmesa->back, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &vmesa->back.Base);
}
if (vmesa->glCtx->Visual.depthBits > 0) {
viaInitRenderbuffer(&vmesa->depth,
(vmesa->glCtx->Visual.depthBits == 16
? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24),
dPriv);
viaSetSpanFunctions(&vmesa->depth, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &vmesa->depth.Base);
}
if (vmesa->glCtx->Visual.stencilBits > 0) {
viaInitRenderbuffer(&vmesa->stencil, GL_STENCIL_INDEX8_EXT,
dPriv);
viaSetSpanFunctions(&vmesa->stencil, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &vmesa->stencil.Base);
}
}
assert(vmesa->front.Base.InternalFormat);
assert(vmesa->front.Base.AllocStorage);
if (fb->Visual.doubleBufferMode) {
assert(vmesa->back.Base.AllocStorage);
}
if (fb->Visual.depthBits) {
assert(vmesa->depth.Base.AllocStorage);
}
/* Allocate front-buffer */
if (vmesa->drawType == GLX_PBUFFER_BIT) {
w = vmesa->driDrawable->w;
h = vmesa->driDrawable->h;
vmesa->front.bpp = vmesa->viaScreen->bitsPerPixel;
vmesa->front.pitch = buffer_align( w ) << shift; /* bytes, not pixels */
vmesa->front.size = vmesa->front.pitch * h;
if (vmesa->front.map)
via_free_draw_buffer(vmesa, &vmesa->front);
if (!via_alloc_draw_buffer(vmesa, &vmesa->front))
return GL_FALSE;
} else {
w = vmesa->viaScreen->width;
h = vmesa->viaScreen->height;
vmesa->front.bpp = vmesa->viaScreen->bitsPerPixel;
vmesa->front.pitch = buffer_align( w ) << shift; /* bytes, not pixels */
vmesa->front.size = vmesa->front.pitch * h;
if (getenv("ALTERNATE_SCREEN"))
vmesa->front.offset = vmesa->front.size;
else
vmesa->front.offset = 0;
vmesa->front.map = (char *) vmesa->driScreen->pFB;
}
/* Allocate back-buffer */
if (vmesa->hasBack) {
vmesa->back.bpp = vmesa->viaScreen->bitsPerPixel;
vmesa->back.pitch = (buffer_align( vmesa->driDrawable->w ) << shift);
vmesa->back.pitch += extra;
vmesa->back.pitch = MIN2(vmesa->back.pitch, vmesa->front.pitch);
vmesa->back.size = vmesa->back.pitch * vmesa->driDrawable->h;
if (vmesa->back.map)
via_free_draw_buffer(vmesa, &vmesa->back);
if (!via_alloc_draw_buffer(vmesa, &vmesa->back))
return GL_FALSE;
}
else {
if (vmesa->back.map)
via_free_draw_buffer(vmesa, &vmesa->back);
(void) memset( &vmesa->back, 0, sizeof( vmesa->back ) );
}
/* Allocate depth-buffer */
if ( vmesa->hasStencil || vmesa->hasDepth ) {
vmesa->depth.bpp = vmesa->depthBits;
if (vmesa->depth.bpp == 24)
vmesa->depth.bpp = 32;
vmesa->depth.pitch = (buffer_align( vmesa->driDrawable->w ) *
(vmesa->depth.bpp/8)) + extra;
vmesa->depth.size = vmesa->depth.pitch * vmesa->driDrawable->h;
if (vmesa->depth.map)
via_free_draw_buffer(vmesa, &vmesa->depth);
if (!via_alloc_draw_buffer(vmesa, &vmesa->depth)) {
return GL_FALSE;
}
}
else {
if (vmesa->depth.map)
via_free_draw_buffer(vmesa, &vmesa->depth);
(void) memset( & vmesa->depth, 0, sizeof( vmesa->depth ) );
}
/* stencil buffer is same as depth buffer */
vmesa->stencil.handle = vmesa->depth.handle;
vmesa->stencil.size = vmesa->depth.size;
vmesa->stencil.offset = vmesa->depth.offset;
vmesa->stencil.index = vmesa->depth.index;
vmesa->stencil.pitch = vmesa->depth.pitch;
vmesa->stencil.bpp = vmesa->depth.bpp;
vmesa->stencil.map = vmesa->depth.map;
vmesa->stencil.orig = vmesa->depth.orig;
vmesa->stencil.origMap = vmesa->depth.origMap;
if( vmesa->viaScreen->width == vmesa->driDrawable->w &&
vmesa->viaScreen->height == vmesa->driDrawable->h ) {
vmesa->doPageFlip = vmesa->allowPageFlip;
if (vmesa->hasBack) {
assert(vmesa->back.pitch == vmesa->front.pitch);
}
}
else
vmesa->doPageFlip = GL_FALSE;
return GL_TRUE;
}
void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
GLuint width, GLuint height)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
calculate_buffer_parameters(vmesa, drawbuffer, vmesa->driDrawable);
_mesa_resize_framebuffer(ctx, drawbuffer, width, height);
}
/* Extension strings exported by the Unichrome driver.
*/
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
/* { "GL_ARB_texture_env_dot3", NULL }, */
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_env_combine", NULL },
/* { "GL_EXT_texture_env_dot3", NULL }, */
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_NV_blend_square", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _via_fastrender_stage;
extern const struct tnl_pipeline_stage _via_render_stage;
static const struct tnl_pipeline_stage *via_pipeline[] = {
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
&_tnl_fog_coordinate_stage,
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
/* REMOVE: point attenuation stage */
#if 1
&_via_fastrender_stage, /* ADD: unclipped rastersetup-to-dma */
#endif
&_tnl_render_stage,
0,
};
static const struct dri_debug_control debug_control[] =
{
{ "fall", DEBUG_FALLBACKS },
{ "tex", DEBUG_TEXTURE },
{ "ioctl", DEBUG_IOCTL },
{ "prim", DEBUG_PRIMS },
{ "vert", DEBUG_VERTS },
{ "state", DEBUG_STATE },
{ "verb", DEBUG_VERBOSE },
{ "dri", DEBUG_DRI },
{ "dma", DEBUG_DMA },
{ "san", DEBUG_SANITY },
{ "sync", DEBUG_SYNC },
{ "sleep", DEBUG_SLEEP },
{ "pix", DEBUG_PIXEL },
{ "2d", DEBUG_2D },
{ NULL, 0 }
};
static GLboolean
AllocateDmaBuffer(struct via_context *vmesa)
{
if (vmesa->dma)
via_free_dma_buffer(vmesa);
if (!via_alloc_dma_buffer(vmesa))
return GL_FALSE;
vmesa->dmaLow = 0;
vmesa->dmaCliprectAddr = ~0;
return GL_TRUE;
}
static void
FreeBuffer(struct via_context *vmesa)
{
if (vmesa->front.map && vmesa->drawType == GLX_PBUFFER_BIT)
via_free_draw_buffer(vmesa, &vmesa->front);
if (vmesa->back.map)
via_free_draw_buffer(vmesa, &vmesa->back);
if (vmesa->depth.map)
via_free_draw_buffer(vmesa, &vmesa->depth);
if (vmesa->breadcrumb.map)
via_free_draw_buffer(vmesa, &vmesa->breadcrumb);
if (vmesa->dma)
via_free_dma_buffer(vmesa);
}
GLboolean
viaCreateContext(gl_api api,
const __GLcontextModes *visual,
__DRIcontext *driContextPriv,
void *sharedContextPrivate)
{
GLcontext *ctx, *shareCtx;
struct via_context *vmesa;
__DRIscreen *sPriv = driContextPriv->driScreenPriv;
viaScreenPrivate *viaScreen = (viaScreenPrivate *)sPriv->private;
drm_via_sarea_t *saPriv = (drm_via_sarea_t *)
(((GLubyte *)sPriv->pSAREA) + viaScreen->sareaPrivOffset);
struct dd_function_table functions;
/* Allocate via context */
vmesa = (struct via_context *) CALLOC_STRUCT(via_context);
if (!vmesa) {
return GL_FALSE;
}
/* Parse configuration files.
*/
driParseConfigFiles (&vmesa->optionCache, &viaScreen->optionCache,
sPriv->myNum, "unichrome");
/* pick back buffer */
vmesa->hasBack = visual->doubleBufferMode;
switch(visual->depthBits) {
case 0:
vmesa->hasDepth = GL_FALSE;
vmesa->depthBits = 0;
vmesa->depth_max = 1.0;
break;
case 16:
vmesa->hasDepth = GL_TRUE;
vmesa->depthBits = visual->depthBits;
vmesa->have_hw_stencil = GL_FALSE;
vmesa->depth_max = (GLfloat)0xffff;
vmesa->depth_clear_mask = 0xf << 28;
vmesa->ClearDepth = 0xffff;
vmesa->polygon_offset_scale = 1.0 / vmesa->depth_max;
break;
case 24:
vmesa->hasDepth = GL_TRUE;
vmesa->depthBits = visual->depthBits;
vmesa->depth_max = (GLfloat) 0xffffff;
vmesa->depth_clear_mask = 0xe << 28;
vmesa->ClearDepth = 0xffffff00;
assert(visual->haveStencilBuffer);
assert(visual->stencilBits == 8);
vmesa->have_hw_stencil = GL_TRUE;
vmesa->stencilBits = visual->stencilBits;
vmesa->stencil_clear_mask = 0x1 << 28;
vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max;
break;
case 32:
vmesa->hasDepth = GL_TRUE;
vmesa->depthBits = visual->depthBits;
assert(!visual->haveStencilBuffer);
vmesa->have_hw_stencil = GL_FALSE;
vmesa->depth_max = (GLfloat)0xffffffff;
vmesa->depth_clear_mask = 0xf << 28;
vmesa->ClearDepth = 0xffffffff;
vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max;
break;
default:
assert(0);
break;
}
make_empty_list(&vmesa->freed_tex_buffers);
make_empty_list(&vmesa->tex_image_list[VIA_MEM_VIDEO]);
make_empty_list(&vmesa->tex_image_list[VIA_MEM_AGP]);
make_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]);
_mesa_init_driver_functions(&functions);
viaInitTextureFuncs(&functions);
/* Allocate the Mesa context */
if (sharedContextPrivate)
shareCtx = ((struct via_context *) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
vmesa->glCtx = _mesa_create_context(visual, shareCtx, &functions,
(void*) vmesa);
vmesa->shareCtx = shareCtx;
if (!vmesa->glCtx) {
FREE(vmesa);
return GL_FALSE;
}
driContextPriv->driverPrivate = vmesa;
ctx = vmesa->glCtx;
if (driQueryOptionb(&vmesa->optionCache, "excess_mipmap"))
ctx->Const.MaxTextureLevels = 11;
else
ctx->Const.MaxTextureLevels = 10;
ctx->Const.MaxTextureUnits = 2;
ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MinLineWidth = 1.0;
ctx->Const.MinLineWidthAA = 1.0;
ctx->Const.MaxLineWidth = 1.0;
ctx->Const.MaxLineWidthAA = 1.0;
ctx->Const.LineWidthGranularity = 1.0;
ctx->Const.MinPointSize = 1.0;
ctx->Const.MinPointSizeAA = 1.0;
ctx->Const.MaxPointSize = 1.0;
ctx->Const.MaxPointSizeAA = 1.0;
ctx->Const.PointSizeGranularity = 1.0;
ctx->Const.MaxDrawBuffers = 1;
ctx->Driver.GetString = viaGetString;
ctx->DriverCtx = (void *)vmesa;
vmesa->glCtx = ctx;
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext(ctx);
_vbo_CreateContext(ctx);
_tnl_CreateContext(ctx);
_swsetup_CreateContext(ctx);
/* Install the customized pipeline:
*/
_tnl_destroy_pipeline(ctx);
_tnl_install_pipeline(ctx, via_pipeline);
/* Configure swrast and T&L to match hardware characteristics:
*/
_swrast_allow_pixel_fog(ctx, GL_FALSE);
_swrast_allow_vertex_fog(ctx, GL_TRUE);
_tnl_allow_pixel_fog(ctx, GL_FALSE);
_tnl_allow_vertex_fog(ctx, GL_TRUE);
vmesa->hHWContext = driContextPriv->hHWContext;
vmesa->driFd = sPriv->fd;
vmesa->driHwLock = &sPriv->pSAREA->lock;
vmesa->viaScreen = viaScreen;
vmesa->driScreen = sPriv;
vmesa->sarea = saPriv;
vmesa->renderIndex = ~0;
vmesa->setupIndex = ~0;
vmesa->hwPrimitive = GL_POLYGON+1;
/* KW: Hardwire this. Was previously set bogusly in
* viaCreateBuffer. Needs work before PBUFFER can be used:
*/
vmesa->drawType = GLX_WINDOW_BIT;
_math_matrix_ctr(&vmesa->ViewportMatrix);
/* Do this early, before VIA_FLUSH_DMA can be called:
*/
if (!AllocateDmaBuffer(vmesa)) {
fprintf(stderr ,"AllocateDmaBuffer fail\n");
FreeBuffer(vmesa);
FREE(vmesa);
return GL_FALSE;
}
/* Allocate a small piece of fb memory for synchronization:
*/
vmesa->breadcrumb.bpp = 32;
vmesa->breadcrumb.pitch = buffer_align( 64 ) << 2;
vmesa->breadcrumb.size = vmesa->breadcrumb.pitch;
if (!via_alloc_draw_buffer(vmesa, &vmesa->breadcrumb)) {
fprintf(stderr ,"AllocateDmaBuffer fail\n");
FreeBuffer(vmesa);
FREE(vmesa);
return GL_FALSE;
}
driInitExtensions( ctx, card_extensions, GL_TRUE );
viaInitStateFuncs(ctx);
viaInitTriFuncs(ctx);
viaInitSpanFuncs(ctx);
viaInitIoctlFuncs(ctx);
viaInitState(ctx);
if (getenv("VIA_DEBUG"))
VIA_DEBUG = driParseDebugString( getenv( "VIA_DEBUG" ),
debug_control );
if (getenv("VIA_NO_RAST") ||
driQueryOptionb(&vmesa->optionCache, "no_rast"))
FALLBACK(vmesa, VIA_FALLBACK_USER_DISABLE, 1);
if (getenv("VIA_PAGEFLIP"))
vmesa->allowPageFlip = 1;
(*sPriv->systemTime->getUST)( &vmesa->swap_ust );
vmesa->regMMIOBase = (GLuint *)((unsigned long)viaScreen->reg);
vmesa->pnGEMode = (GLuint *)((unsigned long)viaScreen->reg + 0x4);
vmesa->regEngineStatus = (GLuint *)((unsigned long)viaScreen->reg + 0x400);
vmesa->regTranSet = (GLuint *)((unsigned long)viaScreen->reg + 0x43C);
vmesa->regTranSpace = (GLuint *)((unsigned long)viaScreen->reg + 0x440);
vmesa->agpBase = viaScreen->agpBase;
return GL_TRUE;
}
void
viaDestroyContext(__DRIcontext *driContextPriv)
{
GET_CURRENT_CONTEXT(ctx);
struct via_context *vmesa =
(struct via_context *)driContextPriv->driverPrivate;
struct via_context *current = ctx ? VIA_CONTEXT(ctx) : NULL;
assert(vmesa); /* should never be null */
if (vmesa->driDrawable) {
viaWaitIdle(vmesa, GL_FALSE);
if (vmesa->doPageFlip) {
LOCK_HARDWARE(vmesa);
if (vmesa->pfCurrentOffset != 0) {
fprintf(stderr, "%s - reset pf\n", __FUNCTION__);
viaResetPageFlippingLocked(vmesa);
}
UNLOCK_HARDWARE(vmesa);
}
}
/* check if we're deleting the currently bound context */
if (vmesa == current) {
VIA_FLUSH_DMA(vmesa);
_mesa_make_current(NULL, NULL, NULL);
}
_swsetup_DestroyContext(vmesa->glCtx);
_tnl_DestroyContext(vmesa->glCtx);
_vbo_DestroyContext(vmesa->glCtx);
_swrast_DestroyContext(vmesa->glCtx);
/* free the Mesa context */
_mesa_destroy_context(vmesa->glCtx);
/* release our data */
FreeBuffer(vmesa);
assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_AGP]));
assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_VIDEO]));
assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]));
assert (is_empty_list(&vmesa->freed_tex_buffers));
driDestroyOptionCache(&vmesa->optionCache);
FREE(vmesa);
}
void viaXMesaWindowMoved(struct via_context *vmesa)
{
__DRIdrawable *const drawable = vmesa->driDrawable;
__DRIdrawable *const readable = vmesa->driReadable;
struct via_renderbuffer * draw_buffer;
struct via_renderbuffer * read_buffer;
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
if (!drawable)
return;
draw_buffer = (struct via_renderbuffer *) drawable->driverPrivate;
read_buffer = (struct via_renderbuffer *) readable->driverPrivate;
switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0]) {
case BUFFER_BACK_LEFT:
if (drawable->numBackClipRects == 0) {
vmesa->numClipRects = drawable->numClipRects;
vmesa->pClipRects = drawable->pClipRects;
}
else {
vmesa->numClipRects = drawable->numBackClipRects;
vmesa->pClipRects = drawable->pBackClipRects;
}
break;
case BUFFER_FRONT_LEFT:
vmesa->numClipRects = drawable->numClipRects;
vmesa->pClipRects = drawable->pClipRects;
break;
default:
vmesa->numClipRects = 0;
break;
}
if ((draw_buffer->drawW != drawable->w)
|| (draw_buffer->drawH != drawable->h)) {
calculate_buffer_parameters(vmesa, vmesa->glCtx->DrawBuffer,
drawable);
}
draw_buffer->drawX = drawable->x;
draw_buffer->drawY = drawable->y;
draw_buffer->drawW = drawable->w;
draw_buffer->drawH = drawable->h;
if (drawable != readable) {
if ((read_buffer->drawW != readable->w)
|| (read_buffer->drawH != readable->h)) {
calculate_buffer_parameters(vmesa, vmesa->glCtx->ReadBuffer,
readable);
}
read_buffer->drawX = readable->x;
read_buffer->drawY = readable->y;
read_buffer->drawW = readable->w;
read_buffer->drawH = readable->h;
}
vmesa->front.orig = (vmesa->front.offset +
draw_buffer->drawY * vmesa->front.pitch +
draw_buffer->drawX * bytePerPixel);
vmesa->front.origMap = (vmesa->front.map +
draw_buffer->drawY * vmesa->front.pitch +
draw_buffer->drawX * bytePerPixel);
vmesa->back.orig = (vmesa->back.offset +
draw_buffer->drawY * vmesa->back.pitch +
draw_buffer->drawX * bytePerPixel);
vmesa->back.origMap = (vmesa->back.map +
draw_buffer->drawY * vmesa->back.pitch +
draw_buffer->drawX * bytePerPixel);
vmesa->depth.orig = (vmesa->depth.offset +
draw_buffer->drawY * vmesa->depth.pitch +
draw_buffer->drawX * bytePerPixel);
vmesa->depth.origMap = (vmesa->depth.map +
draw_buffer->drawY * vmesa->depth.pitch +
draw_buffer->drawX * bytePerPixel);
viaCalcViewport(vmesa->glCtx);
}
GLboolean
viaUnbindContext(__DRIcontext *driContextPriv)
{
return GL_TRUE;
}
GLboolean
viaMakeCurrent(__DRIcontext *driContextPriv,
__DRIdrawable *driDrawPriv,
__DRIdrawable *driReadPriv)
{
if (VIA_DEBUG & DEBUG_DRI) {
fprintf(stderr, "driContextPriv = %016lx\n", (unsigned long)driContextPriv);
fprintf(stderr, "driDrawPriv = %016lx\n", (unsigned long)driDrawPriv);
fprintf(stderr, "driReadPriv = %016lx\n", (unsigned long)driReadPriv);
}
if (driContextPriv) {
struct via_context *vmesa =
(struct via_context *)driContextPriv->driverPrivate;
GLcontext *ctx = vmesa->glCtx;
struct gl_framebuffer *drawBuffer, *readBuffer;
drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
if ((vmesa->driDrawable != driDrawPriv)
|| (vmesa->driReadable != driReadPriv)) {
if (driDrawPriv->swap_interval == (unsigned)-1) {
driDrawPriv->vblFlags =
vmesa->viaScreen->irqEnabled ?
driGetDefaultVBlankFlags(&vmesa->optionCache) :
VBLANK_FLAG_NO_IRQ;
driDrawableInitVBlank(driDrawPriv);
}
vmesa->driDrawable = driDrawPriv;
vmesa->driReadable = driReadPriv;
if ((drawBuffer->Width != driDrawPriv->w)
|| (drawBuffer->Height != driDrawPriv->h)) {
_mesa_resize_framebuffer(ctx, drawBuffer,
driDrawPriv->w, driDrawPriv->h);
drawBuffer->Initialized = GL_TRUE;
}
if (!calculate_buffer_parameters(vmesa, drawBuffer, driDrawPriv)) {
return GL_FALSE;
}
if (driDrawPriv != driReadPriv) {
if ((readBuffer->Width != driReadPriv->w)
|| (readBuffer->Height != driReadPriv->h)) {
_mesa_resize_framebuffer(ctx, readBuffer,
driReadPriv->w, driReadPriv->h);
readBuffer->Initialized = GL_TRUE;
}
if (!calculate_buffer_parameters(vmesa, readBuffer, driReadPriv)) {
return GL_FALSE;
}
}
}
_mesa_make_current(vmesa->glCtx, drawBuffer, readBuffer);
ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
viaXMesaWindowMoved(vmesa);
ctx->Driver.Scissor(vmesa->glCtx,
vmesa->glCtx->Scissor.X,
vmesa->glCtx->Scissor.Y,
vmesa->glCtx->Scissor.Width,
vmesa->glCtx->Scissor.Height);
}
else {
_mesa_make_current(NULL, NULL, NULL);
}
return GL_TRUE;
}
void viaGetLock(struct via_context *vmesa, GLuint flags)
{
__DRIdrawable *dPriv = vmesa->driDrawable;
__DRIscreen *sPriv = vmesa->driScreen;
drmGetLock(vmesa->driFd, vmesa->hHWContext, flags);
DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
if (dPriv != vmesa->driReadable) {
DRI_VALIDATE_DRAWABLE_INFO(sPriv, vmesa->driReadable);
}
if (vmesa->sarea->ctxOwner != vmesa->hHWContext) {
vmesa->sarea->ctxOwner = vmesa->hHWContext;
vmesa->newEmitState = ~0;
}
if (vmesa->lastStamp != dPriv->lastStamp) {
viaXMesaWindowMoved(vmesa);
driUpdateFramebufferSize(vmesa->glCtx, dPriv);
vmesa->newEmitState = ~0;
vmesa->lastStamp = dPriv->lastStamp;
}
if (vmesa->doPageFlip &&
vmesa->pfCurrentOffset != vmesa->sarea->pfCurrentOffset) {
fprintf(stderr, "%s - reset pf\n", __FUNCTION__);
viaResetPageFlippingLocked(vmesa);
}
}
void
viaSwapBuffers(__DRIdrawable *drawablePrivate)
{
__DRIdrawable *dPriv = (__DRIdrawable *)drawablePrivate;
if (dPriv &&
dPriv->driContextPriv &&
dPriv->driContextPriv->driverPrivate) {
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
GLcontext *ctx = vmesa->glCtx;
_mesa_notifySwapBuffers(ctx);
if (ctx->Visual.doubleBufferMode) {
if (vmesa->doPageFlip) {
viaPageFlip(dPriv);
}
else {
viaCopyBuffer(dPriv);
}
}
else
VIA_FLUSH_DMA(vmesa);
}
else {
_mesa_problem(NULL, "viaSwapBuffers: drawable has no context!\n");
}
}
| bsd-3-clause |
bitfusionio/OpenBLAS | lapack-netlib/TESTING/LIN/zsyt03.f | 32 | 6262 | *> \brief \b ZSYT03
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
* Definition:
* ===========
*
* SUBROUTINE ZSYT03( UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK,
* RWORK, RCOND, RESID )
*
* .. Scalar Arguments ..
* CHARACTER UPLO
* INTEGER LDA, LDAINV, LDWORK, N
* DOUBLE PRECISION RCOND, RESID
* ..
* .. Array Arguments ..
* DOUBLE PRECISION RWORK( * )
* COMPLEX*16 A( LDA, * ), AINV( LDAINV, * ),
* $ WORK( LDWORK, * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> ZSYT03 computes the residual for a complex symmetric matrix times
*> its inverse:
*> norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS )
*> where EPS is the machine epsilon.
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] UPLO
*> \verbatim
*> UPLO is CHARACTER*1
*> Specifies whether the upper or lower triangular part of the
*> complex symmetric matrix A is stored:
*> = 'U': Upper triangular
*> = 'L': Lower triangular
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The number of rows and columns of the matrix A. N >= 0.
*> \endverbatim
*>
*> \param[in] A
*> \verbatim
*> A is COMPLEX*16 array, dimension (LDA,N)
*> The original complex symmetric matrix A.
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*> LDA is INTEGER
*> The leading dimension of the array A. LDA >= max(1,N)
*> \endverbatim
*>
*> \param[in,out] AINV
*> \verbatim
*> AINV is COMPLEX*16 array, dimension (LDAINV,N)
*> On entry, the inverse of the matrix A, stored as a symmetric
*> matrix in the same format as A.
*> In this version, AINV is expanded into a full matrix and
*> multiplied by A, so the opposing triangle of AINV will be
*> changed; i.e., if the upper triangular part of AINV is
*> stored, the lower triangular part will be used as work space.
*> \endverbatim
*>
*> \param[in] LDAINV
*> \verbatim
*> LDAINV is INTEGER
*> The leading dimension of the array AINV. LDAINV >= max(1,N).
*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
*> WORK is COMPLEX*16 array, dimension (LDWORK,N)
*> \endverbatim
*>
*> \param[in] LDWORK
*> \verbatim
*> LDWORK is INTEGER
*> The leading dimension of the array WORK. LDWORK >= max(1,N).
*> \endverbatim
*>
*> \param[out] RWORK
*> \verbatim
*> RWORK is DOUBLE PRECISION array, dimension (N)
*> \endverbatim
*>
*> \param[out] RCOND
*> \verbatim
*> RCOND is DOUBLE PRECISION
*> The reciprocal of the condition number of A, computed as
*> RCOND = 1/ (norm(A) * norm(AINV)).
*> \endverbatim
*>
*> \param[out] RESID
*> \verbatim
*> RESID is DOUBLE PRECISION
*> norm(I - A*AINV) / ( N * norm(A) * norm(AINV) * EPS )
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date November 2011
*
*> \ingroup complex16_lin
*
* =====================================================================
SUBROUTINE ZSYT03( UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK,
$ RWORK, RCOND, RESID )
*
* -- LAPACK test routine (version 3.4.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2011
*
* .. Scalar Arguments ..
CHARACTER UPLO
INTEGER LDA, LDAINV, LDWORK, N
DOUBLE PRECISION RCOND, RESID
* ..
* .. Array Arguments ..
DOUBLE PRECISION RWORK( * )
COMPLEX*16 A( LDA, * ), AINV( LDAINV, * ),
$ WORK( LDWORK, * )
* ..
*
* =====================================================================
*
*
* .. Parameters ..
DOUBLE PRECISION ZERO, ONE
PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
COMPLEX*16 CZERO, CONE
PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ),
$ CONE = ( 1.0D+0, 0.0D+0 ) )
* ..
* .. Local Scalars ..
INTEGER I, J
DOUBLE PRECISION AINVNM, ANORM, EPS
* ..
* .. External Functions ..
LOGICAL LSAME
DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
EXTERNAL LSAME, DLAMCH, ZLANGE, ZLANSY
* ..
* .. External Subroutines ..
EXTERNAL ZSYMM
* ..
* .. Intrinsic Functions ..
INTRINSIC DBLE
* ..
* .. Executable Statements ..
*
* Quick exit if N = 0
*
IF( N.LE.0 ) THEN
RCOND = ONE
RESID = ZERO
RETURN
END IF
*
* Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
*
EPS = DLAMCH( 'Epsilon' )
ANORM = ZLANSY( '1', UPLO, N, A, LDA, RWORK )
AINVNM = ZLANSY( '1', UPLO, N, AINV, LDAINV, RWORK )
IF( ANORM.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
RCOND = ZERO
RESID = ONE / EPS
RETURN
END IF
RCOND = ( ONE / ANORM ) / AINVNM
*
* Expand AINV into a full matrix and call ZSYMM to multiply
* AINV on the left by A (store the result in WORK).
*
IF( LSAME( UPLO, 'U' ) ) THEN
DO 20 J = 1, N
DO 10 I = 1, J - 1
AINV( J, I ) = AINV( I, J )
10 CONTINUE
20 CONTINUE
ELSE
DO 40 J = 1, N
DO 30 I = J + 1, N
AINV( J, I ) = AINV( I, J )
30 CONTINUE
40 CONTINUE
END IF
CALL ZSYMM( 'Left', UPLO, N, N, -CONE, A, LDA, AINV, LDAINV,
$ CZERO, WORK, LDWORK )
*
* Add the identity matrix to WORK .
*
DO 50 I = 1, N
WORK( I, I ) = WORK( I, I ) + CONE
50 CONTINUE
*
* Compute norm(I - A*AINV) / (N * norm(A) * norm(AINV) * EPS)
*
RESID = ZLANGE( '1', N, N, WORK, LDWORK, RWORK )
*
RESID = ( ( RESID*RCOND ) / EPS ) / DBLE( N )
*
RETURN
*
* End of ZSYT03
*
END
| bsd-3-clause |
zcm19900902/picasso-graphic | android/freetype/src/base/ftbitmap.c | 33 | 14630 | /***************************************************************************/
/* */
/* ftbitmap.c */
/* */
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
/* bitmaps into 8bpp format (body). */
/* */
/* Copyright 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_BITMAP_H
#include FT_INTERNAL_OBJECTS_H
static
const FT_Bitmap null_bitmap = { 0, 0, 0, 0, 0, 0, 0, 0 };
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( void )
FT_Bitmap_New( FT_Bitmap *abitmap )
{
*abitmap = null_bitmap;
}
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target)
{
FT_Memory memory = library->memory;
FT_Error error = FT_Err_Ok;
FT_Int pitch = source->pitch;
FT_ULong size;
if ( source == target )
return FT_Err_Ok;
if ( source->buffer == NULL )
{
*target = *source;
return FT_Err_Ok;
}
if ( pitch < 0 )
pitch = -pitch;
size = (FT_ULong)( pitch * source->rows );
if ( target->buffer )
{
FT_Int target_pitch = target->pitch;
FT_ULong target_size;
if ( target_pitch < 0 )
target_pitch = -target_pitch;
target_size = (FT_ULong)( target_pitch * target->rows );
if ( target_size != size )
(void)FT_QREALLOC( target->buffer, target_size, size );
}
else
(void)FT_QALLOC( target->buffer, size );
if ( !error )
{
unsigned char *p;
p = target->buffer;
*target = *source;
target->buffer = p;
FT_MEM_COPY( target->buffer, source->buffer, size );
}
return error;
}
static FT_Error
ft_bitmap_assure_buffer( FT_Memory memory,
FT_Bitmap* bitmap,
FT_UInt xpixels,
FT_UInt ypixels )
{
FT_Error error;
int pitch;
int new_pitch;
FT_UInt bpp;
FT_Int i, width, height;
unsigned char* buffer;
width = bitmap->width;
height = bitmap->rows;
pitch = bitmap->pitch;
if ( pitch < 0 )
pitch = -pitch;
switch ( bitmap->pixel_mode )
{
case FT_PIXEL_MODE_MONO:
bpp = 1;
new_pitch = ( width + xpixels + 7 ) >> 3;
break;
case FT_PIXEL_MODE_GRAY2:
bpp = 2;
new_pitch = ( width + xpixels + 3 ) >> 2;
break;
case FT_PIXEL_MODE_GRAY4:
bpp = 4;
new_pitch = ( width + xpixels + 1 ) >> 1;
break;
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
bpp = 8;
new_pitch = ( width + xpixels );
break;
default:
return FT_Err_Invalid_Glyph_Format;
}
/* if no need to allocate memory */
if ( ypixels == 0 && new_pitch <= pitch )
{
/* zero the padding */
FT_Int bit_width = pitch * 8;
FT_Int bit_last = ( width + xpixels ) * bpp;
if ( bit_last < bit_width )
{
FT_Byte* line = bitmap->buffer + ( bit_last >> 3 );
FT_Byte* end = bitmap->buffer + pitch;
FT_Int shift = bit_last & 7;
FT_UInt mask = 0xFF00U >> shift;
FT_Int count = height;
for ( ; count > 0; count--, line += pitch, end += pitch )
{
FT_Byte* write = line;
if ( shift > 0 )
{
write[0] = (FT_Byte)( write[0] & mask );
write++;
}
if ( write < end )
FT_MEM_ZERO( write, end-write );
}
}
return FT_Err_Ok;
}
if ( FT_QALLOC_MULT( buffer, new_pitch, bitmap->rows + ypixels ) )
return error;
if ( bitmap->pitch > 0 )
{
FT_Int len = ( width * bpp + 7 ) >> 3;
for ( i = 0; i < bitmap->rows; i++ )
FT_MEM_COPY( buffer + new_pitch * ( ypixels + i ),
bitmap->buffer + pitch * i, len );
}
else
{
FT_Int len = ( width * bpp + 7 ) >> 3;
for ( i = 0; i < bitmap->rows; i++ )
FT_MEM_COPY( buffer + new_pitch * i,
bitmap->buffer + pitch * i, len );
}
FT_FREE( bitmap->buffer );
bitmap->buffer = buffer;
if ( bitmap->pitch < 0 )
new_pitch = -new_pitch;
/* set pitch only, width and height are left untouched */
bitmap->pitch = new_pitch;
return FT_Err_Ok;
}
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength )
{
FT_Error error;
unsigned char* p;
FT_Int i, x, y, pitch;
FT_Int xstr, ystr;
if ( !library )
return FT_Err_Invalid_Library_Handle;
if ( !bitmap || !bitmap->buffer )
return FT_Err_Invalid_Argument;
xstr = FT_PIX_ROUND( xStrength ) >> 6;
ystr = FT_PIX_ROUND( yStrength ) >> 6;
if ( xstr == 0 && ystr == 0 )
return FT_Err_Ok;
else if ( xstr < 0 || ystr < 0 )
return FT_Err_Invalid_Argument;
switch ( bitmap->pixel_mode )
{
case FT_PIXEL_MODE_GRAY2:
case FT_PIXEL_MODE_GRAY4:
{
FT_Bitmap tmp;
FT_Int align;
if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY2 )
align = ( bitmap->width + xstr + 3 ) / 4;
else
align = ( bitmap->width + xstr + 1 ) / 2;
FT_Bitmap_New( &tmp );
error = FT_Bitmap_Convert( library, bitmap, &tmp, align );
if ( error )
return error;
FT_Bitmap_Done( library, bitmap );
*bitmap = tmp;
}
break;
case FT_PIXEL_MODE_MONO:
if ( xstr > 8 )
xstr = 8;
break;
case FT_PIXEL_MODE_LCD:
xstr *= 3;
break;
case FT_PIXEL_MODE_LCD_V:
ystr *= 3;
break;
}
error = ft_bitmap_assure_buffer( library->memory, bitmap, xstr, ystr );
if ( error )
return error;
pitch = bitmap->pitch;
if ( pitch > 0 )
p = bitmap->buffer + pitch * ystr;
else
{
pitch = -pitch;
p = bitmap->buffer + pitch * ( bitmap->rows - 1 );
}
/* for each row */
for ( y = 0; y < bitmap->rows ; y++ )
{
/*
* Horizontally:
*
* From the last pixel on, make each pixel or'ed with the
* `xstr' pixels before it.
*/
for ( x = pitch - 1; x >= 0; x-- )
{
unsigned char tmp;
tmp = p[x];
for ( i = 1; i <= xstr; i++ )
{
if ( bitmap->pixel_mode == FT_PIXEL_MODE_MONO )
{
p[x] |= tmp >> i;
/* the maximum value of 8 for `xstr' comes from here */
if ( x > 0 )
p[x] |= p[x - 1] << ( 8 - i );
#if 0
if ( p[x] == 0xff )
break;
#endif
}
else
{
if ( x - i >= 0 )
{
if ( p[x] + p[x - i] > bitmap->num_grays - 1 )
{
p[x] = (unsigned char)(bitmap->num_grays - 1);
break;
}
else
{
p[x] = (unsigned char)(p[x] + p[x-i]);
if ( p[x] == bitmap->num_grays - 1 )
break;
}
}
else
break;
}
}
}
/*
* Vertically:
*
* Make the above `ystr' rows or'ed with it.
*/
for ( x = 1; x <= ystr; x++ )
{
unsigned char* q;
q = p - bitmap->pitch * x;
for ( i = 0; i < pitch; i++ )
q[i] |= p[i];
}
p += bitmap->pitch;
}
bitmap->width += xstr;
bitmap->rows += ystr;
return FT_Err_Ok;
}
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target,
FT_Int alignment )
{
FT_Error error = FT_Err_Ok;
FT_Memory memory;
if ( !library )
return FT_Err_Invalid_Library_Handle;
memory = library->memory;
switch ( source->pixel_mode )
{
case FT_PIXEL_MODE_MONO:
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_GRAY2:
case FT_PIXEL_MODE_GRAY4:
{
FT_Int pad;
FT_Long old_size;
old_size = target->rows * target->pitch;
if ( old_size < 0 )
old_size = -old_size;
target->pixel_mode = FT_PIXEL_MODE_GRAY;
target->rows = source->rows;
target->width = source->width;
pad = 0;
if ( alignment > 0 )
{
pad = source->width % alignment;
if ( pad != 0 )
pad = alignment - pad;
}
target->pitch = source->width + pad;
if ( target->rows * target->pitch > old_size &&
FT_QREALLOC( target->buffer,
old_size, target->rows * target->pitch ) )
return error;
}
break;
default:
error = FT_Err_Invalid_Argument;
}
switch ( source->pixel_mode )
{
case FT_PIXEL_MODE_MONO:
{
FT_Byte* s = source->buffer;
FT_Byte* t = target->buffer;
FT_Int i;
target->num_grays = 2;
for ( i = source->rows; i > 0; i-- )
{
FT_Byte* ss = s;
FT_Byte* tt = t;
FT_Int j;
/* get the full bytes */
for ( j = source->width >> 3; j > 0; j-- )
{
FT_Int val = ss[0]; /* avoid a byte->int cast on each line */
tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7 );
tt[1] = (FT_Byte)( ( val & 0x40 ) >> 6 );
tt[2] = (FT_Byte)( ( val & 0x20 ) >> 5 );
tt[3] = (FT_Byte)( ( val & 0x10 ) >> 4 );
tt[4] = (FT_Byte)( ( val & 0x08 ) >> 3 );
tt[5] = (FT_Byte)( ( val & 0x04 ) >> 2 );
tt[6] = (FT_Byte)( ( val & 0x02 ) >> 1 );
tt[7] = (FT_Byte)( val & 0x01 );
tt += 8;
ss += 1;
}
/* get remaining pixels (if any) */
j = source->width & 7;
if ( j > 0 )
{
FT_Int val = *ss;
for ( ; j > 0; j-- )
{
tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7);
val <<= 1;
tt += 1;
}
}
s += source->pitch;
t += target->pitch;
}
}
break;
case FT_PIXEL_MODE_GRAY:
{
FT_Int width = source->width;
FT_Byte* s = source->buffer;
FT_Byte* t = target->buffer;
FT_Int s_pitch = source->pitch;
FT_Int t_pitch = target->pitch;
FT_Int i;
target->num_grays = 256;
for ( i = source->rows; i > 0; i-- )
{
FT_ARRAY_COPY( t, s, width );
s += s_pitch;
t += t_pitch;
}
}
break;
case FT_PIXEL_MODE_GRAY2:
{
FT_Byte* s = source->buffer;
FT_Byte* t = target->buffer;
FT_Int i;
target->num_grays = 4;
for ( i = source->rows; i > 0; i-- )
{
FT_Byte* ss = s;
FT_Byte* tt = t;
FT_Int j;
/* get the full bytes */
for ( j = source->width >> 2; j > 0; j-- )
{
FT_Int val = ss[0];
tt[0] = (FT_Byte)( ( val & 0xC0 ) >> 6 );
tt[1] = (FT_Byte)( ( val & 0x30 ) >> 4 );
tt[2] = (FT_Byte)( ( val & 0x0C ) >> 2 );
tt[3] = (FT_Byte)( ( val & 0x03 ) );
ss += 1;
tt += 4;
}
j = source->width & 3;
if ( j > 0 )
{
FT_Int val = ss[0];
for ( ; j > 0; j-- )
{
tt[0] = (FT_Byte)( ( val & 0xC0 ) >> 6 );
val <<= 2;
tt += 1;
}
}
s += source->pitch;
t += target->pitch;
}
}
break;
case FT_PIXEL_MODE_GRAY4:
{
FT_Byte* s = source->buffer;
FT_Byte* t = target->buffer;
FT_Int i;
target->num_grays = 16;
for ( i = source->rows; i > 0; i-- )
{
FT_Byte* ss = s;
FT_Byte* tt = t;
FT_Int j;
/* get the full bytes */
for ( j = source->width >> 1; j > 0; j-- )
{
FT_Int val = ss[0];
tt[0] = (FT_Byte)( ( val & 0xF0 ) >> 4 );
tt[1] = (FT_Byte)( ( val & 0x0F ) );
ss += 1;
tt += 2;
}
if ( source->width & 1 )
tt[0] = (FT_Byte)( ( ss[0] & 0xF0 ) >> 4 );
s += source->pitch;
t += target->pitch;
}
}
break;
default:
;
}
return error;
}
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap )
{
FT_Memory memory;
if ( !library )
return FT_Err_Invalid_Library_Handle;
if ( !bitmap )
return FT_Err_Invalid_Argument;
memory = library->memory;
FT_FREE( bitmap->buffer );
*bitmap = null_bitmap;
return FT_Err_Ok;
}
/* END */
| bsd-3-clause |
espadrine/opera | chromium/src/third_party/mesa/src/src/gallium/drivers/svga/svgadump/svga_shader_op.c | 33 | 7839 | /**********************************************************
* Copyright 2008-2009 VMware, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************/
/**
* @file
* SVGA Shader Token Opcode Info
*
* @author Michal Krol <michal@vmware.com>
*/
#include "util/u_debug.h"
#include "svga_shader_op.h"
#include "../svga_hw_reg.h"
#include "svga3d_shaderdefs.h"
#define SVGA3DOP_INVALID SVGA3DOP_END
#define TGSI_OPCODE_INVALID TGSI_OPCODE_LAST
static struct sh_opcode_info opcode_info[] =
{
{ "nop", 0, 0, 0, 0, SVGA3DOP_NOP },
{ "mov", 1, 1, 0, 0, SVGA3DOP_MOV, },
{ "add", 1, 2, 0, 0, SVGA3DOP_ADD, },
{ "sub", 1, 2, 0, 0, SVGA3DOP_SUB, },
{ "mad", 1, 3, 0, 0, SVGA3DOP_MAD, },
{ "mul", 1, 2, 0, 0, SVGA3DOP_MUL, },
{ "rcp", 1, 1, 0, 0, SVGA3DOP_RCP, },
{ "rsq", 1, 1, 0, 0, SVGA3DOP_RSQ, },
{ "dp3", 1, 2, 0, 0, SVGA3DOP_DP3, },
{ "dp4", 1, 2, 0, 0, SVGA3DOP_DP4, },
{ "min", 1, 2, 0, 0, SVGA3DOP_MIN, },
{ "max", 1, 2, 0, 0, SVGA3DOP_MAX, },
{ "slt", 1, 2, 0, 0, SVGA3DOP_SLT, },
{ "sge", 1, 2, 0, 0, SVGA3DOP_SGE, },
{ "exp", 1, 1, 0, 0, SVGA3DOP_EXP, },
{ "log", 1, 1, 0, 0, SVGA3DOP_LOG, },
{ "lit", 1, 1, 0, 0, SVGA3DOP_LIT, },
{ "dst", 1, 2, 0, 0, SVGA3DOP_DST, },
{ "lrp", 1, 3, 0, 0, SVGA3DOP_LRP, },
{ "frc", 1, 1, 0, 0, SVGA3DOP_FRC, },
{ "m4x4", 1, 2, 0, 0, SVGA3DOP_M4x4, },
{ "m4x3", 1, 2, 0, 0, SVGA3DOP_M4x3, },
{ "m3x4", 1, 2, 0, 0, SVGA3DOP_M3x4, },
{ "m3x3", 1, 2, 0, 0, SVGA3DOP_M3x3, },
{ "m3x2", 1, 2, 0, 0, SVGA3DOP_M3x2, },
{ "call", 0, 1, 0, 0, SVGA3DOP_CALL, },
{ "callnz", 0, 2, 0, 0, SVGA3DOP_CALLNZ, },
{ "loop", 0, 2, 0, 1, SVGA3DOP_LOOP, },
{ "ret", 0, 0, 0, 0, SVGA3DOP_RET, },
{ "endloop", 0, 0, 1, 0, SVGA3DOP_ENDLOOP, },
{ "label", 0, 1, 0, 0, SVGA3DOP_LABEL, },
{ "dcl", 0, 0, 0, 0, SVGA3DOP_DCL, },
{ "pow", 1, 2, 0, 0, SVGA3DOP_POW, },
{ "crs", 1, 2, 0, 0, SVGA3DOP_CRS, },
{ "sgn", 1, 3, 0, 0, SVGA3DOP_SGN, },
{ "abs", 1, 1, 0, 0, SVGA3DOP_ABS, },
{ "nrm", 1, 1, 0, 0, SVGA3DOP_NRM, }, /* 3-componenet normalization */
{ "sincos", 1, 3, 0, 0, SVGA3DOP_SINCOS, },
{ "rep", 0, 1, 0, 1, SVGA3DOP_REP, },
{ "endrep", 0, 0, 1, 0, SVGA3DOP_ENDREP, },
{ "if", 0, 1, 0, 1, SVGA3DOP_IF, },
{ "ifc", 0, 2, 0, 1, SVGA3DOP_IFC, },
{ "else", 0, 0, 1, 1, SVGA3DOP_ELSE, },
{ "endif", 0, 0, 1, 0, SVGA3DOP_ENDIF, },
{ "break", 0, 0, 0, 0, SVGA3DOP_BREAK, },
{ "breakc", 0, 2, 0, 0, SVGA3DOP_BREAKC, },
{ "mova", 1, 1, 0, 0, SVGA3DOP_MOVA, },
{ "defb", 0, 0, 0, 0, SVGA3DOP_DEFB, },
{ "defi", 0, 0, 0, 0, SVGA3DOP_DEFI, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "???", 0, 0, 0, 0, SVGA3DOP_INVALID, },
{ "texcoord", 1, 0, 0, 0, SVGA3DOP_TEXCOORD, },
{ "texkill", 1, 0, 0, 0, SVGA3DOP_TEXKILL, },
{ "tex", 1, 0, 0, 0, SVGA3DOP_TEX, },
{ "texbem", 1, 1, 0, 0, SVGA3DOP_TEXBEM, },
{ "texbeml", 1, 1, 0, 0, SVGA3DOP_TEXBEML, },
{ "texreg2ar", 1, 1, 0, 0, SVGA3DOP_TEXREG2AR, },
{ "texreg2gb", 1, 1, 0, 0, SVGA3DOP_TEXREG2GB, },
{ "texm3x2pad", 1, 1, 0, 0, SVGA3DOP_TEXM3x2PAD, },
{ "texm3x2tex", 1, 1, 0, 0, SVGA3DOP_TEXM3x2TEX, },
{ "texm3x3pad", 1, 1, 0, 0, SVGA3DOP_TEXM3x3PAD, },
{ "texm3x3tex", 1, 1, 0, 0, SVGA3DOP_TEXM3x3TEX, },
{ "reserved0", 0, 0, 0, 0, SVGA3DOP_RESERVED0, },
{ "texm3x3spec", 1, 2, 0, 0, SVGA3DOP_TEXM3x3SPEC, },
{ "texm3x3vspec", 1, 1, 0, 0, SVGA3DOP_TEXM3x3VSPEC,},
{ "expp", 1, 1, 0, 0, SVGA3DOP_EXPP, },
{ "logp", 1, 1, 0, 0, SVGA3DOP_LOGP, },
{ "cnd", 1, 3, 0, 0, SVGA3DOP_CND, },
{ "def", 0, 0, 0, 0, SVGA3DOP_DEF, },
{ "texreg2rgb", 1, 1, 0, 0, SVGA3DOP_TEXREG2RGB, },
{ "texdp3tex", 1, 1, 0, 0, SVGA3DOP_TEXDP3TEX, },
{ "texm3x2depth", 1, 1, 0, 0, SVGA3DOP_TEXM3x2DEPTH,},
{ "texdp3", 1, 1, 0, 0, SVGA3DOP_TEXDP3, },
{ "texm3x3", 1, 1, 0, 0, SVGA3DOP_TEXM3x3, },
{ "texdepth", 1, 0, 0, 0, SVGA3DOP_TEXDEPTH, },
{ "cmp", 1, 3, 0, 0, SVGA3DOP_CMP, },
{ "bem", 1, 2, 0, 0, SVGA3DOP_BEM, },
{ "dp2add", 1, 3, 0, 0, SVGA3DOP_DP2ADD, },
{ "dsx", 1, 1, 0, 0, SVGA3DOP_INVALID, },
{ "dsy", 1, 1, 0, 0, SVGA3DOP_INVALID, },
{ "texldd", 1, 4, 0, 0, SVGA3DOP_INVALID, },
{ "setp", 1, 2, 0, 0, SVGA3DOP_SETP, },
{ "texldl", 1, 2, 0, 0, SVGA3DOP_INVALID, },
{ "breakp", 0, 1, 0, 0, SVGA3DOP_INVALID, },
};
const struct sh_opcode_info *svga_opcode_info( uint op )
{
struct sh_opcode_info *info;
if (op >= sizeof( opcode_info ) / sizeof( opcode_info[0] )) {
/* The opcode is either PHASE, COMMENT, END or out of range.
*/
assert( 0 );
return NULL;
}
info = &opcode_info[op];
if (info->svga_opcode == SVGA3DOP_INVALID) {
/* No valid information. Please provide number of dst/src registers.
*/
assert( 0 );
return NULL;
}
/* Sanity check.
*/
assert( op == info->svga_opcode );
return info;
}
| bsd-3-clause |
Multi2Sim/m2s-bench-parsec-3.0-src | tools/yasm/src/tools/re2c/translate.c | 41 | 4171 | #include "tools/re2c/globals.h"
unsigned char asc2asc[256] = {
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,
0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,
0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
};
unsigned char *xlat = asc2asc;
unsigned char *talx = asc2asc;
unsigned char asc2ebc[256] = { /* Based on ISO 8859/1 and Code Page 37 */
0x00,0x01,0x02,0x03,0x37,0x2d,0x2e,0x2f,0x16,0x05,0x25,0x0b,0x0c,0x0d,0x0e,0x0f,
0x10,0x11,0x12,0x13,0x3c,0x3d,0x32,0x26,0x18,0x19,0x3f,0x27,0x1c,0x1d,0x1e,0x1f,
0x40,0x5a,0x7f,0x7b,0x5b,0x6c,0x50,0x7d,0x4d,0x5d,0x5c,0x4e,0x6b,0x60,0x4b,0x61,
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0x7a,0x5e,0x4c,0x7e,0x6e,0x6f,
0x7c,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,
0xd7,0xd8,0xd9,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xba,0xe0,0xbb,0xb0,0x6d,
0x79,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x91,0x92,0x93,0x94,0x95,0x96,
0x97,0x98,0x99,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xc0,0x4f,0xd0,0xa1,0x07,
0x20,0x21,0x22,0x23,0x24,0x15,0x06,0x17,0x28,0x29,0x2a,0x2b,0x2c,0x09,0x0a,0x1b,
0x30,0x31,0x1a,0x33,0x34,0x35,0x36,0x08,0x38,0x39,0x3a,0x3b,0x04,0x14,0x3e,0xff,
0x41,0xaa,0x4a,0xb1,0x9f,0xb2,0x6a,0xb5,0xbd,0xb4,0x9a,0x8a,0x5f,0xca,0xaf,0xbc,
0x90,0x8f,0xea,0xfa,0xbe,0xa0,0xb6,0xb3,0x9d,0xda,0x9b,0x8b,0xb7,0xb8,0xb9,0xab,
0x64,0x65,0x62,0x66,0x63,0x67,0x9e,0x68,0x74,0x71,0x72,0x73,0x78,0x75,0x76,0x77,
0xac,0x69,0xed,0xee,0xeb,0xef,0xec,0xbf,0x80,0xfd,0xfe,0xfb,0xfc,0xad,0x8e,0x59,
0x44,0x45,0x42,0x46,0x43,0x47,0x9c,0x48,0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57,
0x8c,0x49,0xcd,0xce,0xcb,0xcf,0xcc,0xe1,0x70,0xdd,0xde,0xdb,0xdc,0x8d,0xae,0xdf
};
unsigned char ebc2asc[256] = { /* Based on ISO 8859/1 and Code Page 37 */
0x00,0x01,0x02,0x03,0x9c,0x09,0x86,0x7f,0x97,0x8d,0x8e,0x0b,0x0c,0x0d,0x0e,0x0f,
0x10,0x11,0x12,0x13,0x9d,0x85,0x08,0x87,0x18,0x19,0x92,0x8f,0x1c,0x1d,0x1e,0x1f,
0x80,0x81,0x82,0x83,0x84,0x0a,0x17,0x1b,0x88,0x89,0x8a,0x8b,0x8c,0x05,0x06,0x07,
0x90,0x91,0x16,0x93,0x94,0x95,0x96,0x04,0x98,0x99,0x9a,0x9b,0x14,0x15,0x9e,0x1a,
0x20,0xa0,0xe2,0xe4,0xe0,0xe1,0xe3,0xe5,0xe7,0xf1,0xa2,0x2e,0x3c,0x28,0x2b,0x7c,
0x26,0xe9,0xea,0xeb,0xe8,0xed,0xee,0xef,0xec,0xdf,0x21,0x24,0x2a,0x29,0x3b,0xac,
0x2d,0x2f,0xc2,0xc4,0xc0,0xc1,0xc3,0xc5,0xc7,0xd1,0xa6,0x2c,0x25,0x5f,0x3e,0x3f,
0xf8,0xc9,0xca,0xcb,0xc8,0xcd,0xce,0xcf,0xcc,0x60,0x3a,0x23,0x40,0x27,0x3d,0x22,
0xd8,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0xab,0xbb,0xf0,0xfd,0xde,0xb1,
0xb0,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0xaa,0xba,0xe6,0xb8,0xc6,0xa4,
0xb5,0x7e,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0xa1,0xbf,0xd0,0xdd,0xfe,0xae,
0x5e,0xa3,0xa5,0xb7,0xa9,0xa7,0xb6,0xbc,0xbd,0xbe,0x5b,0x5d,0xaf,0xa8,0xb4,0xd7,
0x7b,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0xad,0xf4,0xf6,0xf2,0xf3,0xf5,
0x7d,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0xb9,0xfb,0xfc,0xf9,0xfa,0xff,
0x5c,0xf7,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0xb2,0xd4,0xd6,0xd2,0xd3,0xd5,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xb3,0xdb,0xdc,0xd9,0xda,0x9f
};
| bsd-3-clause |
Mahdi-Rom/android_external_skia | gm/thinstrokedrects.cpp | 48 | 2135 | /*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm.h"
namespace skiagm {
// Draw rects with various stroke widths at 1/8 pixel increments
class ThinStrokedRectsGM : public GM {
public:
ThinStrokedRectsGM() {
this->setBGColor(0xFF000000);
}
protected:
virtual SkString onShortName() SK_OVERRIDE {
return SkString("thinstrokedrects");
}
virtual SkISize onISize() SK_OVERRIDE {
return make_isize(240, 320);
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkPaint paint;
paint.setColor(SK_ColorWHITE);
paint.setStyle(SkPaint::kStroke_Style);
paint.setAntiAlias(true);
static const SkRect rect = { 0, 0, 10, 10 };
static const SkRect rect2 = { 0, 0, 20, 20 };
static const SkScalar gStrokeWidths[] = {
4, 2, 1, 0.5f, 0.25f, 0.125f, 0
};
canvas->translate(5, 5);
for (int i = 0; i < 8; ++i) {
canvas->save();
canvas->translate(i*0.125f, i*30.0f);
for (size_t j = 0; j < SK_ARRAY_COUNT(gStrokeWidths); ++j) {
paint.setStrokeWidth(gStrokeWidths[j]);
canvas->drawRect(rect, paint);
canvas->translate(15, 0);
}
canvas->restore();
}
// Draw a second time in red with a scale
paint.setColor(SK_ColorRED);
canvas->translate(0, 15);
for (int i = 0; i < 8; ++i) {
canvas->save();
canvas->translate(i*0.125f, i*30.0f);
canvas->scale(0.5f, 0.5f);
for (size_t j = 0; j < SK_ARRAY_COUNT(gStrokeWidths); ++j) {
paint.setStrokeWidth(2.0f * gStrokeWidths[j]);
canvas->drawRect(rect2, paint);
canvas->translate(30, 0);
}
canvas->restore();
}
}
private:
typedef GM INHERITED;
};
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return SkNEW(ThinStrokedRectsGM); )
}
| bsd-3-clause |
klusark/android_external_chromium_org | native_client_sdk/src/libraries/xray/xray.c | 49 | 23744 | /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
/* XRay -- a simple profiler for Native Client */
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include "xray/xray_priv.h"
#if defined(XRAY)
#define FORCE_INLINE __attribute__((always_inline))
/* GTSC - Get Time Stamp Counter */
#if defined(__amd64__) && !defined(XRAY_NO_RDTSC)
FORCE_INLINE uint64_t RDTSC64() {
uint64_t a, d;
__asm__ __volatile__("rdtsc" : "=a" (a), "=d" (d));
return ((uint64_t)a) | (((uint64_t)d) << 32);
}
#define GTSC(_x) _x = RDTSC64()
#elif defined(__i386__) && !defined(XRAY_NO_RDTSC)
#define GTSC(_x) __asm__ __volatile__ ("rdtsc" : "=A" (_x));
#else
FORCE_INLINE uint64_t GTOD() {
struct timeval tv;
gettimeofday(&tv, NULL);
return (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
}
#define GTSC(_x) _x = GTOD();
#endif
/* Use a TLS variable for cheap thread uid. */
__thread struct XRayTraceCapture* g_xray_capture = NULL;
__thread int g_xray_thread_id_placeholder = 0;
struct XRayTraceStackEntry {
uint32_t depth_addr;
uint64_t tsc;
uint32_t dest;
uint32_t annotation_index;
};
struct XRayTraceFrameEntry {
/* Indices into global tracebuffer */
int start;
int end;
uint64_t start_tsc;
uint64_t end_tsc;
uint64_t total_ticks;
int annotation_count;
bool valid;
#ifndef XRAY_DISABLE_BROWSER_INTEGRATION
struct XRayTimestampPair start_time;
struct XRayTimestampPair end_time;
#endif
};
struct XRayTraceFrame {
struct XRayTraceFrameEntry* entry;
int head;
int tail;
int count;
};
struct XRayTraceCapture {
/* Common variables share cache line */
bool recording;
uint32_t stack_depth;
uint32_t max_stack_depth;
int buffer_index;
int buffer_size;
int disabled;
int annotation_count;
struct XRaySymbolTable* symbols;
bool initialized;
uint32_t annotation_filter;
uint32_t guard0;
struct XRayTraceStackEntry stack[XRAY_TRACE_STACK_SIZE] XRAY_ALIGN64;
uint32_t guard1;
uint32_t guard2;
char annotation[XRAY_ANNOTATION_STACK_SIZE] XRAY_ALIGN64;
uint32_t guard3;
struct XRayTraceBufferEntry* buffer;
struct XRayTraceFrame frame;
#ifndef XRAY_DISABLE_BROWSER_INTEGRATION
int32_t thread_id;
#endif
} XRAY_ALIGN64;
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__pnacl__)
XRAY_NO_INSTRUMENT void __pnacl_profile_func_enter(const char* fname);
XRAY_NO_INSTRUMENT void __pnacl_profile_func_exit(const char* fname);
#else
XRAY_NO_INSTRUMENT void __cyg_profile_func_enter(void* this_fn,
void* call_site);
XRAY_NO_INSTRUMENT void __cyg_profile_func_exit(void* this_fn,
void* call_site);
#endif
XRAY_NO_INSTRUMENT void __xray_profile_append_annotation(
struct XRayTraceCapture* capture,
struct XRayTraceStackEntry* se,
struct XRayTraceBufferEntry* be);
#ifdef __cplusplus
}
#endif
/* Asserts that the guard values haven't changed. */
void XRayCheckGuards(struct XRayTraceCapture* capture) {
assert(capture->guard0 == XRAY_GUARD_VALUE_0x12345678);
assert(capture->guard1 == XRAY_GUARD_VALUE_0x12345678);
assert(capture->guard2 == XRAY_GUARD_VALUE_0x87654321);
assert(capture->guard3 == XRAY_GUARD_VALUE_0x12345678);
}
/* Decrements the trace index, wrapping around if needed. */
XRAY_FORCE_INLINE int XRayTraceDecrementIndexInline(
struct XRayTraceCapture* capture, int index) {
--index;
if (index < 0)
index = capture->buffer_size - 1;
return index;
}
/* Increments the trace index, wrapping around if needed. */
XRAY_FORCE_INLINE int XRayTraceIncrementIndexInline(
struct XRayTraceCapture* capture, int index) {
++index;
if (index >= capture->buffer_size)
index = 0;
return index;
}
/* Returns true if the trace entry is an annotation string. */
bool XRayTraceIsAnnotation(
struct XRayTraceCapture* capture, int index) {
struct XRayTraceBufferEntry* be = &capture->buffer[index];
char* dst = (char*)be;
return 0 == *dst;
}
int XRayTraceIncrementIndex(struct XRayTraceCapture* capture, int index) {
return XRayTraceIncrementIndexInline(capture, index);
}
int XRayTraceDecrementIndex(struct XRayTraceCapture* capture, int index) {
return XRayTraceDecrementIndexInline(capture, index);
}
/* The entry in the tracebuffer at index is an annotation string. */
/* Calculate the next index value representing the next trace entry. */
int XRayTraceSkipAnnotation(struct XRayTraceCapture* capture, int index) {
/* Annotations are strings embedded in the trace buffer. */
/* An annotation string can span multiple trace entries. */
/* Skip over the string by looking for zero termination. */
assert(capture);
assert(XRayTraceIsAnnotation(capture, index));
bool done = false;
int start_index = 1;
int i;
while (!done) {
char* str = (char*) &capture->buffer[index];
const int num = sizeof(capture->buffer[index]);
for (i = start_index; i < num; ++i) {
if (0 == str[i]) {
done = true;
break;
}
}
index = XRayTraceIncrementIndexInline(capture, index);
start_index = 0;
}
return index;
}
struct XRayTraceBufferEntry* XRayTraceGetEntry(
struct XRayTraceCapture* capture, int index) {
return &capture->buffer[index];
}
/* Starting at index, return the index into the trace buffer */
/* for the next trace entry. Index can wrap (ringbuffer) */
int XRayTraceNextEntry(struct XRayTraceCapture* capture, int index) {
if (XRayTraceIsAnnotation(capture, index))
index = XRayTraceSkipAnnotation(capture, index);
else
index = XRayTraceIncrementIndexInline(capture, index);
return index;
}
int XRayFrameGetTraceStartIndex(struct XRayTraceCapture* capture, int frame) {
assert(capture);
assert(capture->initialized);
assert(!capture->recording);
return capture->frame.entry[frame].start;
}
int XRayFrameGetTraceEndIndex(struct XRayTraceCapture* capture, int frame) {
assert(capture);
assert(capture->initialized);
assert(!capture->recording);
return capture->frame.entry[frame].end;
}
/* Not very accurate, annotation strings will also be counted as "entries" */
int XRayFrameGetTraceCount(
struct XRayTraceCapture* capture, int frame) {
assert(true == capture->initialized);
assert(frame >= 0);
assert(frame < capture->frame.count);
assert(!capture->recording);
int start = capture->frame.entry[frame].start;
int end = capture->frame.entry[frame].end;
int num;
if (start < end)
num = end - start;
else
num = capture->buffer_size - (start - end);
return num;
}
/* Append a string to trace buffer. */
void XRayTraceAppendString(struct XRayTraceCapture* capture, char* src) {
int index = capture->buffer_index;
bool done = false;
int start_index = 1;
int s = 0;
int i;
char* dst = (char*)&capture->buffer[index];
const int num = sizeof(capture->buffer[index]);
dst[0] = 0;
while (!done) {
for (i = start_index; i < num; ++i) {
dst[i] = src[s];
if (0 == src[s]) {
dst[i] = 0;
done = true;
break;
}
++s;
}
index = XRayTraceIncrementIndexInline(capture, index);
dst = (char*)&capture->buffer[index];
start_index = 0;
}
capture->buffer_index = index;
}
/* Copies annotation from trace buffer to output string. */
int XRayTraceCopyToString(
struct XRayTraceCapture* capture, int index, char* dst) {
assert(XRayTraceIsAnnotation(capture, index));
bool done = false;
int i;
int d = 0;
int start_index = 1;
while (!done) {
char* src = (char*) &capture->buffer[index];
const int num = sizeof(capture->buffer[index]);
for (i = start_index; i < num; ++i) {
dst[d] = src[i];
if (0 == src[i]) {
done = true;
break;
}
++d;
}
index = XRayTraceIncrementIndexInline(capture, index);
start_index = 0;
}
return index;
}
/* Generic memory malloc for XRay */
/* validates pointer returned by malloc */
/* memsets memory block to zero */
void* XRayMalloc(size_t t) {
void* data;
data = calloc(1, t);
if (NULL == data) {
printf("XRay: malloc(%d) failed, panic shutdown!\n", t);
exit(-1);
}
return data;
}
/* Generic memory free for XRay */
void XRayFree(void* data) {
assert(NULL != data);
free(data);
}
/* Main profile capture function that is called at the start */
/* of every instrumented function. This function is implicitly */
/* called when code is compilied with the -finstrument-functions option */
#if defined(__pnacl__)
void __pnacl_profile_func_enter(const char* this_fn) {
#else
void __cyg_profile_func_enter(void* this_fn, void* call_site) {
#endif
struct XRayTraceCapture* capture = g_xray_capture;
if (capture && capture->recording) {
uint32_t depth = capture->stack_depth;
if (depth < capture->max_stack_depth) {
struct XRayTraceStackEntry* se = &capture->stack[depth];
uint32_t addr = (uint32_t)this_fn;
se->depth_addr = XRAY_PACK_DEPTH_ADDR(depth, addr);
se->dest = capture->buffer_index;
se->annotation_index = 0;
GTSC(se->tsc);
capture->buffer_index =
XRayTraceIncrementIndexInline(capture, capture->buffer_index);
}
++capture->stack_depth;
}
}
/* Main profile capture function that is called at the exit of */
/* every instrumented function. This function is implicity called */
/* when the code is compiled with the -finstrument-functions option */
#if defined(__pnacl__)
void __pnacl_profile_func_exit(const char* this_fn) {
#else
void __cyg_profile_func_exit(void* this_fn, void* call_site) {
#endif
struct XRayTraceCapture* capture = g_xray_capture;
if (capture && capture->recording) {
--capture->stack_depth;
if (capture->stack_depth < capture->max_stack_depth) {
uint32_t depth = capture->stack_depth;
struct XRayTraceStackEntry* se = &capture->stack[depth];
uint32_t buffer_index = se->dest;
uint64_t tsc;
struct XRayTraceBufferEntry* be = &capture->buffer[buffer_index];
GTSC(tsc);
be->depth_addr = se->depth_addr;
be->start_tick = se->tsc;
be->end_tick = tsc;
be->annotation_index = 0;
if (0 != se->annotation_index)
__xray_profile_append_annotation(capture, se, be);
}
}
}
#ifndef XRAY_DISABLE_BROWSER_INTEGRATION
void XRayGetTSC(uint64_t* tsc) {
GTSC(*tsc);
}
int32_t XRayGetSavedThreadID(struct XRayTraceCapture* capture) {
return capture->thread_id;
}
struct XRayTimestampPair XRayFrameGetStartTimestampPair(
struct XRayTraceCapture* capture, int frame) {
return capture->frame.entry[frame].start_time;
}
struct XRayTimestampPair XRayFrameGetEndTimestampPair(
struct XRayTraceCapture* capture, int frame) {
return capture->frame.entry[frame].end_time;
}
#endif
/* Special case appending annotation string to trace buffer */
/* this function should only ever be called from __cyg_profile_func_exit() */
void __xray_profile_append_annotation(struct XRayTraceCapture* capture,
struct XRayTraceStackEntry* se,
struct XRayTraceBufferEntry* be) {
struct XRayTraceStackEntry* parent = se - 1;
int start = parent->annotation_index;
be->annotation_index = capture->buffer_index;
char* str = &capture->annotation[start];
XRayTraceAppendString(capture, str);
*str = 0;
++capture->annotation_count;
}
/* Annotates the trace buffer. no filtering. */
void __XRayAnnotate(const char* fmt, ...) {
va_list args;
struct XRayTraceCapture* capture = g_xray_capture;
/* Only annotate functions recorded in the trace buffer. */
if (capture && capture->initialized) {
if (0 == capture->disabled) {
if (capture->recording) {
char buffer[1024];
int r;
va_start(args, fmt);
r = vsnprintf(buffer, sizeof(buffer), fmt, args);
va_end(args);
{
/* Get current string ptr */
int depth = capture->stack_depth - 1;
struct XRayTraceStackEntry* se = &capture->stack[depth];
if (0 == se->annotation_index) {
struct XRayTraceStackEntry* parent = se - 1;
se->annotation_index = parent->annotation_index;
}
char* dst = &capture->annotation[se->annotation_index];
strcpy(dst, buffer);
int len = strlen(dst);
se->annotation_index += len;
}
}
}
}
}
/* Annotates the trace buffer with user strings. Can be filtered. */
void __XRayAnnotateFiltered(const uint32_t filter, const char* fmt, ...) {
va_list args;
struct XRayTraceCapture* capture = g_xray_capture;
if (capture && capture->initialized) {
if (0 != (filter & capture->annotation_filter)) {
if (0 == capture->disabled) {
if (capture->recording) {
char buffer[XRAY_TRACE_ANNOTATION_LENGTH];
int r;
va_start(args, fmt);
r = vsnprintf(buffer, sizeof(buffer), fmt, args);
va_end(args);
{
/* get current string ptr */
int depth = capture->stack_depth - 1;
struct XRayTraceStackEntry* se = &capture->stack[depth];
if (0 == se->annotation_index) {
struct XRayTraceStackEntry* parent = se - 1;
se->annotation_index = parent->annotation_index;
}
char* dst = &capture->annotation[se->annotation_index];
strcpy(dst, buffer);
int len = strlen(dst);
se->annotation_index += len;
}
}
}
}
}
}
/* Allows user to specify annotation filter value, a 32 bit mask. */
void XRaySetAnnotationFilter(struct XRayTraceCapture* capture,
uint32_t filter) {
capture->annotation_filter = filter;
}
/* Reset xray profiler. */
void XRayReset(struct XRayTraceCapture* capture) {
assert(capture);
assert(capture->initialized);
assert(!capture->recording);
capture->buffer_index = 0;
capture->stack_depth = 0;
capture->disabled = 0;
capture->frame.head = 0;
capture->frame.tail = 0;
memset(capture->frame.entry, 0,
sizeof(capture->frame.entry[0]) * capture->frame.count);
memset(&capture->stack, 0,
sizeof(capture->stack[0]) * XRAY_TRACE_STACK_SIZE);
XRayCheckGuards(capture);
}
/* Change the maximum stack depth captures are made. */
void XRaySetMaxStackDepth(struct XRayTraceCapture* capture, int stack_depth) {
assert(capture);
assert(capture->initialized);
assert(!capture->recording);
if (stack_depth < 1)
stack_depth = 1;
if (stack_depth >= XRAY_TRACE_STACK_SIZE)
stack_depth = (XRAY_TRACE_STACK_SIZE - 1);
capture->max_stack_depth = stack_depth;
}
int XRayFrameGetCount(struct XRayTraceCapture* capture) {
return capture->frame.count;
}
int XRayFrameGetTail(struct XRayTraceCapture* capture) {
return capture->frame.tail;
}
int XRayFrameGetHead(struct XRayTraceCapture* capture) {
return capture->frame.head;
}
int XRayFrameGetPrev(struct XRayTraceCapture* capture, int i) {
i = i - 1;
if (i < 0)
i = capture->frame.count - 1;
return i;
}
int XRayFrameGetNext(struct XRayTraceCapture* capture, int i) {
i = i + 1;
if (i >= capture->frame.count)
i = 0;
return i;
}
bool XRayFrameIsValid(struct XRayTraceCapture* capture, int i) {
return capture->frame.entry[i].valid;
}
int XRayFrameGetTotalTicks(struct XRayTraceCapture* capture, int i) {
return capture->frame.entry[i].total_ticks;
}
int XRayFrameGetAnnotationCount(struct XRayTraceCapture* capture, int i) {
return capture->frame.entry[i].annotation_count;
}
void XRayFrameMakeLabel(struct XRayTraceCapture* capture,
int counter,
char* label) {
snprintf(label, XRAY_MAX_LABEL, "@@@frame%d@@@", counter);
}
/* Scans the ring buffer going backwards to find last valid complete frame. */
/* Will mark whether frames are valid or invalid during the traversal. */
int XRayFrameFindTail(struct XRayTraceCapture* capture) {
int head = capture->frame.head;
int index = XRayFrameGetPrev(capture, head);
int total_capture = 0;
int last_valid_frame = index;
/* Check for no captures */
if (capture->frame.head == capture->frame.tail)
return capture->frame.head;
/* Go back and invalidate all captures that have been stomped. */
while (index != head) {
bool valid = capture->frame.entry[index].valid;
if (valid) {
total_capture += XRayFrameGetTraceCount(capture, index) + 1;
if (total_capture < capture->buffer_size) {
last_valid_frame = index;
capture->frame.entry[index].valid = true;
} else {
capture->frame.entry[index].valid = false;
}
}
index = XRayFrameGetPrev(capture, index);
}
return last_valid_frame;
}
/* Starts a new frame and enables capturing, and must be paired with */
/* XRayEndFrame() Trace capturing only occurs on the thread which called */
/* XRayBeginFrame() and each instance of capture can only trace one thread */
/* at a time. */
void XRayStartFrame(struct XRayTraceCapture* capture) {
int i;
assert(NULL == g_xray_capture);
assert(capture->initialized);
assert(!capture->recording);
i = capture->frame.head;
XRayCheckGuards(capture);
/* Add a trace entry marker so we can detect wrap around stomping */
struct XRayTraceBufferEntry* be = &capture->buffer[capture->buffer_index];
be->depth_addr = XRAY_FRAME_MARKER;
capture->buffer_index =
XRayTraceIncrementIndex(capture, capture->buffer_index);
/* Set start of the frame we're about to trace */
capture->frame.entry[i].start = capture->buffer_index;
capture->disabled = 0;
capture->stack_depth = 1;
/* The trace stack[0] is reserved */
memset(&capture->stack[0], 0, sizeof(capture->stack[0]));
/* Annotation index 0 is reserved to indicate no annotation */
capture->stack[0].annotation_index = 1;
capture->annotation[0] = 0;
capture->annotation[1] = 0;
capture->annotation_count = 0;
capture->recording = true;
GTSC(capture->frame.entry[i].start_tsc);
g_xray_capture = capture;
#ifndef XRAY_DISABLE_BROWSER_INTEGRATION
capture->frame.entry[i].start_time = XRayGenerateTimestampsNow();
#endif
}
/* Ends a frame and disables capturing. Advances to the next frame. */
/* Must be paired with XRayStartFrame(), and called from the same thread. */
void XRayEndFrame(struct XRayTraceCapture* capture) {
int i;
assert(capture);
assert(capture->initialized);
assert(capture->recording);
assert(g_xray_capture == capture);
assert(0 == capture->disabled);
assert(1 == capture->stack_depth);
i = capture->frame.head;
GTSC(capture->frame.entry[i].end_tsc);
capture->frame.entry[i].total_ticks =
capture->frame.entry[i].end_tsc - capture->frame.entry[i].start_tsc;
capture->recording = NULL;
capture->frame.entry[i].end = capture->buffer_index;
capture->frame.entry[i].valid = true;
capture->frame.entry[i].annotation_count = capture->annotation_count;
capture->frame.head = XRayFrameGetNext(capture, capture->frame.head);
/* If the table is filled, bump the tail. */
if (capture->frame.head == capture->frame.tail)
capture->frame.tail = XRayFrameGetNext(capture, capture->frame.tail);
capture->frame.tail = XRayFrameFindTail(capture);
/* Check that we didn't stomp over trace entry marker. */
int marker = XRayTraceDecrementIndex(capture, capture->frame.entry[i].start);
struct XRayTraceBufferEntry* be = &capture->buffer[marker];
if (be->depth_addr != XRAY_FRAME_MARKER) {
fprintf(stderr,
"XRay: XRayStopFrame() detects insufficient trace buffer size!\n");
XRayReset(capture);
} else {
/* Replace marker with an empty annotation string. */
be->depth_addr = XRAY_NULL_ANNOTATION;
XRayCheckGuards(capture);
}
g_xray_capture = NULL;
#ifndef XRAY_DISABLE_BROWSER_INTEGRATION
capture->frame.entry[i].end_time = XRayGenerateTimestampsNow();
#endif
}
/* Get the last frame captured. Do not call while capturing. */
/* (ie call outside of XRayStartFrame() / XRayStopFrame() pair) */
int XRayGetLastFrame(struct XRayTraceCapture* capture) {
assert(capture);
assert(capture->initialized);
assert(!capture->recording);
assert(0 == capture->disabled);
assert(1 == capture->stack_depth);
int last_frame = XRayFrameGetPrev(capture, capture->frame.head);
return last_frame;
}
/* Disables capturing until a paired XRayEnableCapture() is called */
/* This call can be nested, but must be paired with an enable */
/* (If you need to just exclude a specific function and not its */
/* children, the XRAY_NO_INSTRUMENT modifier might be better) */
/* Must be called from same thread as XRayBeginFrame() / XRayEndFrame() */
void XRayDisableCapture(struct XRayTraceCapture* capture) {
assert(capture);
assert(capture == g_xray_capture);
assert(capture->initialized);
++capture->disabled;
capture->recording = false;
}
/* Re-enables capture. Must be paired with XRayDisableCapture() */
void XRayEnableCapture(struct XRayTraceCapture* capture) {
assert(capture);
assert(capture == g_xray_capture);
assert(capture->initialized);
assert(0 < capture->disabled);
--capture->disabled;
if (0 == capture->disabled) {
capture->recording = true;
}
}
struct XRaySymbolTable* XRayGetSymbolTable(struct XRayTraceCapture* capture) {
return capture->symbols;
}
/* Initialize XRay */
struct XRayTraceCapture* XRayInit(int stack_depth,
int buffer_size,
int frame_count,
const char* mapfilename) {
struct XRayTraceCapture* capture;
capture = (struct XRayTraceCapture*)XRayMalloc(
sizeof(struct XRayTraceCapture));
int adj_frame_count = frame_count + 1;
size_t buffer_size_in_bytes =
sizeof(capture->buffer[0]) * buffer_size;
size_t frame_size_in_bytes =
sizeof(capture->frame.entry[0]) * adj_frame_count;
capture->buffer =
(struct XRayTraceBufferEntry *)XRayMalloc(buffer_size_in_bytes);
capture->frame.entry =
(struct XRayTraceFrameEntry *)XRayMalloc(frame_size_in_bytes);
capture->buffer_size = buffer_size;
capture->frame.count = adj_frame_count;
capture->frame.head = 0;
capture->frame.tail = 0;
capture->disabled = 0;
capture->annotation_filter = 0xFFFFFFFF;
capture->guard0 = XRAY_GUARD_VALUE_0x12345678;
capture->guard1 = XRAY_GUARD_VALUE_0x12345678;
capture->guard2 = XRAY_GUARD_VALUE_0x87654321;
capture->guard3 = XRAY_GUARD_VALUE_0x12345678;
capture->initialized = true;
capture->recording = false;
XRaySetMaxStackDepth(capture, stack_depth);
XRayReset(capture);
/* Mapfile is optional; we don't need it for captures, only for reports. */
capture->symbols =
XRaySymbolTableCreate(XRAY_DEFAULT_SYMBOL_TABLE_SIZE);
if (NULL != mapfilename)
XRaySymbolTableParseMapfile(capture->symbols, mapfilename);
#ifndef XRAY_DISABLE_BROWSER_INTEGRATION
/* Use the address of a thread local variable as a fake thread id. */
capture->thread_id = (int32_t)(&g_xray_thread_id_placeholder);
#endif
return capture;
}
/* Shut down and free memory used by XRay. */
void XRayShutdown(struct XRayTraceCapture* capture) {
assert(capture);
assert(capture->initialized);
assert(!capture->recording);
XRayCheckGuards(capture);
if (NULL != capture->symbols) {
XRaySymbolTableFree(capture->symbols);
}
XRayFree(capture->frame.entry);
XRayFree(capture->buffer);
capture->initialized = false;
XRayFree(capture);
}
#endif /* XRAY */
| bsd-3-clause |
anasazi/POP-REU-Project | pkgs/libs/ssl/src/engines/e_cswift.c | 57 | 31536 | /* crypto/engine/hw_cswift.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/buffer.h>
#include <openssl/dso.h>
#include <openssl/engine.h>
#ifndef OPENSSL_NO_RSA
#include <openssl/rsa.h>
#endif
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#endif
#include <openssl/rand.h>
#include <openssl/bn.h>
#ifndef OPENSSL_NO_HW
#ifndef OPENSSL_NO_HW_CSWIFT
/* Attribution notice: Rainbow have generously allowed me to reproduce
* the necessary definitions here from their API. This means the support
* can build independently of whether application builders have the
* API or hardware. This will allow developers to easily produce software
* that has latent hardware support for any users that have accelerators
* installed, without the developers themselves needing anything extra.
*
* I have only clipped the parts from the CryptoSwift header files that
* are (or seem) relevant to the CryptoSwift support code. This is
* simply to keep the file sizes reasonable.
* [Geoff]
*/
#ifdef FLAT_INC
#include "cswift.h"
#else
#include "vendor_defns/cswift.h"
#endif
#define CSWIFT_LIB_NAME "cswift engine"
#include "e_cswift_err.c"
#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1)
static int cswift_destroy(ENGINE *e);
static int cswift_init(ENGINE *e);
static int cswift_finish(ENGINE *e);
static int cswift_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void));
#ifndef OPENSSL_NO_RSA
static int cswift_bn_32copy(SW_LARGENUMBER * out, const BIGNUM * in);
#endif
/* BIGNUM stuff */
static int cswift_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
#ifndef OPENSSL_NO_RSA
static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
const BIGNUM *iqmp, BN_CTX *ctx);
#endif
#ifndef OPENSSL_NO_RSA
/* RSA stuff */
static int cswift_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int cswift_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
#endif
#ifndef OPENSSL_NO_DSA
/* DSA stuff */
static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa);
static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
DSA_SIG *sig, DSA *dsa);
#endif
#ifndef OPENSSL_NO_DH
/* DH stuff */
/* This function is alised to mod_exp (with the DH and mont dropped). */
static int cswift_mod_exp_dh(const DH *dh, BIGNUM *r,
const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
#endif
/* RAND stuff */
static int cswift_rand_bytes(unsigned char *buf, int num);
static int cswift_rand_status(void);
/* The definitions for control commands specific to this engine */
#define CSWIFT_CMD_SO_PATH ENGINE_CMD_BASE
static const ENGINE_CMD_DEFN cswift_cmd_defns[] = {
{CSWIFT_CMD_SO_PATH,
"SO_PATH",
"Specifies the path to the 'cswift' shared library",
ENGINE_CMD_FLAG_STRING},
{0, NULL, NULL, 0}
};
#ifndef OPENSSL_NO_RSA
/* Our internal RSA_METHOD that we provide pointers to */
static RSA_METHOD cswift_rsa =
{
"CryptoSwift RSA method",
NULL,
NULL,
NULL,
NULL,
cswift_rsa_mod_exp,
cswift_mod_exp_mont,
NULL,
NULL,
0,
NULL,
NULL,
NULL,
NULL
};
#endif
#ifndef OPENSSL_NO_DSA
/* Our internal DSA_METHOD that we provide pointers to */
static DSA_METHOD cswift_dsa =
{
"CryptoSwift DSA method",
cswift_dsa_sign,
NULL, /* dsa_sign_setup */
cswift_dsa_verify,
NULL, /* dsa_mod_exp */
NULL, /* bn_mod_exp */
NULL, /* init */
NULL, /* finish */
0, /* flags */
NULL, /* app_data */
NULL, /* dsa_paramgen */
NULL /* dsa_keygen */
};
#endif
#ifndef OPENSSL_NO_DH
/* Our internal DH_METHOD that we provide pointers to */
static DH_METHOD cswift_dh =
{
"CryptoSwift DH method",
NULL,
NULL,
cswift_mod_exp_dh,
NULL,
NULL,
0,
NULL,
NULL
};
#endif
static RAND_METHOD cswift_random =
{
/* "CryptoSwift RAND method", */
NULL,
cswift_rand_bytes,
NULL,
NULL,
cswift_rand_bytes,
cswift_rand_status,
};
/* Constants used when creating the ENGINE */
static const char *engine_cswift_id = "cswift";
static const char *engine_cswift_name = "CryptoSwift hardware engine support";
/* This internal function is used by ENGINE_cswift() and possibly by the
* "dynamic" ENGINE support too */
static int bind_helper(ENGINE *e)
{
#ifndef OPENSSL_NO_RSA
const RSA_METHOD *meth1;
#endif
#ifndef OPENSSL_NO_DH
const DH_METHOD *meth2;
#endif
if(!ENGINE_set_id(e, engine_cswift_id) ||
!ENGINE_set_name(e, engine_cswift_name) ||
#ifndef OPENSSL_NO_RSA
!ENGINE_set_RSA(e, &cswift_rsa) ||
#endif
#ifndef OPENSSL_NO_DSA
!ENGINE_set_DSA(e, &cswift_dsa) ||
#endif
#ifndef OPENSSL_NO_DH
!ENGINE_set_DH(e, &cswift_dh) ||
#endif
!ENGINE_set_RAND(e, &cswift_random) ||
!ENGINE_set_destroy_function(e, cswift_destroy) ||
!ENGINE_set_init_function(e, cswift_init) ||
!ENGINE_set_finish_function(e, cswift_finish) ||
!ENGINE_set_ctrl_function(e, cswift_ctrl) ||
!ENGINE_set_cmd_defns(e, cswift_cmd_defns))
return 0;
#ifndef OPENSSL_NO_RSA
/* We know that the "PKCS1_SSLeay()" functions hook properly
* to the cswift-specific mod_exp and mod_exp_crt so we use
* those functions. NB: We don't use ENGINE_openssl() or
* anything "more generic" because something like the RSAref
* code may not hook properly, and if you own one of these
* cards then you have the right to do RSA operations on it
* anyway! */
meth1 = RSA_PKCS1_SSLeay();
cswift_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
cswift_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
cswift_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
cswift_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
#endif
#ifndef OPENSSL_NO_DH
/* Much the same for Diffie-Hellman */
meth2 = DH_OpenSSL();
cswift_dh.generate_key = meth2->generate_key;
cswift_dh.compute_key = meth2->compute_key;
#endif
/* Ensure the cswift error handling is set up */
ERR_load_CSWIFT_strings();
return 1;
}
#ifdef OPENSSL_NO_DYNAMIC_ENGINE
static ENGINE *engine_cswift(void)
{
ENGINE *ret = ENGINE_new();
if(!ret)
return NULL;
if(!bind_helper(ret))
{
ENGINE_free(ret);
return NULL;
}
return ret;
}
void ENGINE_load_cswift(void)
{
/* Copied from eng_[openssl|dyn].c */
ENGINE *toadd = engine_cswift();
if(!toadd) return;
ENGINE_add(toadd);
ENGINE_free(toadd);
ERR_clear_error();
}
#endif
/* This is a process-global DSO handle used for loading and unloading
* the CryptoSwift library. NB: This is only set (or unset) during an
* init() or finish() call (reference counts permitting) and they're
* operating with global locks, so this should be thread-safe
* implicitly. */
static DSO *cswift_dso = NULL;
/* These are the function pointers that are (un)set when the library has
* successfully (un)loaded. */
t_swAcquireAccContext *p_CSwift_AcquireAccContext = NULL;
t_swAttachKeyParam *p_CSwift_AttachKeyParam = NULL;
t_swSimpleRequest *p_CSwift_SimpleRequest = NULL;
t_swReleaseAccContext *p_CSwift_ReleaseAccContext = NULL;
/* Used in the DSO operations. */
static const char *CSWIFT_LIBNAME = NULL;
static const char *get_CSWIFT_LIBNAME(void)
{
if(CSWIFT_LIBNAME)
return CSWIFT_LIBNAME;
return "swift";
}
static void free_CSWIFT_LIBNAME(void)
{
if(CSWIFT_LIBNAME)
OPENSSL_free((void*)CSWIFT_LIBNAME);
CSWIFT_LIBNAME = NULL;
}
static long set_CSWIFT_LIBNAME(const char *name)
{
free_CSWIFT_LIBNAME();
return (((CSWIFT_LIBNAME = BUF_strdup(name)) != NULL) ? 1 : 0);
}
static const char *CSWIFT_F1 = "swAcquireAccContext";
static const char *CSWIFT_F2 = "swAttachKeyParam";
static const char *CSWIFT_F3 = "swSimpleRequest";
static const char *CSWIFT_F4 = "swReleaseAccContext";
/* CryptoSwift library functions and mechanics - these are used by the
* higher-level functions further down. NB: As and where there's no
* error checking, take a look lower down where these functions are
* called, the checking and error handling is probably down there. */
/* utility function to obtain a context */
static int get_context(SW_CONTEXT_HANDLE *hac)
{
SW_STATUS status;
status = p_CSwift_AcquireAccContext(hac);
if(status != SW_OK)
return 0;
return 1;
}
/* similarly to release one. */
static void release_context(SW_CONTEXT_HANDLE hac)
{
p_CSwift_ReleaseAccContext(hac);
}
/* Destructor (complements the "ENGINE_cswift()" constructor) */
static int cswift_destroy(ENGINE *e)
{
free_CSWIFT_LIBNAME();
ERR_unload_CSWIFT_strings();
return 1;
}
/* (de)initialisation functions. */
static int cswift_init(ENGINE *e)
{
SW_CONTEXT_HANDLE hac;
t_swAcquireAccContext *p1;
t_swAttachKeyParam *p2;
t_swSimpleRequest *p3;
t_swReleaseAccContext *p4;
if(cswift_dso != NULL)
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libswift.so/swift.dll/whatever. */
cswift_dso = DSO_load(NULL, get_CSWIFT_LIBNAME(), NULL, 0);
if(cswift_dso == NULL)
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_NOT_LOADED);
goto err;
}
if(!(p1 = (t_swAcquireAccContext *)
DSO_bind_func(cswift_dso, CSWIFT_F1)) ||
!(p2 = (t_swAttachKeyParam *)
DSO_bind_func(cswift_dso, CSWIFT_F2)) ||
!(p3 = (t_swSimpleRequest *)
DSO_bind_func(cswift_dso, CSWIFT_F3)) ||
!(p4 = (t_swReleaseAccContext *)
DSO_bind_func(cswift_dso, CSWIFT_F4)))
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_NOT_LOADED);
goto err;
}
/* Copy the pointers */
p_CSwift_AcquireAccContext = p1;
p_CSwift_AttachKeyParam = p2;
p_CSwift_SimpleRequest = p3;
p_CSwift_ReleaseAccContext = p4;
/* Try and get a context - if not, we may have a DSO but no
* accelerator! */
if(!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_UNIT_FAILURE);
goto err;
}
release_context(hac);
/* Everything's fine. */
return 1;
err:
if(cswift_dso)
{
DSO_free(cswift_dso);
cswift_dso = NULL;
}
p_CSwift_AcquireAccContext = NULL;
p_CSwift_AttachKeyParam = NULL;
p_CSwift_SimpleRequest = NULL;
p_CSwift_ReleaseAccContext = NULL;
return 0;
}
static int cswift_finish(ENGINE *e)
{
free_CSWIFT_LIBNAME();
if(cswift_dso == NULL)
{
CSWIFTerr(CSWIFT_F_CSWIFT_FINISH,CSWIFT_R_NOT_LOADED);
return 0;
}
if(!DSO_free(cswift_dso))
{
CSWIFTerr(CSWIFT_F_CSWIFT_FINISH,CSWIFT_R_UNIT_FAILURE);
return 0;
}
cswift_dso = NULL;
p_CSwift_AcquireAccContext = NULL;
p_CSwift_AttachKeyParam = NULL;
p_CSwift_SimpleRequest = NULL;
p_CSwift_ReleaseAccContext = NULL;
return 1;
}
static int cswift_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
{
int initialised = ((cswift_dso == NULL) ? 0 : 1);
switch(cmd)
{
case CSWIFT_CMD_SO_PATH:
if(p == NULL)
{
CSWIFTerr(CSWIFT_F_CSWIFT_CTRL,ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if(initialised)
{
CSWIFTerr(CSWIFT_F_CSWIFT_CTRL,CSWIFT_R_ALREADY_LOADED);
return 0;
}
return set_CSWIFT_LIBNAME((const char *)p);
default:
break;
}
CSWIFTerr(CSWIFT_F_CSWIFT_CTRL,CSWIFT_R_CTRL_COMMAND_NOT_IMPLEMENTED);
return 0;
}
/* Un petit mod_exp */
static int cswift_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
/* I need somewhere to store temporary serialised values for
* use with the CryptoSwift API calls. A neat cheat - I'll use
* BIGNUMs from the BN_CTX but access their arrays directly as
* byte arrays <grin>. This way I don't have to clean anything
* up. */
BIGNUM *modulus;
BIGNUM *exponent;
BIGNUM *argument;
BIGNUM *result;
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
SW_PARAM sw_param;
SW_CONTEXT_HANDLE hac;
int to_return, acquired;
modulus = exponent = argument = result = NULL;
to_return = 0; /* expect failure */
acquired = 0;
if(!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_UNIT_FAILURE);
goto err;
}
acquired = 1;
/* Prepare the params */
BN_CTX_start(ctx);
modulus = BN_CTX_get(ctx);
exponent = BN_CTX_get(ctx);
argument = BN_CTX_get(ctx);
result = BN_CTX_get(ctx);
if(!result)
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(modulus, m->top) || !bn_wexpand(exponent, p->top) ||
!bn_wexpand(argument, a->top) || !bn_wexpand(result, m->top))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_EXP;
sw_param.up.exp.modulus.nbytes = BN_bn2bin(m,
(unsigned char *)modulus->d);
sw_param.up.exp.modulus.value = (unsigned char *)modulus->d;
sw_param.up.exp.exponent.nbytes = BN_bn2bin(p,
(unsigned char *)exponent->d);
sw_param.up.exp.exponent.value = (unsigned char *)exponent->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_BAD_KEY_SIZE);
goto err;
default:
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg.nbytes = BN_bn2bin(a, (unsigned char *)argument->d);
arg.value = (unsigned char *)argument->d;
res.nbytes = BN_num_bytes(m);
memset(result->d, 0, res.nbytes);
res.value = (unsigned char *)result->d;
/* Perform the operation */
if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP, &arg, 1,
&res, 1)) != SW_OK)
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
to_return = 1;
err:
if(acquired)
release_context(hac);
BN_CTX_end(ctx);
return to_return;
}
#ifndef OPENSSL_NO_RSA
int cswift_bn_32copy(SW_LARGENUMBER * out, const BIGNUM * in)
{
int mod;
int numbytes = BN_num_bytes(in);
mod = 0;
while( ((out->nbytes = (numbytes+mod)) % 32) )
{
mod++;
}
out->value = (unsigned char*)OPENSSL_malloc(out->nbytes);
if(!out->value)
{
return 0;
}
BN_bn2bin(in, &out->value[mod]);
if(mod)
memset(out->value, 0, mod);
return 1;
}
#endif
#ifndef OPENSSL_NO_RSA
/* Un petit mod_exp chinois */
static int cswift_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *q, const BIGNUM *dmp1,
const BIGNUM *dmq1, const BIGNUM *iqmp, BN_CTX *ctx)
{
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
SW_PARAM sw_param;
SW_CONTEXT_HANDLE hac;
BIGNUM *result = NULL;
BIGNUM *argument = NULL;
int to_return = 0; /* expect failure */
int acquired = 0;
sw_param.up.crt.p.value = NULL;
sw_param.up.crt.q.value = NULL;
sw_param.up.crt.dmp1.value = NULL;
sw_param.up.crt.dmq1.value = NULL;
sw_param.up.crt.iqmp.value = NULL;
if(!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_UNIT_FAILURE);
goto err;
}
acquired = 1;
/* Prepare the params */
argument = BN_new();
result = BN_new();
if(!result || !argument)
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_CTX_FULL);
goto err;
}
sw_param.type = SW_ALG_CRT;
/************************************************************************/
/* 04/02/2003 */
/* Modified by Frederic Giudicelli (deny-all.com) to overcome the */
/* limitation of cswift with values not a multiple of 32 */
/************************************************************************/
if(!cswift_bn_32copy(&sw_param.up.crt.p, p))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
if(!cswift_bn_32copy(&sw_param.up.crt.q, q))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
if(!cswift_bn_32copy(&sw_param.up.crt.dmp1, dmp1))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
if(!cswift_bn_32copy(&sw_param.up.crt.dmq1, dmq1))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
if(!cswift_bn_32copy(&sw_param.up.crt.iqmp, iqmp))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
if( !bn_wexpand(argument, a->top) ||
!bn_wexpand(result, p->top + q->top))
{
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_BAD_KEY_SIZE);
goto err;
default:
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg.nbytes = BN_bn2bin(a, (unsigned char *)argument->d);
arg.value = (unsigned char *)argument->d;
res.nbytes = 2 * BN_num_bytes(p);
memset(result->d, 0, res.nbytes);
res.value = (unsigned char *)result->d;
/* Perform the operation */
if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP_CRT, &arg, 1,
&res, 1)) != SW_OK)
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_MOD_EXP_CRT,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
to_return = 1;
err:
if(sw_param.up.crt.p.value)
OPENSSL_free(sw_param.up.crt.p.value);
if(sw_param.up.crt.q.value)
OPENSSL_free(sw_param.up.crt.q.value);
if(sw_param.up.crt.dmp1.value)
OPENSSL_free(sw_param.up.crt.dmp1.value);
if(sw_param.up.crt.dmq1.value)
OPENSSL_free(sw_param.up.crt.dmq1.value);
if(sw_param.up.crt.iqmp.value)
OPENSSL_free(sw_param.up.crt.iqmp.value);
if(result)
BN_free(result);
if(argument)
BN_free(argument);
if(acquired)
release_context(hac);
return to_return;
}
#endif
#ifndef OPENSSL_NO_RSA
static int cswift_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
{
int to_return = 0;
const RSA_METHOD * def_rsa_method;
if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
{
CSWIFTerr(CSWIFT_F_CSWIFT_RSA_MOD_EXP,CSWIFT_R_MISSING_KEY_COMPONENTS);
goto err;
}
/* Try the limits of RSA (2048 bits) */
if(BN_num_bytes(rsa->p) > 128 ||
BN_num_bytes(rsa->q) > 128 ||
BN_num_bytes(rsa->dmp1) > 128 ||
BN_num_bytes(rsa->dmq1) > 128 ||
BN_num_bytes(rsa->iqmp) > 128)
{
#ifdef RSA_NULL
def_rsa_method=RSA_null_method();
#else
#if 0
def_rsa_method=RSA_PKCS1_RSAref();
#else
def_rsa_method=RSA_PKCS1_SSLeay();
#endif
#endif
if(def_rsa_method)
return def_rsa_method->rsa_mod_exp(r0, I, rsa, ctx);
}
to_return = cswift_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1,
rsa->dmq1, rsa->iqmp, ctx);
err:
return to_return;
}
/* This function is aliased to mod_exp (with the mont stuff dropped). */
static int cswift_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
const RSA_METHOD * def_rsa_method;
/* Try the limits of RSA (2048 bits) */
if(BN_num_bytes(r) > 256 ||
BN_num_bytes(a) > 256 ||
BN_num_bytes(m) > 256)
{
#ifdef RSA_NULL
def_rsa_method=RSA_null_method();
#else
#if 0
def_rsa_method=RSA_PKCS1_RSAref();
#else
def_rsa_method=RSA_PKCS1_SSLeay();
#endif
#endif
if(def_rsa_method)
return def_rsa_method->bn_mod_exp(r, a, p, m, ctx, m_ctx);
}
return cswift_mod_exp(r, a, p, m, ctx);
}
#endif /* OPENSSL_NO_RSA */
#ifndef OPENSSL_NO_DSA
static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
{
SW_CONTEXT_HANDLE hac;
SW_PARAM sw_param;
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
unsigned char *ptr;
BN_CTX *ctx;
BIGNUM *dsa_p = NULL;
BIGNUM *dsa_q = NULL;
BIGNUM *dsa_g = NULL;
BIGNUM *dsa_key = NULL;
BIGNUM *result = NULL;
DSA_SIG *to_return = NULL;
int acquired = 0;
if((ctx = BN_CTX_new()) == NULL)
goto err;
if(!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_UNIT_FAILURE);
goto err;
}
acquired = 1;
/* Prepare the params */
BN_CTX_start(ctx);
dsa_p = BN_CTX_get(ctx);
dsa_q = BN_CTX_get(ctx);
dsa_g = BN_CTX_get(ctx);
dsa_key = BN_CTX_get(ctx);
result = BN_CTX_get(ctx);
if(!result)
{
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(dsa_p, dsa->p->top) ||
!bn_wexpand(dsa_q, dsa->q->top) ||
!bn_wexpand(dsa_g, dsa->g->top) ||
!bn_wexpand(dsa_key, dsa->priv_key->top) ||
!bn_wexpand(result, dsa->p->top))
{
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_DSA;
sw_param.up.dsa.p.nbytes = BN_bn2bin(dsa->p,
(unsigned char *)dsa_p->d);
sw_param.up.dsa.p.value = (unsigned char *)dsa_p->d;
sw_param.up.dsa.q.nbytes = BN_bn2bin(dsa->q,
(unsigned char *)dsa_q->d);
sw_param.up.dsa.q.value = (unsigned char *)dsa_q->d;
sw_param.up.dsa.g.nbytes = BN_bn2bin(dsa->g,
(unsigned char *)dsa_g->d);
sw_param.up.dsa.g.value = (unsigned char *)dsa_g->d;
sw_param.up.dsa.key.nbytes = BN_bn2bin(dsa->priv_key,
(unsigned char *)dsa_key->d);
sw_param.up.dsa.key.value = (unsigned char *)dsa_key->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_BAD_KEY_SIZE);
goto err;
default:
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg.nbytes = dlen;
arg.value = (unsigned char *)dgst;
res.nbytes = BN_num_bytes(dsa->p);
memset(result->d, 0, res.nbytes);
res.value = (unsigned char *)result->d;
/* Perform the operation */
sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_DSS_SIGN, &arg, 1,
&res, 1);
if(sw_status != SW_OK)
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
ptr = (unsigned char *)result->d;
if((to_return = DSA_SIG_new()) == NULL)
goto err;
to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL);
to_return->s = BN_bin2bn((unsigned char *)result->d + 20, 20, NULL);
err:
if(acquired)
release_context(hac);
if(ctx)
{
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
return to_return;
}
static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
DSA_SIG *sig, DSA *dsa)
{
SW_CONTEXT_HANDLE hac;
SW_PARAM sw_param;
SW_STATUS sw_status;
SW_LARGENUMBER arg[2], res;
unsigned long sig_result;
BN_CTX *ctx;
BIGNUM *dsa_p = NULL;
BIGNUM *dsa_q = NULL;
BIGNUM *dsa_g = NULL;
BIGNUM *dsa_key = NULL;
BIGNUM *argument = NULL;
int to_return = -1;
int acquired = 0;
if((ctx = BN_CTX_new()) == NULL)
goto err;
if(!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_UNIT_FAILURE);
goto err;
}
acquired = 1;
/* Prepare the params */
BN_CTX_start(ctx);
dsa_p = BN_CTX_get(ctx);
dsa_q = BN_CTX_get(ctx);
dsa_g = BN_CTX_get(ctx);
dsa_key = BN_CTX_get(ctx);
argument = BN_CTX_get(ctx);
if(!argument)
{
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_BN_CTX_FULL);
goto err;
}
if(!bn_wexpand(dsa_p, dsa->p->top) ||
!bn_wexpand(dsa_q, dsa->q->top) ||
!bn_wexpand(dsa_g, dsa->g->top) ||
!bn_wexpand(dsa_key, dsa->pub_key->top) ||
!bn_wexpand(argument, 40))
{
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_BN_EXPAND_FAIL);
goto err;
}
sw_param.type = SW_ALG_DSA;
sw_param.up.dsa.p.nbytes = BN_bn2bin(dsa->p,
(unsigned char *)dsa_p->d);
sw_param.up.dsa.p.value = (unsigned char *)dsa_p->d;
sw_param.up.dsa.q.nbytes = BN_bn2bin(dsa->q,
(unsigned char *)dsa_q->d);
sw_param.up.dsa.q.value = (unsigned char *)dsa_q->d;
sw_param.up.dsa.g.nbytes = BN_bn2bin(dsa->g,
(unsigned char *)dsa_g->d);
sw_param.up.dsa.g.value = (unsigned char *)dsa_g->d;
sw_param.up.dsa.key.nbytes = BN_bn2bin(dsa->pub_key,
(unsigned char *)dsa_key->d);
sw_param.up.dsa.key.value = (unsigned char *)dsa_key->d;
/* Attach the key params */
sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
switch(sw_status)
{
case SW_OK:
break;
case SW_ERR_INPUT_SIZE:
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_BAD_KEY_SIZE);
goto err;
default:
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
}
goto err;
}
/* Prepare the argument and response */
arg[0].nbytes = dgst_len;
arg[0].value = (unsigned char *)dgst;
arg[1].nbytes = 40;
arg[1].value = (unsigned char *)argument->d;
memset(arg[1].value, 0, 40);
BN_bn2bin(sig->r, arg[1].value + 20 - BN_num_bytes(sig->r));
BN_bn2bin(sig->s, arg[1].value + 40 - BN_num_bytes(sig->s));
res.nbytes = 4; /* unsigned long */
res.value = (unsigned char *)(&sig_result);
/* Perform the operation */
sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_DSS_VERIFY, arg, 2,
&res, 1);
if(sw_status != SW_OK)
{
char tmpbuf[DECIMAL_SIZE(sw_status)+1];
CSWIFTerr(CSWIFT_F_CSWIFT_DSA_VERIFY,CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", sw_status);
ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
goto err;
}
/* Convert the response */
to_return = ((sig_result == 0) ? 0 : 1);
err:
if(acquired)
release_context(hac);
if(ctx)
{
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
return to_return;
}
#endif
#ifndef OPENSSL_NO_DH
/* This function is aliased to mod_exp (with the dh and mont dropped). */
static int cswift_mod_exp_dh(const DH *dh, BIGNUM *r,
const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
{
return cswift_mod_exp(r, a, p, m, ctx);
}
#endif
/* Random bytes are good */
static int cswift_rand_bytes(unsigned char *buf, int num)
{
SW_CONTEXT_HANDLE hac;
SW_STATUS swrc;
SW_LARGENUMBER largenum;
int acquired = 0;
int to_return = 0; /* assume failure */
unsigned char buf32[1024];
if (!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_RAND_BYTES, CSWIFT_R_UNIT_FAILURE);
goto err;
}
acquired = 1;
/************************************************************************/
/* 04/02/2003 */
/* Modified by Frederic Giudicelli (deny-all.com) to overcome the */
/* limitation of cswift with values not a multiple of 32 */
/************************************************************************/
while(num >= (int)sizeof(buf32))
{
largenum.value = buf;
largenum.nbytes = sizeof(buf32);
/* tell CryptoSwift how many bytes we want and where we want it.
* Note: - CryptoSwift cannot do more than 4096 bytes at a time.
* - CryptoSwift can only do multiple of 32-bits. */
swrc = p_CSwift_SimpleRequest(hac, SW_CMD_RAND, NULL, 0, &largenum, 1);
if (swrc != SW_OK)
{
char tmpbuf[20];
CSWIFTerr(CSWIFT_F_CSWIFT_RAND_BYTES, CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", swrc);
ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
goto err;
}
buf += sizeof(buf32);
num -= sizeof(buf32);
}
if(num)
{
largenum.nbytes = sizeof(buf32);
largenum.value = buf32;
swrc = p_CSwift_SimpleRequest(hac, SW_CMD_RAND, NULL, 0, &largenum, 1);
if (swrc != SW_OK)
{
char tmpbuf[20];
CSWIFTerr(CSWIFT_F_CSWIFT_RAND_BYTES, CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", swrc);
ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
goto err;
}
memcpy(buf, largenum.value, num);
}
to_return = 1; /* success */
err:
if (acquired)
release_context(hac);
return to_return;
}
static int cswift_rand_status(void)
{
return 1;
}
/* This stuff is needed if this ENGINE is being compiled into a self-contained
* shared-library. */
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
static int bind_fn(ENGINE *e, const char *id)
{
if(id && (strcmp(id, engine_cswift_id) != 0))
return 0;
if(!bind_helper(e))
return 0;
return 1;
}
IMPLEMENT_DYNAMIC_CHECK_FN()
IMPLEMENT_DYNAMIC_BIND_FN(bind_fn)
#endif /* OPENSSL_NO_DYNAMIC_ENGINE */
#endif /* !OPENSSL_NO_HW_CSWIFT */
#endif /* !OPENSSL_NO_HW */
| bsd-3-clause |
cloudqiu1110/tinype | external/glslang/MachineIndependent/parseConst.cpp | 58 | 7292 | //
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions
//are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//POSSIBILITY OF SUCH DAMAGE.
//
//
// Travarse a tree of constants to create a single folded constant.
// It should only be used when the whole tree is known to be constant.
//
#include "ParseHelper.h"
namespace glslang {
class TConstTraverser : public TIntermTraverser {
public:
TConstTraverser(const TConstUnionArray& cUnion, bool singleConstParam, TOperator constructType, const TType& t)
: unionArray(cUnion), type(t),
constructorType(constructType), singleConstantParam(singleConstParam), error(false), isMatrix(false),
matrixCols(0), matrixRows(0) { index = 0; tOp = EOpNull; }
virtual void visitConstantUnion(TIntermConstantUnion* node);
virtual bool visitAggregate(TVisit, TIntermAggregate* node);
int index;
TConstUnionArray unionArray;
TOperator tOp;
const TType& type;
TOperator constructorType;
bool singleConstantParam;
bool error;
int size; // size of the constructor ( 4 for vec4)
bool isMatrix;
int matrixCols;
int matrixRows;
protected:
TConstTraverser(TConstTraverser&);
TConstTraverser& operator=(TConstTraverser&);
};
bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
{
if (! node->isConstructor() && node->getOp() != EOpComma) {
error = true;
return false;
}
if (node->getSequence().size() == 0) {
error = true;
return false;
}
bool flag = node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion();
if (flag) {
singleConstantParam = true;
constructorType = node->getOp();
size = node->getType().computeNumComponents();
if (node->getType().isMatrix()) {
isMatrix = true;
matrixCols = node->getType().getMatrixCols();
matrixRows = node->getType().getMatrixRows();
}
}
for (TIntermSequence::iterator p = node->getSequence().begin();
p != node->getSequence().end(); p++) {
if (node->getOp() == EOpComma)
index = 0;
(*p)->traverse(this);
}
if (flag)
{
singleConstantParam = false;
constructorType = EOpNull;
size = 0;
isMatrix = false;
matrixCols = 0;
matrixRows = 0;
}
return false;
}
void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
{
TConstUnionArray leftUnionArray(unionArray);
int instanceSize = type.computeNumComponents();
if (index >= instanceSize)
return;
if (! singleConstantParam) {
int rightUnionSize = node->getType().computeNumComponents();
const TConstUnionArray& rightUnionArray = node->getConstArray();
for (int i = 0; i < rightUnionSize; i++) {
if (index >= instanceSize)
return;
leftUnionArray[index] = rightUnionArray[i];
index++;
}
} else {
int endIndex = index + size;
const TConstUnionArray& rightUnionArray = node->getConstArray();
if (! isMatrix) {
int count = 0;
int nodeComps = node->getType().computeNumComponents();
for (int i = index; i < endIndex; i++) {
if (i >= instanceSize)
return;
leftUnionArray[i] = rightUnionArray[count];
(index)++;
if (nodeComps > 1)
count++;
}
} else {
// constructing a matrix, but from what?
if (node->isMatrix()) {
// Matrix from a matrix; this has the outer matrix, node is the argument matrix.
// Traverse the outer, potentially bigger matrix, fill in missing pieces with the
// identity matrix.
for (int c = 0; c < matrixCols; ++c) {
for (int r = 0; r < matrixRows; ++r) {
int targetOffset = index + c * matrixRows + r;
if (r < node->getType().getMatrixRows() && c < node->getType().getMatrixCols()) {
int srcOffset = c * node->getType().getMatrixRows() + r;
leftUnionArray[targetOffset] = rightUnionArray[srcOffset];
} else if (r == c)
leftUnionArray[targetOffset].setDConst(1.0);
else
leftUnionArray[targetOffset].setDConst(0.0);
}
}
} else {
// matrix from vector
int count = 0;
const int startIndex = index;
int nodeComps = node->getType().computeNumComponents();
for (int i = startIndex; i < endIndex; i++) {
if (i >= instanceSize)
return;
if (i == startIndex || (i - startIndex) % (matrixRows + 1) == 0 )
leftUnionArray[i] = rightUnionArray[count];
else
leftUnionArray[i].setDConst(0.0);
index++;
if (nodeComps > 1)
count++;
}
}
}
}
}
bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArray, TOperator constructorType, const TType& t, bool singleConstantParam)
{
if (root == 0)
return false;
TConstTraverser it(unionArray, singleConstantParam, constructorType, t);
root->traverse(&it);
if (it.error)
return true;
else
return false;
}
} // end namespace glslang
| bsd-3-clause |
openthread/ot-rtos | third_party/freertos/repo/FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_6/src/fstat.c | 58 | 2021 | /******************************************************************************
*
* Copyright (C) 2009 - 2015 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
#include <sys/stat.h>
#include "xil_types.h"
#ifdef __cplusplus
extern "C" {
__attribute__((weak)) s32 _fstat(s32 fd, struct stat *buf);
}
#endif
/*
* fstat -- Since we have no file system, we just return an error.
*/
__attribute__((weak)) s32 _fstat(s32 fd, struct stat *buf)
{
(void)fd;
buf->st_mode = S_IFCHR; /* Always pretend to be a tty */
return (0);
}
| bsd-3-clause |
andoma/pdfium | third_party/lcms2-2.6/src/cmssamp.c | 63 | 18151 | //---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2010 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the Software
// is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//---------------------------------------------------------------------------------
//
#include "lcms2_internal.h"
#define cmsmin(a, b) (((a) < (b)) ? (a) : (b))
#define cmsmax(a, b) (((a) > (b)) ? (a) : (b))
// This file contains routines for resampling and LUT optimization, black point detection
// and black preservation.
// Black point detection -------------------------------------------------------------------------
// PCS -> PCS round trip transform, always uses relative intent on the device -> pcs
static
cmsHTRANSFORM CreateRoundtripXForm(cmsHPROFILE hProfile, cmsUInt32Number nIntent)
{
cmsContext ContextID = cmsGetProfileContextID(hProfile);
cmsHPROFILE hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
cmsHTRANSFORM xform;
cmsBool BPC[4] = { FALSE, FALSE, FALSE, FALSE };
cmsFloat64Number States[4] = { 1.0, 1.0, 1.0, 1.0 };
cmsHPROFILE hProfiles[4];
cmsUInt32Number Intents[4];
hProfiles[0] = hLab; hProfiles[1] = hProfile; hProfiles[2] = hProfile; hProfiles[3] = hLab;
Intents[0] = INTENT_RELATIVE_COLORIMETRIC; Intents[1] = nIntent; Intents[2] = INTENT_RELATIVE_COLORIMETRIC; Intents[3] = INTENT_RELATIVE_COLORIMETRIC;
xform = cmsCreateExtendedTransform(ContextID, 4, hProfiles, BPC, Intents,
States, NULL, 0, TYPE_Lab_DBL, TYPE_Lab_DBL, cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE);
cmsCloseProfile(hLab);
return xform;
}
// Use darker colorants to obtain black point. This works in the relative colorimetric intent and
// assumes more ink results in darker colors. No ink limit is assumed.
static
cmsBool BlackPointAsDarkerColorant(cmsHPROFILE hInput,
cmsUInt32Number Intent,
cmsCIEXYZ* BlackPoint,
cmsUInt32Number dwFlags)
{
cmsUInt16Number *Black;
cmsHTRANSFORM xform;
cmsColorSpaceSignature Space;
cmsUInt32Number nChannels;
cmsUInt32Number dwFormat;
cmsHPROFILE hLab;
cmsCIELab Lab;
cmsCIEXYZ BlackXYZ;
cmsContext ContextID = cmsGetProfileContextID(hInput);
// If the profile does not support input direction, assume Black point 0
if (!cmsIsIntentSupported(hInput, Intent, LCMS_USED_AS_INPUT)) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Create a formatter which has n channels and floating point
dwFormat = cmsFormatterForColorspaceOfProfile(hInput, 2, FALSE);
// Try to get black by using black colorant
Space = cmsGetColorSpace(hInput);
// This function returns darker colorant in 16 bits for several spaces
if (!_cmsEndPointsBySpace(Space, NULL, &Black, &nChannels)) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
if (nChannels != T_CHANNELS(dwFormat)) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Lab will be used as the output space, but lab2 will avoid recursion
hLab = cmsCreateLab2ProfileTHR(ContextID, NULL);
if (hLab == NULL) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Create the transform
xform = cmsCreateTransformTHR(ContextID, hInput, dwFormat,
hLab, TYPE_Lab_DBL, Intent, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE);
cmsCloseProfile(hLab);
if (xform == NULL) {
// Something went wrong. Get rid of open resources and return zero as black
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Convert black to Lab
cmsDoTransform(xform, Black, &Lab, 1);
// Force it to be neutral, clip to max. L* of 50
Lab.a = Lab.b = 0;
if (Lab.L > 50) Lab.L = 50;
// Free the resources
cmsDeleteTransform(xform);
// Convert from Lab (which is now clipped) to XYZ.
cmsLab2XYZ(NULL, &BlackXYZ, &Lab);
if (BlackPoint != NULL)
*BlackPoint = BlackXYZ;
return TRUE;
cmsUNUSED_PARAMETER(dwFlags);
}
// Get a black point of output CMYK profile, discounting any ink-limiting embedded
// in the profile. For doing that, we use perceptual intent in input direction:
// Lab (0, 0, 0) -> [Perceptual] Profile -> CMYK -> [Rel. colorimetric] Profile -> Lab
static
cmsBool BlackPointUsingPerceptualBlack(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile)
{
cmsHTRANSFORM hRoundTrip;
cmsCIELab LabIn, LabOut;
cmsCIEXYZ BlackXYZ;
// Is the intent supported by the profile?
if (!cmsIsIntentSupported(hProfile, INTENT_PERCEPTUAL, LCMS_USED_AS_INPUT)) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return TRUE;
}
hRoundTrip = CreateRoundtripXForm(hProfile, INTENT_PERCEPTUAL);
if (hRoundTrip == NULL) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
LabIn.L = LabIn.a = LabIn.b = 0;
cmsDoTransform(hRoundTrip, &LabIn, &LabOut, 1);
// Clip Lab to reasonable limits
if (LabOut.L > 50) LabOut.L = 50;
LabOut.a = LabOut.b = 0;
cmsDeleteTransform(hRoundTrip);
// Convert it to XYZ
cmsLab2XYZ(NULL, &BlackXYZ, &LabOut);
if (BlackPoint != NULL)
*BlackPoint = BlackXYZ;
return TRUE;
}
// This function shouldn't exist at all -- there is such quantity of broken
// profiles on black point tag, that we must somehow fix chromaticity to
// avoid huge tint when doing Black point compensation. This function does
// just that. There is a special flag for using black point tag, but turned
// off by default because it is bogus on most profiles. The detection algorithm
// involves to turn BP to neutral and to use only L component.
cmsBool CMSEXPORT cmsDetectBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags)
{
cmsProfileClassSignature devClass;
// Make sure the device class is adequate
devClass = cmsGetDeviceClass(hProfile);
if (devClass == cmsSigLinkClass ||
devClass == cmsSigAbstractClass ||
devClass == cmsSigNamedColorClass) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Make sure intent is adequate
if (Intent != INTENT_PERCEPTUAL &&
Intent != INTENT_RELATIVE_COLORIMETRIC &&
Intent != INTENT_SATURATION) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// v4 + perceptual & saturation intents does have its own black point, and it is
// well specified enough to use it. Black point tag is deprecated in V4.
if ((cmsGetEncodedICCversion(hProfile) >= 0x4000000) &&
(Intent == INTENT_PERCEPTUAL || Intent == INTENT_SATURATION)) {
// Matrix shaper share MRC & perceptual intents
if (cmsIsMatrixShaper(hProfile))
return BlackPointAsDarkerColorant(hProfile, INTENT_RELATIVE_COLORIMETRIC, BlackPoint, 0);
// Get Perceptual black out of v4 profiles. That is fixed for perceptual & saturation intents
BlackPoint -> X = cmsPERCEPTUAL_BLACK_X;
BlackPoint -> Y = cmsPERCEPTUAL_BLACK_Y;
BlackPoint -> Z = cmsPERCEPTUAL_BLACK_Z;
return TRUE;
}
#ifdef CMS_USE_PROFILE_BLACK_POINT_TAG
// v2, v4 rel/abs colorimetric
if (cmsIsTag(hProfile, cmsSigMediaBlackPointTag) &&
Intent == INTENT_RELATIVE_COLORIMETRIC) {
cmsCIEXYZ *BlackPtr, BlackXYZ, UntrustedBlackPoint, TrustedBlackPoint, MediaWhite;
cmsCIELab Lab;
// If black point is specified, then use it,
BlackPtr = cmsReadTag(hProfile, cmsSigMediaBlackPointTag);
if (BlackPtr != NULL) {
BlackXYZ = *BlackPtr;
_cmsReadMediaWhitePoint(&MediaWhite, hProfile);
// Black point is absolute XYZ, so adapt to D50 to get PCS value
cmsAdaptToIlluminant(&UntrustedBlackPoint, &MediaWhite, cmsD50_XYZ(), &BlackXYZ);
// Force a=b=0 to get rid of any chroma
cmsXYZ2Lab(NULL, &Lab, &UntrustedBlackPoint);
Lab.a = Lab.b = 0;
if (Lab.L > 50) Lab.L = 50; // Clip to L* <= 50
cmsLab2XYZ(NULL, &TrustedBlackPoint, &Lab);
if (BlackPoint != NULL)
*BlackPoint = TrustedBlackPoint;
return TRUE;
}
}
#endif
// That is about v2 profiles.
// If output profile, discount ink-limiting and that's all
if (Intent == INTENT_RELATIVE_COLORIMETRIC &&
(cmsGetDeviceClass(hProfile) == cmsSigOutputClass) &&
(cmsGetColorSpace(hProfile) == cmsSigCmykData))
return BlackPointUsingPerceptualBlack(BlackPoint, hProfile);
// Nope, compute BP using current intent.
return BlackPointAsDarkerColorant(hProfile, Intent, BlackPoint, dwFlags);
}
// ---------------------------------------------------------------------------------------------------------
// Least Squares Fit of a Quadratic Curve to Data
// http://www.personal.psu.edu/jhm/f90/lectures/lsq2.html
static
cmsFloat64Number RootOfLeastSquaresFitQuadraticCurve(int n, cmsFloat64Number x[], cmsFloat64Number y[])
{
double sum_x = 0, sum_x2 = 0, sum_x3 = 0, sum_x4 = 0;
double sum_y = 0, sum_yx = 0, sum_yx2 = 0;
double d, a, b, c;
int i;
cmsMAT3 m;
cmsVEC3 v, res;
if (n < 4) return 0;
for (i=0; i < n; i++) {
double xn = x[i];
double yn = y[i];
sum_x += xn;
sum_x2 += xn*xn;
sum_x3 += xn*xn*xn;
sum_x4 += xn*xn*xn*xn;
sum_y += yn;
sum_yx += yn*xn;
sum_yx2 += yn*xn*xn;
}
_cmsVEC3init(&m.v[0], n, sum_x, sum_x2);
_cmsVEC3init(&m.v[1], sum_x, sum_x2, sum_x3);
_cmsVEC3init(&m.v[2], sum_x2, sum_x3, sum_x4);
_cmsVEC3init(&v, sum_y, sum_yx, sum_yx2);
if (!_cmsMAT3solve(&res, &m, &v)) return 0;
a = res.n[2];
b = res.n[1];
c = res.n[0];
if (fabs(a) < 1.0E-10) {
return cmsmin(0, cmsmax(50, -c/b ));
}
else {
d = b*b - 4.0 * a * c;
if (d <= 0) {
return 0;
}
else {
double rt = (-b + sqrt(d)) / (2.0 * a);
return cmsmax(0, cmsmin(50, rt));
}
}
}
/*
static
cmsBool IsMonotonic(int n, const cmsFloat64Number Table[])
{
int i;
cmsFloat64Number last;
last = Table[n-1];
for (i = n-2; i >= 0; --i) {
if (Table[i] > last)
return FALSE;
else
last = Table[i];
}
return TRUE;
}
*/
// Calculates the black point of a destination profile.
// This algorithm comes from the Adobe paper disclosing its black point compensation method.
cmsBool CMSEXPORT cmsDetectDestinationBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags)
{
cmsColorSpaceSignature ColorSpace;
cmsHTRANSFORM hRoundTrip = NULL;
cmsCIELab InitialLab, destLab, Lab;
cmsFloat64Number inRamp[256], outRamp[256];
cmsFloat64Number MinL, MaxL;
cmsBool NearlyStraightMidrange = TRUE;
cmsFloat64Number yRamp[256];
cmsFloat64Number x[256], y[256];
cmsFloat64Number lo, hi;
int n, l;
cmsProfileClassSignature devClass;
// Make sure the device class is adequate
devClass = cmsGetDeviceClass(hProfile);
if (devClass == cmsSigLinkClass ||
devClass == cmsSigAbstractClass ||
devClass == cmsSigNamedColorClass) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Make sure intent is adequate
if (Intent != INTENT_PERCEPTUAL &&
Intent != INTENT_RELATIVE_COLORIMETRIC &&
Intent != INTENT_SATURATION) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// v4 + perceptual & saturation intents does have its own black point, and it is
// well specified enough to use it. Black point tag is deprecated in V4.
if ((cmsGetEncodedICCversion(hProfile) >= 0x4000000) &&
(Intent == INTENT_PERCEPTUAL || Intent == INTENT_SATURATION)) {
// Matrix shaper share MRC & perceptual intents
if (cmsIsMatrixShaper(hProfile))
return BlackPointAsDarkerColorant(hProfile, INTENT_RELATIVE_COLORIMETRIC, BlackPoint, 0);
// Get Perceptual black out of v4 profiles. That is fixed for perceptual & saturation intents
BlackPoint -> X = cmsPERCEPTUAL_BLACK_X;
BlackPoint -> Y = cmsPERCEPTUAL_BLACK_Y;
BlackPoint -> Z = cmsPERCEPTUAL_BLACK_Z;
return TRUE;
}
// Check if the profile is lut based and gray, rgb or cmyk (7.2 in Adobe's document)
ColorSpace = cmsGetColorSpace(hProfile);
if (!cmsIsCLUT(hProfile, Intent, LCMS_USED_AS_OUTPUT ) ||
(ColorSpace != cmsSigGrayData &&
ColorSpace != cmsSigRgbData &&
ColorSpace != cmsSigCmykData)) {
// In this case, handle as input case
return cmsDetectBlackPoint(BlackPoint, hProfile, Intent, dwFlags);
}
// It is one of the valid cases!, use Adobe algorithm
// Set a first guess, that should work on good profiles.
if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
cmsCIEXYZ IniXYZ;
// calculate initial Lab as source black point
if (!cmsDetectBlackPoint(&IniXYZ, hProfile, Intent, dwFlags)) {
return FALSE;
}
// convert the XYZ to lab
cmsXYZ2Lab(NULL, &InitialLab, &IniXYZ);
} else {
// set the initial Lab to zero, that should be the black point for perceptual and saturation
InitialLab.L = 0;
InitialLab.a = 0;
InitialLab.b = 0;
}
// Step 2
// ======
// Create a roundtrip. Define a Transform BT for all x in L*a*b*
hRoundTrip = CreateRoundtripXForm(hProfile, Intent);
if (hRoundTrip == NULL) return FALSE;
// Compute ramps
for (l=0; l < 256; l++) {
Lab.L = (cmsFloat64Number) (l * 100.0) / 255.0;
Lab.a = cmsmin(50, cmsmax(-50, InitialLab.a));
Lab.b = cmsmin(50, cmsmax(-50, InitialLab.b));
cmsDoTransform(hRoundTrip, &Lab, &destLab, 1);
inRamp[l] = Lab.L;
outRamp[l] = destLab.L;
}
// Make monotonic
for (l = 254; l > 0; --l) {
outRamp[l] = cmsmin(outRamp[l], outRamp[l+1]);
}
// Check
if (! (outRamp[0] < outRamp[255])) {
cmsDeleteTransform(hRoundTrip);
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// Test for mid range straight (only on relative colorimetric)
NearlyStraightMidrange = TRUE;
MinL = outRamp[0]; MaxL = outRamp[255];
if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
for (l=0; l < 256; l++) {
if (! ((inRamp[l] <= MinL + 0.2 * (MaxL - MinL) ) ||
(fabs(inRamp[l] - outRamp[l]) < 4.0 )))
NearlyStraightMidrange = FALSE;
}
// If the mid range is straight (as determined above) then the
// DestinationBlackPoint shall be the same as initialLab.
// Otherwise, the DestinationBlackPoint shall be determined
// using curve fitting.
if (NearlyStraightMidrange) {
cmsLab2XYZ(NULL, BlackPoint, &InitialLab);
cmsDeleteTransform(hRoundTrip);
return TRUE;
}
}
// curve fitting: The round-trip curve normally looks like a nearly constant section at the black point,
// with a corner and a nearly straight line to the white point.
for (l=0; l < 256; l++) {
yRamp[l] = (outRamp[l] - MinL) / (MaxL - MinL);
}
// find the black point using the least squares error quadratic curve fitting
if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
lo = 0.1;
hi = 0.5;
}
else {
// Perceptual and saturation
lo = 0.03;
hi = 0.25;
}
// Capture shadow points for the fitting.
n = 0;
for (l=0; l < 256; l++) {
cmsFloat64Number ff = yRamp[l];
if (ff >= lo && ff < hi) {
x[n] = inRamp[l];
y[n] = yRamp[l];
n++;
}
}
// No suitable points
if (n < 3 ) {
cmsDeleteTransform(hRoundTrip);
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
return FALSE;
}
// fit and get the vertex of quadratic curve
Lab.L = RootOfLeastSquaresFitQuadraticCurve(n, x, y);
if (Lab.L < 0.0) { // clip to zero L* if the vertex is negative
Lab.L = 0;
}
Lab.a = InitialLab.a;
Lab.b = InitialLab.b;
cmsLab2XYZ(NULL, BlackPoint, &Lab);
cmsDeleteTransform(hRoundTrip);
return TRUE;
}
| bsd-3-clause |
Sciumo/redis | deps/lua/src/ltablib.c | 1343 | 7343 | /*
** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
#include <stddef.h>
#define ltablib_c
#define LUA_LIB
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))
static int foreachi (lua_State *L) {
int i;
int n = aux_getn(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION);
for (i=1; i <= n; i++) {
lua_pushvalue(L, 2); /* function */
lua_pushinteger(L, i); /* 1st argument */
lua_rawgeti(L, 1, i); /* 2nd argument */
lua_call(L, 2, 1);
if (!lua_isnil(L, -1))
return 1;
lua_pop(L, 1); /* remove nil result */
}
return 0;
}
static int foreach (lua_State *L) {
luaL_checktype(L, 1, LUA_TTABLE);
luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushnil(L); /* first key */
while (lua_next(L, 1)) {
lua_pushvalue(L, 2); /* function */
lua_pushvalue(L, -3); /* key */
lua_pushvalue(L, -3); /* value */
lua_call(L, 2, 1);
if (!lua_isnil(L, -1))
return 1;
lua_pop(L, 2); /* remove value and result */
}
return 0;
}
static int maxn (lua_State *L) {
lua_Number max = 0;
luaL_checktype(L, 1, LUA_TTABLE);
lua_pushnil(L); /* first key */
while (lua_next(L, 1)) {
lua_pop(L, 1); /* remove value */
if (lua_type(L, -1) == LUA_TNUMBER) {
lua_Number v = lua_tonumber(L, -1);
if (v > max) max = v;
}
}
lua_pushnumber(L, max);
return 1;
}
static int getn (lua_State *L) {
lua_pushinteger(L, aux_getn(L, 1));
return 1;
}
static int setn (lua_State *L) {
luaL_checktype(L, 1, LUA_TTABLE);
#ifndef luaL_setn
luaL_setn(L, 1, luaL_checkint(L, 2));
#else
luaL_error(L, LUA_QL("setn") " is obsolete");
#endif
lua_pushvalue(L, 1);
return 1;
}
static int tinsert (lua_State *L) {
int e = aux_getn(L, 1) + 1; /* first empty element */
int pos; /* where to insert new element */
switch (lua_gettop(L)) {
case 2: { /* called with only 2 arguments */
pos = e; /* insert new element at the end */
break;
}
case 3: {
int i;
pos = luaL_checkint(L, 2); /* 2nd argument is the position */
if (pos > e) e = pos; /* `grow' array if necessary */
for (i = e; i > pos; i--) { /* move up elements */
lua_rawgeti(L, 1, i-1);
lua_rawseti(L, 1, i); /* t[i] = t[i-1] */
}
break;
}
default: {
return luaL_error(L, "wrong number of arguments to " LUA_QL("insert"));
}
}
luaL_setn(L, 1, e); /* new size */
lua_rawseti(L, 1, pos); /* t[pos] = v */
return 0;
}
static int tremove (lua_State *L) {
int e = aux_getn(L, 1);
int pos = luaL_optint(L, 2, e);
if (!(1 <= pos && pos <= e)) /* position is outside bounds? */
return 0; /* nothing to remove */
luaL_setn(L, 1, e - 1); /* t.n = n-1 */
lua_rawgeti(L, 1, pos); /* result = t[pos] */
for ( ;pos<e; pos++) {
lua_rawgeti(L, 1, pos+1);
lua_rawseti(L, 1, pos); /* t[pos] = t[pos+1] */
}
lua_pushnil(L);
lua_rawseti(L, 1, e); /* t[e] = nil */
return 1;
}
static void addfield (lua_State *L, luaL_Buffer *b, int i) {
lua_rawgeti(L, 1, i);
if (!lua_isstring(L, -1))
luaL_error(L, "invalid value (%s) at index %d in table for "
LUA_QL("concat"), luaL_typename(L, -1), i);
luaL_addvalue(b);
}
static int tconcat (lua_State *L) {
luaL_Buffer b;
size_t lsep;
int i, last;
const char *sep = luaL_optlstring(L, 2, "", &lsep);
luaL_checktype(L, 1, LUA_TTABLE);
i = luaL_optint(L, 3, 1);
last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));
luaL_buffinit(L, &b);
for (; i < last; i++) {
addfield(L, &b, i);
luaL_addlstring(&b, sep, lsep);
}
if (i == last) /* add last value (if interval was not empty) */
addfield(L, &b, i);
luaL_pushresult(&b);
return 1;
}
/*
** {======================================================
** Quicksort
** (based on `Algorithms in MODULA-3', Robert Sedgewick;
** Addison-Wesley, 1993.)
*/
static void set2 (lua_State *L, int i, int j) {
lua_rawseti(L, 1, i);
lua_rawseti(L, 1, j);
}
static int sort_comp (lua_State *L, int a, int b) {
if (!lua_isnil(L, 2)) { /* function? */
int res;
lua_pushvalue(L, 2);
lua_pushvalue(L, a-1); /* -1 to compensate function */
lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */
lua_call(L, 2, 1);
res = lua_toboolean(L, -1);
lua_pop(L, 1);
return res;
}
else /* a < b? */
return lua_lessthan(L, a, b);
}
static void auxsort (lua_State *L, int l, int u) {
while (l < u) { /* for tail recursion */
int i, j;
/* sort elements a[l], a[(l+u)/2] and a[u] */
lua_rawgeti(L, 1, l);
lua_rawgeti(L, 1, u);
if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */
set2(L, l, u); /* swap a[l] - a[u] */
else
lua_pop(L, 2);
if (u-l == 1) break; /* only 2 elements */
i = (l+u)/2;
lua_rawgeti(L, 1, i);
lua_rawgeti(L, 1, l);
if (sort_comp(L, -2, -1)) /* a[i]<a[l]? */
set2(L, i, l);
else {
lua_pop(L, 1); /* remove a[l] */
lua_rawgeti(L, 1, u);
if (sort_comp(L, -1, -2)) /* a[u]<a[i]? */
set2(L, i, u);
else
lua_pop(L, 2);
}
if (u-l == 2) break; /* only 3 elements */
lua_rawgeti(L, 1, i); /* Pivot */
lua_pushvalue(L, -1);
lua_rawgeti(L, 1, u-1);
set2(L, i, u-1);
/* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */
i = l; j = u-1;
for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */
/* repeat ++i until a[i] >= P */
while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {
if (i>u) luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[i] */
}
/* repeat --j until a[j] <= P */
while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {
if (j<l) luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[j] */
}
if (j<i) {
lua_pop(L, 3); /* pop pivot, a[i], a[j] */
break;
}
set2(L, i, j);
}
lua_rawgeti(L, 1, u-1);
lua_rawgeti(L, 1, i);
set2(L, u-1, i); /* swap pivot (a[u-1]) with a[i] */
/* a[l..i-1] <= a[i] == P <= a[i+1..u] */
/* adjust so that smaller half is in [j..i] and larger one in [l..u] */
if (i-l < u-i) {
j=l; i=i-1; l=i+2;
}
else {
j=i+1; i=u; u=j-2;
}
auxsort(L, j, i); /* call recursively the smaller one */
} /* repeat the routine for the larger one */
}
static int sort (lua_State *L) {
int n = aux_getn(L, 1);
luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */
if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */
luaL_checktype(L, 2, LUA_TFUNCTION);
lua_settop(L, 2); /* make sure there is two arguments */
auxsort(L, 1, n);
return 0;
}
/* }====================================================== */
static const luaL_Reg tab_funcs[] = {
{"concat", tconcat},
{"foreach", foreach},
{"foreachi", foreachi},
{"getn", getn},
{"maxn", maxn},
{"insert", tinsert},
{"remove", tremove},
{"setn", setn},
{"sort", sort},
{NULL, NULL}
};
LUALIB_API int luaopen_table (lua_State *L) {
luaL_register(L, LUA_TABLIBNAME, tab_funcs);
return 1;
}
| bsd-3-clause |
xiaoqqchen/pcl | filters/src/fast_bilateral.cpp | 72 | 2080 | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2012-, Open Perception, Inc.
* Copyright (c) 2004, Sylvain Paris and Francois Sillion
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
#include <pcl/filters/fast_bilateral.h>
#include <pcl/filters/impl/fast_bilateral.hpp>
#ifndef PCL_NO_PRECOMPILE
#include <pcl/point_types.h>
#include <pcl/impl/instantiate.hpp>
PCL_INSTANTIATE (FastBilateralFilter, (pcl::PointXYZ)(pcl::PointXYZRGB)(pcl::PointXYZRGBA))
#endif // PCL_NO_PRECOMPILE
| bsd-3-clause |
jorik041/phantomjs | src/qt/qtbase/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp | 84 | 3936 | /****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qlinuxfbintegration.h"
#include "qlinuxfbscreen.h"
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
#include <QtPlatformSupport/private/qgenericunixservices_p.h>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
#include <QtPlatformSupport/private/qfbvthandler_p.h>
#include <QtPlatformSupport/private/qfbbackingstore_p.h>
#include <QtPlatformSupport/private/qfbwindow_p.h>
#include <QtPlatformSupport/private/qfbcursor_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
QT_BEGIN_NAMESPACE
QLinuxFbIntegration::QLinuxFbIntegration(const QStringList ¶mList)
: m_fontDb(new QGenericUnixFontDatabase),
m_services(new QGenericUnixServices)
{
m_primaryScreen = new QLinuxFbScreen(paramList);
}
QLinuxFbIntegration::~QLinuxFbIntegration()
{
delete m_primaryScreen;
}
void QLinuxFbIntegration::initialize()
{
if (m_primaryScreen->initialize())
screenAdded(m_primaryScreen);
else
qWarning("linuxfb: Failed to initialize screen");
m_inputContext = QPlatformInputContextFactory::create();
m_nativeInterface.reset(new QPlatformNativeInterface);
m_vtHandler.reset(new QFbVtHandler);
}
bool QLinuxFbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
switch (cap) {
case ThreadedPixmaps: return true;
case WindowManagement: return false;
default: return QPlatformIntegration::hasCapability(cap);
}
}
QPlatformBackingStore *QLinuxFbIntegration::createPlatformBackingStore(QWindow *window) const
{
return new QFbBackingStore(window);
}
QPlatformWindow *QLinuxFbIntegration::createPlatformWindow(QWindow *window) const
{
return new QFbWindow(window);
}
QAbstractEventDispatcher *QLinuxFbIntegration::createEventDispatcher() const
{
return createUnixEventDispatcher();
}
QList<QPlatformScreen *> QLinuxFbIntegration::screens() const
{
QList<QPlatformScreen *> list;
list.append(m_primaryScreen);
return list;
}
QPlatformFontDatabase *QLinuxFbIntegration::fontDatabase() const
{
return m_fontDb.data();
}
QPlatformServices *QLinuxFbIntegration::services() const
{
return m_services.data();
}
QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const
{
return m_nativeInterface.data();
}
QT_END_NAMESPACE
| bsd-3-clause |
mortonjt/scipy | scipy/interpolate/src/_interpolate.cpp | 92 | 8170 | #include "Python.h"
#include <stdlib.h>
#include "interpolate.h"
#include "numpy/arrayobject.h"
using namespace std;
extern "C" {
static PyObject* linear_method(PyObject*self, PyObject* args, PyObject* kywds)
{
static char *kwlist[] = {"x","y","new_x","new_y", NULL};
PyObject *py_x, *py_y, *py_new_x, *py_new_y;
py_x = py_y = py_new_x = py_new_y = NULL;
PyObject *arr_x, *arr_y, *arr_new_x, *arr_new_y;
arr_x = arr_y = arr_new_x = arr_new_y = NULL;
if(!PyArg_ParseTupleAndKeywords(args,kywds,"OOOO:linear_dddd",kwlist,&py_x, &py_y, &py_new_x, &py_new_y))
return NULL;
arr_x = PyArray_FROMANY(py_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
goto fail;
}
arr_y = PyArray_FROMANY(py_y, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
goto fail;
}
arr_new_x = PyArray_FROMANY(py_new_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_new_x) {
PyErr_SetString(PyExc_ValueError, "new_x must be a 1-D array of floats");
goto fail;
}
arr_new_y = PyArray_FROMANY(py_new_y, NPY_DOUBLE, 1, 1, NPY_INOUT_ARRAY);
if (!arr_new_y) {
PyErr_SetString(PyExc_ValueError, "new_y must be a 1-D array of floats");
goto fail;
}
linear((double*)PyArray_DATA(arr_x), (double*)PyArray_DATA(arr_y),
PyArray_DIM(arr_x,0), (double*)PyArray_DATA(arr_new_x),
(double*)PyArray_DATA(arr_new_y), PyArray_DIM(arr_new_x,0));
Py_DECREF(arr_x);
Py_DECREF(arr_y);
Py_DECREF(arr_new_x);
Py_DECREF(arr_new_y);
Py_RETURN_NONE;
fail:
Py_XDECREF(arr_x);
Py_XDECREF(arr_y);
Py_XDECREF(arr_new_x);
Py_XDECREF(arr_new_y);
return NULL;
}
static PyObject* loginterp_method(PyObject*self, PyObject* args, PyObject* kywds)
{
static char *kwlist[] = {"x","y","new_x","new_y", NULL};
PyObject *py_x, *py_y, *py_new_x, *py_new_y;
py_x = py_y = py_new_x = py_new_y = NULL;
PyObject *arr_x, *arr_y, *arr_new_x, *arr_new_y;
arr_x = arr_y = arr_new_x = arr_new_y = NULL;
if(!PyArg_ParseTupleAndKeywords(args,kywds,"OOOO:loginterp_dddd",kwlist,&py_x, &py_y, &py_new_x, &py_new_y))
return NULL;
arr_x = PyArray_FROMANY(py_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
goto fail;
}
arr_y = PyArray_FROMANY(py_y, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
goto fail;
}
arr_new_x = PyArray_FROMANY(py_new_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_new_x) {
PyErr_SetString(PyExc_ValueError, "new_x must be a 1-D array of floats");
goto fail;
}
arr_new_y = PyArray_FROMANY(py_new_y, NPY_DOUBLE, 1, 1, NPY_INOUT_ARRAY);
if (!arr_new_y) {
PyErr_SetString(PyExc_ValueError, "new_y must be a 1-D array of floats");
goto fail;
}
loginterp((double*)PyArray_DATA(arr_x), (double*)PyArray_DATA(arr_y),
PyArray_DIM(arr_x,0), (double*)PyArray_DATA(arr_new_x),
(double*)PyArray_DATA(arr_new_y), PyArray_DIM(arr_new_x,0));
Py_DECREF(arr_x);
Py_DECREF(arr_y);
Py_DECREF(arr_new_x);
Py_DECREF(arr_new_y);
Py_RETURN_NONE;
fail:
Py_XDECREF(arr_x);
Py_XDECREF(arr_y);
Py_XDECREF(arr_new_x);
Py_XDECREF(arr_new_y);
return NULL;
}
static PyObject* window_average_method(PyObject*self, PyObject* args, PyObject* kywds)
{
static char *kwlist[] = {"x","y","new_x","new_y", NULL};
PyObject *py_x, *py_y, *py_new_x, *py_new_y;
py_x = py_y = py_new_x = py_new_y = NULL;
PyObject *arr_x, *arr_y, *arr_new_x, *arr_new_y;
arr_x = arr_y = arr_new_x = arr_new_y = NULL;
double width;
if(!PyArg_ParseTupleAndKeywords(args,kywds,"OOOOd:loginterp_dddd",kwlist,&py_x, &py_y, &py_new_x, &py_new_y, &width))
return NULL;
arr_x = PyArray_FROMANY(py_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
goto fail;
}
arr_y = PyArray_FROMANY(py_y, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
goto fail;
}
arr_new_x = PyArray_FROMANY(py_new_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_new_x) {
PyErr_SetString(PyExc_ValueError, "new_x must be a 1-D array of floats");
goto fail;
}
arr_new_y = PyArray_FROMANY(py_new_y, NPY_DOUBLE, 1, 1, NPY_INOUT_ARRAY);
if (!arr_new_y) {
PyErr_SetString(PyExc_ValueError, "new_y must be a 1-D array of floats");
goto fail;
}
window_average((double*)PyArray_DATA(arr_x), (double*)PyArray_DATA(arr_y),
PyArray_DIM(arr_x,0), (double*)PyArray_DATA(arr_new_x),
(double*)PyArray_DATA(arr_new_y), PyArray_DIM(arr_new_x,0), width);
Py_DECREF(arr_x);
Py_DECREF(arr_y);
Py_DECREF(arr_new_x);
Py_DECREF(arr_new_y);
Py_RETURN_NONE;
fail:
Py_XDECREF(arr_x);
Py_XDECREF(arr_y);
Py_XDECREF(arr_new_x);
Py_XDECREF(arr_new_y);
return NULL;
}
static PyObject* block_average_above_method(PyObject*self, PyObject* args, PyObject* kywds)
{
static char *kwlist[] = {"x","y","new_x","new_y", NULL};
PyObject *py_x, *py_y, *py_new_x, *py_new_y;
py_x = py_y = py_new_x = py_new_y = NULL;
PyObject *arr_x, *arr_y, *arr_new_x, *arr_new_y;
arr_x = arr_y = arr_new_x = arr_new_y = NULL;
if(!PyArg_ParseTupleAndKeywords(args,kywds,"OOOO:loginterp_dddd",kwlist,&py_x, &py_y, &py_new_x, &py_new_y))
return NULL;
arr_x = PyArray_FROMANY(py_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
goto fail;
}
arr_y = PyArray_FROMANY(py_y, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
goto fail;
}
arr_new_x = PyArray_FROMANY(py_new_x, NPY_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!arr_new_x) {
PyErr_SetString(PyExc_ValueError, "new_x must be a 1-D array of floats");
goto fail;
}
arr_new_y = PyArray_FROMANY(py_new_y, NPY_DOUBLE, 1, 1, NPY_INOUT_ARRAY);
if (!arr_new_y) {
PyErr_SetString(PyExc_ValueError, "new_y must be a 1-D array of floats");
goto fail;
}
block_average_above((double*)PyArray_DATA(arr_x), (double*)PyArray_DATA(arr_y),
PyArray_DIM(arr_x,0), (double*)PyArray_DATA(arr_new_x),
(double*)PyArray_DATA(arr_new_y), PyArray_DIM(arr_new_x,0));
Py_DECREF(arr_x);
Py_DECREF(arr_y);
Py_DECREF(arr_new_x);
Py_DECREF(arr_new_y);
Py_RETURN_NONE;
fail:
Py_XDECREF(arr_x);
Py_XDECREF(arr_y);
Py_XDECREF(arr_new_x);
Py_XDECREF(arr_new_y);
return NULL;
}
static PyMethodDef interpolate_methods[] = {
{"linear_dddd", (PyCFunction)linear_method, METH_VARARGS|METH_KEYWORDS,
""},
{"loginterp_dddd", (PyCFunction)loginterp_method, METH_VARARGS|METH_KEYWORDS,
""},
{"window_average_ddddd", (PyCFunction)window_average_method, METH_VARARGS|METH_KEYWORDS,
""},
{"block_average_above_dddd", (PyCFunction)block_average_above_method, METH_VARARGS|METH_KEYWORDS,
""},
{NULL, NULL, 0, NULL}
};
#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"_interpolate",
NULL,
-1,
interpolate_methods,
NULL,
NULL,
NULL,
NULL
};
PyObject *PyInit__interpolate(void)
{
PyObject *m, *d, *s;
m = PyModule_Create(&moduledef);
import_array();
return m;
}
#else
PyMODINIT_FUNC init_interpolate(void)
{
PyObject* m;
m = Py_InitModule3("_interpolate", interpolate_methods,
"A few interpolation routines.\n"
);
if (m == NULL)
return;
import_array();
}
#endif
} // extern "C"
| bsd-3-clause |
farhi-naz/phantomjs | src/qt/qtbase/src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp | 105 | 3666 | /****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
//! [0]
QMouseEvent event(QEvent::MouseButtonPress, pos, 0, 0, 0);
QApplication::sendEvent(mainWindow, &event);
//! [0]
//! [1]
QPushButton *quitButton = new QPushButton("Quit");
connect(quitButton, SIGNAL(clicked()), &app, SLOT(quit()));
//! [1]
//! [2]
foreach (const QString &path, app.libraryPaths())
do_something(path);
//! [2]
//! [3]
// Called once QCoreApplication exists
static void preRoutineMyDebugTool()
{
MyDebugTool* tool = new MyDebugTool(QCoreApplication::instance());
QCoreApplication::instance()->installEventFilter(tool);
}
Q_COREAPP_STARTUP_FUNCTION(preRoutineMyDebugTool)
//! [3]
//! [4]
static int *global_ptr = 0;
static void cleanup_ptr()
{
delete [] global_ptr;
global_ptr = 0;
}
void init_ptr()
{
global_ptr = new int[100]; // allocate data
qAddPostRoutine(cleanup_ptr); // delete later
}
//! [4]
//! [5]
class MyPrivateInitStuff : public QObject
{
public:
static MyPrivateInitStuff *initStuff(QObject *parent)
{
if (!p)
p = new MyPrivateInitStuff(parent);
return p;
}
~MyPrivateInitStuff()
{
// cleanup goes here
}
private:
MyPrivateInitStuff(QObject *parent)
: QObject(parent)
{
// initialization goes here
}
MyPrivateInitStuff *p;
};
//! [5]
//! [6]
static inline QString tr(const char *sourceText,
const char *comment = 0);
static inline QString trUtf8(const char *sourceText,
const char *comment = 0);
//! [6]
//! [7]
class MyMfcView : public CView
{
Q_DECLARE_TR_FUNCTIONS(MyMfcView)
public:
MyMfcView();
...
};
//! [7]
| bsd-3-clause |
tmuelle2/phantomjs | src/qt/qtwebkit/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp | 113 | 7016 | /*
* Copyright (C) 2011, Google Inc. All rights reserved.
* Copyright (C) 2012, Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
#include "config.h"
#include "NavigatorContentUtils.h"
#if ENABLE(NAVIGATOR_CONTENT_UTILS)
#include "Document.h"
#include "ExceptionCode.h"
#include "Frame.h"
#include "Navigator.h"
#include "Page.h"
#include <wtf/HashSet.h>
namespace WebCore {
static HashSet<String>* protocolWhitelist;
static void initProtocolHandlerWhitelist()
{
protocolWhitelist = new HashSet<String>;
#if !PLATFORM(BLACKBERRY)
static const char* protocols[] = {
"irc",
"geo",
"mailto",
"magnet",
"mms",
"news",
"nntp",
"sip",
"sms",
"smsto",
"ssh",
"tel",
"urn",
"webcal",
"xmpp"
};
for (size_t i = 0; i < WTF_ARRAY_LENGTH(protocols); ++i)
protocolWhitelist->add(protocols[i]);
#endif
}
static bool verifyCustomHandlerURL(const String& baseURL, const String& url, ExceptionCode& ec)
{
// The specification requires that it is a SYNTAX_ERR if the "%s" token is
// not present.
static const char token[] = "%s";
int index = url.find(token);
if (-1 == index) {
ec = SYNTAX_ERR;
return false;
}
// It is also a SYNTAX_ERR if the custom handler URL, as created by removing
// the "%s" token and prepending the base url, does not resolve.
String newURL = url;
newURL.remove(index, WTF_ARRAY_LENGTH(token) - 1);
KURL base(ParsedURLString, baseURL);
KURL kurl(base, newURL);
if (kurl.isEmpty() || !kurl.isValid()) {
ec = SYNTAX_ERR;
return false;
}
return true;
}
static bool isProtocolWhitelisted(const String& scheme)
{
if (!protocolWhitelist)
initProtocolHandlerWhitelist();
return protocolWhitelist->contains(scheme);
}
static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionCode& ec)
{
if (scheme.startsWith("web+")) {
if (isValidProtocol(scheme))
return true;
ec = SECURITY_ERR;
return false;
}
if (isProtocolWhitelisted(scheme))
return true;
ec = SECURITY_ERR;
return false;
}
NavigatorContentUtils* NavigatorContentUtils::from(Page* page)
{
return static_cast<NavigatorContentUtils*>(RefCountedSupplement<Page, NavigatorContentUtils>::from(page, NavigatorContentUtils::supplementName()));
}
NavigatorContentUtils::~NavigatorContentUtils()
{
}
PassRefPtr<NavigatorContentUtils> NavigatorContentUtils::create(NavigatorContentUtilsClient* client)
{
return adoptRef(new NavigatorContentUtils(client));
}
void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const String& scheme, const String& url, const String& title, ExceptionCode& ec)
{
if (!navigator->frame())
return;
Document* document = navigator->frame()->document();
if (!document)
return;
String baseURL = document->baseURL().baseAsString();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return;
if (!verifyProtocolHandlerScheme(scheme, ec))
return;
NavigatorContentUtils::from(navigator->frame()->page())->client()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
}
#if ENABLE(CUSTOM_SCHEME_HANDLER)
static String customHandlersStateString(const NavigatorContentUtilsClient::CustomHandlersState state)
{
DEFINE_STATIC_LOCAL(const String, newHandler, (ASCIILiteral("new")));
DEFINE_STATIC_LOCAL(const String, registeredHandler, (ASCIILiteral("registered")));
DEFINE_STATIC_LOCAL(const String, declinedHandler, (ASCIILiteral("declined")));
switch (state) {
case NavigatorContentUtilsClient::CustomHandlersNew:
return newHandler;
case NavigatorContentUtilsClient::CustomHandlersRegistered:
return registeredHandler;
case NavigatorContentUtilsClient::CustomHandlersDeclined:
return declinedHandler;
}
ASSERT_NOT_REACHED();
return String();
}
String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator* navigator, const String& scheme, const String& url, ExceptionCode& ec)
{
DEFINE_STATIC_LOCAL(const String, declined, ("declined"));
if (!navigator->frame())
return declined;
Document* document = navigator->frame()->document();
String baseURL = document->baseURL().baseAsString();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return declined;
if (!verifyProtocolHandlerScheme(scheme, ec))
return declined;
return customHandlersStateString(NavigatorContentUtils::from(navigator->frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
}
void NavigatorContentUtils::unregisterProtocolHandler(Navigator* navigator, const String& scheme, const String& url, ExceptionCode& ec)
{
if (!navigator->frame())
return;
Document* document = navigator->frame()->document();
String baseURL = document->baseURL().baseAsString();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return;
if (!verifyProtocolHandlerScheme(scheme, ec))
return;
NavigatorContentUtils::from(navigator->frame()->page())->client()->unregisterProtocolHandler(scheme, baseURL, url);
}
#endif
const char* NavigatorContentUtils::supplementName()
{
return "NavigatorContentUtils";
}
void provideNavigatorContentUtilsTo(Page* page, NavigatorContentUtilsClient* client)
{
RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(client));
}
} // namespace WebCore
#endif // ENABLE(NAVIGATOR_CONTENT_UTILS)
| bsd-3-clause |
ramanajee/phantomjs | src/qt/qtwebkit/Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp | 113 | 2873 | /*
* Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebColorChooser.h"
#if ENABLE(INPUT_TYPE_COLOR)
#include "WebCoreArgumentCoders.h"
#include "WebPage.h"
#include "WebPageProxyMessages.h"
#include "WebProcess.h"
#include <WebCore/ColorChooserClient.h>
using namespace WebCore;
namespace WebKit {
WebColorChooser::WebColorChooser(WebPage* page, ColorChooserClient* client, const Color& initialColor)
: m_colorChooserClient(client)
, m_page(page)
{
m_page->setActiveColorChooser(this);
WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::ShowColorChooser(initialColor, client->elementRectRelativeToRootView()), m_page->pageID());
}
WebColorChooser::~WebColorChooser()
{
if (!m_page)
return;
m_page->setActiveColorChooser(0);
}
void WebColorChooser::didChooseColor(const Color& color)
{
m_colorChooserClient->didChooseColor(color);
}
void WebColorChooser::didEndChooser()
{
m_colorChooserClient->didEndChooser();
}
void WebColorChooser::disconnectFromPage()
{
m_page = 0;
}
void WebColorChooser::setSelectedColor(const Color& color)
{
if (!m_page)
return;
WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::SetColorChooserColor(color), m_page->pageID());
}
void WebColorChooser::endChooser()
{
if (!m_page)
return;
WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::EndColorChooser(), m_page->pageID());
}
} // namespace WebKit
#endif // ENABLE(INPUT_TYPE_COLOR)
| bsd-3-clause |
jkenn99/phantomjs | src/qt/qtwebkit/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp | 118 | 57898 | /*
* Copyright (C) 2007-2009 Torch Mobile Inc.
* Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "GraphicsContext.h"
#include "AffineTransform.h"
#include "Font.h"
#include "GDIExtras.h"
#include "GlyphBuffer.h"
#include "Gradient.h"
#include "NotImplemented.h"
#include "Path.h"
#include "PlatformPathWinCE.h"
#include "SharedBitmap.h"
#include "SimpleFontData.h"
#include <windows.h>
#include <wtf/OwnPtr.h>
#include <wtf/unicode/CharacterNames.h>
namespace WebCore {
typedef void (*FuncGradientFillRectLinear)(HDC hdc, const IntRect& r, const IntPoint& p0, const IntPoint& p1, const Vector<Gradient::ColorStop>& stops);
typedef void (*FuncGradientFillRectRadial)(HDC hdc, const IntRect& r, const IntPoint& p0, const IntPoint& p1, float r0, float r1, const Vector<Gradient::ColorStop>& stops);
FuncGradientFillRectLinear g_linearGradientFiller = 0;
FuncGradientFillRectRadial g_radialGradientFiller = 0;
static inline bool isZero(double d)
{
return d > 0 ? d <= 1.E-10 : d >= -1.E-10;
}
// stableRound rounds -0.5 to 0, where lround rounds -0.5 to -1.
static inline int stableRound(double d)
{
if (d > 0)
return static_cast<int>(d + 0.5);
int i = static_cast<int>(d);
return i - d > 0.5 ? i - 1 : i;
}
// Unlike enclosingIntRect(), this function does strict rounding.
static inline IntRect roundRect(const FloatRect& r)
{
return IntRect(stableRound(r.x()), stableRound(r.y()), stableRound(r.maxX()) - stableRound(r.x()), stableRound(r.maxY()) - stableRound(r.y()));
}
// Rotation transformation
class RotationTransform {
public:
RotationTransform()
: m_cosA(1.)
, m_sinA(0.)
, m_preShiftX(0)
, m_preShiftY(0)
, m_postShiftX(0)
, m_postShiftY(0)
{
}
RotationTransform operator-() const
{
RotationTransform rtn;
rtn.m_cosA = m_cosA;
rtn.m_sinA = -m_sinA;
rtn.m_preShiftX = m_postShiftX;
rtn.m_preShiftY = m_postShiftY;
rtn.m_postShiftX = m_preShiftX;
rtn.m_postShiftY = m_preShiftY;
return rtn;
}
void map(double x1, double y1, double* x2, double* y2) const
{
x1 += m_preShiftX;
y1 += m_preShiftY;
*x2 = x1 * m_cosA + y1 * m_sinA + m_postShiftX;
*y2 = y1 * m_cosA - x1 * m_sinA + m_postShiftY;
}
void map(int x1, int y1, int* x2, int* y2) const
{
x1 += m_preShiftX;
y1 += m_preShiftY;
*x2 = stableRound(x1 * m_cosA + y1 * m_sinA) + m_postShiftX;
*y2 = stableRound(y1 * m_cosA - x1 * m_sinA) + m_postShiftY;
}
double m_cosA;
double m_sinA;
int m_preShiftX;
int m_preShiftY;
int m_postShiftX;
int m_postShiftY;
};
template<class T> static inline IntPoint mapPoint(const IntPoint& p, const T& t)
{
int x, y;
t.map(p.x(), p.y(), &x, &y);
return IntPoint(x, y);
}
template<class T> static inline FloatPoint mapPoint(const FloatPoint& p, const T& t)
{
double x, y;
t.map(p.x(), p.y(), &x, &y);
return FloatPoint(static_cast<float>(x), static_cast<float>(y));
}
template<class Transform, class Rect, class Value> static inline Rect mapRect(const Rect& rect, const Transform& transform)
{
Value x[4], y[4];
Value l, t, r, b;
r = rect.maxX() - 1;
b = rect.maxY() - 1;
transform.map(rect.x(), rect.y(), x, y);
transform.map(rect.x(), b, x + 1, y + 1);
transform.map(r, b, x + 2, y + 2);
transform.map(r, rect.y(), x + 3, y + 3);
l = r = x[3];
t = b = y[3];
for (int i = 0; i < 3; ++i) {
if (x[i] < l)
l = x[i];
else if (x[i] > r)
r = x[i];
if (y[i] < t)
t = y[i];
else if (y[i] > b)
b = y[i];
}
return IntRect(l, t, r - l + 1, b - t + 1);
}
template<class T> static inline IntRect mapRect(const IntRect& rect, const T& transform)
{
return mapRect<T, IntRect, int>(rect, transform);
}
template<class T> static inline FloatRect mapRect(const FloatRect& rect, const T& transform)
{
return mapRect<T, FloatRect, double>(rect, transform);
}
class GraphicsContextPlatformPrivateData {
public:
GraphicsContextPlatformPrivateData()
: m_transform()
, m_opacity(1.0)
{
}
AffineTransform m_transform;
float m_opacity;
};
enum AlphaPaintType {
AlphaPaintNone,
AlphaPaintImage,
AlphaPaintOther,
};
class GraphicsContextPlatformPrivate : public GraphicsContextPlatformPrivateData {
public:
GraphicsContextPlatformPrivate(HDC dc)
: m_dc(dc)
{
}
~GraphicsContextPlatformPrivate()
{
while (!m_backupData.isEmpty())
restore();
}
void translate(float x, float y)
{
m_transform.translate(x, y);
}
void scale(const FloatSize& size)
{
m_transform.scaleNonUniform(size.width(), size.height());
}
void rotate(float radians)
{
m_transform.rotate(rad2deg(radians));
}
void concatCTM(const AffineTransform& transform)
{
m_transform *= transform;
}
void setCTM(const AffineTransform& transform)
{
m_transform = transform;
}
IntRect mapRect(const IntRect& rect) const
{
return m_transform.mapRect(rect);
}
FloatRect mapRect(const FloatRect& rect) const
{
return m_transform.mapRect(rect);
}
IntPoint mapPoint(const IntPoint& point) const
{
return m_transform.mapPoint(point);
}
FloatPoint mapPoint(const FloatPoint& point) const
{
return m_transform.mapPoint(point);
}
FloatSize mapSize(const FloatSize& size) const
{
double w, h;
m_transform.map(size.width(), size.height(), w, h);
return FloatSize(static_cast<float>(w), static_cast<float>(h));
}
void save()
{
if (m_dc)
SaveDC(m_dc);
m_backupData.append(*static_cast<GraphicsContextPlatformPrivateData*>(this));
}
void restore()
{
if (m_backupData.isEmpty())
return;
if (m_dc)
RestoreDC(m_dc, -1);
GraphicsContextPlatformPrivateData::operator=(m_backupData.last());
m_backupData.removeLast();
}
bool hasAlpha() const { return m_bitmap && m_bitmap->hasAlpha(); }
PassRefPtr<SharedBitmap> getTransparentLayerBitmap(IntRect& origRect, AlphaPaintType alphaPaint, RECT& bmpRect, bool checkClipBox, bool force) const
{
if (m_opacity <= 0)
return 0;
if (force || m_opacity < 1.) {
if (checkClipBox) {
RECT clipBox;
int clipType = GetClipBox(m_dc, &clipBox);
if (clipType == SIMPLEREGION || clipType == COMPLEXREGION)
origRect.intersect(clipBox);
if (origRect.isEmpty())
return 0;
}
RefPtr<SharedBitmap> bmp = SharedBitmap::create(origRect.size(), alphaPaint == AlphaPaintNone ? BitmapInfo::BitCount16 : BitmapInfo::BitCount32, false);
SetRect(&bmpRect, 0, 0, origRect.width(), origRect.height());
if (bmp) {
switch (alphaPaint) {
case AlphaPaintNone:
case AlphaPaintImage:
{
SharedBitmap::DCHolder dc(bmp.get());
if (dc.get()) {
BitBlt(dc.get(), 0, 0, origRect.width(), origRect.height(), m_dc, origRect.x(), origRect.y(), SRCCOPY);
if (bmp->is32bit() && (!m_bitmap || m_bitmap->is16bit())) {
// Set alpha channel
unsigned* pixels = (unsigned*)bmp->bytes();
const unsigned* const pixelsEnd = pixels + bmp->bitmapInfo().numPixels();
while (pixels < pixelsEnd) {
*pixels |= 0xFF000000;
++pixels;
}
}
return bmp;
}
}
break;
//case AlphaPaintOther:
default:
memset(bmp->bytes(), 0xFF, bmp->bitmapInfo().numPixels() * 4);
return bmp;
break;
}
}
}
bmpRect = origRect;
return 0;
}
void paintBackTransparentLayerBitmap(HDC hdc, SharedBitmap* bmp, const IntRect& origRect, AlphaPaintType alphaPaint, const RECT& bmpRect)
{
if (hdc == m_dc)
return;
if (alphaPaint == AlphaPaintOther && hasAlphaBlendSupport()) {
ASSERT(bmp && bmp->bytes() && bmp->is32bit());
unsigned* pixels = (unsigned*)bmp->bytes();
const unsigned* const pixelsEnd = pixels + bmp->bitmapInfo().numPixels();
while (pixels < pixelsEnd) {
*pixels ^= 0xFF000000;
++pixels;
}
}
if ((m_opacity < 1. || alphaPaint == AlphaPaintOther) && hasAlphaBlendSupport()) {
const BLENDFUNCTION blend = { AC_SRC_OVER, 0
, m_opacity >= 1. ? 255 : (BYTE)(m_opacity * 255)
, alphaPaint == AlphaPaintNone ? 0 : AC_SRC_ALPHA };
bool success = alphaBlendIfSupported(m_dc, origRect.x(), origRect.y(), origRect.width(), origRect.height(), hdc, 0, 0, bmpRect.right, bmpRect.bottom, blend);
ASSERT_UNUSED(success, success);
} else
StretchBlt(m_dc, origRect.x(), origRect.y(), origRect.width(), origRect.height(), hdc, 0, 0, bmpRect.right, bmpRect.bottom, SRCCOPY);
}
HDC m_dc;
RefPtr<SharedBitmap> m_bitmap;
Vector<GraphicsContextPlatformPrivateData> m_backupData;
};
static PassOwnPtr<HPEN> createPen(const Color& col, double fWidth, StrokeStyle style)
{
int width = stableRound(fWidth);
if (width < 1)
width = 1;
int penStyle = PS_NULL;
switch (style) {
case SolidStroke:
#if ENABLE(CSS3_TEXT)
case DoubleStroke:
case WavyStroke: // FIXME: https://bugs.webkit.org/show_bug.cgi?id=94114 - Needs platform support.
#endif // CSS3_TEXT
penStyle = PS_SOLID;
break;
case DottedStroke: // not supported on Windows CE
case DashedStroke:
penStyle = PS_DASH;
width = 1;
break;
default:
break;
}
return adoptPtr(CreatePen(penStyle, width, RGB(col.red(), col.green(), col.blue())));
}
static inline PassOwnPtr<HBRUSH> createBrush(const Color& col)
{
return adoptPtr(CreateSolidBrush(RGB(col.red(), col.green(), col.blue())));
}
template <typename PixelType, bool Is16bit> static void _rotateBitmap(SharedBitmap* destBmp, const SharedBitmap* sourceBmp, const RotationTransform& transform)
{
int destW = destBmp->width();
int destH = destBmp->height();
int sourceW = sourceBmp->width();
int sourceH = sourceBmp->height();
PixelType* dest = (PixelType*)destBmp->bytes();
const PixelType* source = (const PixelType*)sourceBmp->bytes();
int padding;
int paddedSourceW;
if (Is16bit) {
padding = destW & 1;
paddedSourceW = sourceW + (sourceW & 1);
} else {
padding = 0;
paddedSourceW = sourceW;
}
if (isZero(transform.m_sinA)) {
int cosA = transform.m_cosA > 0 ? 1 : -1;
for (int y = 0; y < destH; ++y) {
for (int x = 0; x < destW; ++x) {
int x1 = x + transform.m_preShiftX;
int y1 = y + transform.m_preShiftY;
int srcX = x1 * cosA + transform.m_postShiftX;
int srcY = y1 * cosA - transform.m_postShiftY;
if (srcX >= 0 && srcX <= sourceW && srcY >= 0 && srcY <= sourceH)
*dest++ = source[srcY * paddedSourceW + srcX] | 0xFF000000;
else
*dest++ |= 0xFF;
}
dest += padding;
}
} else if (isZero(transform.m_cosA)) {
int sinA = transform.m_sinA > 0 ? 1 : -1;
for (int y = 0; y < destH; ++y) {
for (int x = 0; x < destW; ++x) {
int x1 = x + transform.m_preShiftX;
int y1 = y + transform.m_preShiftY;
int srcX = y1 * sinA + transform.m_postShiftX;
int srcY = -x1 * sinA + transform.m_postShiftY;
if (srcX >= 0 && srcX <= sourceW && srcY >= 0 && srcY <= sourceH)
*dest++ = source[srcY * paddedSourceW + srcX];
}
dest += padding;
}
} else {
for (int y = 0; y < destH; ++y) {
for (int x = 0; x < destW; ++x) {
// FIXME: for best quality, we should get weighted sum of four neighbours,
// but that will be too expensive
int srcX, srcY;
transform.map(x, y, &srcX, &srcY);
if (srcX >= 0 && srcX <= sourceW && srcY >= 0 && srcY <= sourceH)
*dest++ = source[srcY * paddedSourceW + srcX];
}
dest += padding;
}
}
}
static void rotateBitmap(SharedBitmap* destBmp, const SharedBitmap* sourceBmp, const RotationTransform& transform)
{
ASSERT(destBmp->is16bit() == sourceBmp->is16bit());
if (destBmp->is16bit())
_rotateBitmap<unsigned short, true>(destBmp, sourceBmp, transform);
else
_rotateBitmap<unsigned, false>(destBmp, sourceBmp, transform);
}
class TransparentLayerDC {
WTF_MAKE_NONCOPYABLE(TransparentLayerDC);
public:
TransparentLayerDC(GraphicsContextPlatformPrivate* data, IntRect& origRect, const IntRect* rectBeforeTransform = 0, int alpha = 255, bool paintImage = false);
~TransparentLayerDC();
HDC hdc() const { return m_memDc; }
const RECT& rect() const { return m_bmpRect; }
IntSize toShift() const { return IntSize(m_bmpRect.left - m_origRect.x(), m_bmpRect.top - m_origRect.y()); }
void fillAlphaChannel();
private:
GraphicsContextPlatformPrivate* m_data;
IntRect m_origRect;
IntRect m_rotatedOrigRect;
HDC m_memDc;
RefPtr<SharedBitmap> m_bitmap;
RefPtr<SharedBitmap> m_rotatedBitmap;
RECT m_bmpRect;
unsigned m_key;
RotationTransform m_rotation;
float m_oldOpacity;
AlphaPaintType m_alphaPaintType;
};
TransparentLayerDC::TransparentLayerDC(GraphicsContextPlatformPrivate* data, IntRect& origRect, const IntRect* rectBeforeTransform, int alpha, bool paintImage)
: m_data(data)
, m_origRect(origRect)
, m_oldOpacity(data->m_opacity)
// m_key1 and m_key2 are not initalized here. They are used only in the case that
// SharedBitmap::getDC() is called, I.E., when m_bitmap is not null.
{
m_data->m_opacity *= alpha / 255.;
bool mustCreateLayer;
if (!m_data->hasAlpha()) {
mustCreateLayer = false;
m_alphaPaintType = AlphaPaintNone;
} else {
mustCreateLayer = true;
m_alphaPaintType = paintImage ? AlphaPaintImage : AlphaPaintOther;
}
if (rectBeforeTransform && !isZero(m_data->m_transform.b())) {
m_rotatedOrigRect = origRect;
m_rotatedBitmap = m_data->getTransparentLayerBitmap(m_rotatedOrigRect, m_alphaPaintType, m_bmpRect, false, true);
if (m_rotatedBitmap) {
double a = m_data->m_transform.a();
double b = m_data->m_transform.b();
double c = _hypot(a, b);
m_rotation.m_cosA = a / c;
m_rotation.m_sinA = b / c;
int centerX = origRect.x() + origRect.width() / 2;
int centerY = origRect.y() + origRect.height() / 2;
m_rotation.m_preShiftX = -centerX;
m_rotation.m_preShiftY = -centerY;
m_rotation.m_postShiftX = centerX;
m_rotation.m_postShiftY = centerY;
m_origRect = mapRect(m_rotatedOrigRect, m_rotation);
m_rotation.m_preShiftX += m_rotatedOrigRect.x();
m_rotation.m_preShiftY += m_rotatedOrigRect.y();
m_rotation.m_postShiftX -= m_origRect.x();
m_rotation.m_postShiftY -= m_origRect.y();
FloatPoint topLeft = m_data->m_transform.mapPoint(FloatPoint(rectBeforeTransform->location()));
FloatPoint topRight(rectBeforeTransform->maxX() - 1, rectBeforeTransform->y());
topRight = m_data->m_transform.mapPoint(topRight);
FloatPoint bottomLeft(rectBeforeTransform->x(), rectBeforeTransform->maxY() - 1);
bottomLeft = m_data->m_transform.mapPoint(bottomLeft);
FloatSize sideTop = topRight - topLeft;
FloatSize sideLeft = bottomLeft - topLeft;
float width = _hypot(sideTop.width() + 1, sideTop.height() + 1);
float height = _hypot(sideLeft.width() + 1, sideLeft.height() + 1);
origRect.inflateX(stableRound((width - origRect.width()) * 0.5));
origRect.inflateY(stableRound((height - origRect.height()) * 0.5));
m_bitmap = SharedBitmap::create(m_origRect.size(), m_rotatedBitmap->is16bit() ? BitmapInfo::BitCount16 : BitmapInfo::BitCount32, true);
if (m_bitmap)
rotateBitmap(m_bitmap.get(), m_rotatedBitmap.get(), -m_rotation);
else
m_rotatedBitmap = 0;
}
} else
m_bitmap = m_data->getTransparentLayerBitmap(m_origRect, m_alphaPaintType, m_bmpRect, true, mustCreateLayer);
if (m_bitmap)
m_memDc = m_bitmap->getDC(&m_key);
else
m_memDc = m_data->m_dc;
}
TransparentLayerDC::~TransparentLayerDC()
{
if (m_rotatedBitmap) {
m_bitmap->releaseDC(m_memDc, m_key);
m_key = 0;
rotateBitmap(m_rotatedBitmap.get(), m_bitmap.get(), m_rotation);
m_memDc = m_rotatedBitmap->getDC(&m_key);
m_data->paintBackTransparentLayerBitmap(m_memDc, m_rotatedBitmap.get(), m_rotatedOrigRect, m_alphaPaintType, m_bmpRect);
m_rotatedBitmap->releaseDC(m_memDc, m_key);
} else if (m_bitmap) {
m_data->paintBackTransparentLayerBitmap(m_memDc, m_bitmap.get(), m_origRect, m_alphaPaintType, m_bmpRect);
m_bitmap->releaseDC(m_memDc, m_key);
}
m_data->m_opacity = m_oldOpacity;
}
void TransparentLayerDC::fillAlphaChannel()
{
if (!m_bitmap || !m_bitmap->is32bit())
return;
unsigned* pixels = (unsigned*)m_bitmap->bytes();
const unsigned* const pixelsEnd = pixels + m_bitmap->bitmapInfo().numPixels();
while (pixels < pixelsEnd) {
*pixels |= 0xFF000000;
++pixels;
}
}
class ScopeDCProvider {
WTF_MAKE_NONCOPYABLE(ScopeDCProvider);
public:
explicit ScopeDCProvider(GraphicsContextPlatformPrivate* data)
: m_data(data)
{
if (m_data->m_bitmap)
m_data->m_dc = m_data->m_bitmap->getDC(&m_key);
}
~ScopeDCProvider()
{
if (m_data->m_bitmap) {
m_data->m_bitmap->releaseDC(m_data->m_dc, m_key);
m_data->m_dc = 0;
}
}
private:
GraphicsContextPlatformPrivate* m_data;
unsigned m_key;
};
void GraphicsContext::platformInit(PlatformGraphicsContext* dc)
{
m_data = new GraphicsContextPlatformPrivate(dc);
}
void GraphicsContext::platformDestroy()
{
delete m_data;
}
void GraphicsContext::setBitmap(PassRefPtr<SharedBitmap> bmp)
{
ASSERT(!m_data->m_dc);
m_data->m_bitmap = bmp;
}
HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
// FIXME: Add support for AlphaBlend.
ASSERT(!supportAlphaBlend);
return m_data->m_dc;
}
void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
}
void GraphicsContext::savePlatformState()
{
m_data->save();
}
void GraphicsContext::restorePlatformState()
{
m_data->restore();
}
void GraphicsContext::drawRect(const IntRect& rect)
{
if (!m_data->m_opacity || paintingDisabled() || rect.isEmpty())
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect trRect = m_data->mapRect(rect);
TransparentLayerDC transparentDC(m_data, trRect, &rect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
OwnPtr<HBRUSH> brush;
HGDIOBJ oldBrush;
if (fillColor().alpha()) {
brush = createBrush(fillColor());
oldBrush = SelectObject(dc, brush.get());
} else
oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
OwnPtr<HPEN> pen;
HGDIOBJ oldPen;
if (strokeStyle() != NoStroke) {
pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
oldPen = SelectObject(dc, pen.get());
} else
oldPen = SelectObject(dc, GetStockObject(NULL_PEN));
if (brush || pen) {
if (trRect.width() <= 0)
trRect.setWidth(1);
if (trRect.height() <= 0)
trRect.setHeight(1);
Rectangle(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
}
SelectObject(dc, oldPen);
SelectObject(dc, oldBrush);
}
void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
{
if (!m_data->m_opacity || paintingDisabled() || strokeStyle() == NoStroke || !strokeColor().alpha())
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntPoint trPoint1 = m_data->mapPoint(point1);
IntPoint trPoint2 = m_data->mapPoint(point2);
IntRect lineRect(trPoint1, trPoint2 - trPoint1);
lineRect.setHeight(lineRect.height() + strokeThickness());
TransparentLayerDC transparentDC(m_data, lineRect, 0, strokeColor().alpha());
HDC dc = transparentDC.hdc();
if (!dc)
return;
trPoint1 += transparentDC.toShift();
trPoint2 += transparentDC.toShift();
OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
HGDIOBJ oldPen = SelectObject(dc, pen.get());
MoveToEx(dc, trPoint1.x(), trPoint1.y(), 0);
LineTo(dc, trPoint2.x(), trPoint2.y());
SelectObject(dc, oldPen);
}
void GraphicsContext::drawEllipse(const IntRect& rect)
{
if (!m_data->m_opacity || paintingDisabled() || (!fillColor().alpha() && strokeStyle() == NoStroke))
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect trRect = m_data->mapRect(rect);
TransparentLayerDC transparentDC(m_data, trRect, &rect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
OwnPtr<HBRUSH> brush;
HGDIOBJ oldBrush;
if (fillColor().alpha()) {
brush = createBrush(fillColor());
oldBrush = SelectObject(dc, brush.get());
} else
oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
OwnPtr<HPEN> pen;
HGDIOBJ oldPen = 0;
if (strokeStyle() != NoStroke) {
pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
oldPen = SelectObject(dc, pen.get());
} else
oldPen = SelectObject(dc, GetStockObject(NULL_PEN));
if (brush || pen)
Ellipse(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
SelectObject(dc, oldPen);
SelectObject(dc, oldBrush);
}
static inline bool equalAngle(double a, double b)
{
return fabs(a - b) < 1E-5;
}
void getEllipsePointByAngle(double angle, double a, double b, float& x, float& y)
{
while (angle < 0)
angle += 2 * piDouble;
while (angle >= 2 * piDouble)
angle -= 2 * piDouble;
if (equalAngle(angle, 0) || equalAngle(angle, 2 * piDouble)) {
x = a;
y = 0;
} else if (equalAngle(angle, piDouble)) {
x = -a;
y = 0;
} else if (equalAngle(angle, .5 * piDouble)) {
x = 0;
y = b;
} else if (equalAngle(angle, 1.5 * piDouble)) {
x = 0;
y = -b;
} else {
double k = tan(angle);
double sqA = a * a;
double sqB = b * b;
double tmp = 1. / (1. / sqA + (k * k) / sqB);
tmp = tmp <= 0 ? 0 : sqrt(tmp);
if (angle > .5 * piDouble && angle < 1.5 * piDouble)
tmp = -tmp;
x = tmp;
k = tan(.5 * piDouble - angle);
tmp = 1. / ((k * k) / sqA + 1 / sqB);
tmp = tmp <= 0 ? 0 : sqrt(tmp);
if (angle > piDouble)
tmp = -tmp;
y = tmp;
}
}
void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias)
{
if (!m_data->m_opacity || paintingDisabled() || npoints <= 1 || !points)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
Vector<POINT, 20> winPoints(npoints);
FloatPoint trPoint = m_data->mapPoint(points[0]);
winPoints[0].x = stableRound(trPoint.x());
winPoints[0].y = stableRound(trPoint.y());
RECT rect = { winPoints[0].x, winPoints[0].y, winPoints[0].x, winPoints[0].y };
for (size_t i = 1; i < npoints; ++i) {
trPoint = m_data->mapPoint(points[i]);
winPoints[i].x = stableRound(trPoint.x());
winPoints[i].y = stableRound(trPoint.y());
if (rect.left > winPoints[i].x)
rect.left = winPoints[i].x;
else if (rect.right < winPoints[i].x)
rect.right = winPoints[i].x;
if (rect.top > winPoints[i].y)
rect.top = winPoints[i].y;
else if (rect.bottom < winPoints[i].y)
rect.bottom = winPoints[i].y;
}
rect.bottom += 1;
rect.right += 1;
IntRect intRect(rect);
TransparentLayerDC transparentDC(m_data, intRect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
for (size_t i = 0; i < npoints; ++i) {
winPoints[i].x += transparentDC.toShift().width();
winPoints[i].y += transparentDC.toShift().height();
}
OwnPtr<HBRUSH> brush;
HGDIOBJ oldBrush;
if (fillColor().alpha()) {
brush = createBrush(fillColor());
oldBrush = SelectObject(dc, brush.get());
} else
oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
OwnPtr<HPEN> pen;
HGDIOBJ oldPen;
if (strokeStyle() != NoStroke) {
pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
oldPen = SelectObject(dc, pen.get());
} else
oldPen = SelectObject(dc, GetStockObject(NULL_PEN));
if (brush || pen)
Polygon(dc, winPoints.data(), npoints);
SelectObject(dc, oldPen);
SelectObject(dc, oldBrush);
}
void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
if (numPoints <= 1)
return;
// FIXME: IMPLEMENT!!
}
void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
{
if (paintingDisabled() || !m_data->m_opacity)
return;
int alpha = color.alpha();
if (!alpha)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect intRect = enclosingIntRect(rect);
TransparentLayerDC transparentDC(m_data, m_data->mapRect(intRect), &intRect, alpha);
if (!transparentDC.hdc())
return;
OwnPtr<HBRUSH> hbrush = adoptPtr(CreateSolidBrush(RGB(color.red(), color.green(), color.blue())));
FillRect(transparentDC.hdc(), &transparentDC.rect(), hbrush.get());
}
void GraphicsContext::clip(const FloatRect& rect)
{
if (paintingDisabled())
return;
if (!m_data->m_dc)
return;
IntRect trRect = enclosingIntRect(m_data->mapRect(rect));
OwnPtr<HRGN> clipRgn = adoptPtr(CreateRectRgn(0, 0, 0, 0));
if (GetClipRgn(m_data->m_dc, clipRgn.get()) > 0)
IntersectClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
else {
clipRgn = adoptPtr(CreateRectRgn(trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY()));
SelectClipRgn(m_data->m_dc, clipRgn.get());
}
}
void GraphicsContext::clipOut(const IntRect& rect)
{
if (paintingDisabled())
return;
if (!m_data->m_dc)
return;
IntRect trRect = m_data->mapRect(rect);
ExcludeClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
}
void GraphicsContext::drawFocusRing(const Path& path, int width, int offset, const Color& color)
{
// FIXME: implement
}
void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
{
if (!m_data->m_opacity || paintingDisabled())
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
int radius = (width - 1) / 2;
offset += radius;
unsigned rectCount = rects.size();
IntRect finalFocusRect;
for (unsigned i = 0; i < rectCount; i++) {
IntRect focusRect = rects[i];
focusRect.inflate(offset);
finalFocusRect.unite(focusRect);
}
IntRect intRect = finalFocusRect;
IntRect trRect = m_data->mapRect(finalFocusRect);
TransparentLayerDC transparentDC(m_data, trRect, &intRect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
RECT rect = trRect;
DrawFocusRect(dc, &rect);
}
void GraphicsContext::drawLineForText(const FloatPoint& origin, float width, bool printing)
{
if (paintingDisabled())
return;
StrokeStyle oldStyle = strokeStyle();
setStrokeStyle(SolidStroke);
drawLine(roundedIntPoint(origin), roundedIntPoint(origin + FloatSize(width, 0)));
setStrokeStyle(oldStyle);
}
void GraphicsContext::drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle style)
{
notImplemented();
}
void GraphicsContext::setPlatformFillColor(const Color& col, ColorSpace colorSpace)
{
notImplemented();
}
void GraphicsContext::setPlatformStrokeColor(const Color& col, ColorSpace colorSpace)
{
notImplemented();
}
void GraphicsContext::setPlatformStrokeThickness(float strokeThickness)
{
notImplemented();
}
void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect)
{
notImplemented();
}
void GraphicsContext::clearRect(const FloatRect& rect)
{
if (paintingDisabled())
return;
if (m_data->hasAlpha()) {
IntRect trRect = enclosingIntRect(m_data->mapRect(rect));
m_data->m_bitmap->clearPixels(trRect);
return;
}
fillRect(rect, Color(Color::white), ColorSpaceDeviceRGB);
}
void GraphicsContext::strokeRect(const FloatRect& rect, float width)
{
if (!m_data->m_opacity || paintingDisabled() || strokeStyle() == NoStroke)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect intRect = enclosingIntRect(rect);
IntRect trRect = m_data->mapRect(intRect);
TransparentLayerDC transparentDC(m_data, trRect, &intRect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
HGDIOBJ oldPen = SelectObject(dc, pen.get());
int right = trRect.maxX() - 1;
int bottom = trRect.maxY() - 1;
const POINT intPoints[5] =
{
{ trRect.x(), trRect.y() },
{ right, trRect.y() },
{ right, bottom },
{ trRect.x(), bottom },
{ trRect.x(), trRect.y() }
};
Polyline(dc, intPoints, 5);
SelectObject(dc, oldPen);
}
void GraphicsContext::beginPlatformTransparencyLayer(float opacity)
{
m_data->save();
m_data->m_opacity *= opacity;
}
void GraphicsContext::endPlatformTransparencyLayer()
{
m_data->restore();
}
bool GraphicsContext::supportsTransparencyLayers()
{
return true;
}
void GraphicsContext::concatCTM(const AffineTransform& transform)
{
m_data->concatCTM(transform);
}
void GraphicsContext::setCTM(const AffineTransform& transform)
{
m_data->setCTM(transform);
}
AffineTransform& GraphicsContext::affineTransform()
{
return m_data->m_transform;
}
const AffineTransform& GraphicsContext::affineTransform() const
{
return m_data->m_transform;
}
void GraphicsContext::resetAffineTransform()
{
m_data->m_transform.makeIdentity();
}
void GraphicsContext::translate(float x, float y)
{
m_data->translate(x, y);
}
void GraphicsContext::rotate(float radians)
{
m_data->rotate(radians);
}
void GraphicsContext::scale(const FloatSize& size)
{
m_data->scale(size);
}
void GraphicsContext::setLineCap(LineCap lineCap)
{
notImplemented();
}
void GraphicsContext::setLineJoin(LineJoin lineJoin)
{
notImplemented();
}
void GraphicsContext::setMiterLimit(float miter)
{
notImplemented();
}
void GraphicsContext::setAlpha(float alpha)
{
m_data->m_opacity = alpha;
}
void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op, BlendMode blendMode)
{
notImplemented();
}
void GraphicsContext::clip(const Path& path, WindRule)
{
notImplemented();
}
void GraphicsContext::canvasClip(const Path& path, WindRule fillRule)
{
clip(path, fillRule);
}
void GraphicsContext::clipOut(const Path&)
{
notImplemented();
}
static inline IntPoint rectCenterPoint(const RECT& rect)
{
return IntPoint(rect.left + (rect.right - rect.left) / 2, rect.top + (rect.bottom - rect.top) / 2);
}
void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& c, ColorSpace colorSpace)
{
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
FloatSize shadowOffset;
float shadowBlur = 0;
Color shadowColor;
ColorSpace shadowColorSpace;
getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
IntRect dstRect = fillRect;
dstRect.move(stableRound(shadowOffset.width()), stableRound(shadowOffset.height()));
dstRect.inflate(stableRound(shadowBlur));
dstRect = m_data->mapRect(dstRect);
FloatSize newTopLeft(m_data->mapSize(topLeft));
FloatSize newTopRight(m_data->mapSize(topRight));
FloatSize newBottomLeft(m_data->mapSize(bottomLeft));
FloatSize newBottomRight(m_data->mapSize(bottomRight));
TransparentLayerDC transparentDc(m_data, dstRect, &fillRect);
HDC dc = transparentDc.hdc();
if (!dc)
return;
dstRect.move(transparentDc.toShift());
RECT rectWin = dstRect;
OwnPtr<HBRUSH> brush = createBrush(shadowColor);
HGDIOBJ oldBrush = SelectObject(dc, brush.get());
SelectObject(dc, GetStockObject(NULL_PEN));
IntPoint centerPoint = rectCenterPoint(rectWin);
// Draw top left half
RECT clipRect(rectWin);
clipRect.right = centerPoint.x();
clipRect.bottom = centerPoint.y();
OwnPtr<HRGN> clipRgn = adoptPtr(CreateRectRgn(0, 0, 0, 0));
bool needsNewClip = (GetClipRgn(dc, clipRgn.get()) <= 0);
drawRoundCorner(needsNewClip, clipRect, rectWin, dc, stableRound(newTopLeft.width() * 2), stableRound(newTopLeft.height() * 2));
// Draw top right
clipRect = rectWin;
clipRect.left = centerPoint.x();
clipRect.bottom = centerPoint.y();
drawRoundCorner(needsNewClip, clipRect, rectWin, dc, stableRound(newTopRight.width() * 2), stableRound(newTopRight.height() * 2));
// Draw bottom left
clipRect = rectWin;
clipRect.right = centerPoint.x();
clipRect.top = centerPoint.y();
drawRoundCorner(needsNewClip, clipRect, rectWin, dc, stableRound(newBottomLeft.width() * 2), stableRound(newBottomLeft.height() * 2));
// Draw bottom right
clipRect = rectWin;
clipRect.left = centerPoint.x();
clipRect.top = centerPoint.y();
drawRoundCorner(needsNewClip, clipRect, rectWin, dc, stableRound(newBottomRight.width() * 2), stableRound(newBottomRight.height() * 2));
SelectObject(dc, oldBrush);
}
void GraphicsContext::drawRoundCorner(bool needsNewClip, RECT clipRect, RECT rectWin, HDC dc, int width, int height)
{
if (!dc)
return;
OwnPtr<HRGN> clipRgn = adoptPtr(CreateRectRgn(0, 0, 0, 0));
if (needsNewClip) {
clipRgn = adoptPtr(CreateRectRgn(clipRect.left, clipRect.top, clipRect.right, clipRect.bottom));
SelectClipRgn(dc, clipRgn.get());
} else
IntersectClipRect(dc, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom);
::RoundRect(dc, rectWin.left , rectWin.top , rectWin.right , rectWin.bottom , width, height);
SelectClipRgn(dc, needsNewClip ? 0 : clipRgn.get());
}
FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect, RoundingMode)
{
notImplemented();
return frect;
}
Color gradientAverageColor(const Gradient* gradient)
{
const Vector<Gradient::ColorStop>& stops = gradient->getStops();
if (stops.isEmpty())
return Color();
const Gradient::ColorStop& stop = stops.first();
if (stops.size() == 1)
return Color(stop.red, stop.green, stop.blue, stop.alpha);
const Gradient::ColorStop& lastStop = stops.last();
return Color((stop.red + lastStop.red) * 0.5f
, (stop.green + lastStop.green) * 0.5f
, (stop.blue + lastStop.blue) * 0.5f
, (stop.alpha + lastStop.alpha) * 0.5f);
}
void GraphicsContext::fillPath(const Path& path)
{
if (path.isNull())
return;
Color c = m_state.fillGradient
? gradientAverageColor(m_state.fillGradient.get())
: fillColor();
if (!c.alpha() || !m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
OwnPtr<HBRUSH> brush = createBrush(c);
if (m_data->m_opacity < 1.0f || m_data->hasAlpha()) {
IntRect trRect = enclosingIntRect(m_data->mapRect(path.boundingRect()));
trRect.inflate(1);
TransparentLayerDC transparentDC(m_data, trRect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
AffineTransform tr = m_data->m_transform;
tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height());
SelectObject(dc, GetStockObject(NULL_PEN));
HGDIOBJ oldBrush = SelectObject(dc, brush.get());
path.platformPath()->fillPath(dc, &tr);
SelectObject(dc, oldBrush);
} else {
SelectObject(m_data->m_dc, GetStockObject(NULL_PEN));
HGDIOBJ oldBrush = SelectObject(m_data->m_dc, brush.get());
path.platformPath()->fillPath(m_data->m_dc, &m_data->m_transform);
SelectObject(m_data->m_dc, oldBrush);
}
}
void GraphicsContext::strokePath(const Path& path)
{
if (path.isNull() || !m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
if (m_data->m_opacity < 1.0f || m_data->hasAlpha()) {
IntRect trRect = enclosingIntRect(m_data->mapRect(path.boundingRect()));
trRect.inflate(1);
TransparentLayerDC transparentDC(m_data, trRect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
AffineTransform tr = m_data->m_transform;
tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height());
SelectObject(dc, GetStockObject(NULL_BRUSH));
HGDIOBJ oldPen = SelectObject(dc, pen.get());
path.platformPath()->strokePath(dc, &tr);
SelectObject(dc, oldPen);
} else {
SelectObject(m_data->m_dc, GetStockObject(NULL_BRUSH));
HGDIOBJ oldPen = SelectObject(m_data->m_dc, pen.get());
path.platformPath()->strokePath(m_data->m_dc, &m_data->m_transform);
SelectObject(m_data->m_dc, oldPen);
}
}
void GraphicsContext::fillRect(const FloatRect& r, const Gradient* gradient)
{
if (!m_data->m_opacity)
return;
const Vector<Gradient::ColorStop>& stops = gradient->getStops();
if (stops.isEmpty())
return;
size_t numStops = stops.size();
if (numStops == 1) {
const Gradient::ColorStop& stop = stops.first();
Color color(stop.red, stop.green, stop.blue, stop.alpha);
fillRect(r, color, ColorSpaceDeviceRGB);
return;
}
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect intRect = enclosingIntRect(r);
IntRect rect = m_data->mapRect(intRect);
TransparentLayerDC transparentDC(m_data, rect, &intRect, 255, true);
HDC dc = transparentDC.hdc();
if (!dc)
return;
rect.move(transparentDC.toShift());
FloatPoint fp0 = m_data->mapPoint(gradient->p0());
FloatPoint fp1 = m_data->mapPoint(gradient->p1());
IntPoint p0(stableRound(fp0.x()), stableRound(fp0.y()));
IntPoint p1(stableRound(fp1.x()), stableRound(fp1.y()));
p0 += transparentDC.toShift();
p1 += transparentDC.toShift();
if (gradient->isRadial()) {
if (g_radialGradientFiller) {
// FIXME: don't support 2D scaling at this time
double scale = (m_data->m_transform.a() + m_data->m_transform.d()) * 0.5;
float r0 = gradient->startRadius() * scale;
float r1 = gradient->endRadius() * scale;
g_radialGradientFiller(dc, rect, p0, p1, r0, r1, gradient->getStops());
return;
}
} else if (g_linearGradientFiller) {
g_linearGradientFiller(dc, rect, p0, p1, gradient->getStops());
return;
}
// Simple 1D linear solution that assumes p0 is on the top or left side, and p1 is on the right or bottom side
size_t numRects = (numStops - 1);
Vector<TRIVERTEX, 20> tv;
tv.resize(numRects * 2);
Vector<GRADIENT_RECT, 10> mesh;
mesh.resize(numRects);
int x = rect.x();
int y = rect.y();
int width = rect.width();
int height = rect.height();
FloatSize d = gradient->p1() - gradient->p0();
bool vertical = fabs(d.height()) > fabs(d.width());
for (size_t i = 0; i < numStops; ++i) {
const Gradient::ColorStop& stop = stops[i];
int iTv = i ? 2 * i - 1 : 0;
tv[iTv].Red = stop.red * 0xFFFF;
tv[iTv].Green = stop.green * 0xFFFF;
tv[iTv].Blue = stop.blue * 0xFFFF;
tv[iTv].Alpha = stop.alpha * 0xFFFF;
if (i) {
tv[iTv].x = vertical ? x + width: x + width * stop.stop;
tv[iTv].y = vertical ? y + height * stop.stop : y + height;
mesh[i - 1].UpperLeft = iTv - 1;
mesh[i - 1].LowerRight = iTv;
} else {
tv[iTv].x = x;
tv[iTv].y = y;
}
if (i && i < numRects) {
tv[iTv + 1] = tv[iTv];
if (vertical)
tv[iTv + 1].x = x;
else
tv[iTv + 1].y = y;
}
}
GradientFill(dc, tv.data(), tv.size(), mesh.data(), mesh.size(), vertical ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H);
}
AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();
return m_data->m_transform;
}
void GraphicsContext::fillRect(const FloatRect& rect)
{
savePlatformState();
if (m_state.fillGradient)
fillRect(rect, m_state.fillGradient.get());
else
fillRect(rect, fillColor(), ColorSpaceDeviceRGB);
restorePlatformState();
}
void GraphicsContext::setPlatformShadow(const FloatSize&, float, const Color&, ColorSpace)
{
notImplemented();
}
void GraphicsContext::clearPlatformShadow()
{
notImplemented();
}
InterpolationQuality GraphicsContext::imageInterpolationQuality() const
{
notImplemented();
return InterpolationDefault;
}
void GraphicsContext::setImageInterpolationQuality(InterpolationQuality)
{
notImplemented();
}
static inline bool isCharVisible(UChar c)
{
return c && c != zeroWidthSpace;
}
void GraphicsContext::drawText(const Font& font, const TextRun& run, const FloatPoint& point, int from, int to)
{
if (paintingDisabled() || !fillColor().alpha() || !m_data->m_opacity)
return;
bool mustSupportAlpha = m_data->hasAlpha();
if (!mustSupportAlpha && fillColor().alpha() == 0xFF && m_data->m_opacity >= 1.0) {
font.drawText(this, run, point, from, to);
return;
}
float oldOpacity = m_data->m_opacity;
m_data->m_opacity *= fillColor().alpha() / 255.0;
FloatRect textRect = font.selectionRectForText(run, point, font.fontMetrics().height(), from, to);
textRect.setY(textRect.y() - font.fontMetrics().ascent());
IntRect trRect = enclosingIntRect(m_data->mapRect(textRect));
RECT bmpRect;
AlphaPaintType alphaPaintType = mustSupportAlpha ? AlphaPaintOther : AlphaPaintNone;
if (RefPtr<SharedBitmap> bmp = m_data->getTransparentLayerBitmap(trRect, alphaPaintType, bmpRect, true, mustSupportAlpha)) {
{
GraphicsContext gc(0);
gc.setBitmap(bmp);
gc.scale(FloatSize(m_data->m_transform.a(), m_data->m_transform.d()));
font.drawText(&gc, run, IntPoint(0, font.fontMetrics().ascent()), from, to);
}
unsigned key1;
HDC memDC = bmp->getDC(&key1);
if (memDC) {
m_data->paintBackTransparentLayerBitmap(memDC, bmp.get(), trRect, alphaPaintType, bmpRect);
bmp->releaseDC(memDC, key1);
}
}
m_data->m_opacity = oldOpacity;
}
void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer,
int from, int numGlyphs, const FloatPoint& point)
{
if (!m_data->m_opacity)
return;
for (;;) {
if (!numGlyphs)
return;
if (isCharVisible(*glyphBuffer.glyphs(from)))
break;
++from;
--numGlyphs;
}
double scaleX = m_data->m_transform.a();
double scaleY = m_data->m_transform.d();
int height = fontData->platformData().size() * scaleY;
int width = fontData->avgCharWidth() * scaleX;
if (!height || !width)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
HFONT hFont = height > 1
? fontData->platformData().getScaledFontHandle(height, scaleX == scaleY ? 0 : width)
: 0;
FloatPoint startPoint(point.x(), point.y() - fontData->fontMetrics().ascent());
FloatPoint trPoint = m_data->mapPoint(startPoint);
int y = stableRound(trPoint.y());
Color color = fillColor();
if (!color.alpha())
return;
COLORREF fontColor = RGB(color.red(), color.green(), color.blue());
if (!hFont) {
double offset = trPoint.x();
const GlyphBufferAdvance* advance = glyphBuffer.advances(from);
if (scaleX == 1.)
for (int i = 1; i < numGlyphs; ++i)
offset += (*advance++).width();
else
for (int i = 1; i < numGlyphs; ++i)
offset += (*advance++).width() * scaleX;
offset += width;
OwnPtr<HPEN> hPen = adoptPtr(CreatePen(PS_DASH, 1, fontColor));
HGDIOBJ oldPen = SelectObject(m_data->m_dc, hPen.get());
MoveToEx(m_data->m_dc, stableRound(trPoint.x()), y, 0);
LineTo(m_data->m_dc, stableRound(offset), y);
SelectObject(m_data->m_dc, oldPen);
return;
}
FloatSize shadowOffset;
float shadowBlur = 0;
Color shadowColor;
ColorSpace shadowColorSpace;
bool hasShadow = textDrawingMode() == TextModeFill
&& getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace)
&& shadowColor.alpha();
COLORREF shadowRGBColor;
FloatPoint trShadowPoint;
if (hasShadow) {
shadowRGBColor = RGB(shadowColor.red(), shadowColor.green(), shadowColor.blue());
trShadowPoint = m_data->mapPoint(startPoint + shadowOffset);
}
HGDIOBJ hOldFont = SelectObject(m_data->m_dc, hFont);
COLORREF oldTextColor = GetTextColor(m_data->m_dc);
int oldTextAlign = GetTextAlign(m_data->m_dc);
SetTextAlign(m_data->m_dc, 0);
int oldBkMode = GetBkMode(m_data->m_dc);
SetBkMode(m_data->m_dc, TRANSPARENT);
if (numGlyphs > 1) {
double offset = trPoint.x();
Vector<int, 256> glyphSpace(numGlyphs);
Vector<UChar, 256> text(numGlyphs);
int* curSpace = glyphSpace.data();
UChar* curChar = text.data();
const UChar* srcChar = glyphBuffer.glyphs(from);
const UChar* const srcCharEnd = srcChar + numGlyphs;
*curChar++ = *srcChar++;
int firstOffset = stableRound(offset);
int lastOffset = firstOffset;
const GlyphBufferAdvance* advance = glyphBuffer.advances(from);
// FIXME: ExtTextOut() can flip over each word for RTL languages, even when TA_RTLREADING is off.
// (this can be GDI bug or font driver bug?)
// We are not clear how it processes characters and handles specified spaces. On the other side,
// our glyph buffer is already in the correct order for rendering. So, the solution is that we
// call ExtTextOut() for each single character when the text contains any RTL character.
// This solution is not perfect as it is slower than calling ExtTextOut() one time for all characters.
// Drawing characters one by one may be too slow.
bool drawOneByOne = false;
if (scaleX == 1.) {
for (; srcChar < srcCharEnd; ++srcChar) {
offset += (*advance++).width();
int offsetInt = stableRound(offset);
if (isCharVisible(*srcChar)) {
if (!drawOneByOne && WTF::Unicode::direction(*srcChar) == WTF::Unicode::RightToLeft)
drawOneByOne = true;
*curChar++ = *srcChar;
*curSpace++ = offsetInt - lastOffset;
lastOffset = offsetInt;
}
}
} else {
for (; srcChar < srcCharEnd; ++srcChar) {
offset += (*advance++).width() * scaleX;
int offsetInt = stableRound(offset);
if (isCharVisible(*srcChar)) {
if (!drawOneByOne && WTF::Unicode::direction(*srcChar) == WTF::Unicode::RightToLeft)
drawOneByOne = true;
*curChar++ = *srcChar;
*curSpace++ = offsetInt - lastOffset;
lastOffset = offsetInt;
}
}
}
numGlyphs = curChar - text.data();
if (hasShadow) {
SetTextColor(m_data->m_dc, shadowRGBColor);
if (drawOneByOne) {
int xShadow = firstOffset + stableRound(trShadowPoint.x() - trPoint.x());
int yShadow = stableRound(trShadowPoint.y());
for (int i = 0; i < numGlyphs; ++i) {
ExtTextOut(m_data->m_dc, xShadow, yShadow, 0, NULL, text.data() + i, 1, 0);
xShadow += glyphSpace[i];
}
} else
ExtTextOut(m_data->m_dc, firstOffset + stableRound(trShadowPoint.x() - trPoint.x()), stableRound(trShadowPoint.y()), 0, NULL, text.data(), numGlyphs, glyphSpace.data());
}
SetTextColor(m_data->m_dc, fontColor);
if (drawOneByOne) {
int x = firstOffset;
for (int i = 0; i < numGlyphs; ++i) {
ExtTextOut(m_data->m_dc, x, y, 0, NULL, text.data() + i, 1, 0);
x += glyphSpace[i];
}
} else
ExtTextOut(m_data->m_dc, firstOffset, y, 0, NULL, text.data(), numGlyphs, glyphSpace.data());
} else {
UChar c = *glyphBuffer.glyphs(from);
if (hasShadow) {
SetTextColor(m_data->m_dc, shadowRGBColor);
ExtTextOut(m_data->m_dc, stableRound(trShadowPoint.x()), stableRound(trShadowPoint.y()), 0, NULL, &c, 1, 0);
}
SetTextColor(m_data->m_dc, fontColor);
ExtTextOut(m_data->m_dc, stableRound(trPoint.x()), y, 0, NULL, &c, 1, 0);
}
SetTextAlign(m_data->m_dc, oldTextAlign);
SetTextColor(m_data->m_dc, oldTextColor);
SetBkMode(m_data->m_dc, oldBkMode);
SelectObject(m_data->m_dc, hOldFont);
}
void GraphicsContext::drawFrameControl(const IntRect& rect, unsigned type, unsigned state)
{
if (!m_data->m_opacity)
return;
const int boxWidthBest = 8;
const int boxHeightBest = 8;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect trRect = m_data->mapRect(rect);
TransparentLayerDC transparentDC(m_data, trRect, &rect, 255, true);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
RECT rectWin = trRect;
if ((rectWin.right - rectWin.left) < boxWidthBest) {
RefPtr<SharedBitmap> bmp = SharedBitmap::create(IntSize(boxWidthBest, boxHeightBest), BitmapInfo::BitCount16, true);
SharedBitmap::DCHolder memDC(bmp.get());
if (memDC.get()) {
RECT tempRect = {0, 0, boxWidthBest, boxHeightBest};
DrawFrameControl(memDC.get(), &tempRect, type, state);
::StretchBlt(dc, rectWin.left, rectWin.top, rectWin.right - rectWin.left, rectWin.bottom - rectWin.top, memDC.get(), 0, 0, boxWidthBest, boxHeightBest, SRCCOPY);
return;
}
}
DrawFrameControl(dc, &rectWin, type, state);
}
void GraphicsContext::drawFocusRect(const IntRect& rect)
{
if (!m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect trRect = m_data->mapRect(rect);
TransparentLayerDC transparentDC(m_data, trRect, &rect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
RECT rectWin = trRect;
DrawFocusRect(dc, &rectWin);
}
void GraphicsContext::paintTextField(const IntRect& rect, unsigned state)
{
if (!m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect trRect = m_data->mapRect(rect);
TransparentLayerDC transparentDC(m_data, trRect, &rect);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
RECT rectWin = trRect;
DrawEdge(dc, &rectWin, EDGE_ETCHED, BF_RECT | BF_ADJUST);
FillRect(dc, &rectWin, reinterpret_cast<HBRUSH>(((state & DFCS_INACTIVE) ? COLOR_BTNFACE : COLOR_WINDOW) + 1));
}
void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
{
if (!m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect dstRect = m_data->mapRect(dstRectIn);
TransparentLayerDC transparentDC(m_data, dstRect, &dstRectIn, 255, true);
HDC dc = transparentDC.hdc();
if (!dc)
return;
dstRect.move(transparentDC.toShift());
bmp->draw(dc, dstRect, srcRect, compositeOp, blendMode);
if (bmp->is16bit())
transparentDC.fillAlphaChannel();
}
void GraphicsContext::drawBitmapPattern(SharedBitmap* bmp, const FloatRect& tileRectIn, const AffineTransform& patternTransform,
const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRectIn, const IntSize& origSourceSize)
{
if (!m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect intDstRect = enclosingIntRect(destRectIn);
IntRect trRect = m_data->mapRect(intDstRect);
TransparentLayerDC transparentDC(m_data, trRect, &intDstRect, 255, true);
HDC dc = transparentDC.hdc();
if (!dc)
return;
trRect.move(transparentDC.toShift());
FloatRect movedDstRect = m_data->m_transform.inverse().mapRect(FloatRect(trRect));
FloatSize moved(movedDstRect.location() - destRectIn.location());
AffineTransform transform = m_data->m_transform;
transform.translate(moved.width(), moved.height());
bmp->drawPattern(dc, transform, tileRectIn, patternTransform, phase, styleColorSpace, op, destRectIn, origSourceSize);
if (!bmp->hasAlpha())
transparentDC.fillAlphaChannel();
}
void GraphicsContext::drawIcon(HICON icon, const IntRect& dstRectIn, UINT flags)
{
if (!m_data->m_opacity)
return;
ScopeDCProvider dcProvider(m_data);
if (!m_data->m_dc)
return;
IntRect dstRect = m_data->mapRect(dstRectIn);
TransparentLayerDC transparentDC(m_data, dstRect, &dstRectIn, 255, true);
HDC dc = transparentDC.hdc();
if (!dc)
return;
dstRect.move(transparentDC.toShift());
DrawIconEx(dc, dstRect.x(), dstRect.y(), icon, dstRect.width(), dstRect.height(), 0, NULL, flags);
}
void GraphicsContext::setPlatformShouldAntialias(bool)
{
notImplemented();
}
void GraphicsContext::setLineDash(const DashArray&, float)
{
notImplemented();
}
void GraphicsContext::clipPath(const Path&, WindRule)
{
notImplemented();
}
} // namespace WebCore
| bsd-3-clause |
keithroe/vtkoptix | ThirdParty/freetype/vtkfreetype/src/truetype/truetype.c | 376 | 1703 | /***************************************************************************/
/* */
/* truetype.c */
/* */
/* FreeType TrueType driver component (body only). */
/* */
/* Copyright 1996-2001, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "ttpic.c"
#include "ttdriver.c" /* driver interface */
#include "ttpload.c" /* tables loader */
#include "ttgload.c" /* glyph loader */
#include "ttobjs.c" /* object manager */
#ifdef TT_USE_BYTECODE_INTERPRETER
#include "ttinterp.c"
#endif
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include "ttgxvar.c" /* gx distortable font */
#endif
/* END */
| bsd-3-clause |
dcourtois/premake-core | contrib/lua/src/ltablib.c | 124 | 13550 | /*
** $Id: ltablib.c,v 1.93.1.1 2017/04/19 17:20:42 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
#define ltablib_c
#define LUA_LIB
#include "lprefix.h"
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
/*
** Operations that an object must define to mimic a table
** (some functions only need some of them)
*/
#define TAB_R 1 /* read */
#define TAB_W 2 /* write */
#define TAB_L 4 /* length */
#define TAB_RW (TAB_R | TAB_W) /* read/write */
#define aux_getn(L,n,w) (checktab(L, n, (w) | TAB_L), luaL_len(L, n))
static int checkfield (lua_State *L, const char *key, int n) {
lua_pushstring(L, key);
return (lua_rawget(L, -n) != LUA_TNIL);
}
/*
** Check that 'arg' either is a table or can behave like one (that is,
** has a metatable with the required metamethods)
*/
static void checktab (lua_State *L, int arg, int what) {
if (lua_type(L, arg) != LUA_TTABLE) { /* is it not a table? */
int n = 1; /* number of elements to pop */
if (lua_getmetatable(L, arg) && /* must have metatable */
(!(what & TAB_R) || checkfield(L, "__index", ++n)) &&
(!(what & TAB_W) || checkfield(L, "__newindex", ++n)) &&
(!(what & TAB_L) || checkfield(L, "__len", ++n))) {
lua_pop(L, n); /* pop metatable and tested metamethods */
}
else
luaL_checktype(L, arg, LUA_TTABLE); /* force an error */
}
}
#if defined(LUA_COMPAT_MAXN)
static int maxn (lua_State *L) {
lua_Number max = 0;
luaL_checktype(L, 1, LUA_TTABLE);
lua_pushnil(L); /* first key */
while (lua_next(L, 1)) {
lua_pop(L, 1); /* remove value */
if (lua_type(L, -1) == LUA_TNUMBER) {
lua_Number v = lua_tonumber(L, -1);
if (v > max) max = v;
}
}
lua_pushnumber(L, max);
return 1;
}
#endif
static int tinsert (lua_State *L) {
lua_Integer e = aux_getn(L, 1, TAB_RW) + 1; /* first empty element */
lua_Integer pos; /* where to insert new element */
switch (lua_gettop(L)) {
case 2: { /* called with only 2 arguments */
pos = e; /* insert new element at the end */
break;
}
case 3: {
lua_Integer i;
pos = luaL_checkinteger(L, 2); /* 2nd argument is the position */
luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds");
for (i = e; i > pos; i--) { /* move up elements */
lua_geti(L, 1, i - 1);
lua_seti(L, 1, i); /* t[i] = t[i - 1] */
}
break;
}
default: {
return luaL_error(L, "wrong number of arguments to 'insert'");
}
}
lua_seti(L, 1, pos); /* t[pos] = v */
return 0;
}
static int tremove (lua_State *L) {
lua_Integer size = aux_getn(L, 1, TAB_RW);
lua_Integer pos = luaL_optinteger(L, 2, size);
if (pos != size) /* validate 'pos' if given */
luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds");
lua_geti(L, 1, pos); /* result = t[pos] */
for ( ; pos < size; pos++) {
lua_geti(L, 1, pos + 1);
lua_seti(L, 1, pos); /* t[pos] = t[pos + 1] */
}
lua_pushnil(L);
lua_seti(L, 1, pos); /* t[pos] = nil */
return 1;
}
/*
** Copy elements (1[f], ..., 1[e]) into (tt[t], tt[t+1], ...). Whenever
** possible, copy in increasing order, which is better for rehashing.
** "possible" means destination after original range, or smaller
** than origin, or copying to another table.
*/
static int tmove (lua_State *L) {
lua_Integer f = luaL_checkinteger(L, 2);
lua_Integer e = luaL_checkinteger(L, 3);
lua_Integer t = luaL_checkinteger(L, 4);
int tt = !lua_isnoneornil(L, 5) ? 5 : 1; /* destination table */
checktab(L, 1, TAB_R);
checktab(L, tt, TAB_W);
if (e >= f) { /* otherwise, nothing to move */
lua_Integer n, i;
luaL_argcheck(L, f > 0 || e < LUA_MAXINTEGER + f, 3,
"too many elements to move");
n = e - f + 1; /* number of elements to move */
luaL_argcheck(L, t <= LUA_MAXINTEGER - n + 1, 4,
"destination wrap around");
if (t > e || t <= f || (tt != 1 && !lua_compare(L, 1, tt, LUA_OPEQ))) {
for (i = 0; i < n; i++) {
lua_geti(L, 1, f + i);
lua_seti(L, tt, t + i);
}
}
else {
for (i = n - 1; i >= 0; i--) {
lua_geti(L, 1, f + i);
lua_seti(L, tt, t + i);
}
}
}
lua_pushvalue(L, tt); /* return destination table */
return 1;
}
static void addfield (lua_State *L, luaL_Buffer *b, lua_Integer i) {
lua_geti(L, 1, i);
if (!lua_isstring(L, -1))
luaL_error(L, "invalid value (%s) at index %d in table for 'concat'",
luaL_typename(L, -1), i);
luaL_addvalue(b);
}
static int tconcat (lua_State *L) {
luaL_Buffer b;
lua_Integer last = aux_getn(L, 1, TAB_R);
size_t lsep;
const char *sep = luaL_optlstring(L, 2, "", &lsep);
lua_Integer i = luaL_optinteger(L, 3, 1);
last = luaL_optinteger(L, 4, last);
luaL_buffinit(L, &b);
for (; i < last; i++) {
addfield(L, &b, i);
luaL_addlstring(&b, sep, lsep);
}
if (i == last) /* add last value (if interval was not empty) */
addfield(L, &b, i);
luaL_pushresult(&b);
return 1;
}
/*
** {======================================================
** Pack/unpack
** =======================================================
*/
static int pack (lua_State *L) {
int i;
int n = lua_gettop(L); /* number of elements to pack */
lua_createtable(L, n, 1); /* create result table */
lua_insert(L, 1); /* put it at index 1 */
for (i = n; i >= 1; i--) /* assign elements */
lua_seti(L, 1, i);
lua_pushinteger(L, n);
lua_setfield(L, 1, "n"); /* t.n = number of elements */
return 1; /* return table */
}
static int unpack (lua_State *L) {
lua_Unsigned n;
lua_Integer i = luaL_optinteger(L, 2, 1);
lua_Integer e = luaL_opt(L, luaL_checkinteger, 3, luaL_len(L, 1));
if (i > e) return 0; /* empty range */
n = (lua_Unsigned)e - i; /* number of elements minus 1 (avoid overflows) */
if (n >= (unsigned int)INT_MAX || !lua_checkstack(L, (int)(++n)))
return luaL_error(L, "too many results to unpack");
for (; i < e; i++) { /* push arg[i..e - 1] (to avoid overflows) */
lua_geti(L, 1, i);
}
lua_geti(L, 1, e); /* push last element */
return (int)n;
}
/* }====================================================== */
/*
** {======================================================
** Quicksort
** (based on 'Algorithms in MODULA-3', Robert Sedgewick;
** Addison-Wesley, 1993.)
** =======================================================
*/
/* type for array indices */
typedef unsigned int IdxT;
/*
** Produce a "random" 'unsigned int' to randomize pivot choice. This
** macro is used only when 'sort' detects a big imbalance in the result
** of a partition. (If you don't want/need this "randomness", ~0 is a
** good choice.)
*/
#if !defined(l_randomizePivot) /* { */
#include <time.h>
/* size of 'e' measured in number of 'unsigned int's */
#define sof(e) (sizeof(e) / sizeof(unsigned int))
/*
** Use 'time' and 'clock' as sources of "randomness". Because we don't
** know the types 'clock_t' and 'time_t', we cannot cast them to
** anything without risking overflows. A safe way to use their values
** is to copy them to an array of a known type and use the array values.
*/
static unsigned int l_randomizePivot (void) {
clock_t c = clock();
time_t t = time(NULL);
unsigned int buff[sof(c) + sof(t)];
unsigned int i, rnd = 0;
memcpy(buff, &c, sof(c) * sizeof(unsigned int));
memcpy(buff + sof(c), &t, sof(t) * sizeof(unsigned int));
for (i = 0; i < sof(buff); i++)
rnd += buff[i];
return rnd;
}
#endif /* } */
/* arrays larger than 'RANLIMIT' may use randomized pivots */
#define RANLIMIT 100u
static void set2 (lua_State *L, IdxT i, IdxT j) {
lua_seti(L, 1, i);
lua_seti(L, 1, j);
}
/*
** Return true iff value at stack index 'a' is less than the value at
** index 'b' (according to the order of the sort).
*/
static int sort_comp (lua_State *L, int a, int b) {
if (lua_isnil(L, 2)) /* no function? */
return lua_compare(L, a, b, LUA_OPLT); /* a < b */
else { /* function */
int res;
lua_pushvalue(L, 2); /* push function */
lua_pushvalue(L, a-1); /* -1 to compensate function */
lua_pushvalue(L, b-2); /* -2 to compensate function and 'a' */
lua_call(L, 2, 1); /* call function */
res = lua_toboolean(L, -1); /* get result */
lua_pop(L, 1); /* pop result */
return res;
}
}
/*
** Does the partition: Pivot P is at the top of the stack.
** precondition: a[lo] <= P == a[up-1] <= a[up],
** so it only needs to do the partition from lo + 1 to up - 2.
** Pos-condition: a[lo .. i - 1] <= a[i] == P <= a[i + 1 .. up]
** returns 'i'.
*/
static IdxT partition (lua_State *L, IdxT lo, IdxT up) {
IdxT i = lo; /* will be incremented before first use */
IdxT j = up - 1; /* will be decremented before first use */
/* loop invariant: a[lo .. i] <= P <= a[j .. up] */
for (;;) {
/* next loop: repeat ++i while a[i] < P */
while (lua_geti(L, 1, ++i), sort_comp(L, -1, -2)) {
if (i == up - 1) /* a[i] < P but a[up - 1] == P ?? */
luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[i] */
}
/* after the loop, a[i] >= P and a[lo .. i - 1] < P */
/* next loop: repeat --j while P < a[j] */
while (lua_geti(L, 1, --j), sort_comp(L, -3, -1)) {
if (j < i) /* j < i but a[j] > P ?? */
luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[j] */
}
/* after the loop, a[j] <= P and a[j + 1 .. up] >= P */
if (j < i) { /* no elements out of place? */
/* a[lo .. i - 1] <= P <= a[j + 1 .. i .. up] */
lua_pop(L, 1); /* pop a[j] */
/* swap pivot (a[up - 1]) with a[i] to satisfy pos-condition */
set2(L, up - 1, i);
return i;
}
/* otherwise, swap a[i] - a[j] to restore invariant and repeat */
set2(L, i, j);
}
}
/*
** Choose an element in the middle (2nd-3th quarters) of [lo,up]
** "randomized" by 'rnd'
*/
static IdxT choosePivot (IdxT lo, IdxT up, unsigned int rnd) {
IdxT r4 = (up - lo) / 4; /* range/4 */
IdxT p = rnd % (r4 * 2) + (lo + r4);
lua_assert(lo + r4 <= p && p <= up - r4);
return p;
}
/*
** QuickSort algorithm (recursive function)
*/
static void auxsort (lua_State *L, IdxT lo, IdxT up,
unsigned int rnd) {
while (lo < up) { /* loop for tail recursion */
IdxT p; /* Pivot index */
IdxT n; /* to be used later */
/* sort elements 'lo', 'p', and 'up' */
lua_geti(L, 1, lo);
lua_geti(L, 1, up);
if (sort_comp(L, -1, -2)) /* a[up] < a[lo]? */
set2(L, lo, up); /* swap a[lo] - a[up] */
else
lua_pop(L, 2); /* remove both values */
if (up - lo == 1) /* only 2 elements? */
return; /* already sorted */
if (up - lo < RANLIMIT || rnd == 0) /* small interval or no randomize? */
p = (lo + up)/2; /* middle element is a good pivot */
else /* for larger intervals, it is worth a random pivot */
p = choosePivot(lo, up, rnd);
lua_geti(L, 1, p);
lua_geti(L, 1, lo);
if (sort_comp(L, -2, -1)) /* a[p] < a[lo]? */
set2(L, p, lo); /* swap a[p] - a[lo] */
else {
lua_pop(L, 1); /* remove a[lo] */
lua_geti(L, 1, up);
if (sort_comp(L, -1, -2)) /* a[up] < a[p]? */
set2(L, p, up); /* swap a[up] - a[p] */
else
lua_pop(L, 2);
}
if (up - lo == 2) /* only 3 elements? */
return; /* already sorted */
lua_geti(L, 1, p); /* get middle element (Pivot) */
lua_pushvalue(L, -1); /* push Pivot */
lua_geti(L, 1, up - 1); /* push a[up - 1] */
set2(L, p, up - 1); /* swap Pivot (a[p]) with a[up - 1] */
p = partition(L, lo, up);
/* a[lo .. p - 1] <= a[p] == P <= a[p + 1 .. up] */
if (p - lo < up - p) { /* lower interval is smaller? */
auxsort(L, lo, p - 1, rnd); /* call recursively for lower interval */
n = p - lo; /* size of smaller interval */
lo = p + 1; /* tail call for [p + 1 .. up] (upper interval) */
}
else {
auxsort(L, p + 1, up, rnd); /* call recursively for upper interval */
n = up - p; /* size of smaller interval */
up = p - 1; /* tail call for [lo .. p - 1] (lower interval) */
}
if ((up - lo) / 128 > n) /* partition too imbalanced? */
rnd = l_randomizePivot(); /* try a new randomization */
} /* tail call auxsort(L, lo, up, rnd) */
}
static int sort (lua_State *L) {
lua_Integer n = aux_getn(L, 1, TAB_RW);
if (n > 1) { /* non-trivial interval? */
luaL_argcheck(L, n < INT_MAX, 1, "array too big");
if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */
luaL_checktype(L, 2, LUA_TFUNCTION); /* must be a function */
lua_settop(L, 2); /* make sure there are two arguments */
auxsort(L, 1, (IdxT)n, 0);
}
return 0;
}
/* }====================================================== */
static const luaL_Reg tab_funcs[] = {
{"concat", tconcat},
#if defined(LUA_COMPAT_MAXN)
{"maxn", maxn},
#endif
{"insert", tinsert},
{"pack", pack},
{"unpack", unpack},
{"remove", tremove},
{"move", tmove},
{"sort", sort},
{NULL, NULL}
};
LUAMOD_API int luaopen_table (lua_State *L) {
luaL_newlib(L, tab_funcs);
#if defined(LUA_COMPAT_UNPACK)
/* _G.unpack = table.unpack */
lua_getfield(L, -1, "unpack");
lua_setglobal(L, "unpack");
#endif
return 1;
}
| bsd-3-clause |
woodscn/scipy | scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/dsgets.f | 141 | 7453 | c-----------------------------------------------------------------------
c\BeginDoc
c
c\Name: dsgets
c
c\Description:
c Given the eigenvalues of the symmetric tridiagonal matrix H,
c computes the NP shifts AMU that are zeros of the polynomial of
c degree NP which filters out components of the unwanted eigenvectors
c corresponding to the AMU's based on some given criteria.
c
c NOTE: This is called even in the case of user specified shifts in
c order to sort the eigenvalues, and error bounds of H for later use.
c
c\Usage:
c call dsgets
c ( ISHIFT, WHICH, KEV, NP, RITZ, BOUNDS, SHIFTS )
c
c\Arguments
c ISHIFT Integer. (INPUT)
c Method for selecting the implicit shifts at each iteration.
c ISHIFT = 0: user specified shifts
c ISHIFT = 1: exact shift with respect to the matrix H.
c
c WHICH Character*2. (INPUT)
c Shift selection criteria.
c 'LM' -> KEV eigenvalues of largest magnitude are retained.
c 'SM' -> KEV eigenvalues of smallest magnitude are retained.
c 'LA' -> KEV eigenvalues of largest value are retained.
c 'SA' -> KEV eigenvalues of smallest value are retained.
c 'BE' -> KEV eigenvalues, half from each end of the spectrum.
c If KEV is odd, compute one more from the high end.
c
c KEV Integer. (INPUT)
c KEV+NP is the size of the matrix H.
c
c NP Integer. (INPUT)
c Number of implicit shifts to be computed.
c
c RITZ Double precision array of length KEV+NP. (INPUT/OUTPUT)
c On INPUT, RITZ contains the eigenvalues of H.
c On OUTPUT, RITZ are sorted so that the unwanted eigenvalues
c are in the first NP locations and the wanted part is in
c the last KEV locations. When exact shifts are selected, the
c unwanted part corresponds to the shifts to be applied.
c
c BOUNDS Double precision array of length KEV+NP. (INPUT/OUTPUT)
c Error bounds corresponding to the ordering in RITZ.
c
c SHIFTS Double precision array of length NP. (INPUT/OUTPUT)
c On INPUT: contains the user specified shifts if ISHIFT = 0.
c On OUTPUT: contains the shifts sorted into decreasing order
c of magnitude with respect to the Ritz estimates contained in
c BOUNDS. If ISHIFT = 0, SHIFTS is not modified on exit.
c
c\EndDoc
c
c-----------------------------------------------------------------------
c
c\BeginLib
c
c\Local variables:
c xxxxxx real
c
c\Routines called:
c dsortr ARPACK utility sorting routine.
c ivout ARPACK utility routine that prints integers.
c arscnd ARPACK utility routine for timing.
c dvout ARPACK utility routine that prints vectors.
c dcopy Level 1 BLAS that copies one vector to another.
c dswap Level 1 BLAS that swaps the contents of two vectors.
c
c\Author
c Danny Sorensen Phuong Vu
c Richard Lehoucq CRPC / Rice University
c Dept. of Computational & Houston, Texas
c Applied Mathematics
c Rice University
c Houston, Texas
c
c\Revision history:
c xx/xx/93: Version ' 2.1'
c
c\SCCS Information: @(#)
c FILE: sgets.F SID: 2.4 DATE OF SID: 4/19/96 RELEASE: 2
c
c\Remarks
c
c\EndLib
c
c-----------------------------------------------------------------------
c
subroutine dsgets ( ishift, which, kev, np, ritz, bounds, shifts )
c
c %----------------------------------------------------%
c | Include files for debugging and timing information |
c %----------------------------------------------------%
c
include 'debug.h'
include 'stat.h'
c
c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
integer ishift, kev, np
c
c %-----------------%
c | Array Arguments |
c %-----------------%
c
Double precision
& bounds(kev+np), ritz(kev+np), shifts(np)
c
c %------------%
c | Parameters |
c %------------%
c
Double precision
& one, zero
parameter (one = 1.0D+0, zero = 0.0D+0)
c
c %---------------%
c | Local Scalars |
c %---------------%
c
integer kevd2, msglvl
c
c %----------------------%
c | External Subroutines |
c %----------------------%
c
external dswap, dcopy, dsortr, arscnd
c
c %---------------------%
c | Intrinsic Functions |
c %---------------------%
c
intrinsic max, min
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
c %-------------------------------%
c | Initialize timing statistics |
c | & message level for debugging |
c %-------------------------------%
c
call arscnd (t0)
msglvl = msgets
c
if (which .eq. 'BE') then
c
c %-----------------------------------------------------%
c | Both ends of the spectrum are requested. |
c | Sort the eigenvalues into algebraically increasing |
c | order first then swap high end of the spectrum next |
c | to low end in appropriate locations. |
c | NOTE: when np < floor(kev/2) be careful not to swap |
c | overlapping locations. |
c %-----------------------------------------------------%
c
call dsortr ('LA', .true., kev+np, ritz, bounds)
kevd2 = kev / 2
if ( kev .gt. 1 ) then
call dswap ( min(kevd2,np), ritz, 1,
& ritz( max(kevd2,np)+1 ), 1)
call dswap ( min(kevd2,np), bounds, 1,
& bounds( max(kevd2,np)+1 ), 1)
end if
c
else
c
c %----------------------------------------------------%
c | LM, SM, LA, SA case. |
c | Sort the eigenvalues of H into the desired order |
c | and apply the resulting order to BOUNDS. |
c | The eigenvalues are sorted so that the wanted part |
c | are always in the last KEV locations. |
c %----------------------------------------------------%
c
call dsortr (which, .true., kev+np, ritz, bounds)
end if
c
if (ishift .eq. 1 .and. np .gt. 0) then
c
c %-------------------------------------------------------%
c | Sort the unwanted Ritz values used as shifts so that |
c | the ones with largest Ritz estimates are first. |
c | This will tend to minimize the effects of the |
c | forward instability of the iteration when the shifts |
c | are applied in subroutine dsapps. |
c %-------------------------------------------------------%
c
call dsortr ('SM', .true., np, bounds, ritz)
call dcopy (np, ritz, 1, shifts, 1)
end if
c
call arscnd (t1)
tsgets = tsgets + (t1 - t0)
c
if (msglvl .gt. 0) then
call ivout (logfil, 1, kev, ndigit, '_sgets: KEV is')
call ivout (logfil, 1, np, ndigit, '_sgets: NP is')
call dvout (logfil, kev+np, ritz, ndigit,
& '_sgets: Eigenvalues of current H matrix')
call dvout (logfil, kev+np, bounds, ndigit,
& '_sgets: Associated Ritz estimates')
end if
c
return
c
c %---------------%
c | End of dsgets |
c %---------------%
c
end
| bsd-3-clause |
alvieboy/xtc-base | newlib/newlib-2.0.0/newlib/libc/iconv/ccs/cns11643_plane2.c | 143 | 612798 | /*
* This file was generated automatically - don't edit it.
* File contains iconv CCS tables for cns11643_plane2 encoding.
*/
#include "ccsbi.h"
#if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \
|| defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2)
#include <_ansi.h>
#include <sys/types.h>
#include <sys/param.h>
#include "ccs.h"
#include "ccsnames.h"
/*
* 16-bit cns11643_plane2 -> UCS speed-optimized table (42496 bytes).
* ======================================================================
*/
#if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \
&& !(defined (TABLE_USE_SIZE_OPTIMIZATION))
static _CONST __uint16_t
to_ucs_speed_cns11643_plane2[] =
{
/* Heading Block */
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,0x0100,0x0200,0x0300,0x0400,0x0500,0x0600,0x0700,
0x0800,0x0900,0x0A00,0x0B00,0x0C00,0x0D00,0x0E00,0x0F00,
0x1000,0x1100,0x1200,0x1300,0x1400,0x1500,0x1600,0x1700,
0x1800,0x1900,0x1A00,0x1B00,0x1C00,0x1D00,0x1E00,0x1F00,
0x2000,0x2100,0x2200,0x2300,0x2400,0x2500,0x2600,0x2700,
0x2800,0x2900,0x2A00,0x2B00,0x2C00,0x2D00,0x2E00,0x2F00,
0x3000,0x3100,0x3200,0x3300,0x3400,0x3500,0x3600,0x3700,
0x3800,0x3900,0x3A00,0x3B00,0x3C00,0x3D00,0x3E00,0x3F00,
0x4000,0x4100,0x4200,0x4300,0x4400,0x4500,0x4600,0x4700,
0x4800,0x4900,0x4A00,0x4B00,0x4C00,0x4D00,0x4E00,0x4F00,
0x5000,0x5100,0x5200,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
/* Block 34, Array index 0x0100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4E42,0x4E5C,0x51F5,0x531A,0x5382,0x4E07,0x4E0C,
0x4E47,0x4E8D,0x56D7,0x5C6E,0x5F73,0x4E0F,0x5187,0x4E0E,
0x4E2E,0x4E93,0x4EC2,0x4EC9,0x4EC8,0x5198,0x52FC,0x536C,
0x53B9,0x5720,0x5903,0x592C,0x5C10,0x5DFF,0x65E1,0x6BB3,
0x6BCC,0x6C14,0x723F,0x4E31,0x4E3C,0x4EE8,0x4EDC,0x4EE9,
0x4EE1,0x4EDD,0x4EDA,0x520C,0x5209,0x531C,0x534C,0x5722,
0x5723,0x5917,0x592F,0x5B81,0x5B84,0x5C12,0x5C3B,0x5C74,
0x5C73,0x5E04,0x5E80,0x5E82,0x5FC9,0x6209,0x6250,0x6C15,
0x6C36,0x6C43,0x6C3F,0x6C3B,0x72AE,0x72B0,0x738A,0x79B8,
0x808A,0x961E,0x4F0E,0x4F18,0x4F2C,0x4EF5,0x4F14,0x4EF1,
0x4F00,0x4EF7,0x4F08,0x4F1D,0x4F02,0x4F05,0x4F22,0x4F13,
0x4F04,0x4EF4,0x4F12,0x51B1,0x5213,0x5210,0x52A6,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 35, Array index 0x0200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5322,0x531F,0x534D,0x538A,0x5407,0x56E1,0x56DF,
0x572E,0x572A,0x5734,0x593C,0x5980,0x597C,0x5985,0x597B,
0x597E,0x5977,0x597F,0x5B56,0x5C15,0x5C25,0x5C7C,0x5C7A,
0x5C7B,0x5C7E,0x5DDF,0x5E75,0x5E84,0x5F02,0x5F1A,0x5F74,
0x5FD5,0x5FD4,0x5FCF,0x625C,0x625E,0x6264,0x6261,0x6266,
0x6262,0x6259,0x6260,0x625A,0x6265,0x6537,0x65EF,0x65EE,
0x673E,0x6739,0x6738,0x673B,0x673A,0x673F,0x673C,0x6733,
0x6C18,0x6C46,0x6C52,0x6C5C,0x6C4F,0x6C4A,0x6C54,0x6C4B,
0x6C4C,0x7071,0x725E,0x72B4,0x72B5,0x738E,0x752A,0x767F,
0x7A75,0x7F51,0x8278,0x827C,0x8280,0x827D,0x827F,0x864D,
0x897E,0x9099,0x9097,0x9098,0x909B,0x9094,0x9622,0x9624,
0x9620,0x9623,0x4F56,0x4F3B,0x4F62,0x4F49,0x4F53,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 36, Array index 0x0300 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4F64,0x4F3E,0x4F67,0x4F52,0x4F5F,0x4F41,0x4F58,
0x4F2D,0x4F33,0x4F3F,0x4F61,0x518F,0x51B9,0x521C,0x521E,
0x5221,0x52AD,0x52AE,0x5309,0x5363,0x5372,0x538E,0x538F,
0x5430,0x5437,0x542A,0x5454,0x5445,0x5419,0x541C,0x5425,
0x5418,0x543D,0x544F,0x5441,0x5428,0x5424,0x5447,0x56EE,
0x56E7,0x56E5,0x5741,0x5745,0x574C,0x5749,0x574B,0x5752,
0x5906,0x5940,0x59A6,0x5998,0x59A0,0x5997,0x598E,0x59A2,
0x5990,0x598F,0x59A7,0x59A1,0x5B8E,0x5B92,0x5C28,0x5C2A,
0x5C8D,0x5C8F,0x5C88,0x5C8B,0x5C89,0x5C92,0x5C8A,0x5C86,
0x5C93,0x5C95,0x5DE0,0x5E0A,0x5E0E,0x5E8B,0x5E89,0x5E8C,
0x5E88,0x5E8D,0x5F05,0x5F1D,0x5F78,0x5F76,0x5FD2,0x5FD1,
0x5FD0,0x5FED,0x5FE8,0x5FEE,0x5FF3,0x5FE1,0x5FE4,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 37, Array index 0x0400 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5FE3,0x5FFA,0x5FEF,0x5FF7,0x5FFB,0x6000,0x5FF4,
0x623A,0x6283,0x628C,0x628E,0x628F,0x6294,0x6287,0x6271,
0x627B,0x627A,0x6270,0x6281,0x6288,0x6277,0x627D,0x6272,
0x6274,0x65F0,0x65F4,0x65F3,0x65F2,0x65F5,0x6745,0x6747,
0x6759,0x6755,0x674C,0x6748,0x675D,0x674D,0x675A,0x674B,
0x6BD0,0x6C19,0x6C1A,0x6C78,0x6C67,0x6C6B,0x6C84,0x6C8B,
0x6C8F,0x6C71,0x6C6F,0x6C69,0x6C9A,0x6C6D,0x6C87,0x6C95,
0x6C9C,0x6C66,0x6C73,0x6C65,0x6C7B,0x6C8E,0x7074,0x707A,
0x7263,0x72BF,0x72BD,0x72C3,0x72C6,0x72C1,0x72BA,0x72C5,
0x7395,0x7397,0x7393,0x7394,0x7392,0x753A,0x7539,0x7594,
0x7595,0x7681,0x793D,0x8034,0x8095,0x8099,0x8090,0x8092,
0x809C,0x8290,0x828F,0x8285,0x828E,0x8291,0x8293,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 38, Array index 0x0500 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x828A,0x8283,0x8284,0x8C78,0x8FC9,0x8FBF,0x909F,
0x90A1,0x90A5,0x909E,0x90A7,0x90A0,0x9630,0x9628,0x962F,
0x962D,0x4E33,0x4F98,0x4F7C,0x4F85,0x4F7D,0x4F80,0x4F87,
0x4F76,0x4F74,0x4F89,0x4F84,0x4F77,0x4F4C,0x4F97,0x4F6A,
0x4F9A,0x4F79,0x4F81,0x4F78,0x4F90,0x4F9C,0x4F94,0x4F9E,
0x4F92,0x4F82,0x4F95,0x4F6B,0x4F6E,0x519E,0x51BC,0x51BE,
0x5235,0x5232,0x5233,0x5246,0x5231,0x52BC,0x530A,0x530B,
0x533C,0x5392,0x5394,0x5487,0x547F,0x5481,0x5491,0x5482,
0x5488,0x546B,0x547A,0x547E,0x5465,0x546C,0x5474,0x5466,
0x548D,0x546F,0x5461,0x5460,0x5498,0x5463,0x5467,0x5464,
0x56F7,0x56F9,0x576F,0x5772,0x576D,0x576B,0x5771,0x5770,
0x5776,0x5780,0x5775,0x577B,0x5773,0x5774,0x5762,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 39, Array index 0x0600 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5768,0x577D,0x590C,0x5945,0x59B5,0x59BA,0x59CF,
0x59CE,0x59B2,0x59CC,0x59C1,0x59B6,0x59BC,0x59C3,0x59D6,
0x59B1,0x59BD,0x59C0,0x59C8,0x59B4,0x59C7,0x5B62,0x5B65,
0x5B93,0x5B95,0x5C44,0x5C47,0x5CAE,0x5CA4,0x5CA0,0x5CB5,
0x5CAF,0x5CA8,0x5CAC,0x5C9F,0x5CA3,0x5CAD,0x5CA2,0x5CAA,
0x5CA7,0x5C9D,0x5CA5,0x5CB6,0x5CB0,0x5CA6,0x5E17,0x5E14,
0x5E19,0x5F28,0x5F22,0x5F23,0x5F24,0x5F54,0x5F82,0x5F7E,
0x5F7D,0x5FDE,0x5FE5,0x602D,0x6026,0x6019,0x6032,0x600B,
0x6034,0x600A,0x6017,0x6033,0x601A,0x601E,0x602C,0x6022,
0x600D,0x6010,0x602E,0x6013,0x6011,0x600C,0x6009,0x601C,
0x6214,0x623D,0x62AD,0x62B4,0x62D1,0x62BE,0x62AA,0x62B6,
0x62CA,0x62AE,0x62B3,0x62AF,0x62BB,0x62A9,0x62B0,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 40, Array index 0x0700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x62B8,0x653D,0x65A8,0x65BB,0x6609,0x65FC,0x6604,
0x6612,0x6608,0x65FB,0x6603,0x660B,0x660D,0x6605,0x65FD,
0x6611,0x6610,0x66F6,0x670A,0x6785,0x676C,0x678E,0x6792,
0x6776,0x677B,0x6798,0x6786,0x6784,0x6774,0x678D,0x678C,
0x677A,0x679F,0x6791,0x6799,0x6783,0x677D,0x6781,0x6778,
0x6779,0x6794,0x6B25,0x6B80,0x6B7E,0x6BDE,0x6C1D,0x6C93,
0x6CEC,0x6CEB,0x6CEE,0x6CD9,0x6CB6,0x6CD4,0x6CAD,0x6CE7,
0x6CB7,0x6CD0,0x6CC2,0x6CBA,0x6CC3,0x6CC6,0x6CED,0x6CF2,
0x6CD2,0x6CDD,0x6CB4,0x6C8A,0x6C9D,0x6C80,0x6CDE,0x6CC0,
0x6D30,0x6CCD,0x6CC7,0x6CB0,0x6CF9,0x6CCF,0x6CE9,0x6CD1,
0x7094,0x7098,0x7085,0x7093,0x7086,0x7084,0x7091,0x7096,
0x7082,0x709A,0x7083,0x726A,0x72D6,0x72CB,0x72D8,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 41, Array index 0x0800 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x72C9,0x72DC,0x72D2,0x72D4,0x72DA,0x72CC,0x72D1,
0x73A4,0x73A1,0x73AD,0x73A6,0x73A2,0x73A0,0x73AC,0x739D,
0x74DD,0x74E8,0x753F,0x7540,0x753E,0x758C,0x7598,0x76AF,
0x76F3,0x76F1,0x76F0,0x76F5,0x77F8,0x77FC,0x77F9,0x77FB,
0x77FA,0x77F7,0x7942,0x793F,0x79C5,0x7A78,0x7A7B,0x7AFB,
0x7C75,0x7CFD,0x8035,0x808F,0x80AE,0x80A3,0x80B8,0x80B5,
0x80AD,0x8220,0x82A0,0x82C0,0x82AB,0x829A,0x8298,0x829B,
0x82B5,0x82A7,0x82AE,0x82BC,0x829E,0x82BA,0x82B4,0x82A8,
0x82A1,0x82A9,0x82C2,0x82A4,0x82C3,0x82B6,0x82A2,0x8670,
0x866F,0x866D,0x866E,0x8C56,0x8FD2,0x8FCB,0x8FD3,0x8FCD,
0x8FD6,0x8FD5,0x8FD7,0x90B2,0x90B4,0x90AF,0x90B3,0x90B0,
0x9639,0x963D,0x963C,0x963A,0x9643,0x4FCD,0x4FC5,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 42, Array index 0x0900 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4FD3,0x4FB2,0x4FC9,0x4FCB,0x4FC1,0x4FD4,0x4FDC,
0x4FD9,0x4FBB,0x4FB3,0x4FDB,0x4FC7,0x4FD6,0x4FBA,0x4FC0,
0x4FB9,0x4FEC,0x5244,0x5249,0x52C0,0x52C2,0x533D,0x537C,
0x5397,0x5396,0x5399,0x5398,0x54BA,0x54A1,0x54AD,0x54A5,
0x54CF,0x54C3,0x830D,0x54B7,0x54AE,0x54D6,0x54B6,0x54C5,
0x54C6,0x54A0,0x5470,0x54BC,0x54A2,0x54BE,0x5472,0x54DE,
0x54B0,0x57B5,0x579E,0x579F,0x57A4,0x578C,0x5797,0x579D,
0x579B,0x5794,0x5798,0x578F,0x5799,0x57A5,0x579A,0x5795,
0x58F4,0x590D,0x5953,0x59E1,0x59DE,0x59EE,0x5A00,0x59F1,
0x59DD,0x59FA,0x59FD,0x59FC,0x59F6,0x59E4,0x59F2,0x59F7,
0x59DB,0x59E9,0x59F3,0x59F5,0x59E0,0x59FE,0x59F4,0x59ED,
0x5BA8,0x5C4C,0x5CD0,0x5CD8,0x5CCC,0x5CD7,0x5CCB,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 43, Array index 0x0A00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5CDB,0x5CDE,0x5CDA,0x5CC9,0x5CC7,0x5CCA,0x5CD6,
0x5CD3,0x5CD4,0x5CCF,0x5CC8,0x5CC6,0x5CCE,0x5CDF,0x5CF8,
0x5DF9,0x5E21,0x5E22,0x5E23,0x5E20,0x5E24,0x5EB0,0x5EA4,
0x5EA2,0x5E9B,0x5EA3,0x5EA5,0x5F07,0x5F2E,0x5F56,0x5F86,
0x6037,0x6039,0x6054,0x6072,0x605E,0x6045,0x6053,0x6047,
0x6049,0x605B,0x604C,0x6040,0x6042,0x605F,0x6024,0x6044,
0x6058,0x6066,0x606E,0x6242,0x6243,0x62CF,0x630D,0x630B,
0x62F5,0x630E,0x6303,0x62EB,0x62F9,0x630F,0x630C,0x62F8,
0x62F6,0x6300,0x6313,0x6314,0x62FA,0x6315,0x62FB,0x62F0,
0x6541,0x6543,0x65AA,0x65BF,0x6636,0x6621,0x6632,0x6635,
0x661C,0x6626,0x6622,0x6633,0x662B,0x663A,0x661D,0x6634,
0x6639,0x662E,0x670F,0x6710,0x67C1,0x67F2,0x67C8,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 44, Array index 0x0B00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x67BA,0x67DC,0x67BB,0x67F8,0x67D8,0x67C0,0x67B7,
0x67C5,0x67EB,0x67E4,0x67DF,0x67B5,0x67CD,0x67B3,0x67F7,
0x67F6,0x67EE,0x67E3,0x67C2,0x67B9,0x67CE,0x67E7,0x67F0,
0x67B2,0x67FC,0x67C6,0x67ED,0x67CC,0x67AE,0x67E6,0x67DB,
0x67FA,0x67C9,0x67CA,0x67C3,0x67EA,0x67CB,0x6B28,0x6B82,
0x6B84,0x6BB6,0x6BD6,0x6BD8,0x6BE0,0x6C20,0x6C21,0x6D28,
0x6D34,0x6D2D,0x6D1F,0x6D3C,0x6D3F,0x6D12,0x6D0A,0x6CDA,
0x6D33,0x6D04,0x6D19,0x6D3A,0x6D1A,0x6D11,0x6D00,0x6D1D,
0x6D42,0x6D01,0x6D18,0x6D37,0x6D03,0x6D0F,0x6D40,0x6D07,
0x6D20,0x6D2C,0x6D08,0x6D22,0x6D09,0x6D10,0x70B7,0x709F,
0x70BE,0x70B1,0x70B0,0x70A1,0x70B4,0x70B5,0x70A9,0x7241,
0x7249,0x724A,0x726C,0x7270,0x7273,0x726E,0x72CA,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 45, Array index 0x0C00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x72E4,0x72E8,0x72EB,0x72DF,0x72EA,0x72E6,0x72E3,
0x7385,0x73CC,0x73C2,0x73C8,0x73C5,0x73B9,0x73B6,0x73B5,
0x73B4,0x73EB,0x73BF,0x73C7,0x73BE,0x73C3,0x73C6,0x73B8,
0x73CB,0x74EC,0x74EE,0x752E,0x7547,0x7548,0x75A7,0x75AA,
0x7679,0x76C4,0x7708,0x7703,0x7704,0x7705,0x770A,0x76F7,
0x76FB,0x76FA,0x77E7,0x77E8,0x7806,0x7811,0x7812,0x7805,
0x7810,0x780F,0x780E,0x7809,0x7803,0x7813,0x794A,0x794C,
0x794B,0x7945,0x7944,0x79D5,0x79CD,0x79CF,0x79D6,0x79CE,
0x7A80,0x7A7E,0x7AD1,0x7B00,0x7B01,0x7C7A,0x7C78,0x7C79,
0x7C7F,0x7C80,0x7C81,0x7D03,0x7D08,0x7D01,0x7F58,0x7F91,
0x7F8D,0x7FBE,0x8007,0x800E,0x800F,0x8014,0x8037,0x80D8,
0x80C7,0x80E0,0x80D1,0x80C8,0x80C2,0x80D0,0x80C5,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 46, Array index 0x0D00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x80E3,0x80D9,0x80DC,0x80CA,0x80D5,0x80C9,0x80CF,
0x80D7,0x80E6,0x80CD,0x81FF,0x8221,0x8294,0x82D9,0x82FE,
0x82F9,0x8307,0x82E8,0x8300,0x82D5,0x833A,0x82EB,0x82D6,
0x82F4,0x82EC,0x82E1,0x82F2,0x82F5,0x830C,0x82FB,0x82F6,
0x82F0,0x82EA,0x82E4,0x82E0,0x82FA,0x82F3,0x82ED,0x8677,
0x8674,0x867C,0x8673,0x8841,0x884E,0x8867,0x886A,0x8869,
0x89D3,0x8A04,0x8A07,0x8D72,0x8FE3,0x8FE1,0x8FEE,0x8FE0,
0x90F1,0x90BD,0x90BF,0x90D5,0x90C5,0x90BE,0x90C7,0x90CB,
0x90C8,0x91D4,0x91D3,0x9654,0x964F,0x9651,0x9653,0x964A,
0x964E,0x501E,0x5005,0x5007,0x5013,0x5022,0x5030,0x501B,
0x4FF5,0x4FF4,0x5033,0x5037,0x502C,0x4FF6,0x4FF7,0x5017,
0x501C,0x5020,0x5027,0x5035,0x502F,0x5031,0x500E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 47, Array index 0x0E00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x515A,0x5194,0x5193,0x51CA,0x51C4,0x51C5,0x51C8,
0x51CE,0x5261,0x525A,0x5252,0x525E,0x525F,0x5255,0x5262,
0x52CD,0x530E,0x539E,0x5526,0x54E2,0x5517,0x5512,0x54E7,
0x54F3,0x54E4,0x551A,0x54FF,0x5504,0x5508,0x54EB,0x5511,
0x5505,0x54F1,0x550A,0x54FB,0x54F7,0x54F8,0x54E0,0x550E,
0x5503,0x550B,0x5701,0x5702,0x57CC,0x5832,0x57D5,0x57D2,
0x57BA,0x57C6,0x57BD,0x57BC,0x57B8,0x57B6,0x57BF,0x57C7,
0x57D0,0x57B9,0x57C1,0x590E,0x594A,0x5A19,0x5A16,0x5A2D,
0x5A2E,0x5A15,0x5A0F,0x5A17,0x5A0A,0x5A1E,0x5A33,0x5B6C,
0x5BA7,0x5BAD,0x5BAC,0x5C03,0x5C56,0x5C54,0x5CEC,0x5CFF,
0x5CEE,0x5CF1,0x5CF7,0x5D00,0x5CF9,0x5E29,0x5E28,0x5EA8,
0x5EAE,0x5EAA,0x5EAC,0x5F33,0x5F30,0x5F67,0x605D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 48, Array index 0x0F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x605A,0x6067,0x6041,0x60A2,0x6088,0x6080,0x6092,
0x6081,0x609D,0x6083,0x6095,0x609B,0x6097,0x6087,0x609C,
0x608E,0x6219,0x6246,0x62F2,0x6310,0x6356,0x632C,0x6344,
0x6345,0x6336,0x6343,0x63E4,0x6339,0x634B,0x634A,0x633C,
0x6329,0x6341,0x6334,0x6358,0x6354,0x6359,0x632D,0x6347,
0x6333,0x635A,0x6351,0x6338,0x6357,0x6340,0x6348,0x654A,
0x6546,0x65C6,0x65C3,0x65C4,0x65C2,0x664A,0x665F,0x6647,
0x6651,0x6712,0x6713,0x681F,0x681A,0x6849,0x6832,0x6833,
0x683B,0x684B,0x684F,0x6816,0x6831,0x681C,0x6835,0x682B,
0x682D,0x682F,0x684E,0x6844,0x6834,0x681D,0x6812,0x6814,
0x6826,0x6828,0x682E,0x684D,0x683A,0x6825,0x6820,0x6B2C,
0x6B2F,0x6B2D,0x6B31,0x6B34,0x6B6D,0x8082,0x6B88,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 49, Array index 0x1000 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6BE6,0x6BE4,0x6BE8,0x6BE3,0x6BE2,0x6BE7,0x6C25,
0x6D7A,0x6D63,0x6D64,0x6D76,0x6D0D,0x6D61,0x6D92,0x6D58,
0x6D62,0x6D6D,0x6D6F,0x6D91,0x6D8D,0x6DEF,0x6D7F,0x6D86,
0x6D5E,0x6D67,0x6D60,0x6D97,0x6D70,0x6D7C,0x6D5F,0x6D82,
0x6D98,0x6D2F,0x6D68,0x6D8B,0x6D7E,0x6D80,0x6D84,0x6D16,
0x6D83,0x6D7B,0x6D7D,0x6D75,0x6D90,0x70DC,0x70D3,0x70D1,
0x70DD,0x70CB,0x7F39,0x70E2,0x70D7,0x70D2,0x70DE,0x70E0,
0x70D4,0x70CD,0x70C5,0x70C6,0x70C7,0x70DA,0x70CE,0x70E1,
0x7242,0x7278,0x7277,0x7276,0x7300,0x72FA,0x72F4,0x72FE,
0x72F6,0x72F3,0x72FB,0x7301,0x73D3,0x73D9,0x73E5,0x73D6,
0x73BC,0x73E7,0x73E3,0x73E9,0x73DC,0x73D2,0x73DB,0x73D4,
0x73DD,0x73DA,0x73D7,0x73D8,0x73E8,0x74DE,0x74DF,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 50, Array index 0x1100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x74F4,0x74F5,0x7521,0x755B,0x755F,0x75B0,0x75C1,
0x75BB,0x75C4,0x75C0,0x75BF,0x75B6,0x75BA,0x768A,0x76C9,
0x771D,0x771B,0x7710,0x7713,0x7712,0x7723,0x7711,0x7715,
0x7719,0x771A,0x7722,0x7727,0x7823,0x782C,0x7822,0x7835,
0x782F,0x7828,0x782E,0x782B,0x7821,0x7829,0x7833,0x782A,
0x7831,0x7954,0x795B,0x794F,0x795C,0x7953,0x7952,0x7951,
0x79EB,0x79EC,0x79E0,0x79EE,0x79ED,0x79EA,0x79DC,0x79DE,
0x79DD,0x7A86,0x7A89,0x7A85,0x7A8B,0x7A8C,0x7A8A,0x7A87,
0x7AD8,0x7B10,0x7B04,0x7B13,0x7B05,0x7B0F,0x7B08,0x7B0A,
0x7B0E,0x7B09,0x7B12,0x7C84,0x7C91,0x7C8A,0x7C8C,0x7C88,
0x7C8D,0x7C85,0x7D1E,0x7D1D,0x7D11,0x7D0E,0x7D18,0x7D16,
0x7D13,0x7D1F,0x7D12,0x7D0F,0x7D0C,0x7F5C,0x7F61,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 51, Array index 0x1200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7F5E,0x7F60,0x7F5D,0x7F5B,0x7F96,0x7F92,0x7FC3,
0x7FC2,0x7FC0,0x8016,0x803E,0x8039,0x80FA,0x80F2,0x80F9,
0x80F5,0x8101,0x80FB,0x8100,0x8201,0x822F,0x8225,0x8333,
0x832D,0x8344,0x8319,0x8351,0x8325,0x8356,0x833F,0x8341,
0x8326,0x831C,0x8322,0x8342,0x834E,0x831B,0x832A,0x8308,
0x833C,0x834D,0x8316,0x8324,0x8320,0x8337,0x832F,0x8329,
0x8347,0x8345,0x834C,0x8353,0x831E,0x832C,0x834B,0x8327,
0x8348,0x8653,0x8652,0x86A2,0x86A8,0x8696,0x868D,0x8691,
0x869E,0x8687,0x8697,0x8686,0x868B,0x869A,0x8685,0x86A5,
0x8699,0x86A1,0x86A7,0x8695,0x8698,0x868E,0x869D,0x8690,
0x8694,0x8843,0x8844,0x886D,0x8875,0x8876,0x8872,0x8880,
0x8871,0x887F,0x886F,0x8883,0x887E,0x8874,0x887C,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 52, Array index 0x1300 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8A12,0x8C47,0x8C57,0x8C7B,0x8CA4,0x8CA3,0x8D76,
0x8D78,0x8DB5,0x8DB7,0x8DB6,0x8ED1,0x8ED3,0x8FFE,0x8FF5,
0x9002,0x8FFF,0x8FFB,0x9004,0x8FFC,0x8FF6,0x90D6,0x90E0,
0x90D9,0x90DA,0x90E3,0x90DF,0x90E5,0x90D8,0x90DB,0x90D7,
0x90DC,0x90E4,0x9150,0x914E,0x914F,0x91D5,0x91E2,0x91DA,
0x965C,0x965F,0x96BC,0x98E3,0x9ADF,0x9B2F,0x4E7F,0x5070,
0x506A,0x5061,0x505E,0x5060,0x5053,0x504B,0x505D,0x5072,
0x5048,0x504D,0x5041,0x505B,0x504A,0x5062,0x5015,0x5045,
0x505F,0x5069,0x506B,0x5063,0x5064,0x5046,0x5040,0x506E,
0x5073,0x5057,0x5051,0x51D0,0x526B,0x526D,0x526C,0x526E,
0x52D6,0x52D3,0x532D,0x539C,0x5575,0x5576,0x553C,0x554D,
0x5550,0x5534,0x552A,0x5551,0x5562,0x5536,0x5535,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 53, Array index 0x1400 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5530,0x5552,0x5545,0x550C,0x5532,0x5565,0x554E,
0x5539,0x5548,0x552D,0x553B,0x5540,0x554B,0x570A,0x5707,
0x57FB,0x5814,0x57E2,0x57F6,0x57DC,0x57F4,0x5800,0x57ED,
0x57FD,0x5808,0x57F8,0x580B,0x57F3,0x57CF,0x5807,0x57EE,
0x57E3,0x57F2,0x57E5,0x57EC,0x57E1,0x580E,0x57FC,0x5810,
0x57E7,0x5801,0x580C,0x57F1,0x57E9,0x57F0,0x580D,0x5804,
0x595C,0x5A60,0x5A58,0x5A55,0x5A67,0x5A5E,0x5A38,0x5A35,
0x5A6D,0x5A50,0x5A5F,0x5A65,0x5A6C,0x5A53,0x5A64,0x5A57,
0x5A43,0x5A5D,0x5A52,0x5A44,0x5A5B,0x5A48,0x5A8E,0x5A3E,
0x5A4D,0x5A39,0x5A4C,0x5A70,0x5A69,0x5A47,0x5A51,0x5A56,
0x5A42,0x5A5C,0x5B72,0x5B6E,0x5BC1,0x5BC0,0x5C59,0x5D1E,
0x5D0B,0x5D1D,0x5D1A,0x5D20,0x5D0C,0x5D28,0x5D0D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 54, Array index 0x1500 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5D26,0x5D25,0x5D0F,0x5D30,0x5D12,0x5D23,0x5D1F,
0x5D2E,0x5E3E,0x5E34,0x5EB1,0x5EB4,0x5EB9,0x5EB2,0x5EB3,
0x5F36,0x5F38,0x5F9B,0x5F96,0x5F9F,0x608A,0x6090,0x6086,
0x60BE,0x60B0,0x60BA,0x60D3,0x60D4,0x60CF,0x60E4,0x60D9,
0x60DD,0x60C8,0x60B1,0x60DB,0x60B7,0x60CA,0x60BF,0x60C3,
0x60CD,0x60C0,0x6332,0x6365,0x638A,0x6382,0x637D,0x63BD,
0x639E,0x63AD,0x639D,0x6397,0x63AB,0x638E,0x636F,0x6387,
0x6390,0x636E,0x63AF,0x6375,0x639C,0x636D,0x63AE,0x637C,
0x63A4,0x633B,0x639F,0x6378,0x6385,0x6381,0x6391,0x638D,
0x6370,0x6553,0x65CD,0x6665,0x6661,0x665B,0x6659,0x665C,
0x6662,0x6718,0x6879,0x6887,0x6890,0x689C,0x686D,0x686E,
0x68AE,0x68AB,0x6956,0x686F,0x68A3,0x68AC,0x68A9,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 55, Array index 0x1600 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6875,0x6874,0x68B2,0x688F,0x6877,0x6892,0x687C,
0x686B,0x6872,0x68AA,0x6880,0x6871,0x687E,0x689B,0x6896,
0x688B,0x68A0,0x6889,0x68A4,0x6878,0x687B,0x6891,0x688C,
0x688A,0x687D,0x6B36,0x6B33,0x6B37,0x6B38,0x6B91,0x6B8F,
0x6B8D,0x6B8E,0x6B8C,0x6C2A,0x6DC0,0x6DAB,0x6DB4,0x6DB3,
0x6E74,0x6DAC,0x6DE9,0x6DE2,0x6DB7,0x6DF6,0x6DD4,0x6E00,
0x6DC8,0x6DE0,0x6DDF,0x6DD6,0x6DBE,0x6DE5,0x6DDC,0x6DDD,
0x6DDB,0x6DF4,0x6DCA,0x6DBD,0x6DED,0x6DF0,0x6DBA,0x6DD5,
0x6DC2,0x6DCF,0x6DC9,0x6DD0,0x6DF2,0x6DD3,0x6DFD,0x6DD7,
0x6DCD,0x6DE3,0x6DBB,0x70FA,0x710D,0x70F7,0x7117,0x70F4,
0x710C,0x70F0,0x7104,0x70F3,0x7110,0x70FC,0x70FF,0x7106,
0x7113,0x7100,0x70F8,0x70F6,0x710B,0x7102,0x710E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 56, Array index 0x1700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x727E,0x727B,0x727C,0x727F,0x731D,0x7317,0x7307,
0x7311,0x7318,0x730A,0x7308,0x72FF,0x730F,0x731E,0x7388,
0x73F6,0x73F8,0x73F5,0x7404,0x7401,0x73FD,0x7407,0x7400,
0x73FA,0x73FC,0x73FF,0x740C,0x740B,0x73F4,0x7408,0x7564,
0x7563,0x75CE,0x75D2,0x75CF,0x75CB,0x75CC,0x75D1,0x75D0,
0x768F,0x7689,0x76D3,0x7739,0x772F,0x772D,0x7731,0x7732,
0x7734,0x7733,0x773D,0x7725,0x773B,0x7735,0x7848,0x7852,
0x7849,0x784D,0x784A,0x784C,0x7826,0x7845,0x7850,0x7964,
0x7967,0x7969,0x796A,0x7963,0x796B,0x7961,0x79BB,0x79FA,
0x79F8,0x79F6,0x79F7,0x7A8F,0x7A94,0x7A90,0x7B35,0x7B3B,
0x7B34,0x7B25,0x7B30,0x7B22,0x7B24,0x7B33,0x7B18,0x7B2A,
0x7B1D,0x7B31,0x7B2B,0x7B2D,0x7B2F,0x7B32,0x7B38,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 57, Array index 0x1800 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7B1A,0x7B23,0x7C94,0x7C98,0x7C96,0x7CA3,0x7D35,
0x7D3D,0x7D38,0x7D36,0x7D3A,0x7D45,0x7D2C,0x7D29,0x7D41,
0x7D47,0x7D3E,0x7D3F,0x7D4A,0x7D3B,0x7D28,0x7F63,0x7F95,
0x7F9C,0x7F9D,0x7F9B,0x7FCA,0x7FCB,0x7FCD,0x7FD0,0x7FD1,
0x7FC7,0x7FCF,0x7FC9,0x801F,0x801E,0x801B,0x8047,0x8043,
0x8048,0x8118,0x8125,0x8119,0x811B,0x812D,0x811F,0x812C,
0x811E,0x8121,0x8115,0x8127,0x811D,0x8122,0x8211,0x8238,
0x8233,0x823A,0x8234,0x8232,0x8274,0x8390,0x83A3,0x83A8,
0x838D,0x837A,0x8373,0x83A4,0x8374,0x838F,0x8381,0x8395,
0x8399,0x8375,0x8394,0x83A9,0x837D,0x8383,0x838C,0x839D,
0x839B,0x83AA,0x838B,0x837E,0x83A5,0x83AF,0x8388,0x8397,
0x83B0,0x837F,0x83A6,0x8387,0x83AE,0x8376,0x8659,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 58, Array index 0x1900 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8656,0x86BF,0x86B7,0x86C2,0x86C1,0x86C5,0x86BA,
0x86B0,0x86C8,0x86B9,0x86B3,0x86B8,0x86CC,0x86B4,0x86BB,
0x86BC,0x86C3,0x86BD,0x86BE,0x8852,0x8889,0x8895,0x88A8,
0x88A2,0x88AA,0x889A,0x8891,0x88A1,0x889F,0x8898,0x88A7,
0x8899,0x889B,0x8897,0x88A4,0x88AC,0x888C,0x8893,0x888E,
0x8982,0x89D6,0x89D9,0x89D5,0x8A30,0x8A27,0x8A2C,0x8A1E,
0x8C39,0x8C3B,0x8C5C,0x8C5D,0x8C7D,0x8CA5,0x8D7D,0x8D7B,
0x8D79,0x8DBC,0x8DC2,0x8DB9,0x8DBF,0x8DC1,0x8ED8,0x8EDE,
0x8EDD,0x8EDC,0x8ED7,0x8EE0,0x8EE1,0x9024,0x900B,0x9011,
0x901C,0x900C,0x9021,0x90EF,0x90EA,0x90F0,0x90F4,0x90F2,
0x90F3,0x90D4,0x90EB,0x90EC,0x90E9,0x9156,0x9158,0x915A,
0x9153,0x9155,0x91EC,0x91F4,0x91F1,0x91F3,0x91F8,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 59, Array index 0x1A00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x91E4,0x91F9,0x91EA,0x91EB,0x91F7,0x91E8,0x91EE,
0x957A,0x9586,0x9588,0x967C,0x966D,0x966B,0x9671,0x966F,
0x96BF,0x976A,0x9804,0x98E5,0x9997,0x509B,0x5095,0x5094,
0x509E,0x508B,0x50A3,0x5083,0x508C,0x508E,0x509D,0x5068,
0x509C,0x5092,0x5082,0x5087,0x515F,0x51D4,0x5312,0x5311,
0x53A4,0x53A7,0x5591,0x55A8,0x55A5,0x55AD,0x5577,0x5645,
0x55A2,0x5593,0x5588,0x558F,0x55B5,0x5581,0x55A3,0x5592,
0x55A4,0x557D,0x558C,0x55A6,0x557F,0x5595,0x55A1,0x558E,
0x570C,0x5829,0x5837,0x5819,0x581E,0x5827,0x5823,0x5828,
0x57F5,0x5848,0x5825,0x581C,0x581B,0x5833,0x583F,0x5836,
0x582E,0x5839,0x5838,0x582D,0x582C,0x583B,0x5961,0x5AAF,
0x5A94,0x5A9F,0x5A7A,0x5AA2,0x5A9E,0x5A78,0x5AA6,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 60, Array index 0x1B00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5A7C,0x5AA5,0x5AAC,0x5A95,0x5AAE,0x5A37,0x5A84,
0x5A8A,0x5A97,0x5A83,0x5A8B,0x5AA9,0x5A7B,0x5A7D,0x5A8C,
0x5A9C,0x5A8F,0x5A93,0x5A9D,0x5BEA,0x5BCD,0x5BCB,0x5BD4,
0x5BD1,0x5BCA,0x5BCE,0x5C0C,0x5C30,0x5D37,0x5D43,0x5D6B,
0x5D41,0x5D4B,0x5D3F,0x5D35,0x5D51,0x5D4E,0x5D55,0x5D33,
0x5D3A,0x5D52,0x5D3D,0x5D31,0x5D59,0x5D42,0x5D39,0x5D49,
0x5D38,0x5D3C,0x5D32,0x5D36,0x5D40,0x5D45,0x5E44,0x5E41,
0x5F58,0x5FA6,0x5FA5,0x5FAB,0x60C9,0x60B9,0x60CC,0x60E2,
0x60CE,0x60C4,0x6114,0x60F2,0x610A,0x6116,0x6105,0x60F5,
0x6113,0x60F8,0x60FC,0x60FE,0x60C1,0x6103,0x6118,0x611D,
0x6110,0x60FF,0x6104,0x610B,0x624A,0x6394,0x63B1,0x63B0,
0x63CE,0x63E5,0x63E8,0x63EF,0x63C3,0x649D,0x63F3,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 61, Array index 0x1C00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x63CA,0x63E0,0x63F6,0x63D5,0x63F2,0x63F5,0x6461,
0x63DF,0x63BE,0x63DD,0x63DC,0x63C4,0x63D8,0x63D3,0x63C2,
0x63C7,0x63CC,0x63CB,0x63C8,0x63F0,0x63D7,0x63D9,0x6532,
0x6567,0x656A,0x6564,0x655C,0x6568,0x6565,0x658C,0x659D,
0x659E,0x65AE,0x65D0,0x65D2,0x667C,0x666C,0x667B,0x6680,
0x6671,0x6679,0x666A,0x6672,0x6701,0x690C,0x68D3,0x6904,
0x68DC,0x692A,0x68EC,0x68EA,0x68F1,0x690F,0x68D6,0x68F7,
0x68EB,0x68E4,0x68F6,0x6913,0x6910,0x68F3,0x68E1,0x6907,
0x68CC,0x6908,0x6970,0x68B4,0x6911,0x68EF,0x68C6,0x6914,
0x68F8,0x68D0,0x68FD,0x68FC,0x68E8,0x690B,0x690A,0x6917,
0x68CE,0x68C8,0x68DD,0x68DE,0x68E6,0x68F4,0x68D1,0x6906,
0x68D4,0x68E9,0x6915,0x6925,0x68C7,0x6B39,0x6B3B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 62, Array index 0x1D00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6B3F,0x6B3C,0x6B94,0x6B97,0x6B99,0x6B95,0x6BBD,
0x6BF0,0x6BF2,0x6BF3,0x6C30,0x6DFC,0x6E46,0x6E47,0x6E1F,
0x6E49,0x6E88,0x6E3C,0x6E3D,0x6E45,0x6E62,0x6E2B,0x6E3F,
0x6E41,0x6E5D,0x6E73,0x6E1C,0x6E33,0x6E4B,0x6E40,0x6E51,
0x6E3B,0x6E03,0x6E2E,0x6E5E,0x6E68,0x6E5C,0x6E61,0x6E31,
0x6E28,0x6E60,0x6E71,0x6E6B,0x6E39,0x6E22,0x6E30,0x6E53,
0x6E65,0x6E27,0x6E78,0x6E64,0x6E77,0x6E55,0x6E79,0x6E52,
0x6E66,0x6E35,0x6E36,0x6E5A,0x7120,0x711E,0x712F,0x70FB,
0x712E,0x7131,0x7123,0x7125,0x7122,0x7132,0x711F,0x7128,
0x713A,0x711B,0x724B,0x725A,0x7288,0x7289,0x7286,0x7285,
0x728B,0x7312,0x730B,0x7330,0x7322,0x7331,0x7333,0x7327,
0x7332,0x732D,0x7326,0x7323,0x7335,0x730C,0x742E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 63, Array index 0x1E00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x742C,0x7430,0x742B,0x7416,0x741A,0x7421,0x742D,
0x7431,0x7424,0x7423,0x741D,0x7429,0x7420,0x7432,0x74FB,
0x752F,0x756F,0x756C,0x75E7,0x75DA,0x75E1,0x75E6,0x75DD,
0x75DF,0x75E4,0x75D7,0x7695,0x7692,0x76DA,0x7746,0x7747,
0x7744,0x774D,0x7745,0x774A,0x774E,0x774B,0x774C,0x77DE,
0x77EC,0x7860,0x7864,0x7865,0x785C,0x786D,0x7871,0x786A,
0x786E,0x7870,0x7869,0x7868,0x785E,0x7862,0x7974,0x7973,
0x7972,0x7970,0x7A02,0x7A0A,0x7A03,0x7A0C,0x7A04,0x7A99,
0x7AE6,0x7AE4,0x7B4A,0x7B47,0x7B44,0x7B48,0x7B4C,0x7B4E,
0x7B40,0x7B58,0x7B45,0x7CA2,0x7C9E,0x7CA8,0x7CA1,0x7D58,
0x7D6F,0x7D63,0x7D53,0x7D56,0x7D67,0x7D6A,0x7D4F,0x7D6D,
0x7D5C,0x7D6B,0x7D52,0x7D54,0x7D69,0x7D51,0x7D5F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 64, Array index 0x1F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7D4E,0x7F3E,0x7F3F,0x7F65,0x7F66,0x7FA2,0x7FA0,
0x7FA1,0x7FD7,0x8051,0x804F,0x8050,0x80FE,0x80D4,0x8143,
0x814A,0x8152,0x814F,0x8147,0x813D,0x814D,0x813A,0x81E6,
0x81EE,0x81F7,0x81F8,0x81F9,0x8204,0x823C,0x823D,0x823F,
0x8275,0x833B,0x83CF,0x83F9,0x8423,0x83C0,0x83E8,0x8412,
0x83E7,0x83E4,0x83FC,0x83F6,0x8410,0x83C6,0x83C8,0x83EB,
0x83E3,0x83BF,0x8401,0x83DD,0x83E5,0x83D8,0x83FF,0x83E1,
0x83CB,0x83CE,0x83D6,0x83F5,0x83C9,0x8409,0x840F,0x83DE,
0x8411,0x8406,0x83C2,0x83F3,0x83D5,0x83FA,0x83C7,0x83D1,
0x83EA,0x8413,0x839A,0x83C3,0x83EC,0x83EE,0x83C4,0x83FB,
0x83D7,0x83E2,0x841B,0x83DB,0x83FE,0x86D8,0x86E2,0x86E6,
0x86D3,0x86E3,0x86DA,0x86EA,0x86DD,0x86EB,0x86DC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 65, Array index 0x2000 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x86EC,0x86E9,0x86D7,0x86E8,0x86D1,0x8848,0x8856,
0x8855,0x88BA,0x88D7,0x88B9,0x88B8,0x88C0,0x88BE,0x88B6,
0x88BC,0x88B7,0x88BD,0x88B2,0x8901,0x88C9,0x8995,0x8998,
0x8997,0x89DD,0x89DA,0x89DB,0x8A4E,0x8A4D,0x8A39,0x8A59,
0x8A40,0x8A57,0x8A58,0x8A44,0x8A45,0x8A52,0x8A48,0x8A51,
0x8A4A,0x8A4C,0x8A4F,0x8C5F,0x8C81,0x8C80,0x8CBA,0x8CBE,
0x8CB0,0x8CB9,0x8CB5,0x8D84,0x8D80,0x8D89,0x8DD8,0x8DD3,
0x8DCD,0x8DC7,0x8DD6,0x8DDC,0x8DCF,0x8DD5,0x8DD9,0x8DC8,
0x8DD7,0x8DC5,0x8EEF,0x8EF7,0x8EFA,0x8EF9,0x8EE6,0x8EEE,
0x8EE5,0x8EF5,0x8EE7,0x8EE8,0x8EF6,0x8EEB,0x8EF1,0x8EEC,
0x8EF4,0x8EE9,0x902D,0x9034,0x902F,0x9106,0x912C,0x9104,
0x90FF,0x90FC,0x9108,0x90F9,0x90FB,0x9101,0x9100,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 66, Array index 0x2100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9107,0x9105,0x9103,0x9161,0x9164,0x915F,0x9162,
0x9160,0x9201,0x920A,0x9225,0x9203,0x921A,0x9226,0x920F,
0x920C,0x9200,0x9212,0x91FF,0x91FD,0x9206,0x9204,0x9227,
0x9202,0x921C,0x9224,0x9219,0x9217,0x9205,0x9216,0x957B,
0x958D,0x958C,0x9590,0x9687,0x967E,0x9688,0x9689,0x9683,
0x9680,0x96C2,0x96C8,0x96C3,0x96F1,0x96F0,0x976C,0x9770,
0x976E,0x9807,0x98A9,0x98EB,0x9CE6,0x9EF9,0x4E83,0x4E84,
0x4EB6,0x50BD,0x50BF,0x50C6,0x50AE,0x50C4,0x50CA,0x50B4,
0x50C8,0x50C2,0x50B0,0x50C1,0x50BA,0x50B1,0x50CB,0x50C9,
0x50B6,0x50B8,0x51D7,0x527A,0x5278,0x527B,0x527C,0x55C3,
0x55DB,0x55CC,0x55D0,0x55CB,0x55CA,0x55DD,0x55C0,0x55D4,
0x55C4,0x55E9,0x55BF,0x55D2,0x558D,0x55CF,0x55D5,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 67, Array index 0x2200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x55E2,0x55D6,0x55C8,0x55F2,0x55CD,0x55D9,0x55C2,
0x5714,0x5853,0x5868,0x5864,0x584F,0x584D,0x5849,0x586F,
0x5855,0x584E,0x585D,0x5859,0x5865,0x585B,0x583D,0x5863,
0x5871,0x58FC,0x5AC7,0x5AC4,0x5ACB,0x5ABA,0x5AB8,0x5AB1,
0x5AB5,0x5AB0,0x5ABF,0x5AC8,0x5ABB,0x5AC6,0x5AB7,0x5AC0,
0x5ACA,0x5AB4,0x5AB6,0x5ACD,0x5AB9,0x5A90,0x5BD6,0x5BD8,
0x5BD9,0x5C1F,0x5C33,0x5D71,0x5D63,0x5D4A,0x5D65,0x5D72,
0x5D6C,0x5D5E,0x5D68,0x5D67,0x5D62,0x5DF0,0x5E4F,0x5E4E,
0x5E4A,0x5E4D,0x5E4B,0x5EC5,0x5ECC,0x5EC6,0x5ECB,0x5EC7,
0x5F40,0x5FAF,0x5FAD,0x60F7,0x6149,0x614A,0x612B,0x6145,
0x6136,0x6132,0x612E,0x6146,0x612F,0x614F,0x6129,0x6140,
0x6220,0x9168,0x6223,0x6225,0x6224,0x63C5,0x63F1,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 68, Array index 0x2300 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x63EB,0x6410,0x6412,0x6409,0x6420,0x6424,0x6433,
0x6443,0x641F,0x6415,0x6418,0x6439,0x6437,0x6422,0x6423,
0x640C,0x6426,0x6430,0x6428,0x6441,0x6435,0x642F,0x640A,
0x641A,0x6440,0x6425,0x6427,0x640B,0x63E7,0x641B,0x642E,
0x6421,0x640E,0x656F,0x6592,0x65D3,0x6686,0x668C,0x6695,
0x6690,0x668B,0x668A,0x6699,0x6694,0x6678,0x6720,0x6966,
0x695F,0x6938,0x694E,0x6962,0x6971,0x693F,0x6945,0x696A,
0x6939,0x6942,0x6957,0x6959,0x697A,0x6948,0x6949,0x6935,
0x696C,0x6933,0x693D,0x6965,0x68F0,0x6978,0x6934,0x6969,
0x6940,0x696F,0x6944,0x6976,0x6958,0x6941,0x6974,0x694C,
0x693B,0x694B,0x6937,0x695C,0x694F,0x6951,0x6932,0x6952,
0x692F,0x697B,0x693C,0x6B46,0x6B45,0x6B43,0x6B42,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 69, Array index 0x2400 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6B48,0x6B41,0x6B9B,0x6BFB,0x6BFC,0x6BF9,0x6BF7,
0x6BF8,0x6E9B,0x6ED6,0x6EC8,0x6E8F,0x6EC0,0x6E9F,0x6E93,
0x6E94,0x6EA0,0x6EB1,0x6EB9,0x6EC6,0x6ED2,0x6EBD,0x6EC1,
0x6E9E,0x6EC9,0x6EB7,0x6EB0,0x6ECD,0x6EA6,0x6ECF,0x6EB2,
0x6EBE,0x6EC3,0x6EDC,0x6ED8,0x6E99,0x6E92,0x6E8E,0x6E8D,
0x6EA4,0x6EA1,0x6EBF,0x6EB3,0x6ED0,0x6ECA,0x6E97,0x6EAE,
0x6EA3,0x7147,0x7154,0x7152,0x7163,0x7160,0x7141,0x715D,
0x7162,0x7172,0x7178,0x716A,0x7161,0x7142,0x7158,0x7143,
0x714B,0x7170,0x715F,0x7150,0x7153,0x7144,0x714D,0x715A,
0x724F,0x728D,0x728C,0x7291,0x7290,0x728E,0x733C,0x7342,
0x733B,0x733A,0x7340,0x734A,0x7349,0x7444,0x744A,0x744B,
0x7452,0x7451,0x7457,0x7440,0x744F,0x7450,0x744E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 70, Array index 0x2500 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7442,0x7446,0x744D,0x7454,0x74E1,0x74FF,0x74FE,
0x74FD,0x751D,0x7579,0x7577,0x6983,0x75EF,0x760F,0x7603,
0x75F7,0x75FE,0x75FC,0x75F9,0x75F8,0x7610,0x75FB,0x75F6,
0x75ED,0x75F5,0x75FD,0x7699,0x76B5,0x76DD,0x7755,0x775F,
0x7760,0x7752,0x7756,0x775A,0x7769,0x7767,0x7754,0x7759,
0x776D,0x77E0,0x7887,0x789A,0x7894,0x788F,0x7884,0x7895,
0x7885,0x7886,0x78A1,0x7883,0x7879,0x7899,0x7880,0x7896,
0x787B,0x797C,0x7982,0x797D,0x7979,0x7A11,0x7A18,0x7A19,
0x7A12,0x7A17,0x7A15,0x7A22,0x7A13,0x7A1B,0x7A10,0x7AA3,
0x7AA2,0x7A9E,0x7AEB,0x7B66,0x7B64,0x7B6D,0x7B74,0x7B69,
0x7B72,0x7B65,0x7B73,0x7B71,0x7B70,0x7B61,0x7B78,0x7B76,
0x7B63,0x7CB2,0x7CB4,0x7CAF,0x7D88,0x7D86,0x7D80,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 71, Array index 0x2600 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7D8D,0x7D7F,0x7D85,0x7D7A,0x7D8E,0x7D7B,0x7D83,
0x7D7C,0x7D8C,0x7D94,0x7D84,0x7D7D,0x7D92,0x7F6D,0x7F6B,
0x7F67,0x7F68,0x7F6C,0x7FA6,0x7FA5,0x7FA7,0x7FDB,0x7FDC,
0x8021,0x8164,0x8160,0x8177,0x815C,0x8169,0x815B,0x8162,
0x8172,0x6721,0x815E,0x8176,0x8167,0x816F,0x8144,0x8161,
0x821D,0x8249,0x8244,0x8240,0x8242,0x8245,0x84F1,0x843F,
0x8456,0x8476,0x8479,0x848F,0x848D,0x8465,0x8451,0x8440,
0x8486,0x8467,0x8430,0x844D,0x847D,0x845A,0x8459,0x8474,
0x8473,0x845D,0x8507,0x845E,0x8437,0x843A,0x8434,0x847A,
0x8443,0x8478,0x8432,0x8445,0x8429,0x83D9,0x844B,0x842F,
0x8442,0x842D,0x845F,0x8470,0x8439,0x844E,0x844C,0x8452,
0x846F,0x84C5,0x848E,0x843B,0x8447,0x8436,0x8433,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 72, Array index 0x2700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8468,0x847E,0x8444,0x842B,0x8460,0x8454,0x846E,
0x8450,0x870B,0x8704,0x86F7,0x870C,0x86FA,0x86D6,0x86F5,
0x874D,0x86F8,0x870E,0x8709,0x8701,0x86F6,0x870D,0x8705,
0x88D6,0x88CB,0x88CD,0x88CE,0x88DE,0x88DB,0x88DA,0x88CC,
0x88D0,0x8985,0x899B,0x89DF,0x89E5,0x89E4,0x89E1,0x89E0,
0x89E2,0x89DC,0x89E6,0x8A76,0x8A86,0x8A7F,0x8A61,0x8A3F,
0x8A77,0x8A82,0x8A84,0x8A75,0x8A83,0x8A81,0x8A74,0x8A7A,
0x8C3C,0x8C4B,0x8C4A,0x8C65,0x8C64,0x8C66,0x8C86,0x8C84,
0x8C85,0x8CCC,0x8D68,0x8D69,0x8D91,0x8D8C,0x8D8E,0x8D8F,
0x8D8D,0x8D93,0x8D94,0x8D90,0x8D92,0x8DF0,0x8DE0,0x8DEC,
0x8DF1,0x8DEE,0x8DD0,0x8DE9,0x8DE3,0x8DE2,0x8DE7,0x8DF2,
0x8DEB,0x8DF4,0x8F06,0x8EFF,0x8F01,0x8F00,0x8F05,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 73, Array index 0x2800 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8F07,0x8F08,0x8F02,0x8F0B,0x9052,0x903F,0x9044,
0x9049,0x903D,0x9110,0x910D,0x910F,0x9111,0x9116,0x9114,
0x910B,0x910E,0x916E,0x916F,0x9248,0x9252,0x9230,0x923A,
0x9266,0x9233,0x9265,0x925E,0x9283,0x922E,0x924A,0x9246,
0x926D,0x926C,0x924F,0x9260,0x9267,0x926F,0x9236,0x9261,
0x9270,0x9231,0x9254,0x9263,0x9250,0x9272,0x924E,0x9253,
0x924C,0x9256,0x9232,0x959F,0x959C,0x959E,0x959B,0x9692,
0x9693,0x9691,0x9697,0x96CE,0x96FA,0x96FD,0x96F8,0x96F5,
0x9773,0x9777,0x9778,0x9772,0x980F,0x980D,0x980E,0x98AC,
0x98F6,0x98F9,0x99AF,0x99B2,0x99B0,0x99B5,0x9AAD,0x9AAB,
0x9B5B,0x9CEA,0x9CED,0x9CE7,0x9E80,0x9EFD,0x50E6,0x50D4,
0x50D7,0x50E8,0x50F3,0x50DB,0x50EA,0x50DD,0x50E4,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 74, Array index 0x2900 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x50D3,0x50EC,0x50F0,0x50EF,0x50E3,0x50E0,0x51D8,
0x5280,0x5281,0x52E9,0x52EB,0x5330,0x53AC,0x5627,0x5615,
0x560C,0x5612,0x55FC,0x560F,0x561C,0x5601,0x5613,0x5602,
0x55FA,0x561D,0x5604,0x55FF,0x55F9,0x5889,0x587C,0x5890,
0x5898,0x5886,0x5881,0x587F,0x5874,0x588B,0x587A,0x5887,
0x5891,0x588E,0x5876,0x5882,0x5888,0x587B,0x5894,0x588F,
0x58FE,0x596B,0x5ADC,0x5AEE,0x5AE5,0x5AD5,0x5AEA,0x5ADA,
0x5AED,0x5AEB,0x5AF3,0x5AE2,0x5AE0,0x5ADB,0x5AEC,0x5ADE,
0x5ADD,0x5AD9,0x5AE8,0x5ADF,0x5B77,0x5BE0,0x5BE3,0x5C63,
0x5D82,0x5D80,0x5D7D,0x5D86,0x5D7A,0x5D81,0x5D77,0x5D8A,
0x5D89,0x5D88,0x5D7E,0x5D7C,0x5D8D,0x5D79,0x5D7F,0x5E58,
0x5E59,0x5E53,0x5ED8,0x5ED1,0x5ED7,0x5ECE,0x5EDC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 75, Array index 0x2A00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5ED5,0x5ED9,0x5ED2,0x5ED4,0x5F44,0x5F43,0x5F6F,
0x5FB6,0x612C,0x6128,0x6141,0x615E,0x6171,0x6173,0x6152,
0x6153,0x6172,0x616C,0x6180,0x6174,0x6154,0x617A,0x615B,
0x6165,0x613B,0x616A,0x6161,0x6156,0x6229,0x6227,0x622B,
0x642B,0x644D,0x645B,0x645D,0x6474,0x6476,0x6472,0x6473,
0x647D,0x6475,0x6466,0x64A6,0x644E,0x6482,0x645E,0x645C,
0x644B,0x6453,0x6460,0x6450,0x647F,0x643F,0x646C,0x646B,
0x6459,0x6465,0x6477,0x6573,0x65A0,0x66A1,0x66A0,0x669F,
0x6705,0x6704,0x6722,0x69B1,0x69B6,0x69C9,0x69A0,0x69CE,
0x6996,0x69B0,0x69AC,0x69BC,0x6991,0x6999,0x698E,0x69A7,
0x698D,0x69A9,0x69BE,0x69AF,0x69BF,0x69C4,0x69BD,0x69A4,
0x69D4,0x69B9,0x69CA,0x699A,0x69CF,0x69B3,0x6993,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 76, Array index 0x2B00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x69AA,0x69A1,0x699E,0x69D9,0x6997,0x6990,0x69C2,
0x69B5,0x69A5,0x69C6,0x6B4A,0x6B4D,0x6B4B,0x6B9E,0x6B9F,
0x6BA0,0x6BC3,0x6BC4,0x6BFE,0x6ECE,0x6EF5,0x6EF1,0x6F03,
0x6F25,0x6EF8,0x6F37,0x6EFB,0x6F2E,0x6F09,0x6F4E,0x6F19,
0x6F1A,0x6F27,0x6F18,0x6F3B,0x6F12,0x6EED,0x6F0A,0x6F36,
0x6F73,0x6EF9,0x6EEE,0x6F2D,0x6F40,0x6F30,0x6F3C,0x6F35,
0x6EEB,0x6F07,0x6F0E,0x6F43,0x6F05,0x6EFD,0x6EF6,0x6F39,
0x6F1C,0x6EFC,0x6F3A,0x6F1F,0x6F0D,0x6F1E,0x6F08,0x6F21,
0x7187,0x7190,0x7189,0x7180,0x7185,0x7182,0x718F,0x717B,
0x7186,0x7181,0x7197,0x7244,0x7253,0x7297,0x7295,0x7293,
0x7343,0x734D,0x7351,0x734C,0x7462,0x7473,0x7471,0x7475,
0x7472,0x7467,0x746E,0x7500,0x7502,0x7503,0x757D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 77, Array index 0x2C00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7590,0x7616,0x7608,0x760C,0x7615,0x7611,0x760A,
0x7614,0x76B8,0x7781,0x777C,0x7785,0x7782,0x776E,0x7780,
0x776F,0x777E,0x7783,0x78B2,0x78AA,0x78B4,0x78AD,0x78A8,
0x787E,0x78AB,0x789E,0x78A5,0x78A0,0x78AC,0x78A2,0x78A4,
0x7998,0x798A,0x798B,0x7996,0x7995,0x7994,0x7993,0x7997,
0x7988,0x7992,0x7990,0x7A2B,0x7A4A,0x7A30,0x7A2F,0x7A28,
0x7A26,0x7AA8,0x7AAB,0x7AAC,0x7AEE,0x7B88,0x7B9C,0x7B8A,
0x7B91,0x7B90,0x7B96,0x7B8D,0x7B8C,0x7B9B,0x7B8E,0x7B85,
0x7B98,0x5284,0x7B99,0x7BA4,0x7B82,0x7CBB,0x7CBF,0x7CBC,
0x7CBA,0x7DA7,0x7DB7,0x7DC2,0x7DA3,0x7DAA,0x7DC1,0x7DC0,
0x7DC5,0x7D9D,0x7DCE,0x7DC4,0x7DC6,0x7DCB,0x7DCC,0x7DAF,
0x7DB9,0x7D96,0x7DBC,0x7D9F,0x7DA6,0x7DAE,0x7DA9,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 78, Array index 0x2D00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7DA1,0x7DC9,0x7F73,0x7FE2,0x7FE3,0x7FE5,0x7FDE,
0x8024,0x805D,0x805C,0x8189,0x8186,0x8183,0x8187,0x818D,
0x818C,0x818B,0x8215,0x8497,0x84A4,0x84A1,0x849F,0x84BA,
0x84CE,0x84C2,0x84AC,0x84AE,0x84AB,0x84B9,0x84B4,0x84C1,
0x84CD,0x84AA,0x849A,0x84B1,0x84D0,0x849D,0x84A7,0x84BB,
0x84A2,0x8494,0x84C7,0x84CC,0x849B,0x84A9,0x84AF,0x84A8,
0x84D6,0x8498,0x84B6,0x84CF,0x84A0,0x84D7,0x84D4,0x84D2,
0x84DB,0x84B0,0x8491,0x8661,0x8733,0x8723,0x8728,0x876B,
0x8740,0x872E,0x871E,0x8721,0x8719,0x871B,0x8743,0x872C,
0x8741,0x873E,0x8746,0x8720,0x8732,0x872A,0x872D,0x873C,
0x8712,0x873A,0x8731,0x8735,0x8742,0x8726,0x8727,0x8738,
0x8724,0x871A,0x8730,0x8711,0x88F7,0x88E7,0x88F1,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 79, Array index 0x2E00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x88F2,0x88FA,0x88FE,0x88EE,0x88FC,0x88F6,0x88FB,
0x88F0,0x88EC,0x88EB,0x899D,0x89A1,0x899F,0x899E,0x89E9,
0x89EB,0x89E8,0x8AAB,0x8A99,0x8A8B,0x8A92,0x8A8F,0x8A96,
0x8C3D,0x8C68,0x8C69,0x8CD5,0x8CCF,0x8CD7,0x8D96,0x8E09,
0x8E02,0x8DFF,0x8E0D,0x8DFD,0x8E0A,0x8E03,0x8E07,0x8E06,
0x8E05,0x8DFE,0x8E00,0x8E04,0x8F10,0x8F11,0x8F0E,0x8F0D,
0x9123,0x911C,0x9120,0x9122,0x911F,0x911D,0x911A,0x9124,
0x9121,0x911B,0x917A,0x9172,0x9179,0x9173,0x92A5,0x92A4,
0x9276,0x929B,0x927A,0x92A0,0x9294,0x92AA,0x928D,0x92A6,
0x929A,0x92AB,0x9279,0x9297,0x927F,0x92A3,0x92EE,0x928E,
0x9282,0x9295,0x92A2,0x927D,0x9288,0x92A1,0x928A,0x9286,
0x928C,0x9299,0x92A7,0x927E,0x9287,0x92A9,0x929D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 80, Array index 0x2F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x928B,0x922D,0x969E,0x96A1,0x96FF,0x9758,0x977D,
0x977A,0x977E,0x9783,0x9780,0x9782,0x977B,0x9784,0x9781,
0x977F,0x97CE,0x97CD,0x9816,0x98AD,0x98AE,0x9902,0x9900,
0x9907,0x999D,0x999C,0x99C3,0x99B9,0x99BB,0x99BA,0x99C2,
0x99BD,0x99C7,0x9AB1,0x9AE3,0x9AE7,0x9B3E,0x9B3F,0x9B60,
0x9B61,0x9B5F,0x9CF1,0x9CF2,0x9CF5,0x9EA7,0x50FF,0x5103,
0x5130,0x50F8,0x5106,0x5107,0x50F6,0x50FE,0x510B,0x510C,
0x50FD,0x510A,0x528B,0x528C,0x52F1,0x52EF,0x5648,0x5642,
0x564C,0x5635,0x5641,0x564A,0x5649,0x5646,0x5658,0x565A,
0x5640,0x5633,0x563D,0x562C,0x563E,0x5638,0x562A,0x563A,
0x571A,0x58AB,0x589D,0x58B1,0x58A0,0x58A3,0x58AF,0x58AC,
0x58A5,0x58A1,0x58FF,0x5AFF,0x5AF4,0x5AFD,0x5AF7,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 81, Array index 0x3000 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5AF6,0x5B03,0x5AF8,0x5B02,0x5AF9,0x5B01,0x5B07,
0x5B05,0x5B0F,0x5C67,0x5D99,0x5D97,0x5D9F,0x5D92,0x5DA2,
0x5D93,0x5D95,0x5DA0,0x5D9C,0x5DA1,0x5D9A,0x5D9E,0x5E69,
0x5E5D,0x5E60,0x5E5C,0x7DF3,0x5EDB,0x5EDE,0x5EE1,0x5F49,
0x5FB2,0x618B,0x6183,0x6179,0x61B1,0x61B0,0x61A2,0x6189,
0x619B,0x6193,0x61AF,0x61AD,0x619F,0x6192,0x61AA,0x61A1,
0x618D,0x6166,0x61B3,0x622D,0x646E,0x6470,0x6496,0x64A0,
0x6485,0x6497,0x649C,0x648F,0x648B,0x648A,0x648C,0x64A3,
0x649F,0x6468,0x64B1,0x6498,0x6576,0x657A,0x6579,0x657B,
0x65B2,0x65B3,0x66B5,0x66B0,0x66A9,0x66B2,0x66B7,0x66AA,
0x66AF,0x6A00,0x6A06,0x6A17,0x69E5,0x69F8,0x6A15,0x69F1,
0x69E4,0x6A20,0x69FF,0x69EC,0x69E2,0x6A1B,0x6A1D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 82, Array index 0x3100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x69FE,0x6A27,0x69F2,0x69EE,0x6A14,0x69F7,0x69E7,
0x6A40,0x6A08,0x69E6,0x69FB,0x6A0D,0x69FC,0x69EB,0x6A09,
0x6A04,0x6A18,0x6A25,0x6A0F,0x69F6,0x6A26,0x6A07,0x69F4,
0x6A16,0x6B51,0x6BA5,0x6BA3,0x6BA2,0x6BA6,0x6C01,0x6C00,
0x6BFF,0x6C02,0x6F41,0x6F26,0x6F7E,0x6F87,0x6FC6,0x6F92,
0x6F8D,0x6F89,0x6F8C,0x6F62,0x6F4F,0x6F85,0x6F5A,0x6F96,
0x6F76,0x6F6C,0x6F82,0x6F55,0x6F72,0x6F52,0x6F50,0x6F57,
0x6F94,0x6F93,0x6F5D,0x6F00,0x6F61,0x6F6B,0x6F7D,0x6F67,
0x6F90,0x6F53,0x6F8B,0x6F69,0x6F7F,0x6F95,0x6F63,0x6F77,
0x6F6A,0x6F7B,0x71B2,0x71AF,0x719B,0x71B0,0x71A0,0x719A,
0x71A9,0x71B5,0x719D,0x71A5,0x719E,0x71A4,0x71A1,0x71AA,
0x719C,0x71A7,0x71B3,0x7298,0x729A,0x7358,0x7352,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 83, Array index 0x3200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x735E,0x735F,0x7360,0x735D,0x735B,0x7361,0x735A,
0x7359,0x7362,0x7487,0x7489,0x748A,0x7486,0x7481,0x747D,
0x7485,0x7488,0x747C,0x7479,0x7508,0x7507,0x757E,0x7625,
0x761E,0x7619,0x761D,0x761C,0x7623,0x761A,0x7628,0x761B,
0x769C,0x769D,0x769E,0x769B,0x778D,0x778F,0x7789,0x7788,
0x78CD,0x78BB,0x78CF,0x78CC,0x78D1,0x78CE,0x78D4,0x78C8,
0x78C3,0x78C4,0x78C9,0x799A,0x79A1,0x79A0,0x799C,0x79A2,
0x799B,0x6B76,0x7A39,0x7AB2,0x7AB4,0x7AB3,0x7BB7,0x7BCB,
0x7BBE,0x7BAC,0x7BCE,0x7BAF,0x7BB9,0x7BCA,0x7BB5,0x7CC5,
0x7CC8,0x7CCC,0x7CCB,0x7DF7,0x7DDB,0x7DEA,0x7DE7,0x7DD7,
0x7DE1,0x7E03,0x7DFA,0x7DE6,0x7DF6,0x7DF1,0x7DF0,0x7DEE,
0x7DDF,0x7F76,0x7FAC,0x7FB0,0x7FAD,0x7FED,0x7FEB,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 84, Array index 0x3300 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7FEA,0x7FEC,0x7FE6,0x7FE8,0x8064,0x8067,0x81A3,
0x819F,0x819E,0x8195,0x81A2,0x8199,0x8197,0x8216,0x824F,
0x8253,0x8252,0x8250,0x824E,0x8251,0x8524,0x853B,0x850F,
0x8500,0x8529,0x850E,0x8509,0x850D,0x851F,0x850A,0x8527,
0x851C,0x84FB,0x852B,0x84FA,0x8508,0x850C,0x84F4,0x852A,
0x84F2,0x8515,0x84F7,0x84EB,0x84F3,0x84FC,0x8512,0x84EA,
0x84E9,0x8516,0x84FE,0x8528,0x851D,0x852E,0x8502,0x84FD,
0x851E,0x84F6,0x8531,0x8526,0x84E7,0x84E8,0x84F0,0x84EF,
0x84F9,0x8518,0x8520,0x8530,0x850B,0x8519,0x852F,0x8662,
0x8756,0x8763,0x8764,0x8777,0x87E1,0x8773,0x8758,0x8754,
0x875B,0x8752,0x8761,0x875A,0x8751,0x875E,0x876D,0x876A,
0x8750,0x874E,0x875F,0x875D,0x876F,0x876C,0x877A,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 85, Array index 0x3400 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x876E,0x875C,0x8765,0x874F,0x877B,0x8775,0x8762,
0x8767,0x8769,0x885A,0x8905,0x890C,0x8914,0x890B,0x8917,
0x8918,0x8919,0x8906,0x8916,0x8911,0x890E,0x8909,0x89A2,
0x89A4,0x89A3,0x89ED,0x89F0,0x89EC,0x8ACF,0x8AC6,0x8AB8,
0x8AD3,0x8AD1,0x8AD4,0x8AD5,0x8ABB,0x8AD7,0x8ABE,0x8AC0,
0x8AC5,0x8AD8,0x8AC3,0x8ABA,0x8ABD,0x8AD9,0x8C3E,0x8C4D,
0x8C8F,0x8CE5,0x8CDF,0x8CD9,0x8CE8,0x8CDA,0x8CDD,0x8CE7,
0x8DA0,0x8D9C,0x8DA1,0x8D9B,0x8E20,0x8E23,0x8E25,0x8E24,
0x8E2E,0x8E15,0x8E1B,0x8E16,0x8E11,0x8E19,0x8E26,0x8E27,
0x8E14,0x8E12,0x8E18,0x8E13,0x8E1C,0x8E17,0x8E1A,0x8F2C,
0x8F24,0x8F18,0x8F1A,0x8F20,0x8F23,0x8F16,0x8F17,0x9073,
0x9070,0x906F,0x9067,0x906B,0x912F,0x912B,0x9129,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 86, Array index 0x3500 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x912A,0x9132,0x9126,0x912E,0x9185,0x9186,0x918A,
0x9181,0x9182,0x9184,0x9180,0x92D0,0x92C3,0x92C4,0x92C0,
0x92D9,0x92B6,0x92CF,0x92F1,0x92DF,0x92D8,0x92E9,0x92D7,
0x92DD,0x92CC,0x92EF,0x92C2,0x92E8,0x92CA,0x92C8,0x92CE,
0x92E6,0x92CD,0x92D5,0x92C9,0x92E0,0x92DE,0x92E7,0x92D1,
0x92D3,0x92B5,0x92E1,0x9325,0x92C6,0x92B4,0x957C,0x95AC,
0x95AB,0x95AE,0x95B0,0x96A4,0x96A2,0x96D3,0x9705,0x9708,
0x9702,0x975A,0x978A,0x978E,0x9788,0x97D0,0x97CF,0x981E,
0x981D,0x9826,0x9829,0x9828,0x9820,0x981B,0x9827,0x98B2,
0x9908,0x98FA,0x9911,0x9914,0x9916,0x9917,0x9915,0x99DC,
0x99CD,0x99CF,0x99D3,0x99D4,0x99CE,0x99C9,0x99D6,0x99D8,
0x99CB,0x99D7,0x99CC,0x9AB3,0x9AEC,0x9AEB,0x9AF3,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 87, Array index 0x3600 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9AF2,0x9AF1,0x9B46,0x9B43,0x9B67,0x9B74,0x9B71,
0x9B66,0x9B76,0x9B75,0x9B70,0x9B68,0x9B64,0x9B6C,0x9CFC,
0x9CFA,0x9CFD,0x9CFF,0x9CF7,0x9D07,0x9D00,0x9CF9,0x9CFB,
0x9D08,0x9D05,0x9D04,0x9E83,0x9ED3,0x9F0F,0x9F10,0x511C,
0x5113,0x5117,0x511A,0x5111,0x51DE,0x5334,0x53E1,0x5670,
0x5660,0x566E,0x5673,0x5666,0x5663,0x566D,0x5672,0x565E,
0x5677,0x571C,0x571B,0x58C8,0x58BD,0x58C9,0x58BF,0x58BA,
0x58C2,0x58BC,0x58C6,0x5B17,0x5B19,0x5B1B,0x5B21,0x5B14,
0x5B13,0x5B10,0x5B16,0x5B28,0x5B1A,0x5B20,0x5B1E,0x5BEF,
0x5DAC,0x5DB1,0x5DA9,0x5DA7,0x5DB5,0x5DB0,0x5DAE,0x5DAA,
0x5DA8,0x5DB2,0x5DAD,0x5DAF,0x5DB4,0x5E67,0x5E68,0x5E66,
0x5E6F,0x5EE9,0x5EE7,0x5EE6,0x5EE8,0x5EE5,0x5F4B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 88, Array index 0x3700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5FBC,0x5FBB,0x619D,0x61A8,0x6196,0x61C5,0x61B4,
0x61C6,0x61C1,0x61CC,0x61BA,0x61BF,0x61B8,0x618C,0x64D7,
0x64D6,0x64D0,0x64CF,0x64C9,0x64BD,0x6489,0x64C3,0x64DB,
0x64F3,0x64D9,0x6533,0x657F,0x657C,0x65A2,0x66C8,0x66BE,
0x66C0,0x66CA,0x66CB,0x66CF,0x66BD,0x66BB,0x66BA,0x66CC,
0x6723,0x6A34,0x6A66,0x6A49,0x6A67,0x6A32,0x6A68,0x6A3E,
0x6A5D,0x6A6D,0x6A76,0x6A5B,0x6A51,0x6A28,0x6A5A,0x6A3B,
0x6A3F,0x6A41,0x6A6A,0x6A64,0x6A50,0x6A4F,0x6A54,0x6A6F,
0x6A69,0x6A60,0x6A3C,0x6A5E,0x6A56,0x6A55,0x6A4D,0x6A4E,
0x6A46,0x6B55,0x6B54,0x6B56,0x6BA7,0x6BAA,0x6BAB,0x6BC8,
0x6BC7,0x6C04,0x6C03,0x6C06,0x6FAD,0x6FCB,0x6FA3,0x6FC7,
0x6FBC,0x6FCE,0x6FC8,0x6F5E,0x6FC4,0x6FBD,0x6F9E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 89, Array index 0x3800 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6FCA,0x6FA8,0x7004,0x6FA5,0x6FAE,0x6FBA,0x6FAC,
0x6FAA,0x6FCF,0x6FBF,0x6FB8,0x6FA2,0x6FC9,0x6FAB,0x6FCD,
0x6FAF,0x6FB2,0x6FB0,0x71C5,0x71C2,0x71BF,0x71B8,0x71D6,
0x71C0,0x71C1,0x71CB,0x71D4,0x71CA,0x71C7,0x71CF,0x71BD,
0x71D8,0x71BC,0x71C6,0x71DA,0x71DB,0x729D,0x729E,0x7369,
0x7366,0x7367,0x736C,0x7365,0x736B,0x736A,0x747F,0x749A,
0x74A0,0x7494,0x7492,0x7495,0x74A1,0x750B,0x7580,0x762F,
0x762D,0x7631,0x763D,0x7633,0x763C,0x7635,0x7632,0x7630,
0x76BB,0x76E6,0x779A,0x779D,0x77A1,0x779C,0x779B,0x77A2,
0x77A3,0x7795,0x7799,0x7797,0x78DD,0x78E9,0x78E5,0x78EA,
0x78DE,0x78E3,0x78DB,0x78E1,0x78E2,0x78ED,0x78DF,0x78E0,
0x79A4,0x7A44,0x7A48,0x7A47,0x7AB6,0x7AB8,0x7AB5,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 90, Array index 0x3900 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7AB1,0x7AB7,0x7BDE,0x7BE3,0x7BE7,0x7BDD,0x7BD5,
0x7BE5,0x7BDA,0x7BE8,0x7BF9,0x7BD4,0x7BEA,0x7BE2,0x7BDC,
0x7BEB,0x7BD8,0x7BDF,0x7CD2,0x7CD4,0x7CD7,0x7CD0,0x7CD1,
0x7E12,0x7E21,0x7E17,0x7E0C,0x7E1F,0x7E20,0x7E13,0x7E0E,
0x7E1C,0x7E15,0x7E1A,0x7E22,0x7E0B,0x7E0F,0x7E16,0x7E0D,
0x7E14,0x7E25,0x7E24,0x7F43,0x7F7B,0x7F7C,0x7F7A,0x7FB1,
0x7FEF,0x802A,0x8029,0x806C,0x81B1,0x81A6,0x81AE,0x81B9,
0x81B5,0x81AB,0x81B0,0x81AC,0x81B4,0x81B2,0x81B7,0x81A7,
0x81F2,0x8255,0x8256,0x8257,0x8556,0x8545,0x856B,0x854D,
0x8553,0x8561,0x8558,0x8540,0x8546,0x8564,0x8541,0x8562,
0x8544,0x8551,0x8547,0x8563,0x853E,0x855B,0x8571,0x854E,
0x856E,0x8575,0x8555,0x8567,0x8560,0x858C,0x8566,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 91, Array index 0x3A00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x855D,0x8554,0x8565,0x856C,0x8663,0x8665,0x8664,
0x87A4,0x879B,0x878F,0x8797,0x8793,0x8792,0x8788,0x8781,
0x8796,0x8798,0x8779,0x8787,0x87A3,0x8785,0x8790,0x8791,
0x879D,0x8784,0x8794,0x879C,0x879A,0x8789,0x891E,0x8926,
0x8930,0x892D,0x892E,0x8927,0x8931,0x8922,0x8929,0x8923,
0x892F,0x892C,0x891F,0x89F1,0x8AE0,0x8AE2,0x8AF2,0x8AF4,
0x8AF5,0x8ADD,0x8B14,0x8AE4,0x8ADF,0x8AF0,0x8AC8,0x8ADE,
0x8AE1,0x8AE8,0x8AFF,0x8AEF,0x8AFB,0x8C91,0x8C92,0x8C90,
0x8CF5,0x8CEE,0x8CF1,0x8CF0,0x8CF3,0x8D6C,0x8D6E,0x8DA5,
0x8DA7,0x8E33,0x8E3E,0x8E38,0x8E40,0x8E45,0x8E36,0x8E3C,
0x8E3D,0x8E41,0x8E30,0x8E3F,0x8EBD,0x8F36,0x8F2E,0x8F35,
0x8F32,0x8F39,0x8F37,0x8F34,0x9076,0x9079,0x907B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 92, Array index 0x3B00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9086,0x90FA,0x9133,0x9135,0x9136,0x9193,0x9190,
0x9191,0x918D,0x918F,0x9327,0x931E,0x9308,0x931F,0x9306,
0x930F,0x937A,0x9338,0x933C,0x931B,0x9323,0x9312,0x9301,
0x9346,0x932D,0x930E,0x930D,0x92CB,0x931D,0x92FA,0x9313,
0x92F9,0x92F7,0x9334,0x9302,0x9324,0x92FF,0x9329,0x9339,
0x9335,0x932A,0x9314,0x930C,0x930B,0x92FE,0x9309,0x9300,
0x92FB,0x9316,0x95BC,0x95CD,0x95BE,0x95B9,0x95BA,0x95B6,
0x95BF,0x95B5,0x95BD,0x96A9,0x96D4,0x970B,0x9712,0x9710,
0x9799,0x9797,0x9794,0x97F0,0x97F8,0x9835,0x982F,0x9832,
0x9924,0x991F,0x9927,0x9929,0x999E,0x99EE,0x99EC,0x99E5,
0x99E4,0x99F0,0x99E3,0x99EA,0x99E9,0x99E7,0x9AB9,0x9ABF,
0x9AB4,0x9ABB,0x9AF6,0x9AFA,0x9AF9,0x9AF7,0x9B33,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 93, Array index 0x3C00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9B80,0x9B85,0x9B87,0x9B7C,0x9B7E,0x9B7B,0x9B82,
0x9B93,0x9B92,0x9B90,0x9B7A,0x9B95,0x9B7D,0x9B88,0x9D25,
0x9D17,0x9D20,0x9D1E,0x9D14,0x9D29,0x9D1D,0x9D18,0x9D22,
0x9D10,0x9D19,0x9D1F,0x9E88,0x9E86,0x9E87,0x9EAE,0x9EAD,
0x9ED5,0x9ED6,0x9EFA,0x9F12,0x9F3D,0x5126,0x5125,0x5122,
0x5124,0x5120,0x5129,0x52F4,0x5693,0x568C,0x568D,0x5686,
0x5684,0x5683,0x567E,0x5682,0x567F,0x5681,0x58D6,0x58D4,
0x58CF,0x58D2,0x5B2D,0x5B25,0x5B32,0x5B23,0x5B2C,0x5B27,
0x5B26,0x5B2F,0x5B2E,0x5B7B,0x5BF1,0x5BF2,0x5DB7,0x5E6C,
0x5E6A,0x5FBE,0x61C3,0x61B5,0x61BC,0x61E7,0x61E0,0x61E5,
0x61E4,0x61E8,0x61DE,0x64EF,0x64E9,0x64E3,0x64EB,0x64E4,
0x64E8,0x6581,0x6580,0x65B6,0x65DA,0x66D2,0x6A8D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 94, Array index 0x3D00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6A96,0x6A81,0x6AA5,0x6A89,0x6A9F,0x6A9B,0x6AA1,
0x6A9E,0x6A87,0x6A93,0x6A8E,0x6A95,0x6A83,0x6AA8,0x6AA4,
0x6A91,0x6A7F,0x6AA6,0x6A9A,0x6A85,0x6A8C,0x6A92,0x6B5B,
0x6BAD,0x6C09,0x6FCC,0x6FA9,0x6FF4,0x6FD4,0x6FE3,0x6FDC,
0x6FED,0x6FE7,0x6FE6,0x6FDE,0x6FF2,0x6FDD,0x6FE2,0x6FE8,
0x71E1,0x71F1,0x71E8,0x71F2,0x71E4,0x71F0,0x71E2,0x7373,
0x736E,0x736F,0x7497,0x74B2,0x74AB,0x7490,0x74AA,0x74AD,
0x74B1,0x74A5,0x74AF,0x7510,0x7511,0x7512,0x750F,0x7584,
0x7643,0x7648,0x7649,0x7647,0x76A4,0x76E9,0x77B5,0x77AB,
0x77B2,0x77B7,0x77B6,0x77B4,0x77B1,0x77A8,0x77F0,0x78F3,
0x78FD,0x7902,0x78FB,0x78FC,0x78FF,0x78F2,0x7905,0x78F9,
0x78FE,0x7904,0x79AB,0x79A8,0x7A5C,0x7A5B,0x7A56,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 95, Array index 0x3E00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7A58,0x7A54,0x7A5A,0x7ABE,0x7AC0,0x7AC1,0x7C05,
0x7C0F,0x7BF2,0x7C00,0x7BFF,0x7BFB,0x7C0E,0x7BF4,0x7C0B,
0x7BF3,0x7C02,0x7C09,0x7C03,0x7C01,0x7BF8,0x7BFD,0x7C06,
0x7BF0,0x7BF1,0x7C10,0x7C0A,0x7CE8,0x7E2D,0x7E3C,0x7E42,
0x7E33,0x9848,0x7E38,0x7E2A,0x7E49,0x7E40,0x7E47,0x7E29,
0x7E4C,0x7E30,0x7E3B,0x7E36,0x7E44,0x7E3A,0x7F45,0x7F7F,
0x7F7E,0x7F7D,0x7FF4,0x7FF2,0x802C,0x81BB,0x81C4,0x81CC,
0x81CA,0x81C5,0x81C7,0x81BC,0x81E9,0x825B,0x825A,0x825C,
0x8583,0x8580,0x858F,0x85A7,0x8595,0x85A0,0x858B,0x85A3,
0x857B,0x85A4,0x859A,0x859E,0x8577,0x857C,0x8589,0x85A1,
0x857A,0x8578,0x8557,0x858E,0x8596,0x8586,0x858D,0x8599,
0x859D,0x8581,0x85A2,0x8582,0x8588,0x8585,0x8579,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 96, Array index 0x3F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8576,0x8598,0x8590,0x859F,0x8668,0x87BE,0x87AA,
0x87AD,0x87C5,0x87B0,0x87AC,0x87B9,0x87B5,0x87BC,0x87AE,
0x87C9,0x87C3,0x87C2,0x87CC,0x87B7,0x87AF,0x87C4,0x87CA,
0x87B4,0x87B6,0x87BF,0x87B8,0x87BD,0x87DE,0x87B2,0x8935,
0x8933,0x893C,0x893E,0x8941,0x8952,0x8937,0x8942,0x89AD,
0x89AF,0x89AE,0x89F2,0x89F3,0x8B1E,0x8B18,0x8B16,0x8B11,
0x8B05,0x8B0B,0x8B22,0x8B0F,0x8B12,0x8B15,0x8B07,0x8B0D,
0x8B08,0x8B06,0x8B1C,0x8B13,0x8B1A,0x8C4F,0x8C70,0x8C72,
0x8C71,0x8C6F,0x8C95,0x8C94,0x8CF9,0x8D6F,0x8E4E,0x8E4D,
0x8E53,0x8E50,0x8E4C,0x8E47,0x8F43,0x8F40,0x9085,0x907E,
0x9138,0x919A,0x91A2,0x919B,0x9199,0x919F,0x91A1,0x919D,
0x91A0,0x93A1,0x9383,0x93AF,0x9364,0x9356,0x9347,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 97, Array index 0x4000 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x937C,0x9358,0x935C,0x9376,0x9349,0x9350,0x9351,
0x9360,0x936D,0x938F,0x934C,0x936A,0x9379,0x9357,0x9355,
0x9352,0x934F,0x9371,0x9377,0x937B,0x9361,0x935E,0x9363,
0x9367,0x934E,0x9359,0x95C7,0x95C0,0x95C9,0x95C3,0x95C5,
0x95B7,0x96AE,0x96B0,0x96AC,0x9720,0x971F,0x9718,0x971D,
0x9719,0x979A,0x97A1,0x979C,0x979E,0x979D,0x97D5,0x97D4,
0x97F1,0x9841,0x9844,0x984A,0x9849,0x9845,0x9843,0x9925,
0x992B,0x992C,0x992A,0x9933,0x9932,0x992F,0x992D,0x9931,
0x9930,0x9998,0x99A3,0x99A1,0x9A02,0x99FA,0x99F4,0x99F7,
0x99F9,0x99F8,0x99F6,0x99FB,0x99FD,0x99FE,0x99FC,0x9A03,
0x9ABE,0x9AFE,0x9AFD,0x9B01,0x9AFC,0x9B48,0x9B9A,0x9BA8,
0x9B9E,0x9B9B,0x9BA6,0x9BA1,0x9BA5,0x9BA4,0x9B86,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 98, Array index 0x4100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9BA2,0x9BA0,0x9BAF,0x9D33,0x9D41,0x9D67,0x9D36,
0x9D2E,0x9D2F,0x9D31,0x9D38,0x9D30,0x9D45,0x9D42,0x9D43,
0x9D3E,0x9D37,0x9D40,0x9D3D,0x7FF5,0x9D2D,0x9E8A,0x9E89,
0x9E8D,0x9EB0,0x9EC8,0x9EDA,0x9EFB,0x9EFF,0x9F24,0x9F23,
0x9F22,0x9F54,0x9FA0,0x5131,0x512D,0x512E,0x5698,0x569C,
0x5697,0x569A,0x569D,0x5699,0x5970,0x5B3C,0x5C69,0x5C6A,
0x5DC0,0x5E6D,0x5E6E,0x61D8,0x61DF,0x61ED,0x61EE,0x61F1,
0x61EA,0x61F0,0x61EB,0x61D6,0x61E9,0x64FF,0x6504,0x64FD,
0x64F8,0x6501,0x6503,0x64FC,0x6594,0x65DB,0x66DA,0x66DB,
0x66D8,0x6AC5,0x6AB9,0x6ABD,0x6AE1,0x6AC6,0x6ABA,0x6AB6,
0x6AB7,0x6AC7,0x6AB4,0x6AAD,0x6B5E,0x6BC9,0x6C0B,0x7007,
0x700C,0x700D,0x7001,0x7005,0x7014,0x700E,0x6FFF,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 99, Array index 0x4200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x7000,0x6FFB,0x7026,0x6FFC,0x6FF7,0x700A,0x7201,
0x71FF,0x71F9,0x7203,0x71FD,0x7376,0x74B8,0x74C0,0x74B5,
0x74C1,0x74BE,0x74B6,0x74BB,0x74C2,0x7514,0x7513,0x765C,
0x7664,0x7659,0x7650,0x7653,0x7657,0x765A,0x76A6,0x76BD,
0x76EC,0x77C2,0x77BA,0x790C,0x7913,0x7914,0x7909,0x7910,
0x7912,0x7911,0x79AD,0x79AC,0x7A5F,0x7C1C,0x7C29,0x7C19,
0x7C20,0x7C1F,0x7C2D,0x7C1D,0x7C26,0x7C28,0x7C22,0x7C25,
0x7C30,0x7E5C,0x7E50,0x7E56,0x7E63,0x7E58,0x7E62,0x7E5F,
0x7E51,0x7E60,0x7E57,0x7E53,0x7FB5,0x7FB3,0x7FF7,0x7FF8,
0x8075,0x81D1,0x81D2,0x81D0,0x825F,0x825E,0x85B4,0x85C6,
0x85C0,0x85C3,0x85C2,0x85B3,0x85B5,0x85BD,0x85C7,0x85C4,
0x85BF,0x85CB,0x85CE,0x85C8,0x85C5,0x85B1,0x85B6,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 100, Array index 0x4300 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x85D2,0x8624,0x85B8,0x85B7,0x85BE,0x8669,0x87E7,
0x87E6,0x87E2,0x87DB,0x87EB,0x87EA,0x87E5,0x87DF,0x87F3,
0x87E4,0x87D4,0x87DC,0x87D3,0x87ED,0x87D8,0x87E3,0x87D7,
0x87D9,0x8801,0x87F4,0x87E8,0x87DD,0x8953,0x894B,0x894F,
0x894C,0x8946,0x8950,0x8951,0x8949,0x8B2A,0x8B27,0x8B23,
0x8B33,0x8B30,0x8B35,0x8B47,0x8B2F,0x8B3C,0x8B3E,0x8B31,
0x8B25,0x8B37,0x8B26,0x8B36,0x8B2E,0x8B24,0x8B3B,0x8B3D,
0x8B3A,0x8C42,0x8C75,0x8C99,0x8C98,0x8C97,0x8CFE,0x8D04,
0x8D02,0x8D00,0x8E5C,0x8E62,0x8E60,0x8E57,0x8E56,0x8E5E,
0x8E65,0x8E67,0x8E5B,0x8E5A,0x8E61,0x8E5D,0x8E69,0x8E54,
0x8F46,0x8F47,0x8F48,0x8F4B,0x9128,0x913A,0x913B,0x913E,
0x91A8,0x91A5,0x91A7,0x91AF,0x91AA,0x93B5,0x938C,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 101, Array index 0x4400 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9392,0x93B7,0x939B,0x939D,0x9389,0x93A7,0x938E,
0x93AA,0x939E,0x93A6,0x9395,0x9388,0x9399,0x939F,0x9380,
0x938D,0x93B1,0x9391,0x93B2,0x93A4,0x93A8,0x93B4,0x93A3,
0x95D2,0x95D3,0x95D1,0x96B3,0x96D7,0x96DA,0x5DC2,0x96DF,
0x96D8,0x96DD,0x9723,0x9722,0x9725,0x97AC,0x97AE,0x97A8,
0x97AB,0x97A4,0x97AA,0x97A2,0x97A5,0x97D7,0x97D9,0x97D6,
0x97D8,0x97FA,0x9850,0x9851,0x9852,0x98B8,0x9941,0x993C,
0x993A,0x9A0F,0x9A0B,0x9A09,0x9A0D,0x9A04,0x9A11,0x9A0A,
0x9A05,0x9A07,0x9A06,0x9AC0,0x9ADC,0x9B08,0x9B04,0x9B05,
0x9B29,0x9B35,0x9B4A,0x9B4C,0x9B4B,0x9BC7,0x9BC6,0x9BC3,
0x9BBF,0x9BC1,0x9BB5,0x9BB8,0x9BD3,0x9BB6,0x9BC4,0x9BB9,
0x9BBD,0x9D5C,0x9D53,0x9D4F,0x9D4A,0x9D5B,0x9D4B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 102, Array index 0x4500 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9D59,0x9D56,0x9D4C,0x9D57,0x9D52,0x9D54,0x9D5F,
0x9D58,0x9D5A,0x9E8E,0x9E8C,0x9EDF,0x9F01,0x9F00,0x9F16,
0x9F25,0x9F2B,0x9F2A,0x9F29,0x9F28,0x9F4C,0x9F55,0x5134,
0x5135,0x5296,0x52F7,0x53B4,0x56AB,0x56AD,0x56A6,0x56A7,
0x56AA,0x56AC,0x58DA,0x58DD,0x58DB,0x5912,0x5B3D,0x5B3E,
0x5B3F,0x5DC3,0x5E70,0x5FBF,0x61FB,0x6507,0x6510,0x650D,
0x6509,0x650C,0x650E,0x6584,0x65DE,0x65DD,0x66DE,0x6AE7,
0x6AE0,0x6ACC,0x6AD1,0x6AD9,0x6ACB,0x6ADF,0x6ADC,0x6AD0,
0x6AEB,0x6ACF,0x6ACD,0x6ADE,0x6B60,0x6BB0,0x6C0C,0x7019,
0x7027,0x7020,0x7016,0x702B,0x7021,0x7022,0x7023,0x7029,
0x7017,0x7024,0x701C,0x720C,0x720A,0x7207,0x7202,0x7205,
0x72A5,0x72A6,0x72A4,0x72A3,0x72A1,0x74CB,0x74C5,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 103, Array index 0x4600 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x74B7,0x74C3,0x7516,0x7660,0x77C9,0x77CA,0x77C4,
0x77F1,0x791D,0x791B,0x7921,0x791C,0x7917,0x791E,0x79B0,
0x7A67,0x7A68,0x7C33,0x7C3C,0x7C39,0x7C2C,0x7C3B,0x7CEC,
0x7CEA,0x7E76,0x7E75,0x7E78,0x7E70,0x7E77,0x7E6F,0x7E7A,
0x7E72,0x7E74,0x7E68,0x7F4B,0x7F4A,0x7F83,0x7F86,0x7FB7,
0x7FFD,0x7FFE,0x8078,0x81D7,0x81D5,0x820B,0x8264,0x8261,
0x8263,0x85EB,0x85F1,0x85ED,0x85D9,0x85E1,0x85E8,0x85DA,
0x85D7,0x85EC,0x85F2,0x85F8,0x85D8,0x85DF,0x85E3,0x85DC,
0x85D1,0x85F0,0x85E6,0x85EF,0x85DE,0x85E2,0x8800,0x87FA,
0x8803,0x87F6,0x87F7,0x8809,0x880C,0x880B,0x8806,0x87FC,
0x8808,0x87FF,0x880A,0x8802,0x8962,0x895A,0x895B,0x8957,
0x8961,0x895C,0x8958,0x895D,0x8959,0x8988,0x89B7,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 104, Array index 0x4700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x89B6,0x89F6,0x8B50,0x8B48,0x8B4A,0x8B40,0x8B53,
0x8B56,0x8B54,0x8B4B,0x8B55,0x8B51,0x8B42,0x8B52,0x8B57,
0x8C43,0x8C77,0x8C76,0x8C9A,0x8D06,0x8D07,0x8D09,0x8DAC,
0x8DAA,0x8DAD,0x8DAB,0x8E6D,0x8E78,0x8E73,0x8E6A,0x8E6F,
0x8E7B,0x8EC2,0x8F52,0x8F51,0x8F4F,0x8F50,0x8F53,0x8FB4,
0x9140,0x913F,0x91B0,0x91AD,0x93DE,0x93C7,0x93CF,0x93C2,
0x93DA,0x93D0,0x93F9,0x93EC,0x93CC,0x93D9,0x93A9,0x93E6,
0x93CA,0x93D4,0x93EE,0x93E3,0x93D5,0x93C4,0x93CE,0x93C0,
0x93D2,0x93A5,0x93E7,0x957D,0x95DA,0x95DB,0x96E1,0x9729,
0x972B,0x972C,0x9728,0x9726,0x97B3,0x97B7,0x97B6,0x97DD,
0x97DE,0x97DF,0x985C,0x9859,0x985D,0x9857,0x98BF,0x98BD,
0x98BB,0x98BE,0x9948,0x9947,0x9943,0x99A6,0x99A7,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 105, Array index 0x4800 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9A1A,0x9A15,0x9A25,0x9A1D,0x9A24,0x9A1B,0x9A22,
0x9A20,0x9A27,0x9A23,0x9A1E,0x9A1C,0x9A14,0x9AC2,0x9B0B,
0x9B0A,0x9B0E,0x9B0C,0x9B37,0x9BEA,0x9BEB,0x9BE0,0x9BDE,
0x9BE4,0x9BE6,0x9BE2,0x9BF0,0x9BD4,0x9BD7,0x9BEC,0x9BDC,
0x9BD9,0x9BE5,0x9BD5,0x9BE1,0x9BDA,0x9D77,0x9D81,0x9D8A,
0x9D84,0x9D88,0x9D71,0x9D80,0x9D78,0x9D86,0x9D8B,0x9D8C,
0x9D7D,0x9D6B,0x9D74,0x9D75,0x9D70,0x9D69,0x9D85,0x9D73,
0x9D7B,0x9D82,0x9D6F,0x9D79,0x9D7F,0x9D87,0x9D68,0x9E94,
0x9E91,0x9EC0,0x9EFC,0x9F2D,0x9F40,0x9F41,0x9F4D,0x9F56,
0x9F57,0x9F58,0x5337,0x56B2,0x56B5,0x56B3,0x58E3,0x5B45,
0x5DC6,0x5DC7,0x5EEE,0x5EEF,0x5FC0,0x5FC1,0x61F9,0x6517,
0x6516,0x6515,0x6513,0x65DF,0x66E8,0x66E3,0x66E4,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 106, Array index 0x4900 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6AF3,0x6AF0,0x6AEA,0x6AE8,0x6AF9,0x6AF1,0x6AEE,
0x6AEF,0x703C,0x7035,0x702F,0x7037,0x7034,0x7031,0x7042,
0x7038,0x703F,0x703A,0x7039,0x702A,0x7040,0x703B,0x7033,
0x7041,0x7213,0x7214,0x72A8,0x737D,0x737C,0x74BA,0x76AB,
0x76AA,0x76BE,0x76ED,0x77CC,0x77CE,0x77CF,0x77CD,0x77F2,
0x7925,0x7923,0x7927,0x7928,0x7924,0x7929,0x79B2,0x7A6E,
0x7A6C,0x7A6D,0x7AF7,0x7C49,0x7C48,0x7C4A,0x7C47,0x7C45,
0x7CEE,0x7E7B,0x7E7E,0x7E81,0x7E80,0x7FBA,0x7FFF,0x8079,
0x81DB,0x81D9,0x8268,0x8269,0x8622,0x85FF,0x8601,0x85FE,
0x861B,0x8600,0x85F6,0x8604,0x8609,0x8605,0x860C,0x85FD,
0x8819,0x8810,0x8811,0x8817,0x8813,0x8816,0x8963,0x8966,
0x89B9,0x89F7,0x8B60,0x8B6A,0x8B5D,0x8B68,0x8B63,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 107, Array index 0x4A00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8B65,0x8B67,0x8B6D,0x8DAE,0x8E86,0x8E88,0x8E84,
0x8F59,0x8F56,0x8F57,0x8F55,0x8F58,0x8F5A,0x908D,0x9143,
0x9141,0x91B7,0x91B5,0x91B2,0x91B3,0x940B,0x9413,0x93FB,
0x9420,0x940F,0x9414,0x93FE,0x9415,0x9410,0x9428,0x9419,
0x940D,0x93F5,0x9400,0x93F7,0x9407,0x940E,0x9416,0x9412,
0x93FA,0x9409,0x93F8,0x943C,0x940A,0x93FF,0x93FC,0x940C,
0x93F6,0x9411,0x9406,0x95DE,0x95E0,0x95DF,0x972E,0x972F,
0x97B9,0x97BB,0x97FD,0x97FE,0x9860,0x9862,0x9863,0x985F,
0x98C1,0x98C2,0x9950,0x994E,0x9959,0x994C,0x994B,0x9953,
0x9A32,0x9A34,0x9A31,0x9A2C,0x9A2A,0x9A36,0x9A29,0x9A2E,
0x9A38,0x9A2D,0x9AC7,0x9ACA,0x9AC6,0x9B10,0x9B12,0x9B11,
0x9C0B,0x9C08,0x9BF7,0x9C05,0x9C12,0x9BF8,0x9C40,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 108, Array index 0x4B00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9C07,0x9C0E,0x9C06,0x9C17,0x9C14,0x9C09,0x9D9F,
0x9D99,0x9DA4,0x9D9D,0x9D92,0x9D98,0x9D90,0x9D9B,0x9DA0,
0x9D94,0x9D9C,0x9DAA,0x9D97,0x9DA1,0x9D9A,0x9DA2,0x9DA8,
0x9D9E,0x9DA3,0x9DBF,0x9DA9,0x9D96,0x9DA6,0x9DA7,0x9E99,
0x9E9B,0x9E9A,0x9EE5,0x9EE4,0x9EE7,0x9EE6,0x9F30,0x9F2E,
0x9F5B,0x9F60,0x9F5E,0x9F5D,0x9F59,0x9F91,0x513A,0x5139,
0x5298,0x5297,0x56C3,0x56BD,0x56BE,0x5B48,0x5B47,0x5DCB,
0x5DCF,0x5EF1,0x61FD,0x651B,0x6B02,0x6AFC,0x6B03,0x6AF8,
0x6B00,0x7043,0x7044,0x704A,0x7048,0x7049,0x7045,0x7046,
0x721D,0x721A,0x7219,0x737E,0x7517,0x766A,0x77D0,0x792D,
0x7931,0x792F,0x7C54,0x7C53,0x7CF2,0x7E8A,0x7E87,0x7E88,
0x7E8B,0x7E86,0x7E8D,0x7F4D,0x7FBB,0x8030,0x81DD,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 109, Array index 0x4C00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8618,0x862A,0x8626,0x861F,0x8623,0x861C,0x8619,
0x8627,0x862E,0x8621,0x8620,0x8629,0x861E,0x8625,0x8829,
0x881D,0x881B,0x8820,0x8824,0x881C,0x882B,0x884A,0x896D,
0x8969,0x896E,0x896B,0x89FA,0x8B79,0x8B78,0x8B45,0x8B7A,
0x8B7B,0x8D10,0x8D14,0x8DAF,0x8E8E,0x8E8C,0x8F5E,0x8F5B,
0x8F5D,0x9146,0x9144,0x9145,0x91B9,0x943F,0x943B,0x9436,
0x9429,0x943D,0x9430,0x9439,0x942A,0x9437,0x942C,0x9440,
0x9431,0x95E5,0x95E4,0x95E3,0x9735,0x973A,0x97BF,0x97E1,
0x9864,0x98C9,0x98C6,0x98C0,0x9958,0x9956,0x9A39,0x9A3D,
0x9A46,0x9A44,0x9A42,0x9A41,0x9A3A,0x9A3F,0x9ACD,0x9B15,
0x9B17,0x9B18,0x9B16,0x9B3A,0x9B52,0x9C2B,0x9C1D,0x9C1C,
0x9C2C,0x9C23,0x9C28,0x9C29,0x9C24,0x9C21,0x9DB7,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 110, Array index 0x4D00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9DB6,0x9DBC,0x9DC1,0x9DC7,0x9DCA,0x9DCF,0x9DBE,
0x9DC5,0x9DC3,0x9DBB,0x9DB5,0x9DCE,0x9DB9,0x9DBA,0x9DAC,
0x9DC8,0x9DB1,0x9DAD,0x9DCC,0x9DB3,0x9DCD,0x9DB2,0x9E7A,
0x9E9C,0x9EEB,0x9EEE,0x9EED,0x9F1B,0x9F18,0x9F1A,0x9F31,
0x9F4E,0x9F65,0x9F64,0x9F92,0x4EB9,0x56C6,0x56C5,0x56CB,
0x5971,0x5B4B,0x5B4C,0x5DD5,0x5DD1,0x5EF2,0x6521,0x6520,
0x6526,0x6522,0x6B0B,0x6B08,0x6B09,0x6C0D,0x7055,0x7056,
0x7057,0x7052,0x721E,0x721F,0x72A9,0x737F,0x74D8,0x74D5,
0x74D9,0x74D7,0x766D,0x76AD,0x7935,0x79B4,0x7A70,0x7A71,
0x7C57,0x7C5C,0x7C59,0x7C5B,0x7C5A,0x7CF4,0x7CF1,0x7E91,
0x7F4F,0x7F87,0x81DE,0x826B,0x8634,0x8635,0x8633,0x862C,
0x8632,0x8636,0x882C,0x8828,0x8826,0x882A,0x8825,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 111, Array index 0x4E00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x8971,0x89BF,0x89BE,0x89FB,0x8B7E,0x8B84,0x8B82,
0x8B86,0x8B85,0x8B7F,0x8D15,0x8E95,0x8E94,0x8E9A,0x8E92,
0x8E90,0x8E96,0x8E97,0x8F60,0x8F62,0x9147,0x944C,0x9450,
0x944A,0x944B,0x944F,0x9447,0x9445,0x9448,0x9449,0x9446,
0x973F,0x97E3,0x986A,0x9869,0x98CB,0x9954,0x995B,0x9A4E,
0x9A53,0x9A54,0x9A4C,0x9A4F,0x9A48,0x9A4A,0x9A49,0x9A52,
0x9A50,0x9AD0,0x9B19,0x9B2B,0x9B3B,0x9B56,0x9B55,0x9C46,
0x9C48,0x9C3F,0x9C44,0x9C39,0x9C33,0x9C41,0x9C3C,0x9C37,
0x9C34,0x9C32,0x9C3D,0x9C36,0x9DDB,0x9DD2,0x9DDE,0x9DDA,
0x9DCB,0x9DD0,0x9DDC,0x9DD1,0x9DDF,0x9DE9,0x9DD9,0x9DD8,
0x9DD6,0x9DF5,0x9DD5,0x9DDD,0x9EB6,0x9EF0,0x9F35,0x9F33,
0x9F32,0x9F42,0x9F6B,0x9F95,0x9FA2,0x513D,0x5299,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 112, Array index 0x4F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x58E8,0x58E7,0x5972,0x5B4D,0x5DD8,0x882F,0x5F4F,
0x6201,0x6203,0x6204,0x6529,0x6525,0x6596,0x66EB,0x6B11,
0x6B12,0x6B0F,0x6BCA,0x705B,0x705A,0x7222,0x7382,0x7381,
0x7383,0x7670,0x77D4,0x7C67,0x7C66,0x7E95,0x826C,0x863A,
0x8640,0x8639,0x863C,0x8631,0x863B,0x863E,0x8830,0x8832,
0x882E,0x8833,0x8976,0x8974,0x8973,0x89FE,0x8B8C,0x8B8E,
0x8B8B,0x8B88,0x8C45,0x8D19,0x8E98,0x8F64,0x8F63,0x91BC,
0x9462,0x9455,0x945D,0x9457,0x945E,0x97C4,0x97C5,0x9800,
0x9A56,0x9A59,0x9B1E,0x9B1F,0x9B20,0x9C52,0x9C58,0x9C50,
0x9C4A,0x9C4D,0x9C4B,0x9C55,0x9C59,0x9C4C,0x9C4E,0x9DFB,
0x9DF7,0x9DEF,0x9DE3,0x9DEB,0x9DF8,0x9DE4,0x9DF6,0x9DE1,
0x9DEE,0x9DE6,0x9DF2,0x9DF0,0x9DE2,0x9DEC,0x9DF4,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 113, Array index 0x5000 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9DF3,0x9DE8,0x9DED,0x9EC2,0x9ED0,0x9EF2,0x9EF3,
0x9F06,0x9F1C,0x9F38,0x9F37,0x9F36,0x9F43,0x9F4F,0x9F71,
0x9F70,0x9F6E,0x9F6F,0x56D3,0x56CD,0x5B4E,0x5C6D,0x652D,
0x66ED,0x66EE,0x6B13,0x705F,0x7061,0x705D,0x7060,0x7223,
0x74DB,0x74E5,0x77D5,0x7938,0x79B7,0x79B6,0x7C6A,0x7E97,
0x7F89,0x826D,0x8643,0x8838,0x8837,0x8835,0x884B,0x8B94,
0x8B95,0x8E9E,0x8E9F,0x8EA0,0x8E9D,0x91BE,0x91BD,0x91C2,
0x946B,0x9468,0x9469,0x96E5,0x9746,0x9743,0x9747,0x97C7,
0x97E5,0x9A5E,0x9AD5,0x9B59,0x9C63,0x9C67,0x9C66,0x9C62,
0x9C5E,0x9C60,0x9E02,0x9DFE,0x9E07,0x9E03,0x9E06,0x9E05,
0x9E00,0x9E01,0x9E09,0x9DFF,0x9DFD,0x9E04,0x9EA0,0x9F1E,
0x9F46,0x9F74,0x9F75,0x9F76,0x56D4,0x652E,0x65B8,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 114, Array index 0x5100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6B18,0x6B19,0x6B17,0x6B1A,0x7062,0x7226,0x72AA,
0x77D8,0x77D9,0x7939,0x7C69,0x7C6B,0x7CF6,0x7E9A,0x7E98,
0x7E9B,0x7E99,0x81E0,0x81E1,0x8646,0x8647,0x8648,0x8979,
0x897A,0x897C,0x897B,0x89FF,0x8B98,0x8B99,0x8EA5,0x8EA4,
0x8EA3,0x946E,0x946D,0x946F,0x9471,0x9473,0x9749,0x9872,
0x995F,0x9C68,0x9C6E,0x9C6D,0x9E0B,0x9E0D,0x9E10,0x9E0F,
0x9E12,0x9E11,0x9EA1,0x9EF5,0x9F09,0x9F47,0x9F78,0x9F7B,
0x9F7A,0x9F79,0x571E,0x7066,0x7C6F,0x883C,0x8DB2,0x8EA6,
0x91C3,0x9474,0x9478,0x9476,0x9475,0x9A60,0x9B2E,0x9C74,
0x9C73,0x9C71,0x9C75,0x9E14,0x9E13,0x9EF6,0x9F0A,0x9FA4,
0x7068,0x7065,0x7CF7,0x866A,0x883E,0x883D,0x883F,0x8B9E,
0x8C9C,0x8EA9,0x8EC9,0x974B,0x9873,0x9874,0x98CC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 115, Array index 0x5200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x9961,0x99AB,0x9A64,0x9A66,0x9A67,0x9B24,0x9E15,
0x9E17,0x9F48,0x6207,0x6B1E,0x7227,0x864C,0x8EA8,0x9482,
0x9480,0x9481,0x9A69,0x9A68,0x9E19,0x864B,0x8B9F,0x9483,
0x9C79,0x9EB7,0x7675,0x9A6B,0x9C7A,0x9E1D,0x7069,0x706A,
0x7229,0x9EA4,0x9F7E,0x9F49,0x9F98,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
};
#endif /* ICONV_TO_UCS_CCS_CNS11643_PLANE2 && !defined (TABLE_USE_SIZE_OPTIMIZATION) */
/*
* 16-bit cns11643_plane2 -> UCS size-optimized table (15798 bytes).
* ======================================================================
*/
#if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \
&& (defined (TABLE_USE_SIZE_OPTIMIZATION))
static _CONST __uint16_t
to_ucs_size_cns11643_plane2[] =
{
0x0052, /* Ranges number */
0x0000, /* Unranged codes number */
0x1EDB, /* First unranged code index */
/* Ranges list: first code, last Code, array index. */
/* Array index: 0x0003 */ 0x2121, 0x217E, 0x00F9,
/* Array index: 0x0006 */ 0x2221, 0x227E, 0x0157,
/* Array index: 0x0009 */ 0x2321, 0x237E, 0x01B5,
/* Array index: 0x000C */ 0x2421, 0x247E, 0x0213,
/* Array index: 0x000F */ 0x2521, 0x257E, 0x0271,
/* Array index: 0x0012 */ 0x2621, 0x267E, 0x02CF,
/* Array index: 0x0015 */ 0x2721, 0x277E, 0x032D,
/* Array index: 0x0018 */ 0x2821, 0x287E, 0x038B,
/* Array index: 0x001B */ 0x2921, 0x297E, 0x03E9,
/* Array index: 0x001E */ 0x2A21, 0x2A7E, 0x0447,
/* Array index: 0x0021 */ 0x2B21, 0x2B7E, 0x04A5,
/* Array index: 0x0024 */ 0x2C21, 0x2C7E, 0x0503,
/* Array index: 0x0027 */ 0x2D21, 0x2D7E, 0x0561,
/* Array index: 0x002A */ 0x2E21, 0x2E7E, 0x05BF,
/* Array index: 0x002D */ 0x2F21, 0x2F7E, 0x061D,
/* Array index: 0x0030 */ 0x3021, 0x307E, 0x067B,
/* Array index: 0x0033 */ 0x3121, 0x317E, 0x06D9,
/* Array index: 0x0036 */ 0x3221, 0x327E, 0x0737,
/* Array index: 0x0039 */ 0x3321, 0x337E, 0x0795,
/* Array index: 0x003C */ 0x3421, 0x347E, 0x07F3,
/* Array index: 0x003F */ 0x3521, 0x357E, 0x0851,
/* Array index: 0x0042 */ 0x3621, 0x367E, 0x08AF,
/* Array index: 0x0045 */ 0x3721, 0x377E, 0x090D,
/* Array index: 0x0048 */ 0x3821, 0x387E, 0x096B,
/* Array index: 0x004B */ 0x3921, 0x397E, 0x09C9,
/* Array index: 0x004E */ 0x3A21, 0x3A7E, 0x0A27,
/* Array index: 0x0051 */ 0x3B21, 0x3B7E, 0x0A85,
/* Array index: 0x0054 */ 0x3C21, 0x3C7E, 0x0AE3,
/* Array index: 0x0057 */ 0x3D21, 0x3D7E, 0x0B41,
/* Array index: 0x005A */ 0x3E21, 0x3E7E, 0x0B9F,
/* Array index: 0x005D */ 0x3F21, 0x3F7E, 0x0BFD,
/* Array index: 0x0060 */ 0x4021, 0x407E, 0x0C5B,
/* Array index: 0x0063 */ 0x4121, 0x417E, 0x0CB9,
/* Array index: 0x0066 */ 0x4221, 0x427E, 0x0D17,
/* Array index: 0x0069 */ 0x4321, 0x437E, 0x0D75,
/* Array index: 0x006C */ 0x4421, 0x447E, 0x0DD3,
/* Array index: 0x006F */ 0x4521, 0x457E, 0x0E31,
/* Array index: 0x0072 */ 0x4621, 0x467E, 0x0E8F,
/* Array index: 0x0075 */ 0x4721, 0x477E, 0x0EED,
/* Array index: 0x0078 */ 0x4821, 0x487E, 0x0F4B,
/* Array index: 0x007B */ 0x4921, 0x497E, 0x0FA9,
/* Array index: 0x007E */ 0x4A21, 0x4A7E, 0x1007,
/* Array index: 0x0081 */ 0x4B21, 0x4B7E, 0x1065,
/* Array index: 0x0084 */ 0x4C21, 0x4C7E, 0x10C3,
/* Array index: 0x0087 */ 0x4D21, 0x4D7E, 0x1121,
/* Array index: 0x008A */ 0x4E21, 0x4E7E, 0x117F,
/* Array index: 0x008D */ 0x4F21, 0x4F7E, 0x11DD,
/* Array index: 0x0090 */ 0x5021, 0x507E, 0x123B,
/* Array index: 0x0093 */ 0x5121, 0x517E, 0x1299,
/* Array index: 0x0096 */ 0x5221, 0x527E, 0x12F7,
/* Array index: 0x0099 */ 0x5321, 0x537E, 0x1355,
/* Array index: 0x009C */ 0x5421, 0x547E, 0x13B3,
/* Array index: 0x009F */ 0x5521, 0x557E, 0x1411,
/* Array index: 0x00A2 */ 0x5621, 0x567E, 0x146F,
/* Array index: 0x00A5 */ 0x5721, 0x577E, 0x14CD,
/* Array index: 0x00A8 */ 0x5821, 0x587E, 0x152B,
/* Array index: 0x00AB */ 0x5921, 0x597E, 0x1589,
/* Array index: 0x00AE */ 0x5A21, 0x5A7E, 0x15E7,
/* Array index: 0x00B1 */ 0x5B21, 0x5B7E, 0x1645,
/* Array index: 0x00B4 */ 0x5C21, 0x5C7E, 0x16A3,
/* Array index: 0x00B7 */ 0x5D21, 0x5D7E, 0x1701,
/* Array index: 0x00BA */ 0x5E21, 0x5E7E, 0x175F,
/* Array index: 0x00BD */ 0x5F21, 0x5F7E, 0x17BD,
/* Array index: 0x00C0 */ 0x6021, 0x607E, 0x181B,
/* Array index: 0x00C3 */ 0x6121, 0x617E, 0x1879,
/* Array index: 0x00C6 */ 0x6221, 0x627E, 0x18D7,
/* Array index: 0x00C9 */ 0x6321, 0x637E, 0x1935,
/* Array index: 0x00CC */ 0x6421, 0x647E, 0x1993,
/* Array index: 0x00CF */ 0x6521, 0x657E, 0x19F1,
/* Array index: 0x00D2 */ 0x6621, 0x667E, 0x1A4F,
/* Array index: 0x00D5 */ 0x6721, 0x677E, 0x1AAD,
/* Array index: 0x00D8 */ 0x6821, 0x687E, 0x1B0B,
/* Array index: 0x00DB */ 0x6921, 0x697E, 0x1B69,
/* Array index: 0x00DE */ 0x6A21, 0x6A7E, 0x1BC7,
/* Array index: 0x00E1 */ 0x6B21, 0x6B7E, 0x1C25,
/* Array index: 0x00E4 */ 0x6C21, 0x6C7E, 0x1C83,
/* Array index: 0x00E7 */ 0x6D21, 0x6D7E, 0x1CE1,
/* Array index: 0x00EA */ 0x6E21, 0x6E7E, 0x1D3F,
/* Array index: 0x00ED */ 0x6F21, 0x6F7E, 0x1D9D,
/* Array index: 0x00F0 */ 0x7021, 0x707E, 0x1DFB,
/* Array index: 0x00F3 */ 0x7121, 0x717E, 0x1E59,
/* Array index: 0x00F6 */ 0x7221, 0x7244, 0x1EB7,
/* Ranges content */
/* Range 0x2121 - 0x217E, array index: 0x00F9 */
0x4E42,0x4E5C,0x51F5,0x531A,0x5382,0x4E07,0x4E0C,0x4E47,
0x4E8D,0x56D7,0x5C6E,0x5F73,0x4E0F,0x5187,0x4E0E,0x4E2E,
0x4E93,0x4EC2,0x4EC9,0x4EC8,0x5198,0x52FC,0x536C,0x53B9,
0x5720,0x5903,0x592C,0x5C10,0x5DFF,0x65E1,0x6BB3,0x6BCC,
0x6C14,0x723F,0x4E31,0x4E3C,0x4EE8,0x4EDC,0x4EE9,0x4EE1,
0x4EDD,0x4EDA,0x520C,0x5209,0x531C,0x534C,0x5722,0x5723,
0x5917,0x592F,0x5B81,0x5B84,0x5C12,0x5C3B,0x5C74,0x5C73,
0x5E04,0x5E80,0x5E82,0x5FC9,0x6209,0x6250,0x6C15,0x6C36,
0x6C43,0x6C3F,0x6C3B,0x72AE,0x72B0,0x738A,0x79B8,0x808A,
0x961E,0x4F0E,0x4F18,0x4F2C,0x4EF5,0x4F14,0x4EF1,0x4F00,
0x4EF7,0x4F08,0x4F1D,0x4F02,0x4F05,0x4F22,0x4F13,0x4F04,
0x4EF4,0x4F12,0x51B1,0x5213,0x5210,0x52A6,
/* Range 0x2221 - 0x227E, array index: 0x0157 */
0x5322,0x531F,0x534D,0x538A,0x5407,0x56E1,0x56DF,0x572E,
0x572A,0x5734,0x593C,0x5980,0x597C,0x5985,0x597B,0x597E,
0x5977,0x597F,0x5B56,0x5C15,0x5C25,0x5C7C,0x5C7A,0x5C7B,
0x5C7E,0x5DDF,0x5E75,0x5E84,0x5F02,0x5F1A,0x5F74,0x5FD5,
0x5FD4,0x5FCF,0x625C,0x625E,0x6264,0x6261,0x6266,0x6262,
0x6259,0x6260,0x625A,0x6265,0x6537,0x65EF,0x65EE,0x673E,
0x6739,0x6738,0x673B,0x673A,0x673F,0x673C,0x6733,0x6C18,
0x6C46,0x6C52,0x6C5C,0x6C4F,0x6C4A,0x6C54,0x6C4B,0x6C4C,
0x7071,0x725E,0x72B4,0x72B5,0x738E,0x752A,0x767F,0x7A75,
0x7F51,0x8278,0x827C,0x8280,0x827D,0x827F,0x864D,0x897E,
0x9099,0x9097,0x9098,0x909B,0x9094,0x9622,0x9624,0x9620,
0x9623,0x4F56,0x4F3B,0x4F62,0x4F49,0x4F53,
/* Range 0x2321 - 0x237E, array index: 0x01B5 */
0x4F64,0x4F3E,0x4F67,0x4F52,0x4F5F,0x4F41,0x4F58,0x4F2D,
0x4F33,0x4F3F,0x4F61,0x518F,0x51B9,0x521C,0x521E,0x5221,
0x52AD,0x52AE,0x5309,0x5363,0x5372,0x538E,0x538F,0x5430,
0x5437,0x542A,0x5454,0x5445,0x5419,0x541C,0x5425,0x5418,
0x543D,0x544F,0x5441,0x5428,0x5424,0x5447,0x56EE,0x56E7,
0x56E5,0x5741,0x5745,0x574C,0x5749,0x574B,0x5752,0x5906,
0x5940,0x59A6,0x5998,0x59A0,0x5997,0x598E,0x59A2,0x5990,
0x598F,0x59A7,0x59A1,0x5B8E,0x5B92,0x5C28,0x5C2A,0x5C8D,
0x5C8F,0x5C88,0x5C8B,0x5C89,0x5C92,0x5C8A,0x5C86,0x5C93,
0x5C95,0x5DE0,0x5E0A,0x5E0E,0x5E8B,0x5E89,0x5E8C,0x5E88,
0x5E8D,0x5F05,0x5F1D,0x5F78,0x5F76,0x5FD2,0x5FD1,0x5FD0,
0x5FED,0x5FE8,0x5FEE,0x5FF3,0x5FE1,0x5FE4,
/* Range 0x2421 - 0x247E, array index: 0x0213 */
0x5FE3,0x5FFA,0x5FEF,0x5FF7,0x5FFB,0x6000,0x5FF4,0x623A,
0x6283,0x628C,0x628E,0x628F,0x6294,0x6287,0x6271,0x627B,
0x627A,0x6270,0x6281,0x6288,0x6277,0x627D,0x6272,0x6274,
0x65F0,0x65F4,0x65F3,0x65F2,0x65F5,0x6745,0x6747,0x6759,
0x6755,0x674C,0x6748,0x675D,0x674D,0x675A,0x674B,0x6BD0,
0x6C19,0x6C1A,0x6C78,0x6C67,0x6C6B,0x6C84,0x6C8B,0x6C8F,
0x6C71,0x6C6F,0x6C69,0x6C9A,0x6C6D,0x6C87,0x6C95,0x6C9C,
0x6C66,0x6C73,0x6C65,0x6C7B,0x6C8E,0x7074,0x707A,0x7263,
0x72BF,0x72BD,0x72C3,0x72C6,0x72C1,0x72BA,0x72C5,0x7395,
0x7397,0x7393,0x7394,0x7392,0x753A,0x7539,0x7594,0x7595,
0x7681,0x793D,0x8034,0x8095,0x8099,0x8090,0x8092,0x809C,
0x8290,0x828F,0x8285,0x828E,0x8291,0x8293,
/* Range 0x2521 - 0x257E, array index: 0x0271 */
0x828A,0x8283,0x8284,0x8C78,0x8FC9,0x8FBF,0x909F,0x90A1,
0x90A5,0x909E,0x90A7,0x90A0,0x9630,0x9628,0x962F,0x962D,
0x4E33,0x4F98,0x4F7C,0x4F85,0x4F7D,0x4F80,0x4F87,0x4F76,
0x4F74,0x4F89,0x4F84,0x4F77,0x4F4C,0x4F97,0x4F6A,0x4F9A,
0x4F79,0x4F81,0x4F78,0x4F90,0x4F9C,0x4F94,0x4F9E,0x4F92,
0x4F82,0x4F95,0x4F6B,0x4F6E,0x519E,0x51BC,0x51BE,0x5235,
0x5232,0x5233,0x5246,0x5231,0x52BC,0x530A,0x530B,0x533C,
0x5392,0x5394,0x5487,0x547F,0x5481,0x5491,0x5482,0x5488,
0x546B,0x547A,0x547E,0x5465,0x546C,0x5474,0x5466,0x548D,
0x546F,0x5461,0x5460,0x5498,0x5463,0x5467,0x5464,0x56F7,
0x56F9,0x576F,0x5772,0x576D,0x576B,0x5771,0x5770,0x5776,
0x5780,0x5775,0x577B,0x5773,0x5774,0x5762,
/* Range 0x2621 - 0x267E, array index: 0x02CF */
0x5768,0x577D,0x590C,0x5945,0x59B5,0x59BA,0x59CF,0x59CE,
0x59B2,0x59CC,0x59C1,0x59B6,0x59BC,0x59C3,0x59D6,0x59B1,
0x59BD,0x59C0,0x59C8,0x59B4,0x59C7,0x5B62,0x5B65,0x5B93,
0x5B95,0x5C44,0x5C47,0x5CAE,0x5CA4,0x5CA0,0x5CB5,0x5CAF,
0x5CA8,0x5CAC,0x5C9F,0x5CA3,0x5CAD,0x5CA2,0x5CAA,0x5CA7,
0x5C9D,0x5CA5,0x5CB6,0x5CB0,0x5CA6,0x5E17,0x5E14,0x5E19,
0x5F28,0x5F22,0x5F23,0x5F24,0x5F54,0x5F82,0x5F7E,0x5F7D,
0x5FDE,0x5FE5,0x602D,0x6026,0x6019,0x6032,0x600B,0x6034,
0x600A,0x6017,0x6033,0x601A,0x601E,0x602C,0x6022,0x600D,
0x6010,0x602E,0x6013,0x6011,0x600C,0x6009,0x601C,0x6214,
0x623D,0x62AD,0x62B4,0x62D1,0x62BE,0x62AA,0x62B6,0x62CA,
0x62AE,0x62B3,0x62AF,0x62BB,0x62A9,0x62B0,
/* Range 0x2721 - 0x277E, array index: 0x032D */
0x62B8,0x653D,0x65A8,0x65BB,0x6609,0x65FC,0x6604,0x6612,
0x6608,0x65FB,0x6603,0x660B,0x660D,0x6605,0x65FD,0x6611,
0x6610,0x66F6,0x670A,0x6785,0x676C,0x678E,0x6792,0x6776,
0x677B,0x6798,0x6786,0x6784,0x6774,0x678D,0x678C,0x677A,
0x679F,0x6791,0x6799,0x6783,0x677D,0x6781,0x6778,0x6779,
0x6794,0x6B25,0x6B80,0x6B7E,0x6BDE,0x6C1D,0x6C93,0x6CEC,
0x6CEB,0x6CEE,0x6CD9,0x6CB6,0x6CD4,0x6CAD,0x6CE7,0x6CB7,
0x6CD0,0x6CC2,0x6CBA,0x6CC3,0x6CC6,0x6CED,0x6CF2,0x6CD2,
0x6CDD,0x6CB4,0x6C8A,0x6C9D,0x6C80,0x6CDE,0x6CC0,0x6D30,
0x6CCD,0x6CC7,0x6CB0,0x6CF9,0x6CCF,0x6CE9,0x6CD1,0x7094,
0x7098,0x7085,0x7093,0x7086,0x7084,0x7091,0x7096,0x7082,
0x709A,0x7083,0x726A,0x72D6,0x72CB,0x72D8,
/* Range 0x2821 - 0x287E, array index: 0x038B */
0x72C9,0x72DC,0x72D2,0x72D4,0x72DA,0x72CC,0x72D1,0x73A4,
0x73A1,0x73AD,0x73A6,0x73A2,0x73A0,0x73AC,0x739D,0x74DD,
0x74E8,0x753F,0x7540,0x753E,0x758C,0x7598,0x76AF,0x76F3,
0x76F1,0x76F0,0x76F5,0x77F8,0x77FC,0x77F9,0x77FB,0x77FA,
0x77F7,0x7942,0x793F,0x79C5,0x7A78,0x7A7B,0x7AFB,0x7C75,
0x7CFD,0x8035,0x808F,0x80AE,0x80A3,0x80B8,0x80B5,0x80AD,
0x8220,0x82A0,0x82C0,0x82AB,0x829A,0x8298,0x829B,0x82B5,
0x82A7,0x82AE,0x82BC,0x829E,0x82BA,0x82B4,0x82A8,0x82A1,
0x82A9,0x82C2,0x82A4,0x82C3,0x82B6,0x82A2,0x8670,0x866F,
0x866D,0x866E,0x8C56,0x8FD2,0x8FCB,0x8FD3,0x8FCD,0x8FD6,
0x8FD5,0x8FD7,0x90B2,0x90B4,0x90AF,0x90B3,0x90B0,0x9639,
0x963D,0x963C,0x963A,0x9643,0x4FCD,0x4FC5,
/* Range 0x2921 - 0x297E, array index: 0x03E9 */
0x4FD3,0x4FB2,0x4FC9,0x4FCB,0x4FC1,0x4FD4,0x4FDC,0x4FD9,
0x4FBB,0x4FB3,0x4FDB,0x4FC7,0x4FD6,0x4FBA,0x4FC0,0x4FB9,
0x4FEC,0x5244,0x5249,0x52C0,0x52C2,0x533D,0x537C,0x5397,
0x5396,0x5399,0x5398,0x54BA,0x54A1,0x54AD,0x54A5,0x54CF,
0x54C3,0x830D,0x54B7,0x54AE,0x54D6,0x54B6,0x54C5,0x54C6,
0x54A0,0x5470,0x54BC,0x54A2,0x54BE,0x5472,0x54DE,0x54B0,
0x57B5,0x579E,0x579F,0x57A4,0x578C,0x5797,0x579D,0x579B,
0x5794,0x5798,0x578F,0x5799,0x57A5,0x579A,0x5795,0x58F4,
0x590D,0x5953,0x59E1,0x59DE,0x59EE,0x5A00,0x59F1,0x59DD,
0x59FA,0x59FD,0x59FC,0x59F6,0x59E4,0x59F2,0x59F7,0x59DB,
0x59E9,0x59F3,0x59F5,0x59E0,0x59FE,0x59F4,0x59ED,0x5BA8,
0x5C4C,0x5CD0,0x5CD8,0x5CCC,0x5CD7,0x5CCB,
/* Range 0x2A21 - 0x2A7E, array index: 0x0447 */
0x5CDB,0x5CDE,0x5CDA,0x5CC9,0x5CC7,0x5CCA,0x5CD6,0x5CD3,
0x5CD4,0x5CCF,0x5CC8,0x5CC6,0x5CCE,0x5CDF,0x5CF8,0x5DF9,
0x5E21,0x5E22,0x5E23,0x5E20,0x5E24,0x5EB0,0x5EA4,0x5EA2,
0x5E9B,0x5EA3,0x5EA5,0x5F07,0x5F2E,0x5F56,0x5F86,0x6037,
0x6039,0x6054,0x6072,0x605E,0x6045,0x6053,0x6047,0x6049,
0x605B,0x604C,0x6040,0x6042,0x605F,0x6024,0x6044,0x6058,
0x6066,0x606E,0x6242,0x6243,0x62CF,0x630D,0x630B,0x62F5,
0x630E,0x6303,0x62EB,0x62F9,0x630F,0x630C,0x62F8,0x62F6,
0x6300,0x6313,0x6314,0x62FA,0x6315,0x62FB,0x62F0,0x6541,
0x6543,0x65AA,0x65BF,0x6636,0x6621,0x6632,0x6635,0x661C,
0x6626,0x6622,0x6633,0x662B,0x663A,0x661D,0x6634,0x6639,
0x662E,0x670F,0x6710,0x67C1,0x67F2,0x67C8,
/* Range 0x2B21 - 0x2B7E, array index: 0x04A5 */
0x67BA,0x67DC,0x67BB,0x67F8,0x67D8,0x67C0,0x67B7,0x67C5,
0x67EB,0x67E4,0x67DF,0x67B5,0x67CD,0x67B3,0x67F7,0x67F6,
0x67EE,0x67E3,0x67C2,0x67B9,0x67CE,0x67E7,0x67F0,0x67B2,
0x67FC,0x67C6,0x67ED,0x67CC,0x67AE,0x67E6,0x67DB,0x67FA,
0x67C9,0x67CA,0x67C3,0x67EA,0x67CB,0x6B28,0x6B82,0x6B84,
0x6BB6,0x6BD6,0x6BD8,0x6BE0,0x6C20,0x6C21,0x6D28,0x6D34,
0x6D2D,0x6D1F,0x6D3C,0x6D3F,0x6D12,0x6D0A,0x6CDA,0x6D33,
0x6D04,0x6D19,0x6D3A,0x6D1A,0x6D11,0x6D00,0x6D1D,0x6D42,
0x6D01,0x6D18,0x6D37,0x6D03,0x6D0F,0x6D40,0x6D07,0x6D20,
0x6D2C,0x6D08,0x6D22,0x6D09,0x6D10,0x70B7,0x709F,0x70BE,
0x70B1,0x70B0,0x70A1,0x70B4,0x70B5,0x70A9,0x7241,0x7249,
0x724A,0x726C,0x7270,0x7273,0x726E,0x72CA,
/* Range 0x2C21 - 0x2C7E, array index: 0x0503 */
0x72E4,0x72E8,0x72EB,0x72DF,0x72EA,0x72E6,0x72E3,0x7385,
0x73CC,0x73C2,0x73C8,0x73C5,0x73B9,0x73B6,0x73B5,0x73B4,
0x73EB,0x73BF,0x73C7,0x73BE,0x73C3,0x73C6,0x73B8,0x73CB,
0x74EC,0x74EE,0x752E,0x7547,0x7548,0x75A7,0x75AA,0x7679,
0x76C4,0x7708,0x7703,0x7704,0x7705,0x770A,0x76F7,0x76FB,
0x76FA,0x77E7,0x77E8,0x7806,0x7811,0x7812,0x7805,0x7810,
0x780F,0x780E,0x7809,0x7803,0x7813,0x794A,0x794C,0x794B,
0x7945,0x7944,0x79D5,0x79CD,0x79CF,0x79D6,0x79CE,0x7A80,
0x7A7E,0x7AD1,0x7B00,0x7B01,0x7C7A,0x7C78,0x7C79,0x7C7F,
0x7C80,0x7C81,0x7D03,0x7D08,0x7D01,0x7F58,0x7F91,0x7F8D,
0x7FBE,0x8007,0x800E,0x800F,0x8014,0x8037,0x80D8,0x80C7,
0x80E0,0x80D1,0x80C8,0x80C2,0x80D0,0x80C5,
/* Range 0x2D21 - 0x2D7E, array index: 0x0561 */
0x80E3,0x80D9,0x80DC,0x80CA,0x80D5,0x80C9,0x80CF,0x80D7,
0x80E6,0x80CD,0x81FF,0x8221,0x8294,0x82D9,0x82FE,0x82F9,
0x8307,0x82E8,0x8300,0x82D5,0x833A,0x82EB,0x82D6,0x82F4,
0x82EC,0x82E1,0x82F2,0x82F5,0x830C,0x82FB,0x82F6,0x82F0,
0x82EA,0x82E4,0x82E0,0x82FA,0x82F3,0x82ED,0x8677,0x8674,
0x867C,0x8673,0x8841,0x884E,0x8867,0x886A,0x8869,0x89D3,
0x8A04,0x8A07,0x8D72,0x8FE3,0x8FE1,0x8FEE,0x8FE0,0x90F1,
0x90BD,0x90BF,0x90D5,0x90C5,0x90BE,0x90C7,0x90CB,0x90C8,
0x91D4,0x91D3,0x9654,0x964F,0x9651,0x9653,0x964A,0x964E,
0x501E,0x5005,0x5007,0x5013,0x5022,0x5030,0x501B,0x4FF5,
0x4FF4,0x5033,0x5037,0x502C,0x4FF6,0x4FF7,0x5017,0x501C,
0x5020,0x5027,0x5035,0x502F,0x5031,0x500E,
/* Range 0x2E21 - 0x2E7E, array index: 0x05BF */
0x515A,0x5194,0x5193,0x51CA,0x51C4,0x51C5,0x51C8,0x51CE,
0x5261,0x525A,0x5252,0x525E,0x525F,0x5255,0x5262,0x52CD,
0x530E,0x539E,0x5526,0x54E2,0x5517,0x5512,0x54E7,0x54F3,
0x54E4,0x551A,0x54FF,0x5504,0x5508,0x54EB,0x5511,0x5505,
0x54F1,0x550A,0x54FB,0x54F7,0x54F8,0x54E0,0x550E,0x5503,
0x550B,0x5701,0x5702,0x57CC,0x5832,0x57D5,0x57D2,0x57BA,
0x57C6,0x57BD,0x57BC,0x57B8,0x57B6,0x57BF,0x57C7,0x57D0,
0x57B9,0x57C1,0x590E,0x594A,0x5A19,0x5A16,0x5A2D,0x5A2E,
0x5A15,0x5A0F,0x5A17,0x5A0A,0x5A1E,0x5A33,0x5B6C,0x5BA7,
0x5BAD,0x5BAC,0x5C03,0x5C56,0x5C54,0x5CEC,0x5CFF,0x5CEE,
0x5CF1,0x5CF7,0x5D00,0x5CF9,0x5E29,0x5E28,0x5EA8,0x5EAE,
0x5EAA,0x5EAC,0x5F33,0x5F30,0x5F67,0x605D,
/* Range 0x2F21 - 0x2F7E, array index: 0x061D */
0x605A,0x6067,0x6041,0x60A2,0x6088,0x6080,0x6092,0x6081,
0x609D,0x6083,0x6095,0x609B,0x6097,0x6087,0x609C,0x608E,
0x6219,0x6246,0x62F2,0x6310,0x6356,0x632C,0x6344,0x6345,
0x6336,0x6343,0x63E4,0x6339,0x634B,0x634A,0x633C,0x6329,
0x6341,0x6334,0x6358,0x6354,0x6359,0x632D,0x6347,0x6333,
0x635A,0x6351,0x6338,0x6357,0x6340,0x6348,0x654A,0x6546,
0x65C6,0x65C3,0x65C4,0x65C2,0x664A,0x665F,0x6647,0x6651,
0x6712,0x6713,0x681F,0x681A,0x6849,0x6832,0x6833,0x683B,
0x684B,0x684F,0x6816,0x6831,0x681C,0x6835,0x682B,0x682D,
0x682F,0x684E,0x6844,0x6834,0x681D,0x6812,0x6814,0x6826,
0x6828,0x682E,0x684D,0x683A,0x6825,0x6820,0x6B2C,0x6B2F,
0x6B2D,0x6B31,0x6B34,0x6B6D,0x8082,0x6B88,
/* Range 0x3021 - 0x307E, array index: 0x067B */
0x6BE6,0x6BE4,0x6BE8,0x6BE3,0x6BE2,0x6BE7,0x6C25,0x6D7A,
0x6D63,0x6D64,0x6D76,0x6D0D,0x6D61,0x6D92,0x6D58,0x6D62,
0x6D6D,0x6D6F,0x6D91,0x6D8D,0x6DEF,0x6D7F,0x6D86,0x6D5E,
0x6D67,0x6D60,0x6D97,0x6D70,0x6D7C,0x6D5F,0x6D82,0x6D98,
0x6D2F,0x6D68,0x6D8B,0x6D7E,0x6D80,0x6D84,0x6D16,0x6D83,
0x6D7B,0x6D7D,0x6D75,0x6D90,0x70DC,0x70D3,0x70D1,0x70DD,
0x70CB,0x7F39,0x70E2,0x70D7,0x70D2,0x70DE,0x70E0,0x70D4,
0x70CD,0x70C5,0x70C6,0x70C7,0x70DA,0x70CE,0x70E1,0x7242,
0x7278,0x7277,0x7276,0x7300,0x72FA,0x72F4,0x72FE,0x72F6,
0x72F3,0x72FB,0x7301,0x73D3,0x73D9,0x73E5,0x73D6,0x73BC,
0x73E7,0x73E3,0x73E9,0x73DC,0x73D2,0x73DB,0x73D4,0x73DD,
0x73DA,0x73D7,0x73D8,0x73E8,0x74DE,0x74DF,
/* Range 0x3121 - 0x317E, array index: 0x06D9 */
0x74F4,0x74F5,0x7521,0x755B,0x755F,0x75B0,0x75C1,0x75BB,
0x75C4,0x75C0,0x75BF,0x75B6,0x75BA,0x768A,0x76C9,0x771D,
0x771B,0x7710,0x7713,0x7712,0x7723,0x7711,0x7715,0x7719,
0x771A,0x7722,0x7727,0x7823,0x782C,0x7822,0x7835,0x782F,
0x7828,0x782E,0x782B,0x7821,0x7829,0x7833,0x782A,0x7831,
0x7954,0x795B,0x794F,0x795C,0x7953,0x7952,0x7951,0x79EB,
0x79EC,0x79E0,0x79EE,0x79ED,0x79EA,0x79DC,0x79DE,0x79DD,
0x7A86,0x7A89,0x7A85,0x7A8B,0x7A8C,0x7A8A,0x7A87,0x7AD8,
0x7B10,0x7B04,0x7B13,0x7B05,0x7B0F,0x7B08,0x7B0A,0x7B0E,
0x7B09,0x7B12,0x7C84,0x7C91,0x7C8A,0x7C8C,0x7C88,0x7C8D,
0x7C85,0x7D1E,0x7D1D,0x7D11,0x7D0E,0x7D18,0x7D16,0x7D13,
0x7D1F,0x7D12,0x7D0F,0x7D0C,0x7F5C,0x7F61,
/* Range 0x3221 - 0x327E, array index: 0x0737 */
0x7F5E,0x7F60,0x7F5D,0x7F5B,0x7F96,0x7F92,0x7FC3,0x7FC2,
0x7FC0,0x8016,0x803E,0x8039,0x80FA,0x80F2,0x80F9,0x80F5,
0x8101,0x80FB,0x8100,0x8201,0x822F,0x8225,0x8333,0x832D,
0x8344,0x8319,0x8351,0x8325,0x8356,0x833F,0x8341,0x8326,
0x831C,0x8322,0x8342,0x834E,0x831B,0x832A,0x8308,0x833C,
0x834D,0x8316,0x8324,0x8320,0x8337,0x832F,0x8329,0x8347,
0x8345,0x834C,0x8353,0x831E,0x832C,0x834B,0x8327,0x8348,
0x8653,0x8652,0x86A2,0x86A8,0x8696,0x868D,0x8691,0x869E,
0x8687,0x8697,0x8686,0x868B,0x869A,0x8685,0x86A5,0x8699,
0x86A1,0x86A7,0x8695,0x8698,0x868E,0x869D,0x8690,0x8694,
0x8843,0x8844,0x886D,0x8875,0x8876,0x8872,0x8880,0x8871,
0x887F,0x886F,0x8883,0x887E,0x8874,0x887C,
/* Range 0x3321 - 0x337E, array index: 0x0795 */
0x8A12,0x8C47,0x8C57,0x8C7B,0x8CA4,0x8CA3,0x8D76,0x8D78,
0x8DB5,0x8DB7,0x8DB6,0x8ED1,0x8ED3,0x8FFE,0x8FF5,0x9002,
0x8FFF,0x8FFB,0x9004,0x8FFC,0x8FF6,0x90D6,0x90E0,0x90D9,
0x90DA,0x90E3,0x90DF,0x90E5,0x90D8,0x90DB,0x90D7,0x90DC,
0x90E4,0x9150,0x914E,0x914F,0x91D5,0x91E2,0x91DA,0x965C,
0x965F,0x96BC,0x98E3,0x9ADF,0x9B2F,0x4E7F,0x5070,0x506A,
0x5061,0x505E,0x5060,0x5053,0x504B,0x505D,0x5072,0x5048,
0x504D,0x5041,0x505B,0x504A,0x5062,0x5015,0x5045,0x505F,
0x5069,0x506B,0x5063,0x5064,0x5046,0x5040,0x506E,0x5073,
0x5057,0x5051,0x51D0,0x526B,0x526D,0x526C,0x526E,0x52D6,
0x52D3,0x532D,0x539C,0x5575,0x5576,0x553C,0x554D,0x5550,
0x5534,0x552A,0x5551,0x5562,0x5536,0x5535,
/* Range 0x3421 - 0x347E, array index: 0x07F3 */
0x5530,0x5552,0x5545,0x550C,0x5532,0x5565,0x554E,0x5539,
0x5548,0x552D,0x553B,0x5540,0x554B,0x570A,0x5707,0x57FB,
0x5814,0x57E2,0x57F6,0x57DC,0x57F4,0x5800,0x57ED,0x57FD,
0x5808,0x57F8,0x580B,0x57F3,0x57CF,0x5807,0x57EE,0x57E3,
0x57F2,0x57E5,0x57EC,0x57E1,0x580E,0x57FC,0x5810,0x57E7,
0x5801,0x580C,0x57F1,0x57E9,0x57F0,0x580D,0x5804,0x595C,
0x5A60,0x5A58,0x5A55,0x5A67,0x5A5E,0x5A38,0x5A35,0x5A6D,
0x5A50,0x5A5F,0x5A65,0x5A6C,0x5A53,0x5A64,0x5A57,0x5A43,
0x5A5D,0x5A52,0x5A44,0x5A5B,0x5A48,0x5A8E,0x5A3E,0x5A4D,
0x5A39,0x5A4C,0x5A70,0x5A69,0x5A47,0x5A51,0x5A56,0x5A42,
0x5A5C,0x5B72,0x5B6E,0x5BC1,0x5BC0,0x5C59,0x5D1E,0x5D0B,
0x5D1D,0x5D1A,0x5D20,0x5D0C,0x5D28,0x5D0D,
/* Range 0x3521 - 0x357E, array index: 0x0851 */
0x5D26,0x5D25,0x5D0F,0x5D30,0x5D12,0x5D23,0x5D1F,0x5D2E,
0x5E3E,0x5E34,0x5EB1,0x5EB4,0x5EB9,0x5EB2,0x5EB3,0x5F36,
0x5F38,0x5F9B,0x5F96,0x5F9F,0x608A,0x6090,0x6086,0x60BE,
0x60B0,0x60BA,0x60D3,0x60D4,0x60CF,0x60E4,0x60D9,0x60DD,
0x60C8,0x60B1,0x60DB,0x60B7,0x60CA,0x60BF,0x60C3,0x60CD,
0x60C0,0x6332,0x6365,0x638A,0x6382,0x637D,0x63BD,0x639E,
0x63AD,0x639D,0x6397,0x63AB,0x638E,0x636F,0x6387,0x6390,
0x636E,0x63AF,0x6375,0x639C,0x636D,0x63AE,0x637C,0x63A4,
0x633B,0x639F,0x6378,0x6385,0x6381,0x6391,0x638D,0x6370,
0x6553,0x65CD,0x6665,0x6661,0x665B,0x6659,0x665C,0x6662,
0x6718,0x6879,0x6887,0x6890,0x689C,0x686D,0x686E,0x68AE,
0x68AB,0x6956,0x686F,0x68A3,0x68AC,0x68A9,
/* Range 0x3621 - 0x367E, array index: 0x08AF */
0x6875,0x6874,0x68B2,0x688F,0x6877,0x6892,0x687C,0x686B,
0x6872,0x68AA,0x6880,0x6871,0x687E,0x689B,0x6896,0x688B,
0x68A0,0x6889,0x68A4,0x6878,0x687B,0x6891,0x688C,0x688A,
0x687D,0x6B36,0x6B33,0x6B37,0x6B38,0x6B91,0x6B8F,0x6B8D,
0x6B8E,0x6B8C,0x6C2A,0x6DC0,0x6DAB,0x6DB4,0x6DB3,0x6E74,
0x6DAC,0x6DE9,0x6DE2,0x6DB7,0x6DF6,0x6DD4,0x6E00,0x6DC8,
0x6DE0,0x6DDF,0x6DD6,0x6DBE,0x6DE5,0x6DDC,0x6DDD,0x6DDB,
0x6DF4,0x6DCA,0x6DBD,0x6DED,0x6DF0,0x6DBA,0x6DD5,0x6DC2,
0x6DCF,0x6DC9,0x6DD0,0x6DF2,0x6DD3,0x6DFD,0x6DD7,0x6DCD,
0x6DE3,0x6DBB,0x70FA,0x710D,0x70F7,0x7117,0x70F4,0x710C,
0x70F0,0x7104,0x70F3,0x7110,0x70FC,0x70FF,0x7106,0x7113,
0x7100,0x70F8,0x70F6,0x710B,0x7102,0x710E,
/* Range 0x3721 - 0x377E, array index: 0x090D */
0x727E,0x727B,0x727C,0x727F,0x731D,0x7317,0x7307,0x7311,
0x7318,0x730A,0x7308,0x72FF,0x730F,0x731E,0x7388,0x73F6,
0x73F8,0x73F5,0x7404,0x7401,0x73FD,0x7407,0x7400,0x73FA,
0x73FC,0x73FF,0x740C,0x740B,0x73F4,0x7408,0x7564,0x7563,
0x75CE,0x75D2,0x75CF,0x75CB,0x75CC,0x75D1,0x75D0,0x768F,
0x7689,0x76D3,0x7739,0x772F,0x772D,0x7731,0x7732,0x7734,
0x7733,0x773D,0x7725,0x773B,0x7735,0x7848,0x7852,0x7849,
0x784D,0x784A,0x784C,0x7826,0x7845,0x7850,0x7964,0x7967,
0x7969,0x796A,0x7963,0x796B,0x7961,0x79BB,0x79FA,0x79F8,
0x79F6,0x79F7,0x7A8F,0x7A94,0x7A90,0x7B35,0x7B3B,0x7B34,
0x7B25,0x7B30,0x7B22,0x7B24,0x7B33,0x7B18,0x7B2A,0x7B1D,
0x7B31,0x7B2B,0x7B2D,0x7B2F,0x7B32,0x7B38,
/* Range 0x3821 - 0x387E, array index: 0x096B */
0x7B1A,0x7B23,0x7C94,0x7C98,0x7C96,0x7CA3,0x7D35,0x7D3D,
0x7D38,0x7D36,0x7D3A,0x7D45,0x7D2C,0x7D29,0x7D41,0x7D47,
0x7D3E,0x7D3F,0x7D4A,0x7D3B,0x7D28,0x7F63,0x7F95,0x7F9C,
0x7F9D,0x7F9B,0x7FCA,0x7FCB,0x7FCD,0x7FD0,0x7FD1,0x7FC7,
0x7FCF,0x7FC9,0x801F,0x801E,0x801B,0x8047,0x8043,0x8048,
0x8118,0x8125,0x8119,0x811B,0x812D,0x811F,0x812C,0x811E,
0x8121,0x8115,0x8127,0x811D,0x8122,0x8211,0x8238,0x8233,
0x823A,0x8234,0x8232,0x8274,0x8390,0x83A3,0x83A8,0x838D,
0x837A,0x8373,0x83A4,0x8374,0x838F,0x8381,0x8395,0x8399,
0x8375,0x8394,0x83A9,0x837D,0x8383,0x838C,0x839D,0x839B,
0x83AA,0x838B,0x837E,0x83A5,0x83AF,0x8388,0x8397,0x83B0,
0x837F,0x83A6,0x8387,0x83AE,0x8376,0x8659,
/* Range 0x3921 - 0x397E, array index: 0x09C9 */
0x8656,0x86BF,0x86B7,0x86C2,0x86C1,0x86C5,0x86BA,0x86B0,
0x86C8,0x86B9,0x86B3,0x86B8,0x86CC,0x86B4,0x86BB,0x86BC,
0x86C3,0x86BD,0x86BE,0x8852,0x8889,0x8895,0x88A8,0x88A2,
0x88AA,0x889A,0x8891,0x88A1,0x889F,0x8898,0x88A7,0x8899,
0x889B,0x8897,0x88A4,0x88AC,0x888C,0x8893,0x888E,0x8982,
0x89D6,0x89D9,0x89D5,0x8A30,0x8A27,0x8A2C,0x8A1E,0x8C39,
0x8C3B,0x8C5C,0x8C5D,0x8C7D,0x8CA5,0x8D7D,0x8D7B,0x8D79,
0x8DBC,0x8DC2,0x8DB9,0x8DBF,0x8DC1,0x8ED8,0x8EDE,0x8EDD,
0x8EDC,0x8ED7,0x8EE0,0x8EE1,0x9024,0x900B,0x9011,0x901C,
0x900C,0x9021,0x90EF,0x90EA,0x90F0,0x90F4,0x90F2,0x90F3,
0x90D4,0x90EB,0x90EC,0x90E9,0x9156,0x9158,0x915A,0x9153,
0x9155,0x91EC,0x91F4,0x91F1,0x91F3,0x91F8,
/* Range 0x3A21 - 0x3A7E, array index: 0x0A27 */
0x91E4,0x91F9,0x91EA,0x91EB,0x91F7,0x91E8,0x91EE,0x957A,
0x9586,0x9588,0x967C,0x966D,0x966B,0x9671,0x966F,0x96BF,
0x976A,0x9804,0x98E5,0x9997,0x509B,0x5095,0x5094,0x509E,
0x508B,0x50A3,0x5083,0x508C,0x508E,0x509D,0x5068,0x509C,
0x5092,0x5082,0x5087,0x515F,0x51D4,0x5312,0x5311,0x53A4,
0x53A7,0x5591,0x55A8,0x55A5,0x55AD,0x5577,0x5645,0x55A2,
0x5593,0x5588,0x558F,0x55B5,0x5581,0x55A3,0x5592,0x55A4,
0x557D,0x558C,0x55A6,0x557F,0x5595,0x55A1,0x558E,0x570C,
0x5829,0x5837,0x5819,0x581E,0x5827,0x5823,0x5828,0x57F5,
0x5848,0x5825,0x581C,0x581B,0x5833,0x583F,0x5836,0x582E,
0x5839,0x5838,0x582D,0x582C,0x583B,0x5961,0x5AAF,0x5A94,
0x5A9F,0x5A7A,0x5AA2,0x5A9E,0x5A78,0x5AA6,
/* Range 0x3B21 - 0x3B7E, array index: 0x0A85 */
0x5A7C,0x5AA5,0x5AAC,0x5A95,0x5AAE,0x5A37,0x5A84,0x5A8A,
0x5A97,0x5A83,0x5A8B,0x5AA9,0x5A7B,0x5A7D,0x5A8C,0x5A9C,
0x5A8F,0x5A93,0x5A9D,0x5BEA,0x5BCD,0x5BCB,0x5BD4,0x5BD1,
0x5BCA,0x5BCE,0x5C0C,0x5C30,0x5D37,0x5D43,0x5D6B,0x5D41,
0x5D4B,0x5D3F,0x5D35,0x5D51,0x5D4E,0x5D55,0x5D33,0x5D3A,
0x5D52,0x5D3D,0x5D31,0x5D59,0x5D42,0x5D39,0x5D49,0x5D38,
0x5D3C,0x5D32,0x5D36,0x5D40,0x5D45,0x5E44,0x5E41,0x5F58,
0x5FA6,0x5FA5,0x5FAB,0x60C9,0x60B9,0x60CC,0x60E2,0x60CE,
0x60C4,0x6114,0x60F2,0x610A,0x6116,0x6105,0x60F5,0x6113,
0x60F8,0x60FC,0x60FE,0x60C1,0x6103,0x6118,0x611D,0x6110,
0x60FF,0x6104,0x610B,0x624A,0x6394,0x63B1,0x63B0,0x63CE,
0x63E5,0x63E8,0x63EF,0x63C3,0x649D,0x63F3,
/* Range 0x3C21 - 0x3C7E, array index: 0x0AE3 */
0x63CA,0x63E0,0x63F6,0x63D5,0x63F2,0x63F5,0x6461,0x63DF,
0x63BE,0x63DD,0x63DC,0x63C4,0x63D8,0x63D3,0x63C2,0x63C7,
0x63CC,0x63CB,0x63C8,0x63F0,0x63D7,0x63D9,0x6532,0x6567,
0x656A,0x6564,0x655C,0x6568,0x6565,0x658C,0x659D,0x659E,
0x65AE,0x65D0,0x65D2,0x667C,0x666C,0x667B,0x6680,0x6671,
0x6679,0x666A,0x6672,0x6701,0x690C,0x68D3,0x6904,0x68DC,
0x692A,0x68EC,0x68EA,0x68F1,0x690F,0x68D6,0x68F7,0x68EB,
0x68E4,0x68F6,0x6913,0x6910,0x68F3,0x68E1,0x6907,0x68CC,
0x6908,0x6970,0x68B4,0x6911,0x68EF,0x68C6,0x6914,0x68F8,
0x68D0,0x68FD,0x68FC,0x68E8,0x690B,0x690A,0x6917,0x68CE,
0x68C8,0x68DD,0x68DE,0x68E6,0x68F4,0x68D1,0x6906,0x68D4,
0x68E9,0x6915,0x6925,0x68C7,0x6B39,0x6B3B,
/* Range 0x3D21 - 0x3D7E, array index: 0x0B41 */
0x6B3F,0x6B3C,0x6B94,0x6B97,0x6B99,0x6B95,0x6BBD,0x6BF0,
0x6BF2,0x6BF3,0x6C30,0x6DFC,0x6E46,0x6E47,0x6E1F,0x6E49,
0x6E88,0x6E3C,0x6E3D,0x6E45,0x6E62,0x6E2B,0x6E3F,0x6E41,
0x6E5D,0x6E73,0x6E1C,0x6E33,0x6E4B,0x6E40,0x6E51,0x6E3B,
0x6E03,0x6E2E,0x6E5E,0x6E68,0x6E5C,0x6E61,0x6E31,0x6E28,
0x6E60,0x6E71,0x6E6B,0x6E39,0x6E22,0x6E30,0x6E53,0x6E65,
0x6E27,0x6E78,0x6E64,0x6E77,0x6E55,0x6E79,0x6E52,0x6E66,
0x6E35,0x6E36,0x6E5A,0x7120,0x711E,0x712F,0x70FB,0x712E,
0x7131,0x7123,0x7125,0x7122,0x7132,0x711F,0x7128,0x713A,
0x711B,0x724B,0x725A,0x7288,0x7289,0x7286,0x7285,0x728B,
0x7312,0x730B,0x7330,0x7322,0x7331,0x7333,0x7327,0x7332,
0x732D,0x7326,0x7323,0x7335,0x730C,0x742E,
/* Range 0x3E21 - 0x3E7E, array index: 0x0B9F */
0x742C,0x7430,0x742B,0x7416,0x741A,0x7421,0x742D,0x7431,
0x7424,0x7423,0x741D,0x7429,0x7420,0x7432,0x74FB,0x752F,
0x756F,0x756C,0x75E7,0x75DA,0x75E1,0x75E6,0x75DD,0x75DF,
0x75E4,0x75D7,0x7695,0x7692,0x76DA,0x7746,0x7747,0x7744,
0x774D,0x7745,0x774A,0x774E,0x774B,0x774C,0x77DE,0x77EC,
0x7860,0x7864,0x7865,0x785C,0x786D,0x7871,0x786A,0x786E,
0x7870,0x7869,0x7868,0x785E,0x7862,0x7974,0x7973,0x7972,
0x7970,0x7A02,0x7A0A,0x7A03,0x7A0C,0x7A04,0x7A99,0x7AE6,
0x7AE4,0x7B4A,0x7B47,0x7B44,0x7B48,0x7B4C,0x7B4E,0x7B40,
0x7B58,0x7B45,0x7CA2,0x7C9E,0x7CA8,0x7CA1,0x7D58,0x7D6F,
0x7D63,0x7D53,0x7D56,0x7D67,0x7D6A,0x7D4F,0x7D6D,0x7D5C,
0x7D6B,0x7D52,0x7D54,0x7D69,0x7D51,0x7D5F,
/* Range 0x3F21 - 0x3F7E, array index: 0x0BFD */
0x7D4E,0x7F3E,0x7F3F,0x7F65,0x7F66,0x7FA2,0x7FA0,0x7FA1,
0x7FD7,0x8051,0x804F,0x8050,0x80FE,0x80D4,0x8143,0x814A,
0x8152,0x814F,0x8147,0x813D,0x814D,0x813A,0x81E6,0x81EE,
0x81F7,0x81F8,0x81F9,0x8204,0x823C,0x823D,0x823F,0x8275,
0x833B,0x83CF,0x83F9,0x8423,0x83C0,0x83E8,0x8412,0x83E7,
0x83E4,0x83FC,0x83F6,0x8410,0x83C6,0x83C8,0x83EB,0x83E3,
0x83BF,0x8401,0x83DD,0x83E5,0x83D8,0x83FF,0x83E1,0x83CB,
0x83CE,0x83D6,0x83F5,0x83C9,0x8409,0x840F,0x83DE,0x8411,
0x8406,0x83C2,0x83F3,0x83D5,0x83FA,0x83C7,0x83D1,0x83EA,
0x8413,0x839A,0x83C3,0x83EC,0x83EE,0x83C4,0x83FB,0x83D7,
0x83E2,0x841B,0x83DB,0x83FE,0x86D8,0x86E2,0x86E6,0x86D3,
0x86E3,0x86DA,0x86EA,0x86DD,0x86EB,0x86DC,
/* Range 0x4021 - 0x407E, array index: 0x0C5B */
0x86EC,0x86E9,0x86D7,0x86E8,0x86D1,0x8848,0x8856,0x8855,
0x88BA,0x88D7,0x88B9,0x88B8,0x88C0,0x88BE,0x88B6,0x88BC,
0x88B7,0x88BD,0x88B2,0x8901,0x88C9,0x8995,0x8998,0x8997,
0x89DD,0x89DA,0x89DB,0x8A4E,0x8A4D,0x8A39,0x8A59,0x8A40,
0x8A57,0x8A58,0x8A44,0x8A45,0x8A52,0x8A48,0x8A51,0x8A4A,
0x8A4C,0x8A4F,0x8C5F,0x8C81,0x8C80,0x8CBA,0x8CBE,0x8CB0,
0x8CB9,0x8CB5,0x8D84,0x8D80,0x8D89,0x8DD8,0x8DD3,0x8DCD,
0x8DC7,0x8DD6,0x8DDC,0x8DCF,0x8DD5,0x8DD9,0x8DC8,0x8DD7,
0x8DC5,0x8EEF,0x8EF7,0x8EFA,0x8EF9,0x8EE6,0x8EEE,0x8EE5,
0x8EF5,0x8EE7,0x8EE8,0x8EF6,0x8EEB,0x8EF1,0x8EEC,0x8EF4,
0x8EE9,0x902D,0x9034,0x902F,0x9106,0x912C,0x9104,0x90FF,
0x90FC,0x9108,0x90F9,0x90FB,0x9101,0x9100,
/* Range 0x4121 - 0x417E, array index: 0x0CB9 */
0x9107,0x9105,0x9103,0x9161,0x9164,0x915F,0x9162,0x9160,
0x9201,0x920A,0x9225,0x9203,0x921A,0x9226,0x920F,0x920C,
0x9200,0x9212,0x91FF,0x91FD,0x9206,0x9204,0x9227,0x9202,
0x921C,0x9224,0x9219,0x9217,0x9205,0x9216,0x957B,0x958D,
0x958C,0x9590,0x9687,0x967E,0x9688,0x9689,0x9683,0x9680,
0x96C2,0x96C8,0x96C3,0x96F1,0x96F0,0x976C,0x9770,0x976E,
0x9807,0x98A9,0x98EB,0x9CE6,0x9EF9,0x4E83,0x4E84,0x4EB6,
0x50BD,0x50BF,0x50C6,0x50AE,0x50C4,0x50CA,0x50B4,0x50C8,
0x50C2,0x50B0,0x50C1,0x50BA,0x50B1,0x50CB,0x50C9,0x50B6,
0x50B8,0x51D7,0x527A,0x5278,0x527B,0x527C,0x55C3,0x55DB,
0x55CC,0x55D0,0x55CB,0x55CA,0x55DD,0x55C0,0x55D4,0x55C4,
0x55E9,0x55BF,0x55D2,0x558D,0x55CF,0x55D5,
/* Range 0x4221 - 0x427E, array index: 0x0D17 */
0x55E2,0x55D6,0x55C8,0x55F2,0x55CD,0x55D9,0x55C2,0x5714,
0x5853,0x5868,0x5864,0x584F,0x584D,0x5849,0x586F,0x5855,
0x584E,0x585D,0x5859,0x5865,0x585B,0x583D,0x5863,0x5871,
0x58FC,0x5AC7,0x5AC4,0x5ACB,0x5ABA,0x5AB8,0x5AB1,0x5AB5,
0x5AB0,0x5ABF,0x5AC8,0x5ABB,0x5AC6,0x5AB7,0x5AC0,0x5ACA,
0x5AB4,0x5AB6,0x5ACD,0x5AB9,0x5A90,0x5BD6,0x5BD8,0x5BD9,
0x5C1F,0x5C33,0x5D71,0x5D63,0x5D4A,0x5D65,0x5D72,0x5D6C,
0x5D5E,0x5D68,0x5D67,0x5D62,0x5DF0,0x5E4F,0x5E4E,0x5E4A,
0x5E4D,0x5E4B,0x5EC5,0x5ECC,0x5EC6,0x5ECB,0x5EC7,0x5F40,
0x5FAF,0x5FAD,0x60F7,0x6149,0x614A,0x612B,0x6145,0x6136,
0x6132,0x612E,0x6146,0x612F,0x614F,0x6129,0x6140,0x6220,
0x9168,0x6223,0x6225,0x6224,0x63C5,0x63F1,
/* Range 0x4321 - 0x437E, array index: 0x0D75 */
0x63EB,0x6410,0x6412,0x6409,0x6420,0x6424,0x6433,0x6443,
0x641F,0x6415,0x6418,0x6439,0x6437,0x6422,0x6423,0x640C,
0x6426,0x6430,0x6428,0x6441,0x6435,0x642F,0x640A,0x641A,
0x6440,0x6425,0x6427,0x640B,0x63E7,0x641B,0x642E,0x6421,
0x640E,0x656F,0x6592,0x65D3,0x6686,0x668C,0x6695,0x6690,
0x668B,0x668A,0x6699,0x6694,0x6678,0x6720,0x6966,0x695F,
0x6938,0x694E,0x6962,0x6971,0x693F,0x6945,0x696A,0x6939,
0x6942,0x6957,0x6959,0x697A,0x6948,0x6949,0x6935,0x696C,
0x6933,0x693D,0x6965,0x68F0,0x6978,0x6934,0x6969,0x6940,
0x696F,0x6944,0x6976,0x6958,0x6941,0x6974,0x694C,0x693B,
0x694B,0x6937,0x695C,0x694F,0x6951,0x6932,0x6952,0x692F,
0x697B,0x693C,0x6B46,0x6B45,0x6B43,0x6B42,
/* Range 0x4421 - 0x447E, array index: 0x0DD3 */
0x6B48,0x6B41,0x6B9B,0x6BFB,0x6BFC,0x6BF9,0x6BF7,0x6BF8,
0x6E9B,0x6ED6,0x6EC8,0x6E8F,0x6EC0,0x6E9F,0x6E93,0x6E94,
0x6EA0,0x6EB1,0x6EB9,0x6EC6,0x6ED2,0x6EBD,0x6EC1,0x6E9E,
0x6EC9,0x6EB7,0x6EB0,0x6ECD,0x6EA6,0x6ECF,0x6EB2,0x6EBE,
0x6EC3,0x6EDC,0x6ED8,0x6E99,0x6E92,0x6E8E,0x6E8D,0x6EA4,
0x6EA1,0x6EBF,0x6EB3,0x6ED0,0x6ECA,0x6E97,0x6EAE,0x6EA3,
0x7147,0x7154,0x7152,0x7163,0x7160,0x7141,0x715D,0x7162,
0x7172,0x7178,0x716A,0x7161,0x7142,0x7158,0x7143,0x714B,
0x7170,0x715F,0x7150,0x7153,0x7144,0x714D,0x715A,0x724F,
0x728D,0x728C,0x7291,0x7290,0x728E,0x733C,0x7342,0x733B,
0x733A,0x7340,0x734A,0x7349,0x7444,0x744A,0x744B,0x7452,
0x7451,0x7457,0x7440,0x744F,0x7450,0x744E,
/* Range 0x4521 - 0x457E, array index: 0x0E31 */
0x7442,0x7446,0x744D,0x7454,0x74E1,0x74FF,0x74FE,0x74FD,
0x751D,0x7579,0x7577,0x6983,0x75EF,0x760F,0x7603,0x75F7,
0x75FE,0x75FC,0x75F9,0x75F8,0x7610,0x75FB,0x75F6,0x75ED,
0x75F5,0x75FD,0x7699,0x76B5,0x76DD,0x7755,0x775F,0x7760,
0x7752,0x7756,0x775A,0x7769,0x7767,0x7754,0x7759,0x776D,
0x77E0,0x7887,0x789A,0x7894,0x788F,0x7884,0x7895,0x7885,
0x7886,0x78A1,0x7883,0x7879,0x7899,0x7880,0x7896,0x787B,
0x797C,0x7982,0x797D,0x7979,0x7A11,0x7A18,0x7A19,0x7A12,
0x7A17,0x7A15,0x7A22,0x7A13,0x7A1B,0x7A10,0x7AA3,0x7AA2,
0x7A9E,0x7AEB,0x7B66,0x7B64,0x7B6D,0x7B74,0x7B69,0x7B72,
0x7B65,0x7B73,0x7B71,0x7B70,0x7B61,0x7B78,0x7B76,0x7B63,
0x7CB2,0x7CB4,0x7CAF,0x7D88,0x7D86,0x7D80,
/* Range 0x4621 - 0x467E, array index: 0x0E8F */
0x7D8D,0x7D7F,0x7D85,0x7D7A,0x7D8E,0x7D7B,0x7D83,0x7D7C,
0x7D8C,0x7D94,0x7D84,0x7D7D,0x7D92,0x7F6D,0x7F6B,0x7F67,
0x7F68,0x7F6C,0x7FA6,0x7FA5,0x7FA7,0x7FDB,0x7FDC,0x8021,
0x8164,0x8160,0x8177,0x815C,0x8169,0x815B,0x8162,0x8172,
0x6721,0x815E,0x8176,0x8167,0x816F,0x8144,0x8161,0x821D,
0x8249,0x8244,0x8240,0x8242,0x8245,0x84F1,0x843F,0x8456,
0x8476,0x8479,0x848F,0x848D,0x8465,0x8451,0x8440,0x8486,
0x8467,0x8430,0x844D,0x847D,0x845A,0x8459,0x8474,0x8473,
0x845D,0x8507,0x845E,0x8437,0x843A,0x8434,0x847A,0x8443,
0x8478,0x8432,0x8445,0x8429,0x83D9,0x844B,0x842F,0x8442,
0x842D,0x845F,0x8470,0x8439,0x844E,0x844C,0x8452,0x846F,
0x84C5,0x848E,0x843B,0x8447,0x8436,0x8433,
/* Range 0x4721 - 0x477E, array index: 0x0EED */
0x8468,0x847E,0x8444,0x842B,0x8460,0x8454,0x846E,0x8450,
0x870B,0x8704,0x86F7,0x870C,0x86FA,0x86D6,0x86F5,0x874D,
0x86F8,0x870E,0x8709,0x8701,0x86F6,0x870D,0x8705,0x88D6,
0x88CB,0x88CD,0x88CE,0x88DE,0x88DB,0x88DA,0x88CC,0x88D0,
0x8985,0x899B,0x89DF,0x89E5,0x89E4,0x89E1,0x89E0,0x89E2,
0x89DC,0x89E6,0x8A76,0x8A86,0x8A7F,0x8A61,0x8A3F,0x8A77,
0x8A82,0x8A84,0x8A75,0x8A83,0x8A81,0x8A74,0x8A7A,0x8C3C,
0x8C4B,0x8C4A,0x8C65,0x8C64,0x8C66,0x8C86,0x8C84,0x8C85,
0x8CCC,0x8D68,0x8D69,0x8D91,0x8D8C,0x8D8E,0x8D8F,0x8D8D,
0x8D93,0x8D94,0x8D90,0x8D92,0x8DF0,0x8DE0,0x8DEC,0x8DF1,
0x8DEE,0x8DD0,0x8DE9,0x8DE3,0x8DE2,0x8DE7,0x8DF2,0x8DEB,
0x8DF4,0x8F06,0x8EFF,0x8F01,0x8F00,0x8F05,
/* Range 0x4821 - 0x487E, array index: 0x0F4B */
0x8F07,0x8F08,0x8F02,0x8F0B,0x9052,0x903F,0x9044,0x9049,
0x903D,0x9110,0x910D,0x910F,0x9111,0x9116,0x9114,0x910B,
0x910E,0x916E,0x916F,0x9248,0x9252,0x9230,0x923A,0x9266,
0x9233,0x9265,0x925E,0x9283,0x922E,0x924A,0x9246,0x926D,
0x926C,0x924F,0x9260,0x9267,0x926F,0x9236,0x9261,0x9270,
0x9231,0x9254,0x9263,0x9250,0x9272,0x924E,0x9253,0x924C,
0x9256,0x9232,0x959F,0x959C,0x959E,0x959B,0x9692,0x9693,
0x9691,0x9697,0x96CE,0x96FA,0x96FD,0x96F8,0x96F5,0x9773,
0x9777,0x9778,0x9772,0x980F,0x980D,0x980E,0x98AC,0x98F6,
0x98F9,0x99AF,0x99B2,0x99B0,0x99B5,0x9AAD,0x9AAB,0x9B5B,
0x9CEA,0x9CED,0x9CE7,0x9E80,0x9EFD,0x50E6,0x50D4,0x50D7,
0x50E8,0x50F3,0x50DB,0x50EA,0x50DD,0x50E4,
/* Range 0x4921 - 0x497E, array index: 0x0FA9 */
0x50D3,0x50EC,0x50F0,0x50EF,0x50E3,0x50E0,0x51D8,0x5280,
0x5281,0x52E9,0x52EB,0x5330,0x53AC,0x5627,0x5615,0x560C,
0x5612,0x55FC,0x560F,0x561C,0x5601,0x5613,0x5602,0x55FA,
0x561D,0x5604,0x55FF,0x55F9,0x5889,0x587C,0x5890,0x5898,
0x5886,0x5881,0x587F,0x5874,0x588B,0x587A,0x5887,0x5891,
0x588E,0x5876,0x5882,0x5888,0x587B,0x5894,0x588F,0x58FE,
0x596B,0x5ADC,0x5AEE,0x5AE5,0x5AD5,0x5AEA,0x5ADA,0x5AED,
0x5AEB,0x5AF3,0x5AE2,0x5AE0,0x5ADB,0x5AEC,0x5ADE,0x5ADD,
0x5AD9,0x5AE8,0x5ADF,0x5B77,0x5BE0,0x5BE3,0x5C63,0x5D82,
0x5D80,0x5D7D,0x5D86,0x5D7A,0x5D81,0x5D77,0x5D8A,0x5D89,
0x5D88,0x5D7E,0x5D7C,0x5D8D,0x5D79,0x5D7F,0x5E58,0x5E59,
0x5E53,0x5ED8,0x5ED1,0x5ED7,0x5ECE,0x5EDC,
/* Range 0x4A21 - 0x4A7E, array index: 0x1007 */
0x5ED5,0x5ED9,0x5ED2,0x5ED4,0x5F44,0x5F43,0x5F6F,0x5FB6,
0x612C,0x6128,0x6141,0x615E,0x6171,0x6173,0x6152,0x6153,
0x6172,0x616C,0x6180,0x6174,0x6154,0x617A,0x615B,0x6165,
0x613B,0x616A,0x6161,0x6156,0x6229,0x6227,0x622B,0x642B,
0x644D,0x645B,0x645D,0x6474,0x6476,0x6472,0x6473,0x647D,
0x6475,0x6466,0x64A6,0x644E,0x6482,0x645E,0x645C,0x644B,
0x6453,0x6460,0x6450,0x647F,0x643F,0x646C,0x646B,0x6459,
0x6465,0x6477,0x6573,0x65A0,0x66A1,0x66A0,0x669F,0x6705,
0x6704,0x6722,0x69B1,0x69B6,0x69C9,0x69A0,0x69CE,0x6996,
0x69B0,0x69AC,0x69BC,0x6991,0x6999,0x698E,0x69A7,0x698D,
0x69A9,0x69BE,0x69AF,0x69BF,0x69C4,0x69BD,0x69A4,0x69D4,
0x69B9,0x69CA,0x699A,0x69CF,0x69B3,0x6993,
/* Range 0x4B21 - 0x4B7E, array index: 0x1065 */
0x69AA,0x69A1,0x699E,0x69D9,0x6997,0x6990,0x69C2,0x69B5,
0x69A5,0x69C6,0x6B4A,0x6B4D,0x6B4B,0x6B9E,0x6B9F,0x6BA0,
0x6BC3,0x6BC4,0x6BFE,0x6ECE,0x6EF5,0x6EF1,0x6F03,0x6F25,
0x6EF8,0x6F37,0x6EFB,0x6F2E,0x6F09,0x6F4E,0x6F19,0x6F1A,
0x6F27,0x6F18,0x6F3B,0x6F12,0x6EED,0x6F0A,0x6F36,0x6F73,
0x6EF9,0x6EEE,0x6F2D,0x6F40,0x6F30,0x6F3C,0x6F35,0x6EEB,
0x6F07,0x6F0E,0x6F43,0x6F05,0x6EFD,0x6EF6,0x6F39,0x6F1C,
0x6EFC,0x6F3A,0x6F1F,0x6F0D,0x6F1E,0x6F08,0x6F21,0x7187,
0x7190,0x7189,0x7180,0x7185,0x7182,0x718F,0x717B,0x7186,
0x7181,0x7197,0x7244,0x7253,0x7297,0x7295,0x7293,0x7343,
0x734D,0x7351,0x734C,0x7462,0x7473,0x7471,0x7475,0x7472,
0x7467,0x746E,0x7500,0x7502,0x7503,0x757D,
/* Range 0x4C21 - 0x4C7E, array index: 0x10C3 */
0x7590,0x7616,0x7608,0x760C,0x7615,0x7611,0x760A,0x7614,
0x76B8,0x7781,0x777C,0x7785,0x7782,0x776E,0x7780,0x776F,
0x777E,0x7783,0x78B2,0x78AA,0x78B4,0x78AD,0x78A8,0x787E,
0x78AB,0x789E,0x78A5,0x78A0,0x78AC,0x78A2,0x78A4,0x7998,
0x798A,0x798B,0x7996,0x7995,0x7994,0x7993,0x7997,0x7988,
0x7992,0x7990,0x7A2B,0x7A4A,0x7A30,0x7A2F,0x7A28,0x7A26,
0x7AA8,0x7AAB,0x7AAC,0x7AEE,0x7B88,0x7B9C,0x7B8A,0x7B91,
0x7B90,0x7B96,0x7B8D,0x7B8C,0x7B9B,0x7B8E,0x7B85,0x7B98,
0x5284,0x7B99,0x7BA4,0x7B82,0x7CBB,0x7CBF,0x7CBC,0x7CBA,
0x7DA7,0x7DB7,0x7DC2,0x7DA3,0x7DAA,0x7DC1,0x7DC0,0x7DC5,
0x7D9D,0x7DCE,0x7DC4,0x7DC6,0x7DCB,0x7DCC,0x7DAF,0x7DB9,
0x7D96,0x7DBC,0x7D9F,0x7DA6,0x7DAE,0x7DA9,
/* Range 0x4D21 - 0x4D7E, array index: 0x1121 */
0x7DA1,0x7DC9,0x7F73,0x7FE2,0x7FE3,0x7FE5,0x7FDE,0x8024,
0x805D,0x805C,0x8189,0x8186,0x8183,0x8187,0x818D,0x818C,
0x818B,0x8215,0x8497,0x84A4,0x84A1,0x849F,0x84BA,0x84CE,
0x84C2,0x84AC,0x84AE,0x84AB,0x84B9,0x84B4,0x84C1,0x84CD,
0x84AA,0x849A,0x84B1,0x84D0,0x849D,0x84A7,0x84BB,0x84A2,
0x8494,0x84C7,0x84CC,0x849B,0x84A9,0x84AF,0x84A8,0x84D6,
0x8498,0x84B6,0x84CF,0x84A0,0x84D7,0x84D4,0x84D2,0x84DB,
0x84B0,0x8491,0x8661,0x8733,0x8723,0x8728,0x876B,0x8740,
0x872E,0x871E,0x8721,0x8719,0x871B,0x8743,0x872C,0x8741,
0x873E,0x8746,0x8720,0x8732,0x872A,0x872D,0x873C,0x8712,
0x873A,0x8731,0x8735,0x8742,0x8726,0x8727,0x8738,0x8724,
0x871A,0x8730,0x8711,0x88F7,0x88E7,0x88F1,
/* Range 0x4E21 - 0x4E7E, array index: 0x117F */
0x88F2,0x88FA,0x88FE,0x88EE,0x88FC,0x88F6,0x88FB,0x88F0,
0x88EC,0x88EB,0x899D,0x89A1,0x899F,0x899E,0x89E9,0x89EB,
0x89E8,0x8AAB,0x8A99,0x8A8B,0x8A92,0x8A8F,0x8A96,0x8C3D,
0x8C68,0x8C69,0x8CD5,0x8CCF,0x8CD7,0x8D96,0x8E09,0x8E02,
0x8DFF,0x8E0D,0x8DFD,0x8E0A,0x8E03,0x8E07,0x8E06,0x8E05,
0x8DFE,0x8E00,0x8E04,0x8F10,0x8F11,0x8F0E,0x8F0D,0x9123,
0x911C,0x9120,0x9122,0x911F,0x911D,0x911A,0x9124,0x9121,
0x911B,0x917A,0x9172,0x9179,0x9173,0x92A5,0x92A4,0x9276,
0x929B,0x927A,0x92A0,0x9294,0x92AA,0x928D,0x92A6,0x929A,
0x92AB,0x9279,0x9297,0x927F,0x92A3,0x92EE,0x928E,0x9282,
0x9295,0x92A2,0x927D,0x9288,0x92A1,0x928A,0x9286,0x928C,
0x9299,0x92A7,0x927E,0x9287,0x92A9,0x929D,
/* Range 0x4F21 - 0x4F7E, array index: 0x11DD */
0x928B,0x922D,0x969E,0x96A1,0x96FF,0x9758,0x977D,0x977A,
0x977E,0x9783,0x9780,0x9782,0x977B,0x9784,0x9781,0x977F,
0x97CE,0x97CD,0x9816,0x98AD,0x98AE,0x9902,0x9900,0x9907,
0x999D,0x999C,0x99C3,0x99B9,0x99BB,0x99BA,0x99C2,0x99BD,
0x99C7,0x9AB1,0x9AE3,0x9AE7,0x9B3E,0x9B3F,0x9B60,0x9B61,
0x9B5F,0x9CF1,0x9CF2,0x9CF5,0x9EA7,0x50FF,0x5103,0x5130,
0x50F8,0x5106,0x5107,0x50F6,0x50FE,0x510B,0x510C,0x50FD,
0x510A,0x528B,0x528C,0x52F1,0x52EF,0x5648,0x5642,0x564C,
0x5635,0x5641,0x564A,0x5649,0x5646,0x5658,0x565A,0x5640,
0x5633,0x563D,0x562C,0x563E,0x5638,0x562A,0x563A,0x571A,
0x58AB,0x589D,0x58B1,0x58A0,0x58A3,0x58AF,0x58AC,0x58A5,
0x58A1,0x58FF,0x5AFF,0x5AF4,0x5AFD,0x5AF7,
/* Range 0x5021 - 0x507E, array index: 0x123B */
0x5AF6,0x5B03,0x5AF8,0x5B02,0x5AF9,0x5B01,0x5B07,0x5B05,
0x5B0F,0x5C67,0x5D99,0x5D97,0x5D9F,0x5D92,0x5DA2,0x5D93,
0x5D95,0x5DA0,0x5D9C,0x5DA1,0x5D9A,0x5D9E,0x5E69,0x5E5D,
0x5E60,0x5E5C,0x7DF3,0x5EDB,0x5EDE,0x5EE1,0x5F49,0x5FB2,
0x618B,0x6183,0x6179,0x61B1,0x61B0,0x61A2,0x6189,0x619B,
0x6193,0x61AF,0x61AD,0x619F,0x6192,0x61AA,0x61A1,0x618D,
0x6166,0x61B3,0x622D,0x646E,0x6470,0x6496,0x64A0,0x6485,
0x6497,0x649C,0x648F,0x648B,0x648A,0x648C,0x64A3,0x649F,
0x6468,0x64B1,0x6498,0x6576,0x657A,0x6579,0x657B,0x65B2,
0x65B3,0x66B5,0x66B0,0x66A9,0x66B2,0x66B7,0x66AA,0x66AF,
0x6A00,0x6A06,0x6A17,0x69E5,0x69F8,0x6A15,0x69F1,0x69E4,
0x6A20,0x69FF,0x69EC,0x69E2,0x6A1B,0x6A1D,
/* Range 0x5121 - 0x517E, array index: 0x1299 */
0x69FE,0x6A27,0x69F2,0x69EE,0x6A14,0x69F7,0x69E7,0x6A40,
0x6A08,0x69E6,0x69FB,0x6A0D,0x69FC,0x69EB,0x6A09,0x6A04,
0x6A18,0x6A25,0x6A0F,0x69F6,0x6A26,0x6A07,0x69F4,0x6A16,
0x6B51,0x6BA5,0x6BA3,0x6BA2,0x6BA6,0x6C01,0x6C00,0x6BFF,
0x6C02,0x6F41,0x6F26,0x6F7E,0x6F87,0x6FC6,0x6F92,0x6F8D,
0x6F89,0x6F8C,0x6F62,0x6F4F,0x6F85,0x6F5A,0x6F96,0x6F76,
0x6F6C,0x6F82,0x6F55,0x6F72,0x6F52,0x6F50,0x6F57,0x6F94,
0x6F93,0x6F5D,0x6F00,0x6F61,0x6F6B,0x6F7D,0x6F67,0x6F90,
0x6F53,0x6F8B,0x6F69,0x6F7F,0x6F95,0x6F63,0x6F77,0x6F6A,
0x6F7B,0x71B2,0x71AF,0x719B,0x71B0,0x71A0,0x719A,0x71A9,
0x71B5,0x719D,0x71A5,0x719E,0x71A4,0x71A1,0x71AA,0x719C,
0x71A7,0x71B3,0x7298,0x729A,0x7358,0x7352,
/* Range 0x5221 - 0x527E, array index: 0x12F7 */
0x735E,0x735F,0x7360,0x735D,0x735B,0x7361,0x735A,0x7359,
0x7362,0x7487,0x7489,0x748A,0x7486,0x7481,0x747D,0x7485,
0x7488,0x747C,0x7479,0x7508,0x7507,0x757E,0x7625,0x761E,
0x7619,0x761D,0x761C,0x7623,0x761A,0x7628,0x761B,0x769C,
0x769D,0x769E,0x769B,0x778D,0x778F,0x7789,0x7788,0x78CD,
0x78BB,0x78CF,0x78CC,0x78D1,0x78CE,0x78D4,0x78C8,0x78C3,
0x78C4,0x78C9,0x799A,0x79A1,0x79A0,0x799C,0x79A2,0x799B,
0x6B76,0x7A39,0x7AB2,0x7AB4,0x7AB3,0x7BB7,0x7BCB,0x7BBE,
0x7BAC,0x7BCE,0x7BAF,0x7BB9,0x7BCA,0x7BB5,0x7CC5,0x7CC8,
0x7CCC,0x7CCB,0x7DF7,0x7DDB,0x7DEA,0x7DE7,0x7DD7,0x7DE1,
0x7E03,0x7DFA,0x7DE6,0x7DF6,0x7DF1,0x7DF0,0x7DEE,0x7DDF,
0x7F76,0x7FAC,0x7FB0,0x7FAD,0x7FED,0x7FEB,
/* Range 0x5321 - 0x537E, array index: 0x1355 */
0x7FEA,0x7FEC,0x7FE6,0x7FE8,0x8064,0x8067,0x81A3,0x819F,
0x819E,0x8195,0x81A2,0x8199,0x8197,0x8216,0x824F,0x8253,
0x8252,0x8250,0x824E,0x8251,0x8524,0x853B,0x850F,0x8500,
0x8529,0x850E,0x8509,0x850D,0x851F,0x850A,0x8527,0x851C,
0x84FB,0x852B,0x84FA,0x8508,0x850C,0x84F4,0x852A,0x84F2,
0x8515,0x84F7,0x84EB,0x84F3,0x84FC,0x8512,0x84EA,0x84E9,
0x8516,0x84FE,0x8528,0x851D,0x852E,0x8502,0x84FD,0x851E,
0x84F6,0x8531,0x8526,0x84E7,0x84E8,0x84F0,0x84EF,0x84F9,
0x8518,0x8520,0x8530,0x850B,0x8519,0x852F,0x8662,0x8756,
0x8763,0x8764,0x8777,0x87E1,0x8773,0x8758,0x8754,0x875B,
0x8752,0x8761,0x875A,0x8751,0x875E,0x876D,0x876A,0x8750,
0x874E,0x875F,0x875D,0x876F,0x876C,0x877A,
/* Range 0x5421 - 0x547E, array index: 0x13B3 */
0x876E,0x875C,0x8765,0x874F,0x877B,0x8775,0x8762,0x8767,
0x8769,0x885A,0x8905,0x890C,0x8914,0x890B,0x8917,0x8918,
0x8919,0x8906,0x8916,0x8911,0x890E,0x8909,0x89A2,0x89A4,
0x89A3,0x89ED,0x89F0,0x89EC,0x8ACF,0x8AC6,0x8AB8,0x8AD3,
0x8AD1,0x8AD4,0x8AD5,0x8ABB,0x8AD7,0x8ABE,0x8AC0,0x8AC5,
0x8AD8,0x8AC3,0x8ABA,0x8ABD,0x8AD9,0x8C3E,0x8C4D,0x8C8F,
0x8CE5,0x8CDF,0x8CD9,0x8CE8,0x8CDA,0x8CDD,0x8CE7,0x8DA0,
0x8D9C,0x8DA1,0x8D9B,0x8E20,0x8E23,0x8E25,0x8E24,0x8E2E,
0x8E15,0x8E1B,0x8E16,0x8E11,0x8E19,0x8E26,0x8E27,0x8E14,
0x8E12,0x8E18,0x8E13,0x8E1C,0x8E17,0x8E1A,0x8F2C,0x8F24,
0x8F18,0x8F1A,0x8F20,0x8F23,0x8F16,0x8F17,0x9073,0x9070,
0x906F,0x9067,0x906B,0x912F,0x912B,0x9129,
/* Range 0x5521 - 0x557E, array index: 0x1411 */
0x912A,0x9132,0x9126,0x912E,0x9185,0x9186,0x918A,0x9181,
0x9182,0x9184,0x9180,0x92D0,0x92C3,0x92C4,0x92C0,0x92D9,
0x92B6,0x92CF,0x92F1,0x92DF,0x92D8,0x92E9,0x92D7,0x92DD,
0x92CC,0x92EF,0x92C2,0x92E8,0x92CA,0x92C8,0x92CE,0x92E6,
0x92CD,0x92D5,0x92C9,0x92E0,0x92DE,0x92E7,0x92D1,0x92D3,
0x92B5,0x92E1,0x9325,0x92C6,0x92B4,0x957C,0x95AC,0x95AB,
0x95AE,0x95B0,0x96A4,0x96A2,0x96D3,0x9705,0x9708,0x9702,
0x975A,0x978A,0x978E,0x9788,0x97D0,0x97CF,0x981E,0x981D,
0x9826,0x9829,0x9828,0x9820,0x981B,0x9827,0x98B2,0x9908,
0x98FA,0x9911,0x9914,0x9916,0x9917,0x9915,0x99DC,0x99CD,
0x99CF,0x99D3,0x99D4,0x99CE,0x99C9,0x99D6,0x99D8,0x99CB,
0x99D7,0x99CC,0x9AB3,0x9AEC,0x9AEB,0x9AF3,
/* Range 0x5621 - 0x567E, array index: 0x146F */
0x9AF2,0x9AF1,0x9B46,0x9B43,0x9B67,0x9B74,0x9B71,0x9B66,
0x9B76,0x9B75,0x9B70,0x9B68,0x9B64,0x9B6C,0x9CFC,0x9CFA,
0x9CFD,0x9CFF,0x9CF7,0x9D07,0x9D00,0x9CF9,0x9CFB,0x9D08,
0x9D05,0x9D04,0x9E83,0x9ED3,0x9F0F,0x9F10,0x511C,0x5113,
0x5117,0x511A,0x5111,0x51DE,0x5334,0x53E1,0x5670,0x5660,
0x566E,0x5673,0x5666,0x5663,0x566D,0x5672,0x565E,0x5677,
0x571C,0x571B,0x58C8,0x58BD,0x58C9,0x58BF,0x58BA,0x58C2,
0x58BC,0x58C6,0x5B17,0x5B19,0x5B1B,0x5B21,0x5B14,0x5B13,
0x5B10,0x5B16,0x5B28,0x5B1A,0x5B20,0x5B1E,0x5BEF,0x5DAC,
0x5DB1,0x5DA9,0x5DA7,0x5DB5,0x5DB0,0x5DAE,0x5DAA,0x5DA8,
0x5DB2,0x5DAD,0x5DAF,0x5DB4,0x5E67,0x5E68,0x5E66,0x5E6F,
0x5EE9,0x5EE7,0x5EE6,0x5EE8,0x5EE5,0x5F4B,
/* Range 0x5721 - 0x577E, array index: 0x14CD */
0x5FBC,0x5FBB,0x619D,0x61A8,0x6196,0x61C5,0x61B4,0x61C6,
0x61C1,0x61CC,0x61BA,0x61BF,0x61B8,0x618C,0x64D7,0x64D6,
0x64D0,0x64CF,0x64C9,0x64BD,0x6489,0x64C3,0x64DB,0x64F3,
0x64D9,0x6533,0x657F,0x657C,0x65A2,0x66C8,0x66BE,0x66C0,
0x66CA,0x66CB,0x66CF,0x66BD,0x66BB,0x66BA,0x66CC,0x6723,
0x6A34,0x6A66,0x6A49,0x6A67,0x6A32,0x6A68,0x6A3E,0x6A5D,
0x6A6D,0x6A76,0x6A5B,0x6A51,0x6A28,0x6A5A,0x6A3B,0x6A3F,
0x6A41,0x6A6A,0x6A64,0x6A50,0x6A4F,0x6A54,0x6A6F,0x6A69,
0x6A60,0x6A3C,0x6A5E,0x6A56,0x6A55,0x6A4D,0x6A4E,0x6A46,
0x6B55,0x6B54,0x6B56,0x6BA7,0x6BAA,0x6BAB,0x6BC8,0x6BC7,
0x6C04,0x6C03,0x6C06,0x6FAD,0x6FCB,0x6FA3,0x6FC7,0x6FBC,
0x6FCE,0x6FC8,0x6F5E,0x6FC4,0x6FBD,0x6F9E,
/* Range 0x5821 - 0x587E, array index: 0x152B */
0x6FCA,0x6FA8,0x7004,0x6FA5,0x6FAE,0x6FBA,0x6FAC,0x6FAA,
0x6FCF,0x6FBF,0x6FB8,0x6FA2,0x6FC9,0x6FAB,0x6FCD,0x6FAF,
0x6FB2,0x6FB0,0x71C5,0x71C2,0x71BF,0x71B8,0x71D6,0x71C0,
0x71C1,0x71CB,0x71D4,0x71CA,0x71C7,0x71CF,0x71BD,0x71D8,
0x71BC,0x71C6,0x71DA,0x71DB,0x729D,0x729E,0x7369,0x7366,
0x7367,0x736C,0x7365,0x736B,0x736A,0x747F,0x749A,0x74A0,
0x7494,0x7492,0x7495,0x74A1,0x750B,0x7580,0x762F,0x762D,
0x7631,0x763D,0x7633,0x763C,0x7635,0x7632,0x7630,0x76BB,
0x76E6,0x779A,0x779D,0x77A1,0x779C,0x779B,0x77A2,0x77A3,
0x7795,0x7799,0x7797,0x78DD,0x78E9,0x78E5,0x78EA,0x78DE,
0x78E3,0x78DB,0x78E1,0x78E2,0x78ED,0x78DF,0x78E0,0x79A4,
0x7A44,0x7A48,0x7A47,0x7AB6,0x7AB8,0x7AB5,
/* Range 0x5921 - 0x597E, array index: 0x1589 */
0x7AB1,0x7AB7,0x7BDE,0x7BE3,0x7BE7,0x7BDD,0x7BD5,0x7BE5,
0x7BDA,0x7BE8,0x7BF9,0x7BD4,0x7BEA,0x7BE2,0x7BDC,0x7BEB,
0x7BD8,0x7BDF,0x7CD2,0x7CD4,0x7CD7,0x7CD0,0x7CD1,0x7E12,
0x7E21,0x7E17,0x7E0C,0x7E1F,0x7E20,0x7E13,0x7E0E,0x7E1C,
0x7E15,0x7E1A,0x7E22,0x7E0B,0x7E0F,0x7E16,0x7E0D,0x7E14,
0x7E25,0x7E24,0x7F43,0x7F7B,0x7F7C,0x7F7A,0x7FB1,0x7FEF,
0x802A,0x8029,0x806C,0x81B1,0x81A6,0x81AE,0x81B9,0x81B5,
0x81AB,0x81B0,0x81AC,0x81B4,0x81B2,0x81B7,0x81A7,0x81F2,
0x8255,0x8256,0x8257,0x8556,0x8545,0x856B,0x854D,0x8553,
0x8561,0x8558,0x8540,0x8546,0x8564,0x8541,0x8562,0x8544,
0x8551,0x8547,0x8563,0x853E,0x855B,0x8571,0x854E,0x856E,
0x8575,0x8555,0x8567,0x8560,0x858C,0x8566,
/* Range 0x5A21 - 0x5A7E, array index: 0x15E7 */
0x855D,0x8554,0x8565,0x856C,0x8663,0x8665,0x8664,0x87A4,
0x879B,0x878F,0x8797,0x8793,0x8792,0x8788,0x8781,0x8796,
0x8798,0x8779,0x8787,0x87A3,0x8785,0x8790,0x8791,0x879D,
0x8784,0x8794,0x879C,0x879A,0x8789,0x891E,0x8926,0x8930,
0x892D,0x892E,0x8927,0x8931,0x8922,0x8929,0x8923,0x892F,
0x892C,0x891F,0x89F1,0x8AE0,0x8AE2,0x8AF2,0x8AF4,0x8AF5,
0x8ADD,0x8B14,0x8AE4,0x8ADF,0x8AF0,0x8AC8,0x8ADE,0x8AE1,
0x8AE8,0x8AFF,0x8AEF,0x8AFB,0x8C91,0x8C92,0x8C90,0x8CF5,
0x8CEE,0x8CF1,0x8CF0,0x8CF3,0x8D6C,0x8D6E,0x8DA5,0x8DA7,
0x8E33,0x8E3E,0x8E38,0x8E40,0x8E45,0x8E36,0x8E3C,0x8E3D,
0x8E41,0x8E30,0x8E3F,0x8EBD,0x8F36,0x8F2E,0x8F35,0x8F32,
0x8F39,0x8F37,0x8F34,0x9076,0x9079,0x907B,
/* Range 0x5B21 - 0x5B7E, array index: 0x1645 */
0x9086,0x90FA,0x9133,0x9135,0x9136,0x9193,0x9190,0x9191,
0x918D,0x918F,0x9327,0x931E,0x9308,0x931F,0x9306,0x930F,
0x937A,0x9338,0x933C,0x931B,0x9323,0x9312,0x9301,0x9346,
0x932D,0x930E,0x930D,0x92CB,0x931D,0x92FA,0x9313,0x92F9,
0x92F7,0x9334,0x9302,0x9324,0x92FF,0x9329,0x9339,0x9335,
0x932A,0x9314,0x930C,0x930B,0x92FE,0x9309,0x9300,0x92FB,
0x9316,0x95BC,0x95CD,0x95BE,0x95B9,0x95BA,0x95B6,0x95BF,
0x95B5,0x95BD,0x96A9,0x96D4,0x970B,0x9712,0x9710,0x9799,
0x9797,0x9794,0x97F0,0x97F8,0x9835,0x982F,0x9832,0x9924,
0x991F,0x9927,0x9929,0x999E,0x99EE,0x99EC,0x99E5,0x99E4,
0x99F0,0x99E3,0x99EA,0x99E9,0x99E7,0x9AB9,0x9ABF,0x9AB4,
0x9ABB,0x9AF6,0x9AFA,0x9AF9,0x9AF7,0x9B33,
/* Range 0x5C21 - 0x5C7E, array index: 0x16A3 */
0x9B80,0x9B85,0x9B87,0x9B7C,0x9B7E,0x9B7B,0x9B82,0x9B93,
0x9B92,0x9B90,0x9B7A,0x9B95,0x9B7D,0x9B88,0x9D25,0x9D17,
0x9D20,0x9D1E,0x9D14,0x9D29,0x9D1D,0x9D18,0x9D22,0x9D10,
0x9D19,0x9D1F,0x9E88,0x9E86,0x9E87,0x9EAE,0x9EAD,0x9ED5,
0x9ED6,0x9EFA,0x9F12,0x9F3D,0x5126,0x5125,0x5122,0x5124,
0x5120,0x5129,0x52F4,0x5693,0x568C,0x568D,0x5686,0x5684,
0x5683,0x567E,0x5682,0x567F,0x5681,0x58D6,0x58D4,0x58CF,
0x58D2,0x5B2D,0x5B25,0x5B32,0x5B23,0x5B2C,0x5B27,0x5B26,
0x5B2F,0x5B2E,0x5B7B,0x5BF1,0x5BF2,0x5DB7,0x5E6C,0x5E6A,
0x5FBE,0x61C3,0x61B5,0x61BC,0x61E7,0x61E0,0x61E5,0x61E4,
0x61E8,0x61DE,0x64EF,0x64E9,0x64E3,0x64EB,0x64E4,0x64E8,
0x6581,0x6580,0x65B6,0x65DA,0x66D2,0x6A8D,
/* Range 0x5D21 - 0x5D7E, array index: 0x1701 */
0x6A96,0x6A81,0x6AA5,0x6A89,0x6A9F,0x6A9B,0x6AA1,0x6A9E,
0x6A87,0x6A93,0x6A8E,0x6A95,0x6A83,0x6AA8,0x6AA4,0x6A91,
0x6A7F,0x6AA6,0x6A9A,0x6A85,0x6A8C,0x6A92,0x6B5B,0x6BAD,
0x6C09,0x6FCC,0x6FA9,0x6FF4,0x6FD4,0x6FE3,0x6FDC,0x6FED,
0x6FE7,0x6FE6,0x6FDE,0x6FF2,0x6FDD,0x6FE2,0x6FE8,0x71E1,
0x71F1,0x71E8,0x71F2,0x71E4,0x71F0,0x71E2,0x7373,0x736E,
0x736F,0x7497,0x74B2,0x74AB,0x7490,0x74AA,0x74AD,0x74B1,
0x74A5,0x74AF,0x7510,0x7511,0x7512,0x750F,0x7584,0x7643,
0x7648,0x7649,0x7647,0x76A4,0x76E9,0x77B5,0x77AB,0x77B2,
0x77B7,0x77B6,0x77B4,0x77B1,0x77A8,0x77F0,0x78F3,0x78FD,
0x7902,0x78FB,0x78FC,0x78FF,0x78F2,0x7905,0x78F9,0x78FE,
0x7904,0x79AB,0x79A8,0x7A5C,0x7A5B,0x7A56,
/* Range 0x5E21 - 0x5E7E, array index: 0x175F */
0x7A58,0x7A54,0x7A5A,0x7ABE,0x7AC0,0x7AC1,0x7C05,0x7C0F,
0x7BF2,0x7C00,0x7BFF,0x7BFB,0x7C0E,0x7BF4,0x7C0B,0x7BF3,
0x7C02,0x7C09,0x7C03,0x7C01,0x7BF8,0x7BFD,0x7C06,0x7BF0,
0x7BF1,0x7C10,0x7C0A,0x7CE8,0x7E2D,0x7E3C,0x7E42,0x7E33,
0x9848,0x7E38,0x7E2A,0x7E49,0x7E40,0x7E47,0x7E29,0x7E4C,
0x7E30,0x7E3B,0x7E36,0x7E44,0x7E3A,0x7F45,0x7F7F,0x7F7E,
0x7F7D,0x7FF4,0x7FF2,0x802C,0x81BB,0x81C4,0x81CC,0x81CA,
0x81C5,0x81C7,0x81BC,0x81E9,0x825B,0x825A,0x825C,0x8583,
0x8580,0x858F,0x85A7,0x8595,0x85A0,0x858B,0x85A3,0x857B,
0x85A4,0x859A,0x859E,0x8577,0x857C,0x8589,0x85A1,0x857A,
0x8578,0x8557,0x858E,0x8596,0x8586,0x858D,0x8599,0x859D,
0x8581,0x85A2,0x8582,0x8588,0x8585,0x8579,
/* Range 0x5F21 - 0x5F7E, array index: 0x17BD */
0x8576,0x8598,0x8590,0x859F,0x8668,0x87BE,0x87AA,0x87AD,
0x87C5,0x87B0,0x87AC,0x87B9,0x87B5,0x87BC,0x87AE,0x87C9,
0x87C3,0x87C2,0x87CC,0x87B7,0x87AF,0x87C4,0x87CA,0x87B4,
0x87B6,0x87BF,0x87B8,0x87BD,0x87DE,0x87B2,0x8935,0x8933,
0x893C,0x893E,0x8941,0x8952,0x8937,0x8942,0x89AD,0x89AF,
0x89AE,0x89F2,0x89F3,0x8B1E,0x8B18,0x8B16,0x8B11,0x8B05,
0x8B0B,0x8B22,0x8B0F,0x8B12,0x8B15,0x8B07,0x8B0D,0x8B08,
0x8B06,0x8B1C,0x8B13,0x8B1A,0x8C4F,0x8C70,0x8C72,0x8C71,
0x8C6F,0x8C95,0x8C94,0x8CF9,0x8D6F,0x8E4E,0x8E4D,0x8E53,
0x8E50,0x8E4C,0x8E47,0x8F43,0x8F40,0x9085,0x907E,0x9138,
0x919A,0x91A2,0x919B,0x9199,0x919F,0x91A1,0x919D,0x91A0,
0x93A1,0x9383,0x93AF,0x9364,0x9356,0x9347,
/* Range 0x6021 - 0x607E, array index: 0x181B */
0x937C,0x9358,0x935C,0x9376,0x9349,0x9350,0x9351,0x9360,
0x936D,0x938F,0x934C,0x936A,0x9379,0x9357,0x9355,0x9352,
0x934F,0x9371,0x9377,0x937B,0x9361,0x935E,0x9363,0x9367,
0x934E,0x9359,0x95C7,0x95C0,0x95C9,0x95C3,0x95C5,0x95B7,
0x96AE,0x96B0,0x96AC,0x9720,0x971F,0x9718,0x971D,0x9719,
0x979A,0x97A1,0x979C,0x979E,0x979D,0x97D5,0x97D4,0x97F1,
0x9841,0x9844,0x984A,0x9849,0x9845,0x9843,0x9925,0x992B,
0x992C,0x992A,0x9933,0x9932,0x992F,0x992D,0x9931,0x9930,
0x9998,0x99A3,0x99A1,0x9A02,0x99FA,0x99F4,0x99F7,0x99F9,
0x99F8,0x99F6,0x99FB,0x99FD,0x99FE,0x99FC,0x9A03,0x9ABE,
0x9AFE,0x9AFD,0x9B01,0x9AFC,0x9B48,0x9B9A,0x9BA8,0x9B9E,
0x9B9B,0x9BA6,0x9BA1,0x9BA5,0x9BA4,0x9B86,
/* Range 0x6121 - 0x617E, array index: 0x1879 */
0x9BA2,0x9BA0,0x9BAF,0x9D33,0x9D41,0x9D67,0x9D36,0x9D2E,
0x9D2F,0x9D31,0x9D38,0x9D30,0x9D45,0x9D42,0x9D43,0x9D3E,
0x9D37,0x9D40,0x9D3D,0x7FF5,0x9D2D,0x9E8A,0x9E89,0x9E8D,
0x9EB0,0x9EC8,0x9EDA,0x9EFB,0x9EFF,0x9F24,0x9F23,0x9F22,
0x9F54,0x9FA0,0x5131,0x512D,0x512E,0x5698,0x569C,0x5697,
0x569A,0x569D,0x5699,0x5970,0x5B3C,0x5C69,0x5C6A,0x5DC0,
0x5E6D,0x5E6E,0x61D8,0x61DF,0x61ED,0x61EE,0x61F1,0x61EA,
0x61F0,0x61EB,0x61D6,0x61E9,0x64FF,0x6504,0x64FD,0x64F8,
0x6501,0x6503,0x64FC,0x6594,0x65DB,0x66DA,0x66DB,0x66D8,
0x6AC5,0x6AB9,0x6ABD,0x6AE1,0x6AC6,0x6ABA,0x6AB6,0x6AB7,
0x6AC7,0x6AB4,0x6AAD,0x6B5E,0x6BC9,0x6C0B,0x7007,0x700C,
0x700D,0x7001,0x7005,0x7014,0x700E,0x6FFF,
/* Range 0x6221 - 0x627E, array index: 0x18D7 */
0x7000,0x6FFB,0x7026,0x6FFC,0x6FF7,0x700A,0x7201,0x71FF,
0x71F9,0x7203,0x71FD,0x7376,0x74B8,0x74C0,0x74B5,0x74C1,
0x74BE,0x74B6,0x74BB,0x74C2,0x7514,0x7513,0x765C,0x7664,
0x7659,0x7650,0x7653,0x7657,0x765A,0x76A6,0x76BD,0x76EC,
0x77C2,0x77BA,0x790C,0x7913,0x7914,0x7909,0x7910,0x7912,
0x7911,0x79AD,0x79AC,0x7A5F,0x7C1C,0x7C29,0x7C19,0x7C20,
0x7C1F,0x7C2D,0x7C1D,0x7C26,0x7C28,0x7C22,0x7C25,0x7C30,
0x7E5C,0x7E50,0x7E56,0x7E63,0x7E58,0x7E62,0x7E5F,0x7E51,
0x7E60,0x7E57,0x7E53,0x7FB5,0x7FB3,0x7FF7,0x7FF8,0x8075,
0x81D1,0x81D2,0x81D0,0x825F,0x825E,0x85B4,0x85C6,0x85C0,
0x85C3,0x85C2,0x85B3,0x85B5,0x85BD,0x85C7,0x85C4,0x85BF,
0x85CB,0x85CE,0x85C8,0x85C5,0x85B1,0x85B6,
/* Range 0x6321 - 0x637E, array index: 0x1935 */
0x85D2,0x8624,0x85B8,0x85B7,0x85BE,0x8669,0x87E7,0x87E6,
0x87E2,0x87DB,0x87EB,0x87EA,0x87E5,0x87DF,0x87F3,0x87E4,
0x87D4,0x87DC,0x87D3,0x87ED,0x87D8,0x87E3,0x87D7,0x87D9,
0x8801,0x87F4,0x87E8,0x87DD,0x8953,0x894B,0x894F,0x894C,
0x8946,0x8950,0x8951,0x8949,0x8B2A,0x8B27,0x8B23,0x8B33,
0x8B30,0x8B35,0x8B47,0x8B2F,0x8B3C,0x8B3E,0x8B31,0x8B25,
0x8B37,0x8B26,0x8B36,0x8B2E,0x8B24,0x8B3B,0x8B3D,0x8B3A,
0x8C42,0x8C75,0x8C99,0x8C98,0x8C97,0x8CFE,0x8D04,0x8D02,
0x8D00,0x8E5C,0x8E62,0x8E60,0x8E57,0x8E56,0x8E5E,0x8E65,
0x8E67,0x8E5B,0x8E5A,0x8E61,0x8E5D,0x8E69,0x8E54,0x8F46,
0x8F47,0x8F48,0x8F4B,0x9128,0x913A,0x913B,0x913E,0x91A8,
0x91A5,0x91A7,0x91AF,0x91AA,0x93B5,0x938C,
/* Range 0x6421 - 0x647E, array index: 0x1993 */
0x9392,0x93B7,0x939B,0x939D,0x9389,0x93A7,0x938E,0x93AA,
0x939E,0x93A6,0x9395,0x9388,0x9399,0x939F,0x9380,0x938D,
0x93B1,0x9391,0x93B2,0x93A4,0x93A8,0x93B4,0x93A3,0x95D2,
0x95D3,0x95D1,0x96B3,0x96D7,0x96DA,0x5DC2,0x96DF,0x96D8,
0x96DD,0x9723,0x9722,0x9725,0x97AC,0x97AE,0x97A8,0x97AB,
0x97A4,0x97AA,0x97A2,0x97A5,0x97D7,0x97D9,0x97D6,0x97D8,
0x97FA,0x9850,0x9851,0x9852,0x98B8,0x9941,0x993C,0x993A,
0x9A0F,0x9A0B,0x9A09,0x9A0D,0x9A04,0x9A11,0x9A0A,0x9A05,
0x9A07,0x9A06,0x9AC0,0x9ADC,0x9B08,0x9B04,0x9B05,0x9B29,
0x9B35,0x9B4A,0x9B4C,0x9B4B,0x9BC7,0x9BC6,0x9BC3,0x9BBF,
0x9BC1,0x9BB5,0x9BB8,0x9BD3,0x9BB6,0x9BC4,0x9BB9,0x9BBD,
0x9D5C,0x9D53,0x9D4F,0x9D4A,0x9D5B,0x9D4B,
/* Range 0x6521 - 0x657E, array index: 0x19F1 */
0x9D59,0x9D56,0x9D4C,0x9D57,0x9D52,0x9D54,0x9D5F,0x9D58,
0x9D5A,0x9E8E,0x9E8C,0x9EDF,0x9F01,0x9F00,0x9F16,0x9F25,
0x9F2B,0x9F2A,0x9F29,0x9F28,0x9F4C,0x9F55,0x5134,0x5135,
0x5296,0x52F7,0x53B4,0x56AB,0x56AD,0x56A6,0x56A7,0x56AA,
0x56AC,0x58DA,0x58DD,0x58DB,0x5912,0x5B3D,0x5B3E,0x5B3F,
0x5DC3,0x5E70,0x5FBF,0x61FB,0x6507,0x6510,0x650D,0x6509,
0x650C,0x650E,0x6584,0x65DE,0x65DD,0x66DE,0x6AE7,0x6AE0,
0x6ACC,0x6AD1,0x6AD9,0x6ACB,0x6ADF,0x6ADC,0x6AD0,0x6AEB,
0x6ACF,0x6ACD,0x6ADE,0x6B60,0x6BB0,0x6C0C,0x7019,0x7027,
0x7020,0x7016,0x702B,0x7021,0x7022,0x7023,0x7029,0x7017,
0x7024,0x701C,0x720C,0x720A,0x7207,0x7202,0x7205,0x72A5,
0x72A6,0x72A4,0x72A3,0x72A1,0x74CB,0x74C5,
/* Range 0x6621 - 0x667E, array index: 0x1A4F */
0x74B7,0x74C3,0x7516,0x7660,0x77C9,0x77CA,0x77C4,0x77F1,
0x791D,0x791B,0x7921,0x791C,0x7917,0x791E,0x79B0,0x7A67,
0x7A68,0x7C33,0x7C3C,0x7C39,0x7C2C,0x7C3B,0x7CEC,0x7CEA,
0x7E76,0x7E75,0x7E78,0x7E70,0x7E77,0x7E6F,0x7E7A,0x7E72,
0x7E74,0x7E68,0x7F4B,0x7F4A,0x7F83,0x7F86,0x7FB7,0x7FFD,
0x7FFE,0x8078,0x81D7,0x81D5,0x820B,0x8264,0x8261,0x8263,
0x85EB,0x85F1,0x85ED,0x85D9,0x85E1,0x85E8,0x85DA,0x85D7,
0x85EC,0x85F2,0x85F8,0x85D8,0x85DF,0x85E3,0x85DC,0x85D1,
0x85F0,0x85E6,0x85EF,0x85DE,0x85E2,0x8800,0x87FA,0x8803,
0x87F6,0x87F7,0x8809,0x880C,0x880B,0x8806,0x87FC,0x8808,
0x87FF,0x880A,0x8802,0x8962,0x895A,0x895B,0x8957,0x8961,
0x895C,0x8958,0x895D,0x8959,0x8988,0x89B7,
/* Range 0x6721 - 0x677E, array index: 0x1AAD */
0x89B6,0x89F6,0x8B50,0x8B48,0x8B4A,0x8B40,0x8B53,0x8B56,
0x8B54,0x8B4B,0x8B55,0x8B51,0x8B42,0x8B52,0x8B57,0x8C43,
0x8C77,0x8C76,0x8C9A,0x8D06,0x8D07,0x8D09,0x8DAC,0x8DAA,
0x8DAD,0x8DAB,0x8E6D,0x8E78,0x8E73,0x8E6A,0x8E6F,0x8E7B,
0x8EC2,0x8F52,0x8F51,0x8F4F,0x8F50,0x8F53,0x8FB4,0x9140,
0x913F,0x91B0,0x91AD,0x93DE,0x93C7,0x93CF,0x93C2,0x93DA,
0x93D0,0x93F9,0x93EC,0x93CC,0x93D9,0x93A9,0x93E6,0x93CA,
0x93D4,0x93EE,0x93E3,0x93D5,0x93C4,0x93CE,0x93C0,0x93D2,
0x93A5,0x93E7,0x957D,0x95DA,0x95DB,0x96E1,0x9729,0x972B,
0x972C,0x9728,0x9726,0x97B3,0x97B7,0x97B6,0x97DD,0x97DE,
0x97DF,0x985C,0x9859,0x985D,0x9857,0x98BF,0x98BD,0x98BB,
0x98BE,0x9948,0x9947,0x9943,0x99A6,0x99A7,
/* Range 0x6821 - 0x687E, array index: 0x1B0B */
0x9A1A,0x9A15,0x9A25,0x9A1D,0x9A24,0x9A1B,0x9A22,0x9A20,
0x9A27,0x9A23,0x9A1E,0x9A1C,0x9A14,0x9AC2,0x9B0B,0x9B0A,
0x9B0E,0x9B0C,0x9B37,0x9BEA,0x9BEB,0x9BE0,0x9BDE,0x9BE4,
0x9BE6,0x9BE2,0x9BF0,0x9BD4,0x9BD7,0x9BEC,0x9BDC,0x9BD9,
0x9BE5,0x9BD5,0x9BE1,0x9BDA,0x9D77,0x9D81,0x9D8A,0x9D84,
0x9D88,0x9D71,0x9D80,0x9D78,0x9D86,0x9D8B,0x9D8C,0x9D7D,
0x9D6B,0x9D74,0x9D75,0x9D70,0x9D69,0x9D85,0x9D73,0x9D7B,
0x9D82,0x9D6F,0x9D79,0x9D7F,0x9D87,0x9D68,0x9E94,0x9E91,
0x9EC0,0x9EFC,0x9F2D,0x9F40,0x9F41,0x9F4D,0x9F56,0x9F57,
0x9F58,0x5337,0x56B2,0x56B5,0x56B3,0x58E3,0x5B45,0x5DC6,
0x5DC7,0x5EEE,0x5EEF,0x5FC0,0x5FC1,0x61F9,0x6517,0x6516,
0x6515,0x6513,0x65DF,0x66E8,0x66E3,0x66E4,
/* Range 0x6921 - 0x697E, array index: 0x1B69 */
0x6AF3,0x6AF0,0x6AEA,0x6AE8,0x6AF9,0x6AF1,0x6AEE,0x6AEF,
0x703C,0x7035,0x702F,0x7037,0x7034,0x7031,0x7042,0x7038,
0x703F,0x703A,0x7039,0x702A,0x7040,0x703B,0x7033,0x7041,
0x7213,0x7214,0x72A8,0x737D,0x737C,0x74BA,0x76AB,0x76AA,
0x76BE,0x76ED,0x77CC,0x77CE,0x77CF,0x77CD,0x77F2,0x7925,
0x7923,0x7927,0x7928,0x7924,0x7929,0x79B2,0x7A6E,0x7A6C,
0x7A6D,0x7AF7,0x7C49,0x7C48,0x7C4A,0x7C47,0x7C45,0x7CEE,
0x7E7B,0x7E7E,0x7E81,0x7E80,0x7FBA,0x7FFF,0x8079,0x81DB,
0x81D9,0x8268,0x8269,0x8622,0x85FF,0x8601,0x85FE,0x861B,
0x8600,0x85F6,0x8604,0x8609,0x8605,0x860C,0x85FD,0x8819,
0x8810,0x8811,0x8817,0x8813,0x8816,0x8963,0x8966,0x89B9,
0x89F7,0x8B60,0x8B6A,0x8B5D,0x8B68,0x8B63,
/* Range 0x6A21 - 0x6A7E, array index: 0x1BC7 */
0x8B65,0x8B67,0x8B6D,0x8DAE,0x8E86,0x8E88,0x8E84,0x8F59,
0x8F56,0x8F57,0x8F55,0x8F58,0x8F5A,0x908D,0x9143,0x9141,
0x91B7,0x91B5,0x91B2,0x91B3,0x940B,0x9413,0x93FB,0x9420,
0x940F,0x9414,0x93FE,0x9415,0x9410,0x9428,0x9419,0x940D,
0x93F5,0x9400,0x93F7,0x9407,0x940E,0x9416,0x9412,0x93FA,
0x9409,0x93F8,0x943C,0x940A,0x93FF,0x93FC,0x940C,0x93F6,
0x9411,0x9406,0x95DE,0x95E0,0x95DF,0x972E,0x972F,0x97B9,
0x97BB,0x97FD,0x97FE,0x9860,0x9862,0x9863,0x985F,0x98C1,
0x98C2,0x9950,0x994E,0x9959,0x994C,0x994B,0x9953,0x9A32,
0x9A34,0x9A31,0x9A2C,0x9A2A,0x9A36,0x9A29,0x9A2E,0x9A38,
0x9A2D,0x9AC7,0x9ACA,0x9AC6,0x9B10,0x9B12,0x9B11,0x9C0B,
0x9C08,0x9BF7,0x9C05,0x9C12,0x9BF8,0x9C40,
/* Range 0x6B21 - 0x6B7E, array index: 0x1C25 */
0x9C07,0x9C0E,0x9C06,0x9C17,0x9C14,0x9C09,0x9D9F,0x9D99,
0x9DA4,0x9D9D,0x9D92,0x9D98,0x9D90,0x9D9B,0x9DA0,0x9D94,
0x9D9C,0x9DAA,0x9D97,0x9DA1,0x9D9A,0x9DA2,0x9DA8,0x9D9E,
0x9DA3,0x9DBF,0x9DA9,0x9D96,0x9DA6,0x9DA7,0x9E99,0x9E9B,
0x9E9A,0x9EE5,0x9EE4,0x9EE7,0x9EE6,0x9F30,0x9F2E,0x9F5B,
0x9F60,0x9F5E,0x9F5D,0x9F59,0x9F91,0x513A,0x5139,0x5298,
0x5297,0x56C3,0x56BD,0x56BE,0x5B48,0x5B47,0x5DCB,0x5DCF,
0x5EF1,0x61FD,0x651B,0x6B02,0x6AFC,0x6B03,0x6AF8,0x6B00,
0x7043,0x7044,0x704A,0x7048,0x7049,0x7045,0x7046,0x721D,
0x721A,0x7219,0x737E,0x7517,0x766A,0x77D0,0x792D,0x7931,
0x792F,0x7C54,0x7C53,0x7CF2,0x7E8A,0x7E87,0x7E88,0x7E8B,
0x7E86,0x7E8D,0x7F4D,0x7FBB,0x8030,0x81DD,
/* Range 0x6C21 - 0x6C7E, array index: 0x1C83 */
0x8618,0x862A,0x8626,0x861F,0x8623,0x861C,0x8619,0x8627,
0x862E,0x8621,0x8620,0x8629,0x861E,0x8625,0x8829,0x881D,
0x881B,0x8820,0x8824,0x881C,0x882B,0x884A,0x896D,0x8969,
0x896E,0x896B,0x89FA,0x8B79,0x8B78,0x8B45,0x8B7A,0x8B7B,
0x8D10,0x8D14,0x8DAF,0x8E8E,0x8E8C,0x8F5E,0x8F5B,0x8F5D,
0x9146,0x9144,0x9145,0x91B9,0x943F,0x943B,0x9436,0x9429,
0x943D,0x9430,0x9439,0x942A,0x9437,0x942C,0x9440,0x9431,
0x95E5,0x95E4,0x95E3,0x9735,0x973A,0x97BF,0x97E1,0x9864,
0x98C9,0x98C6,0x98C0,0x9958,0x9956,0x9A39,0x9A3D,0x9A46,
0x9A44,0x9A42,0x9A41,0x9A3A,0x9A3F,0x9ACD,0x9B15,0x9B17,
0x9B18,0x9B16,0x9B3A,0x9B52,0x9C2B,0x9C1D,0x9C1C,0x9C2C,
0x9C23,0x9C28,0x9C29,0x9C24,0x9C21,0x9DB7,
/* Range 0x6D21 - 0x6D7E, array index: 0x1CE1 */
0x9DB6,0x9DBC,0x9DC1,0x9DC7,0x9DCA,0x9DCF,0x9DBE,0x9DC5,
0x9DC3,0x9DBB,0x9DB5,0x9DCE,0x9DB9,0x9DBA,0x9DAC,0x9DC8,
0x9DB1,0x9DAD,0x9DCC,0x9DB3,0x9DCD,0x9DB2,0x9E7A,0x9E9C,
0x9EEB,0x9EEE,0x9EED,0x9F1B,0x9F18,0x9F1A,0x9F31,0x9F4E,
0x9F65,0x9F64,0x9F92,0x4EB9,0x56C6,0x56C5,0x56CB,0x5971,
0x5B4B,0x5B4C,0x5DD5,0x5DD1,0x5EF2,0x6521,0x6520,0x6526,
0x6522,0x6B0B,0x6B08,0x6B09,0x6C0D,0x7055,0x7056,0x7057,
0x7052,0x721E,0x721F,0x72A9,0x737F,0x74D8,0x74D5,0x74D9,
0x74D7,0x766D,0x76AD,0x7935,0x79B4,0x7A70,0x7A71,0x7C57,
0x7C5C,0x7C59,0x7C5B,0x7C5A,0x7CF4,0x7CF1,0x7E91,0x7F4F,
0x7F87,0x81DE,0x826B,0x8634,0x8635,0x8633,0x862C,0x8632,
0x8636,0x882C,0x8828,0x8826,0x882A,0x8825,
/* Range 0x6E21 - 0x6E7E, array index: 0x1D3F */
0x8971,0x89BF,0x89BE,0x89FB,0x8B7E,0x8B84,0x8B82,0x8B86,
0x8B85,0x8B7F,0x8D15,0x8E95,0x8E94,0x8E9A,0x8E92,0x8E90,
0x8E96,0x8E97,0x8F60,0x8F62,0x9147,0x944C,0x9450,0x944A,
0x944B,0x944F,0x9447,0x9445,0x9448,0x9449,0x9446,0x973F,
0x97E3,0x986A,0x9869,0x98CB,0x9954,0x995B,0x9A4E,0x9A53,
0x9A54,0x9A4C,0x9A4F,0x9A48,0x9A4A,0x9A49,0x9A52,0x9A50,
0x9AD0,0x9B19,0x9B2B,0x9B3B,0x9B56,0x9B55,0x9C46,0x9C48,
0x9C3F,0x9C44,0x9C39,0x9C33,0x9C41,0x9C3C,0x9C37,0x9C34,
0x9C32,0x9C3D,0x9C36,0x9DDB,0x9DD2,0x9DDE,0x9DDA,0x9DCB,
0x9DD0,0x9DDC,0x9DD1,0x9DDF,0x9DE9,0x9DD9,0x9DD8,0x9DD6,
0x9DF5,0x9DD5,0x9DDD,0x9EB6,0x9EF0,0x9F35,0x9F33,0x9F32,
0x9F42,0x9F6B,0x9F95,0x9FA2,0x513D,0x5299,
/* Range 0x6F21 - 0x6F7E, array index: 0x1D9D */
0x58E8,0x58E7,0x5972,0x5B4D,0x5DD8,0x882F,0x5F4F,0x6201,
0x6203,0x6204,0x6529,0x6525,0x6596,0x66EB,0x6B11,0x6B12,
0x6B0F,0x6BCA,0x705B,0x705A,0x7222,0x7382,0x7381,0x7383,
0x7670,0x77D4,0x7C67,0x7C66,0x7E95,0x826C,0x863A,0x8640,
0x8639,0x863C,0x8631,0x863B,0x863E,0x8830,0x8832,0x882E,
0x8833,0x8976,0x8974,0x8973,0x89FE,0x8B8C,0x8B8E,0x8B8B,
0x8B88,0x8C45,0x8D19,0x8E98,0x8F64,0x8F63,0x91BC,0x9462,
0x9455,0x945D,0x9457,0x945E,0x97C4,0x97C5,0x9800,0x9A56,
0x9A59,0x9B1E,0x9B1F,0x9B20,0x9C52,0x9C58,0x9C50,0x9C4A,
0x9C4D,0x9C4B,0x9C55,0x9C59,0x9C4C,0x9C4E,0x9DFB,0x9DF7,
0x9DEF,0x9DE3,0x9DEB,0x9DF8,0x9DE4,0x9DF6,0x9DE1,0x9DEE,
0x9DE6,0x9DF2,0x9DF0,0x9DE2,0x9DEC,0x9DF4,
/* Range 0x7021 - 0x707E, array index: 0x1DFB */
0x9DF3,0x9DE8,0x9DED,0x9EC2,0x9ED0,0x9EF2,0x9EF3,0x9F06,
0x9F1C,0x9F38,0x9F37,0x9F36,0x9F43,0x9F4F,0x9F71,0x9F70,
0x9F6E,0x9F6F,0x56D3,0x56CD,0x5B4E,0x5C6D,0x652D,0x66ED,
0x66EE,0x6B13,0x705F,0x7061,0x705D,0x7060,0x7223,0x74DB,
0x74E5,0x77D5,0x7938,0x79B7,0x79B6,0x7C6A,0x7E97,0x7F89,
0x826D,0x8643,0x8838,0x8837,0x8835,0x884B,0x8B94,0x8B95,
0x8E9E,0x8E9F,0x8EA0,0x8E9D,0x91BE,0x91BD,0x91C2,0x946B,
0x9468,0x9469,0x96E5,0x9746,0x9743,0x9747,0x97C7,0x97E5,
0x9A5E,0x9AD5,0x9B59,0x9C63,0x9C67,0x9C66,0x9C62,0x9C5E,
0x9C60,0x9E02,0x9DFE,0x9E07,0x9E03,0x9E06,0x9E05,0x9E00,
0x9E01,0x9E09,0x9DFF,0x9DFD,0x9E04,0x9EA0,0x9F1E,0x9F46,
0x9F74,0x9F75,0x9F76,0x56D4,0x652E,0x65B8,
/* Range 0x7121 - 0x717E, array index: 0x1E59 */
0x6B18,0x6B19,0x6B17,0x6B1A,0x7062,0x7226,0x72AA,0x77D8,
0x77D9,0x7939,0x7C69,0x7C6B,0x7CF6,0x7E9A,0x7E98,0x7E9B,
0x7E99,0x81E0,0x81E1,0x8646,0x8647,0x8648,0x8979,0x897A,
0x897C,0x897B,0x89FF,0x8B98,0x8B99,0x8EA5,0x8EA4,0x8EA3,
0x946E,0x946D,0x946F,0x9471,0x9473,0x9749,0x9872,0x995F,
0x9C68,0x9C6E,0x9C6D,0x9E0B,0x9E0D,0x9E10,0x9E0F,0x9E12,
0x9E11,0x9EA1,0x9EF5,0x9F09,0x9F47,0x9F78,0x9F7B,0x9F7A,
0x9F79,0x571E,0x7066,0x7C6F,0x883C,0x8DB2,0x8EA6,0x91C3,
0x9474,0x9478,0x9476,0x9475,0x9A60,0x9B2E,0x9C74,0x9C73,
0x9C71,0x9C75,0x9E14,0x9E13,0x9EF6,0x9F0A,0x9FA4,0x7068,
0x7065,0x7CF7,0x866A,0x883E,0x883D,0x883F,0x8B9E,0x8C9C,
0x8EA9,0x8EC9,0x974B,0x9873,0x9874,0x98CC,
/* Range 0x7221 - 0x7244, array index: 0x1EB7 */
0x9961,0x99AB,0x9A64,0x9A66,0x9A67,0x9B24,0x9E15,0x9E17,
0x9F48,0x6207,0x6B1E,0x7227,0x864C,0x8EA8,0x9482,0x9480,
0x9481,0x9A69,0x9A68,0x9E19,0x864B,0x8B9F,0x9483,0x9C79,
0x9EB7,0x7675,0x9A6B,0x9C7A,0x9E1D,0x7069,0x706A,0x7229,
0x9EA4,0x9F7E,0x9F49,0x9F98,
/* Unranged codes (82 codes) */
};
#endif /* ICONV_TO_UCS_CCS_CNS11643_PLANE2 && defined (TABLE_USE_SIZE_OPTIMIZATION) */
/*
* 16-bit UCS -> cns11643_plane2 speed-optimized table (42496 bytes).
* ======================================================================
*/
#if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) \
&& !(defined (TABLE_USE_SIZE_OPTIMIZATION))
static _CONST __uint16_t
from_ucs_speed_cns11643_plane2[] =
{
/* Heading Block */
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,0x0100,0x0200,
0x0300,0x0400,0x0500,0x0600,0x0700,0x0800,0x0900,0x0A00,
0x0B00,0x0C00,0x0D00,0x0E00,0x0F00,0x1000,0x1100,0x1200,
0x1300,0x1400,0x1500,0x1600,0x1700,0x1800,0x1900,0x1A00,
0x1B00,0x1C00,0x1D00,0x1E00,0x1F00,0x2000,0x2100,0x2200,
0x2300,0x2400,0x2500,0x2600,0x2700,0x2800,0x2900,0x2A00,
0x2B00,0x2C00,0x2D00,0x2E00,0x2F00,0x3000,0x3100,0x3200,
0x3300,0x3400,0x3500,0x3600,0x3700,0x3800,0x3900,0x3A00,
0x3B00,0x3C00,0x3D00,0x3E00,0x3F00,0x4000,0x4100,0x4200,
0x4300,0x4400,0x4500,0x4600,0x4700,0x4800,0x4900,0x4A00,
0x4B00,0x4C00,0x4D00,0x4E00,0x4F00,0x5000,0x5100,0x5200,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,INVBLK,
/* Block 79, Array index 0x0100 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2126,
INVALC,INVALC,INVALC,INVALC,0x2127,INVALC,0x212F,0x212D,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2130,INVALC,
INVALC,0x2143,INVALC,0x2531,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2144,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2121,INVALC,INVALC,INVALC,INVALC,0x2128,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2122,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x334E,
INVALC,INVALC,INVALC,0x4156,0x4157,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2129,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2131,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4158,INVALC,
INVALC,0x6D44,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2132,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2134,0x2133,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x214A,INVALC,0x2146,0x2149,INVALC,INVALC,
INVALC,0x2148,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2145,0x2147,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x216F,INVALC,INVALC,0x2179,0x216D,INVALC,0x2171,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 80, Array index 0x0200 */
0x2170,INVALC,0x2174,INVALC,0x2178,0x2175,INVALC,INVALC,
0x2172,INVALC,INVALC,INVALC,INVALC,INVALC,0x216A,INVALC,
INVALC,INVALC,0x217A,0x2177,0x216E,INVALC,INVALC,INVALC,
0x216B,INVALC,INVALC,INVALC,INVALC,0x2173,INVALC,INVALC,
INVALC,INVALC,0x2176,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x216C,0x2328,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2329,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x227B,INVALC,INVALC,0x2322,0x232A,
INVALC,0x2326,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x227D,INVALC,INVALC,0x253D,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2324,0x227E,INVALC,INVALC,0x227A,INVALC,
0x2327,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2325,
INVALC,0x232B,0x227C,INVALC,0x2321,INVALC,INVALC,0x2323,
INVALC,INVALC,0x253F,0x254B,INVALC,INVALC,0x254C,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2539,INVALC,0x2538,0x253C,
0x2543,0x2541,INVALC,INVALC,0x2533,0x2535,INVALC,INVALC,
0x2536,0x2542,0x2549,INVALC,0x253B,0x2534,INVALC,0x2537,
INVALC,0x253A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2544,INVALC,0x2548,INVALC,0x2546,0x254A,INVALC,0x253E,
0x2532,INVALC,0x2540,INVALC,0x2545,INVALC,0x2547,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2922,0x292A,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2930,0x292E,0x2929,INVALC,INVALC,INVALC,INVALC,
0x292F,0x2925,INVALC,INVALC,INVALC,0x287E,INVALC,0x292C,
INVALC,0x2923,INVALC,0x2924,INVALC,0x287D,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2921,0x2926,INVALC,0x292D,INVALC,
INVALC,0x2928,INVALC,0x292B,0x2927,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2931,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2D71,0x2D70,0x2D75,0x2D76,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 81, Array index 0x0300 */
INVALC,INVALC,INVALC,INVALC,INVALC,0x2D6A,INVALC,0x2D6B,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2D7E,INVALC,
INVALC,INVALC,INVALC,0x2D6C,INVALC,0x335E,INVALC,0x2D77,
INVALC,INVALC,INVALC,0x2D6F,0x2D78,INVALC,0x2D69,INVALC,
0x2D79,INVALC,0x2D6D,INVALC,INVALC,INVALC,INVALC,0x2D7A,
INVALC,INVALC,INVALC,INVALC,0x2D74,INVALC,INVALC,0x2D7C,
0x2D6E,0x2D7D,INVALC,0x2D72,INVALC,0x2D7B,INVALC,0x2D73,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3366,0x335A,INVALC,INVALC,INVALC,0x335F,0x3365,INVALC,
0x3358,INVALC,0x335C,0x3355,INVALC,0x3359,INVALC,INVALC,
INVALC,0x336A,INVALC,0x3354,INVALC,INVALC,INVALC,0x3369,
INVALC,INVALC,INVALC,0x335B,INVALC,0x3356,0x3352,0x3360,
0x3353,0x3351,0x335D,0x3363,0x3364,INVALC,INVALC,INVALC,
0x3A3F,0x3361,0x3350,0x3362,INVALC,INVALC,0x3367,INVALC,
0x334F,INVALC,0x3357,0x3368,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3A42,0x3A3B,INVALC,INVALC,INVALC,0x3A43,
INVALC,INVALC,INVALC,0x3A39,0x3A3C,INVALC,0x3A3D,INVALC,
INVALC,INVALC,0x3A41,INVALC,0x3A37,0x3A36,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3A35,0x3A40,0x3A3E,0x3A38,INVALC,
INVALC,INVALC,INVALC,0x3A3A,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x415C,INVALC,
0x4162,0x4165,INVALC,INVALC,0x415F,INVALC,0x4168,INVALC,
0x4169,INVALC,0x4164,INVALC,INVALC,0x4159,INVALC,0x415A,
INVALC,0x4163,0x4161,INVALC,0x415D,INVALC,0x415B,INVALC,
0x4160,0x4167,0x415E,0x4166,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4921,0x4877,INVALC,INVALC,0x4878,
INVALC,INVALC,INVALC,0x487B,INVALC,0x487D,INVALC,INVALC,
0x4926,INVALC,INVALC,0x4925,0x487E,INVALC,0x4876,INVALC,
0x4879,INVALC,0x487C,INVALC,0x4922,INVALC,INVALC,0x4924,
0x4923,INVALC,INVALC,0x487A,INVALC,INVALC,0x4F54,INVALC,
0x4F51,INVALC,INVALC,INVALC,INVALC,0x4F58,0x4F55,0x4F4E,
/* Block 82, Array index 0x0400 */
INVALC,INVALC,INVALC,0x4F4F,INVALC,INVALC,0x4F52,0x4F53,
INVALC,INVALC,0x4F59,0x4F56,0x4F57,INVALC,INVALC,INVALC,
INVALC,0x5643,INVALC,0x5640,INVALC,INVALC,INVALC,0x5641,
INVALC,INVALC,0x5642,INVALC,0x563F,INVALC,INVALC,INVALC,
0x5C49,INVALC,0x5C47,INVALC,0x5C48,0x5C46,0x5C45,INVALC,
INVALC,0x5C4A,INVALC,INVALC,INVALC,0x6144,0x6145,INVALC,
0x4F50,0x6143,INVALC,INVALC,0x6537,0x6538,INVALC,INVALC,
INVALC,0x6B4F,0x6B4E,INVALC,INVALC,0x6E7D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2E21,INVALC,INVALC,INVALC,INVALC,0x3A44,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x212E,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x232C,
INVALC,INVALC,INVALC,0x2E23,0x2E22,INVALC,INVALC,INVALC,
0x2135,INVALC,INVALC,INVALC,INVALC,INVALC,0x254D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x217B,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x232D,INVALC,INVALC,0x254E,INVALC,0x254F,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2E25,0x2E26,INVALC,INVALC,
0x2E27,INVALC,0x2E24,INVALC,INVALC,INVALC,0x2E28,INVALC,
0x336B,INVALC,INVALC,INVALC,0x3A45,INVALC,INVALC,0x416A,
0x4927,INVALC,INVALC,INVALC,INVALC,INVALC,0x5644,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2123,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 83, Array index 0x0500 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x214C,INVALC,INVALC,0x214B,INVALC,INVALC,INVALC,
0x217D,INVALC,INVALC,0x217C,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x232E,INVALC,0x232F,INVALC,
INVALC,0x2330,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2554,0x2551,0x2552,INVALC,0x2550,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2932,INVALC,0x2553,INVALC,
INVALC,0x2933,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2E2B,INVALC,INVALC,0x2E2E,INVALC,INVALC,
INVALC,INVALC,0x2E2A,INVALC,INVALC,INVALC,0x2E2C,0x2E2D,
INVALC,0x2E29,0x2E2F,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x336C,0x336E,0x336D,0x336F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x416C,INVALC,0x416B,0x416D,0x416E,INVALC,INVALC,INVALC,
0x4928,0x4929,INVALC,INVALC,0x4C61,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4F5A,0x4F5B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6539,0x6B51,
0x6B50,0x6E7E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x217E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2331,0x2332,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2555,INVALC,INVALC,INVALC,
0x2934,INVALC,0x2935,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2E30,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3371,INVALC,INVALC,0x3370,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x492A,INVALC,0x492B,INVALC,INVALC,INVALC,0x4F5D,
INVALC,0x4F5C,INVALC,INVALC,0x5C4B,INVALC,INVALC,0x653A,
INVALC,INVALC,INVALC,INVALC,0x2136,INVALC,INVALC,INVALC,
/* Block 84, Array index 0x0600 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2333,0x2556,0x2557,INVALC,INVALC,0x2E31,INVALC,
INVALC,0x3A47,0x3A46,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2124,INVALC,0x214D,INVALC,INVALC,0x2222,
INVALC,INVALC,0x2221,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3372,INVALC,INVALC,
0x492C,INVALC,INVALC,INVALC,0x5645,INVALC,INVALC,0x686A,
INVALC,INVALC,INVALC,INVALC,0x2558,0x2936,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x214E,0x2223,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2334,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2137,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2335,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2937,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2125,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2224,INVALC,INVALC,INVALC,0x2336,0x2337,
INVALC,INVALC,0x2559,INVALC,0x255A,INVALC,0x2939,0x2938,
0x293B,0x293A,INVALC,INVALC,0x3373,INVALC,0x2E32,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3A48,INVALC,INVALC,0x3A49,
INVALC,INVALC,INVALC,INVALC,0x492D,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x653B,INVALC,INVALC,INVALC,
INVALC,0x2138,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5646,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 85, Array index 0x0700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2225,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2340,0x233D,INVALC,INVALC,0x233E,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2345,0x233F,INVALC,INVALC,
0x2344,INVALC,0x233A,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2338,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2339,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2341,INVALC,INVALC,
INVALC,0x2343,INVALC,INVALC,INVALC,0x233C,INVALC,0x2346,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2342,
INVALC,INVALC,INVALC,INVALC,0x233B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x256B,0x256A,INVALC,0x256D,0x256F,0x2564,0x2567,0x256E,
INVALC,INVALC,INVALC,0x2561,0x2565,INVALC,INVALC,0x2569,
0x294A,INVALC,0x294E,INVALC,0x2566,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2562,INVALC,INVALC,INVALC,0x2563,0x255C,
INVALC,0x255D,0x255F,INVALC,INVALC,INVALC,INVALC,0x255B,
0x2560,INVALC,INVALC,INVALC,INVALC,0x2568,INVALC,INVALC,
INVALC,0x255E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x256C,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2949,0x293D,0x294C,INVALC,INVALC,0x293F,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x293E,0x2944,INVALC,
0x2950,INVALC,INVALC,INVALC,INVALC,INVALC,0x2946,0x2943,
INVALC,INVALC,0x293C,INVALC,0x294B,INVALC,0x294D,INVALC,
INVALC,INVALC,INVALC,0x2941,INVALC,0x2947,0x2948,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2940,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2945,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x294F,INVALC,
0x2E46,INVALC,0x2E34,INVALC,0x2E39,INVALC,INVALC,0x2E37,
INVALC,INVALC,INVALC,0x2E3E,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2E41,INVALC,0x2E38,INVALC,INVALC,INVALC,0x2E44,
0x2E45,INVALC,INVALC,0x2E43,INVALC,INVALC,INVALC,0x2E3B,
/* Block 86, Array index 0x0800 */
INVALC,INVALC,INVALC,0x2E48,0x2E3C,0x2E40,INVALC,INVALC,
0x2E3D,INVALC,0x2E42,0x2E49,0x3424,INVALC,0x2E47,INVALC,
INVALC,0x2E3F,0x2E36,INVALC,INVALC,INVALC,INVALC,0x2E35,
INVALC,INVALC,0x2E3A,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2E33,INVALC,
INVALC,INVALC,0x337A,INVALC,INVALC,0x342A,INVALC,INVALC,
0x3421,INVALC,0x3425,INVALC,0x3379,0x337E,0x337D,INVALC,
INVALC,0x3428,INVALC,0x342B,0x3376,INVALC,INVALC,INVALC,
0x342C,INVALC,INVALC,INVALC,INVALC,0x3423,INVALC,INVALC,
0x3429,INVALC,INVALC,0x342D,INVALC,0x3377,0x3427,INVALC,
0x3378,0x337B,0x3422,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x337C,INVALC,INVALC,0x3426,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3374,0x3375,0x3A4E,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3A59,INVALC,0x3A5C,
INVALC,0x3A55,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3A52,INVALC,INVALC,INVALC,0x3A5A,0x417C,0x3A5F,0x3A53,
INVALC,0x3A4A,0x3A57,0x3A51,INVALC,0x3A5D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3A5E,0x3A50,0x3A56,0x3A58,0x3A4C,0x3A5B,INVALC,
0x3A4B,INVALC,INVALC,INVALC,INVALC,0x3A4D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3A54,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x417A,
0x4176,INVALC,0x4227,0x416F,0x4178,INVALC,INVALC,INVALC,
0x4223,INVALC,0x4174,0x4173,0x4171,0x4225,INVALC,0x417D,
0x4172,INVALC,0x417B,INVALC,0x4177,0x417E,0x4222,INVALC,
INVALC,0x4226,INVALC,0x4170,INVALC,0x4175,INVALC,INVALC,
INVALC,INVALC,0x4221,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4179,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4224,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x493C,0x4938,INVALC,0x4932,INVALC,INVALC,0x493B,
/* Block 87, Array index 0x0900 */
INVALC,0x4935,0x4937,INVALC,0x493A,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4930,INVALC,INVALC,0x4933,
INVALC,INVALC,0x4931,0x4936,INVALC,0x492F,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4934,0x4939,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x492E,
INVALC,INVALC,0x4F6E,INVALC,0x4F6B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4F69,INVALC,0x4F61,INVALC,INVALC,
0x4F6D,INVALC,0x4F6F,INVALC,INVALC,0x4F6A,0x4F6C,INVALC,
0x4F68,0x4F62,0x4F5F,INVALC,INVALC,0x3A4F,0x4F65,INVALC,
0x4F5E,0x4F64,0x4F63,INVALC,0x4F60,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4F66,INVALC,0x4F67,INVALC,INVALC,INVALC,0x564F,INVALC,
0x5648,INVALC,INVALC,0x564C,INVALC,INVALC,0x564B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x564D,0x5649,INVALC,
0x5647,INVALC,0x564E,0x564A,INVALC,INVALC,INVALC,0x5650,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5C52,0x5C54,
INVALC,0x5C55,0x5C53,0x5C51,0x5C50,INVALC,0x5C4F,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5C4D,0x5C4E,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5C4C,INVALC,INVALC,INVALC,0x6148,
0x6146,0x614B,0x6149,INVALC,0x6147,0x614A,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x653E,0x653F,
INVALC,INVALC,0x6540,0x653C,0x6541,0x653D,INVALC,INVALC,
INVALC,INVALC,0x686B,0x686D,INVALC,0x686C,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6B53,0x6B54,INVALC,
INVALC,INVALC,INVALC,0x6B52,INVALC,0x6D46,0x6D45,INVALC,
INVALC,INVALC,INVALC,0x6D47,INVALC,0x7034,INVALC,INVALC,
INVALC,INVALC,INVALC,0x7033,0x707C,INVALC,INVALC,0x212A,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2227,
INVALC,0x2226,INVALC,INVALC,INVALC,0x2349,INVALC,0x2348,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2347,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2570,
INVALC,0x2571,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 88, Array index 0x0A00 */
INVALC,0x2E4A,0x2E4B,INVALC,INVALC,INVALC,INVALC,0x342F,
INVALC,INVALC,0x342E,INVALC,0x3A60,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4228,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4F70,0x5652,0x5651,INVALC,0x715A,INVALC,
0x2139,INVALC,0x214F,0x2150,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2229,INVALC,INVALC,INVALC,0x2228,INVALC,
INVALC,INVALC,INVALC,INVALC,0x222A,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x234A,INVALC,INVALC,INVALC,0x234B,INVALC,INVALC,
INVALC,0x234D,INVALC,0x234E,0x234C,INVALC,INVALC,INVALC,
INVALC,INVALC,0x234F,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x257E,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2621,INVALC,INVALC,0x2575,INVALC,0x2574,INVALC,0x2572,
0x2577,0x2576,0x2573,0x257C,0x257D,0x257A,0x2578,INVALC,
INVALC,INVALC,INVALC,0x257B,INVALC,0x2622,INVALC,INVALC,
0x2579,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2955,INVALC,INVALC,0x295B,
INVALC,INVALC,INVALC,INVALC,0x2959,0x295F,INVALC,0x2956,
0x295A,0x295C,0x295E,0x2958,INVALC,0x2957,0x2952,0x2953,
INVALC,INVALC,INVALC,INVALC,0x2954,0x295D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2951,0x2E55,INVALC,
0x2E54,0x2E59,0x2E50,INVALC,0x2E53,0x2E52,INVALC,0x2E56,
INVALC,0x2E5A,INVALC,INVALC,INVALC,INVALC,0x2E51,0x2E57,
INVALC,INVALC,INVALC,INVALC,0x2E4C,INVALC,INVALC,0x343D,
0x2E58,INVALC,0x2E4F,INVALC,INVALC,0x2E4E,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3434,INVALC,INVALC,INVALC,
INVALC,0x3444,0x3432,0x3440,INVALC,0x3442,INVALC,0x3448,
INVALC,0x344C,INVALC,INVALC,0x3443,0x3437,0x343F,INVALC,
0x344D,0x344B,0x3441,0x343C,0x3435,0x3A68,0x3433,INVALC,
0x343A,INVALC,INVALC,0x3430,0x3446,0x3438,INVALC,INVALC,
/* Block 89, Array index 0x0B00 */
0x3436,0x3449,INVALC,INVALC,0x344F,INVALC,INVALC,0x343E,
0x3439,INVALC,INVALC,0x343B,0x344A,0x344E,0x3445,INVALC,
0x3447,INVALC,INVALC,INVALC,0x3431,INVALC,INVALC,INVALC,
INVALC,0x3A63,INVALC,0x3A6C,0x3A6B,INVALC,0x3A64,INVALC,
INVALC,INVALC,INVALC,0x3A66,INVALC,0x3A6A,INVALC,0x3A65,
0x3A67,0x3A61,INVALC,INVALC,0x3A74,0x3A73,0x3A70,INVALC,
INVALC,INVALC,0x2E4D,0x3A6D,INVALC,INVALC,0x3A6F,0x3A62,
0x3A72,0x3A71,INVALC,0x3A75,INVALC,0x4236,INVALC,0x3A6E,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3A69,0x422E,INVALC,INVALC,INVALC,0x422D,0x4231,0x422C,
INVALC,INVALC,INVALC,0x4229,INVALC,0x4230,INVALC,INVALC,
INVALC,0x4233,INVALC,0x4235,INVALC,0x4232,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4237,0x422B,0x4234,INVALC,INVALC,
0x422A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x422F,
INVALC,0x4238,INVALC,INVALC,0x4944,INVALC,0x494A,INVALC,
INVALC,INVALC,0x4946,0x494D,0x493E,INVALC,INVALC,0x4943,
INVALC,0x4942,0x494B,INVALC,INVALC,INVALC,0x4941,0x4947,
0x494C,0x493D,INVALC,0x4945,INVALC,INVALC,0x4949,0x494F,
0x493F,0x4948,INVALC,INVALC,0x494E,INVALC,INVALC,INVALC,
0x4940,INVALC,INVALC,INVALC,INVALC,0x4F72,INVALC,INVALC,
0x4F74,0x4F79,INVALC,0x4F75,INVALC,0x4F78,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4F71,0x4F77,INVALC,INVALC,0x4F76,
INVALC,0x4F73,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x5657,INVALC,0x5659,0x5654,INVALC,0x5656,
INVALC,INVALC,0x5658,INVALC,INVALC,INVALC,0x565A,INVALC,
0x5653,0x5655,INVALC,INVALC,INVALC,INVALC,INVALC,0x5C58,
INVALC,INVALC,0x5C59,INVALC,0x5C57,INVALC,0x5C56,INVALC,
INVALC,INVALC,0x6542,0x6544,INVALC,0x6543,INVALC,INVALC,
INVALC,INVALC,INVALC,0x686E,INVALC,INVALC,INVALC,0x6F22,
0x6F21,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2960,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4239,INVALC,0x4950,0x4F7A,
/* Block 90, Array index 0x0C00 */
INVALC,INVALC,INVALC,0x213A,INVALC,INVALC,0x2350,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2623,0x2961,0x2E5B,INVALC,
INVALC,INVALC,0x6545,INVALC,INVALC,INVALC,INVALC,0x2151,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x213B,INVALC,INVALC,0x2152,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x222B,INVALC,INVALC,INVALC,
0x2351,INVALC,INVALC,INVALC,INVALC,0x2624,INVALC,INVALC,
INVALC,INVALC,0x2E5C,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2962,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3450,INVALC,INVALC,INVALC,
INVALC,0x3A76,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4951,INVALC,INVALC,INVALC,INVALC,
0x614C,0x6D48,0x6F23,INVALC,INVALC,INVALC,INVALC,0x2231,
INVALC,INVALC,INVALC,0x222F,0x222D,INVALC,0x2230,0x2232,
0x222C,INVALC,INVALC,INVALC,INVALC,0x222E,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2356,0x2359,
0x2358,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2355,
0x2353,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2354,0x235B,0x2357,INVALC,INVALC,INVALC,0x2352,0x235A,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2630,0x2629,INVALC,0x2634,0x2625,0x262C,INVALC,
INVALC,INVALC,0x2626,INVALC,0x262D,0x2631,INVALC,INVALC,
0x2632,0x262B,INVALC,0x262E,INVALC,INVALC,INVALC,0x2635,
0x2633,INVALC,INVALC,INVALC,0x262A,INVALC,0x2628,0x2627,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x262F,INVALC,
INVALC,INVALC,INVALC,0x2970,INVALC,0x2968,0x2964,INVALC,
0x2974,0x2963,INVALC,INVALC,0x296D,INVALC,INVALC,INVALC,
INVALC,0x2971,INVALC,INVALC,INVALC,0x2977,0x2965,INVALC,
INVALC,0x2967,0x296E,0x2972,0x2976,0x2973,0x296C,0x296F,
INVALC,INVALC,0x2969,INVALC,0x296B,0x296A,0x2975,INVALC,
/* Block 91, Array index 0x0D00 */
0x2966,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2E64,INVALC,INVALC,INVALC,INVALC,0x2E62,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2E61,0x2E5E,0x2E63,
INVALC,0x2E5D,INVALC,INVALC,INVALC,INVALC,0x2E65,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2E5F,0x2E60,INVALC,
INVALC,INVALC,INVALC,0x2E66,INVALC,0x3457,INVALC,0x3B26,
0x3456,0x3469,INVALC,INVALC,INVALC,INVALC,0x3467,INVALC,
INVALC,INVALC,0x3470,0x3460,0x3463,INVALC,INVALC,0x346D,
0x3465,INVALC,INVALC,INVALC,0x346A,0x3468,INVALC,INVALC,
0x3459,0x346E,0x3462,0x345D,INVALC,0x3453,0x346F,0x345F,
0x3452,INVALC,INVALC,0x3464,0x3471,0x3461,0x3455,0x345A,
0x3451,INVALC,INVALC,INVALC,0x345E,0x345B,INVALC,0x3454,
INVALC,0x346C,INVALC,INVALC,0x345C,0x3458,INVALC,INVALC,
0x346B,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3A7D,INVALC,0x3A7A,0x3B2D,0x3B21,0x3B2E,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3B2A,0x3B27,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3B28,0x3B2B,0x3B2F,INVALC,0x3466,0x3B31,
0x424D,INVALC,INVALC,0x3B32,0x3A78,0x3B24,INVALC,0x3B29,
INVALC,INVALC,INVALC,INVALC,0x3B30,0x3B33,0x3A7C,0x3A79,
INVALC,INVALC,0x3A7B,INVALC,INVALC,0x3B22,0x3A7E,INVALC,
INVALC,0x3B2C,INVALC,INVALC,0x3B23,INVALC,0x3B25,0x3A77,
0x4241,0x423F,INVALC,INVALC,0x4249,0x4240,0x424A,0x4246,
0x423E,0x424C,0x423D,0x4244,INVALC,INVALC,INVALC,0x4242,
0x4247,INVALC,INVALC,INVALC,0x423B,INVALC,0x4245,0x423A,
0x4243,INVALC,0x4248,0x423C,INVALC,0x424B,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4955,INVALC,INVALC,
INVALC,0x4961,0x4957,0x495D,0x4952,0x4960,0x495F,0x4963,
0x495C,INVALC,0x495B,INVALC,INVALC,0x4954,INVALC,INVALC,
0x4962,INVALC,0x4956,0x4959,0x495E,0x4958,0x4953,INVALC,
INVALC,INVALC,INVALC,0x495A,0x4F7C,INVALC,0x5021,0x4F7E,
0x5023,0x5025,INVALC,INVALC,INVALC,0x4F7D,INVALC,0x4F7B,
/* Block 92, Array index 0x0E00 */
INVALC,0x5026,0x5024,0x5022,INVALC,0x5028,INVALC,0x5027,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5029,
0x5661,INVALC,INVALC,0x5660,0x565F,INVALC,0x5662,0x565B,
INVALC,0x565C,0x5664,0x565D,INVALC,INVALC,0x5666,INVALC,
0x5665,0x565E,INVALC,0x5C5D,INVALC,0x5C5B,0x5C60,0x5C5F,
0x5663,INVALC,INVALC,INVALC,0x5C5E,0x5C5A,0x5C62,0x5C61,
INVALC,INVALC,0x5C5C,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x614D,0x6546,0x6547,0x6548,
INVALC,INVALC,INVALC,INVALC,INVALC,0x686F,INVALC,0x6B56,
0x6B55,INVALC,INVALC,0x6D49,0x6D4A,0x6F24,0x7035,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2233,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2636,INVALC,INVALC,0x2637,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2E67,INVALC,0x3473,INVALC,
INVALC,INVALC,0x3472,INVALC,INVALC,INVALC,INVALC,0x4964,
INVALC,INVALC,INVALC,0x5C63,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2153,INVALC,INVALC,0x2154,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x235C,INVALC,
INVALC,INVALC,0x235D,0x2638,INVALC,0x2639,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2E68,
0x2978,INVALC,INVALC,INVALC,0x2E6A,0x2E69,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3475,0x3474,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3B39,0x3B36,INVALC,0x3B35,0x3B3A,INVALC,
INVALC,0x3B38,INVALC,INVALC,0x3B37,INVALC,0x424E,INVALC,
0x424F,0x4250,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4965,INVALC,INVALC,0x4966,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3B34,INVALC,INVALC,INVALC,INVALC,0x5667,
INVALC,0x5C64,0x5C65,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 93, Array index 0x0F00 */
INVALC,INVALC,INVALC,0x2E6B,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3B3B,INVALC,INVALC,INVALC,
0x213C,INVALC,0x2155,INVALC,INVALC,0x2234,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4251,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2235,INVALC,INVALC,
0x235E,INVALC,0x235F,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3B3C,INVALC,INVALC,0x4252,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2156,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x263A,INVALC,INVALC,0x263B,
INVALC,INVALC,INVALC,INVALC,0x2979,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2E6D,INVALC,0x2E6C,INVALC,
INVALC,0x3476,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4967,INVALC,INVALC,INVALC,0x502A,
INVALC,0x614E,0x614F,INVALC,INVALC,0x7036,0x212B,INVALC,
INVALC,INVALC,INVALC,0x2158,0x2157,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2237,0x2238,0x2236,INVALC,0x2239,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2367,INVALC,
0x2362,0x2364,0x2366,0x2363,INVALC,0x2360,INVALC,0x2361,
INVALC,INVALC,0x2365,0x2368,INVALC,0x2369,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2649,INVALC,0x2643,
0x263E,INVALC,0x2646,0x2644,0x263D,0x264A,0x264D,0x2648,
0x2641,INVALC,0x2647,INVALC,0x2642,0x2645,0x263C,0x2640,
0x264C,INVALC,INVALC,INVALC,INVALC,0x263F,0x264B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2A2C,0x2A25,
0x2A2B,0x2A24,0x2A26,0x297E,0x297C,INVALC,0x2A2D,0x2A2A,
0x297A,INVALC,INVALC,0x2A28,0x2A29,INVALC,0x2A27,0x297D,
0x297B,INVALC,0x2A23,0x2A21,INVALC,INVALC,0x2A22,0x2A2E,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2E6E,INVALC,0x2E70,INVALC,
INVALC,0x2E71,INVALC,INVALC,INVALC,INVALC,INVALC,0x2E72,
0x2A2F,0x2E74,INVALC,INVALC,INVALC,INVALC,INVALC,0x2E6F,
/* Block 94, Array index 0x1000 */
0x2E73,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3478,0x347C,0x347E,INVALC,0x3523,
INVALC,INVALC,0x3525,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x347A,INVALC,INVALC,0x3479,0x3477,0x3527,
0x347B,INVALC,INVALC,0x3526,INVALC,0x3522,0x3521,INVALC,
0x347D,INVALC,INVALC,INVALC,INVALC,INVALC,0x3528,INVALC,
0x3524,0x3B4B,0x3B52,0x3B47,INVALC,0x3B43,0x3B53,0x3B3D,
0x3B50,0x3B4E,0x3B48,INVALC,0x3B51,0x3B4A,INVALC,0x3B42,
0x3B54,0x3B40,0x3B4D,0x3B3E,INVALC,0x3B55,INVALC,INVALC,
INVALC,0x3B4F,0x4255,0x3B41,INVALC,INVALC,0x3B45,INVALC,
INVALC,0x3B44,0x3B49,INVALC,INVALC,0x3B46,INVALC,INVALC,
INVALC,0x3B4C,INVALC,INVALC,INVALC,INVALC,0x4259,INVALC,
INVALC,INVALC,0x425C,0x4254,INVALC,0x4256,INVALC,0x425B,
0x425A,INVALC,INVALC,0x3B3F,0x4258,INVALC,INVALC,INVALC,
INVALC,0x4253,0x4257,INVALC,INVALC,INVALC,INVALC,0x496E,
INVALC,0x4975,0x496C,INVALC,0x4973,0x496A,0x4972,0x4976,
0x4969,0x496D,0x4968,INVALC,INVALC,INVALC,0x496B,INVALC,
0x4971,0x4970,0x496F,INVALC,INVALC,0x4974,INVALC,INVALC,
INVALC,INVALC,0x502E,0x5030,INVALC,0x5031,INVALC,0x502C,
INVALC,0x502B,0x5035,INVALC,0x5033,INVALC,0x5036,0x502D,
0x5032,0x5034,0x502F,INVALC,INVALC,INVALC,INVALC,0x566B,
0x5670,0x566A,0x566F,INVALC,0x5668,0x5672,0x566E,0x5673,
0x566D,0x5669,0x5671,INVALC,0x5674,0x566C,INVALC,0x5C66,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6150,INVALC,0x643E,0x6549,INVALC,INVALC,0x6870,0x6871,
INVALC,INVALC,INVALC,0x6B57,INVALC,INVALC,INVALC,0x6B58,
INVALC,0x6D4C,INVALC,INVALC,INVALC,0x6D4B,INVALC,INVALC,
0x6F25,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x223A,
0x236A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x425D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2A30,INVALC,INVALC,INVALC,INVALC,INVALC,0x213D,
/* Block 95, Array index 0x1100 */
INVALC,INVALC,INVALC,INVALC,0x2159,INVALC,INVALC,INVALC,
INVALC,INVALC,0x236B,INVALC,INVALC,INVALC,0x236C,INVALC,
INVALC,INVALC,INVALC,INVALC,0x264F,INVALC,INVALC,0x264E,
INVALC,0x2650,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2A34,0x2A31,0x2A32,0x2A33,0x2A35,INVALC,INVALC,INVALC,
0x2E76,0x2E75,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x352A,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3529,INVALC,
INVALC,0x3B57,INVALC,INVALC,0x3B56,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4260,0x4262,INVALC,0x4261,0x425F,0x425E,
INVALC,INVALC,INVALC,0x4979,INVALC,INVALC,INVALC,INVALC,
0x4977,0x4978,INVALC,INVALC,0x503A,0x5038,INVALC,INVALC,
0x5039,INVALC,INVALC,INVALC,INVALC,INVALC,0x5677,0x5675,
0x5676,0x5037,0x5C68,INVALC,0x5C67,0x6151,0x6152,0x5678,
0x654A,INVALC,INVALC,INVALC,INVALC,0x223B,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x215A,INVALC,0x215B,INVALC,0x223C,INVALC,INVALC,INVALC,
0x2370,0x236E,INVALC,0x236D,0x236F,0x2371,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2A39,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2A38,0x2A3A,0x2A37,0x2A3B,INVALC,INVALC,
0x2E77,INVALC,0x2E79,INVALC,0x2E7A,INVALC,0x2E78,INVALC,
0x2A36,0x352B,0x352E,0x352F,0x352C,INVALC,INVALC,INVALC,
INVALC,0x352D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4263,0x4265,0x4267,
INVALC,INVALC,INVALC,0x4266,0x4264,INVALC,0x497D,INVALC,
INVALC,0x497B,0x4A23,INVALC,0x4A24,0x4A21,INVALC,0x497C,
0x497A,0x4A22,INVALC,0x503C,0x497E,INVALC,0x503D,INVALC,
INVALC,0x503E,INVALC,INVALC,INVALC,0x567D,0x567B,0x567A,
0x567C,0x5679,INVALC,INVALC,INVALC,INVALC,0x6872,0x6873,
INVALC,0x6B59,0x6D4D,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 96, Array index 0x1200 */
INVALC,INVALC,0x223D,INVALC,INVALC,0x2372,INVALC,0x2A3C,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x223E,INVALC,INVALC,0x2373,INVALC,INVALC,
INVALC,INVALC,0x2652,0x2653,0x2654,INVALC,INVALC,INVALC,
0x2651,INVALC,INVALC,INVALC,INVALC,INVALC,0x2A3D,INVALC,
0x2E7C,INVALC,INVALC,0x2E7B,INVALC,INVALC,0x3530,INVALC,
0x3531,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4268,INVALC,INVALC,0x4A26,0x4A25,INVALC,INVALC,INVALC,
INVALC,0x503F,INVALC,0x567E,INVALC,INVALC,INVALC,0x6F27,
INVALC,INVALC,INVALC,INVALC,0x2655,INVALC,0x2A3E,INVALC,
0x3B58,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2E7D,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4A27,
INVALC,INVALC,INVALC,0x212C,0x223F,INVALC,0x2375,INVALC,
0x2374,INVALC,INVALC,INVALC,INVALC,0x2658,0x2657,INVALC,
INVALC,INVALC,0x2656,INVALC,INVALC,INVALC,0x2A3F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3533,INVALC,
INVALC,INVALC,INVALC,0x3532,INVALC,INVALC,INVALC,0x3534,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3B5A,0x3B59,INVALC,
INVALC,INVALC,INVALC,0x3B5B,INVALC,0x426A,INVALC,0x4269,
INVALC,INVALC,0x5040,INVALC,INVALC,INVALC,0x4A28,INVALC,
INVALC,INVALC,INVALC,0x5722,0x5721,INVALC,0x5C69,0x654B,
0x6874,0x6875,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x215C,INVALC,INVALC,INVALC,INVALC,INVALC,0x2242,
0x2378,0x2377,0x2376,INVALC,0x2241,0x2240,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2659,INVALC,
INVALC,0x237D,INVALC,0x2421,0x237E,0x265A,INVALC,INVALC,
0x237A,INVALC,INVALC,INVALC,INVALC,0x2379,0x237B,0x2423,
INVALC,INVALC,INVALC,0x237C,0x2427,INVALC,INVALC,0x2424,
INVALC,INVALC,0x2422,0x2425,INVALC,INVALC,INVALC,INVALC,
/* Block 97, Array index 0x1300 */
0x2426,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x266E,0x2661,0x265F,0x266D,0x2668,INVALC,INVALC,
0x2669,0x266C,INVALC,0x266B,INVALC,INVALC,INVALC,0x2662,
INVALC,0x265D,0x2664,INVALC,0x266F,INVALC,0x2665,INVALC,
INVALC,INVALC,0x2667,INVALC,0x2A4E,INVALC,0x265C,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2666,0x265B,0x266A,INVALC,
INVALC,INVALC,0x265E,0x2663,0x2660,INVALC,INVALC,0x2A40,
INVALC,0x2A41,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2A4B,0x2F23,0x2A4C,INVALC,0x2A4F,0x2A45,INVALC,0x2A47,
INVALC,0x2A48,INVALC,INVALC,0x2A4A,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2A46,0x2A42,INVALC,INVALC,INVALC,
0x2A50,INVALC,0x2F21,0x2A49,INVALC,0x2E7E,0x2A44,0x2A4D,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2A51,0x2F22,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2A52,INVALC,
INVALC,INVALC,0x2A43,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2F26,0x2F28,INVALC,0x2F2A,INVALC,INVALC,0x3537,0x2F2E,
0x2F25,INVALC,0x3535,INVALC,INVALC,INVALC,0x2F30,INVALC,
0x3536,INVALC,0x2F27,INVALC,INVALC,0x2F2B,INVALC,0x2F2D,
INVALC,INVALC,INVALC,0x2F2C,0x2F2F,0x2F29,INVALC,INVALC,
INVALC,INVALC,0x2F24,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3539,0x3542,INVALC,INVALC,INVALC,INVALC,INVALC,0x3544,
INVALC,0x3B5D,0x353A,INVALC,INVALC,INVALC,0x3538,0x3546,
0x3549,0x3B6C,INVALC,0x3547,0x3B61,INVALC,INVALC,INVALC,
0x3541,0x3B5C,0x3545,INVALC,0x3B5E,0x3548,0x3B60,0x353D,
INVALC,INVALC,INVALC,0x353B,0x353C,INVALC,INVALC,INVALC,
INVALC,0x353F,INVALC,0x3543,INVALC,0x3540,INVALC,INVALC,
INVALC,INVALC,0x3B5F,INVALC,0x353E,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3B63,INVALC,INVALC,0x3B67,INVALC,0x426B,
0x3B69,INVALC,INVALC,INVALC,0x3B6A,INVALC,0x3B6B,0x3B71,
/* Block 98, Array index 0x1400 */
INVALC,INVALC,INVALC,0x3B6D,0x3B72,0x3B66,INVALC,INVALC,
INVALC,INVALC,0x3B64,0x3B73,INVALC,INVALC,INVALC,INVALC,
0x3B70,INVALC,INVALC,0x3B68,0x3B62,INVALC,0x3B65,INVALC,
0x3B6E,INVALC,INVALC,INVALC,INVALC,0x3B6F,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4A2A,0x4276,INVALC,0x426E,0x4A29,INVALC,0x4272,0x4274,
INVALC,INVALC,0x4271,INVALC,INVALC,INVALC,0x4270,INVALC,
INVALC,INVALC,INVALC,0x4A39,INVALC,INVALC,INVALC,INVALC,
0x4277,0x4A2B,INVALC,INVALC,INVALC,0x426F,0x4273,INVALC,
INVALC,0x426C,0x426D,INVALC,INVALC,INVALC,INVALC,0x4275,
INVALC,INVALC,0x4A2F,0x4A30,0x4A35,INVALC,0x4A3C,INVALC,
INVALC,INVALC,INVALC,0x4A37,INVALC,INVALC,0x4A2C,INVALC,
INVALC,0x4A3B,INVALC,INVALC,INVALC,0x4A38,0x5051,INVALC,
INVALC,INVALC,0x4A3A,INVALC,0x4A32,INVALC,INVALC,INVALC,
INVALC,0x4A2D,0x4A31,0x4A2E,0x4A34,INVALC,INVALC,INVALC,
INVALC,0x5043,0x4A36,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4A33,INVALC,INVALC,0x5042,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5047,INVALC,0x5041,0x572E,0x5050,INVALC,INVALC,
INVALC,INVALC,0x504D,0x5049,INVALC,INVALC,0x5725,INVALC,
INVALC,INVALC,INVALC,0x5048,INVALC,0x5723,INVALC,0x504C,
INVALC,0x504F,0x5046,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5724,INVALC,0x504E,INVALC,INVALC,0x504B,INVALC,0x504A,
0x5045,0x5044,INVALC,0x5052,0x5727,0x5C6B,INVALC,INVALC,
0x572D,INVALC,0x572B,INVALC,0x5C6C,INVALC,INVALC,0x572C,
INVALC,0x5729,INVALC,0x5C6A,INVALC,0x5726,0x5728,INVALC,
INVALC,INVALC,INVALC,INVALC,0x572A,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x615B,INVALC,
0x6153,INVALC,INVALC,INVALC,INVALC,INVALC,0x5C72,0x6154,
0x5C6E,INVALC,INVALC,INVALC,0x5C70,0x5C6F,INVALC,0x5C6D,
0x5C71,0x615C,0x6158,0x615A,INVALC,0x6155,0x6156,INVALC,
0x6159,0x6157,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6876,INVALC,0x654C,INVALC,0x6B5A,INVALC,INVALC,
/* Block 99, Array index 0x1500 */
INVALC,0x6F28,INVALC,0x6F29,0x6F2A,INVALC,INVALC,0x722A,
INVALC,0x215D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2670,INVALC,INVALC,INVALC,
INVALC,0x2F31,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4278,INVALC,INVALC,0x427A,0x427C,0x427B,INVALC,0x4A3E,
INVALC,0x4A3D,INVALC,0x4A3F,INVALC,0x5053,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2428,INVALC,INVALC,0x2671,INVALC,INVALC,
INVALC,INVALC,0x2A53,0x2A54,INVALC,INVALC,0x2F32,INVALC,
INVALC,INVALC,0x3B74,INVALC,INVALC,INVALC,INVALC,INVALC,
0x215E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2249,0x224B,INVALC,0x2243,INVALC,0x2244,INVALC,
0x224A,0x2246,0x2248,INVALC,0x2245,0x224C,0x2247,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2432,0x242F,0x2437,INVALC,0x2438,INVALC,INVALC,0x2435,
INVALC,INVALC,0x2431,0x2430,INVALC,0x2436,INVALC,INVALC,
INVALC,0x2433,INVALC,0x2429,INVALC,INVALC,INVALC,0x242E,
0x2434,INVALC,INVALC,INVALC,0x242A,INVALC,0x242B,0x242C,
INVALC,INVALC,INVALC,INVALC,0x242D,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x267D,0x2676,INVALC,INVALC,0x2672,0x2679,0x267B,
0x267E,INVALC,INVALC,0x267A,0x2673,INVALC,0x2677,INVALC,
0x2721,INVALC,INVALC,0x267C,INVALC,INVALC,0x2675,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2678,INVALC,INVALC,INVALC,INVALC,0x2A55,
INVALC,0x2674,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2A5B,INVALC,INVALC,INVALC,INVALC,
0x2A67,INVALC,0x2F33,INVALC,INVALC,0x2A58,0x2A60,INVALC,
0x2A5F,0x2A5C,0x2A64,0x2A66,INVALC,INVALC,INVALC,INVALC,
/* Block 100, Array index 0x1600 */
0x2A61,INVALC,INVALC,0x2A5A,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2A57,0x2A5E,0x2A56,0x2A59,0x2A5D,
0x2F34,INVALC,INVALC,0x2A62,0x2A63,0x2A65,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2F40,INVALC,INVALC,0x2F36,0x2F46,INVALC,INVALC,
INVALC,INVALC,0x354A,0x2F48,0x2F42,INVALC,0x2F39,INVALC,
0x2F4B,0x2F3C,INVALC,0x3561,0x2F3F,INVALC,INVALC,INVALC,
0x2F4D,0x2F41,INVALC,0x2F3A,0x2F37,0x2F38,INVALC,0x2F47,
0x2F4E,INVALC,0x2F3E,0x2F3D,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2F4A,INVALC,INVALC,0x2F44,INVALC,0x2F35,0x2F4C,
0x2F43,0x2F45,0x2F49,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x354B,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x355D,0x3559,0x3556,
0x3568,INVALC,INVALC,INVALC,INVALC,0x355B,INVALC,INVALC,
0x3563,INVALC,INVALC,INVALC,0x355F,0x354E,INVALC,INVALC,
INVALC,0x3565,0x354D,INVALC,INVALC,0x3564,INVALC,0x3557,
INVALC,INVALC,0x354C,INVALC,INVALC,0x3567,0x3555,INVALC,
0x3558,0x3566,INVALC,INVALC,0x3B75,INVALC,INVALC,0x3553,
INVALC,INVALC,INVALC,INVALC,0x355C,0x3552,0x3550,0x3562,
INVALC,INVALC,INVALC,INVALC,0x3560,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3554,INVALC,0x3551,0x355E,0x355A,
0x3B77,0x3B76,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x354F,0x3C29,INVALC,
INVALC,INVALC,0x3C2F,0x3B7C,0x3C2C,0x427D,INVALC,0x3C30,
0x3C33,INVALC,0x3C21,0x3C32,0x3C31,INVALC,0x3B78,INVALC,
INVALC,INVALC,INVALC,0x3C2E,INVALC,0x3C24,INVALC,0x3C35,
0x3C2D,0x3C36,INVALC,INVALC,0x3C2B,0x3C2A,INVALC,0x3C28,
0x3C22,INVALC,INVALC,INVALC,0x2F3B,0x3B79,INVALC,0x433D,
0x3B7A,INVALC,INVALC,0x4321,INVALC,INVALC,INVALC,0x3B7B,
0x3C34,0x427E,0x3C25,0x3B7E,INVALC,0x3C26,0x3C23,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 101, Array index 0x1700 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4324,0x4337,0x433C,0x4330,INVALC,0x4341,INVALC,
0x4322,INVALC,0x4323,INVALC,INVALC,0x432A,INVALC,INVALC,
0x432B,INVALC,0x4338,0x433E,INVALC,INVALC,INVALC,0x4329,
0x4325,0x4340,0x432E,0x432F,0x4326,0x433A,0x4331,0x433B,
0x4333,INVALC,INVALC,0x4A40,INVALC,INVALC,0x433F,0x4336,
0x4332,INVALC,INVALC,0x4327,INVALC,0x4335,INVALC,0x432D,
INVALC,0x432C,INVALC,INVALC,INVALC,INVALC,INVALC,0x4A55,
0x4339,0x4334,INVALC,0x4328,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4A50,INVALC,0x4A41,0x4A4C,INVALC,
0x4A53,INVALC,INVALC,0x4A51,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4A58,INVALC,0x4A42,0x4A4F,0x4A43,0x4A4E,INVALC,
0x4A52,0x3C27,INVALC,INVALC,INVALC,0x4A59,0x4A4A,INVALC,
0x5061,INVALC,INVALC,0x4A57,0x4A56,INVALC,0x5054,INVALC,
0x5055,INVALC,0x4A46,0x4A47,0x4A44,0x4A49,0x4A45,0x4A5A,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4A48,INVALC,0x4A54,
INVALC,INVALC,0x4A4D,INVALC,INVALC,0x5058,INVALC,INVALC,
INVALC,0x5735,0x505D,0x505C,0x505E,INVALC,INVALC,0x505B,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5056,0x5059,
0x5063,INVALC,INVALC,INVALC,0x505A,0x3B7D,INVALC,0x5060,
0x5057,INVALC,INVALC,0x505F,INVALC,INVALC,0x4A4B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5062,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5734,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5736,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5733,INVALC,INVALC,INVALC,INVALC,INVALC,0x5732,
0x5731,INVALC,INVALC,INVALC,INVALC,INVALC,0x5730,0x572F,
INVALC,0x5739,INVALC,0x5737,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5C75,0x5C77,INVALC,INVALC,INVALC,
0x5C78,0x5C74,INVALC,0x5C76,INVALC,INVALC,INVALC,0x5C73,
INVALC,INVALC,INVALC,0x5738,INVALC,INVALC,INVALC,INVALC,
0x6160,INVALC,INVALC,INVALC,0x6163,0x615F,INVALC,0x615D,
/* Block 102, Array index 0x1800 */
INVALC,0x6161,INVALC,0x6162,0x615E,INVALC,INVALC,0x654D,
INVALC,0x6550,INVALC,INVALC,0x6551,0x654F,0x6552,INVALC,
0x654E,INVALC,INVALC,0x687A,INVALC,0x6879,0x6878,0x6877,
INVALC,INVALC,INVALC,0x6B5B,INVALC,INVALC,INVALC,INVALC,
0x6D4F,0x6D4E,0x6D51,INVALC,INVALC,0x6F2C,0x6D50,INVALC,
INVALC,0x6F2B,INVALC,INVALC,INVALC,0x7037,0x707D,INVALC,
INVALC,INVALC,0x3C37,0x573A,INVALC,INVALC,INVALC,0x224D,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2722,INVALC,INVALC,
INVALC,0x2A68,INVALC,0x2A69,INVALC,INVALC,0x2F50,INVALC,
INVALC,INVALC,0x2F4F,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3569,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3C3B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3C3A,0x3C3D,INVALC,0x3C38,
0x3C3C,INVALC,0x3C39,INVALC,INVALC,INVALC,INVALC,0x4342,
INVALC,INVALC,INVALC,0x4A5B,INVALC,INVALC,0x5064,INVALC,
INVALC,0x5066,0x5065,0x5067,0x573C,INVALC,INVALC,0x573B,
0x5C7A,0x5C79,INVALC,INVALC,0x6553,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3C3E,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4343,INVALC,0x6164,INVALC,0x6F2D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3C3F,0x3C40,INVALC,
0x4A5C,INVALC,0x573D,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2723,INVALC,0x2A6A,INVALC,INVALC,INVALC,0x3C41,INVALC,
INVALC,INVALC,0x5068,0x5069,INVALC,INVALC,0x5C7B,INVALC,
0x707E,INVALC,INVALC,0x2724,INVALC,INVALC,INVALC,0x2A6B,
INVALC,INVALC,0x2F54,0x2F52,0x2F53,INVALC,0x2F51,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x356A,INVALC,INVALC,
0x3C42,INVALC,0x3C43,0x4344,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x5C7C,0x6165,INVALC,0x6555,0x6554,0x687B,
INVALC,0x213E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x224F,0x224E,
0x2439,INVALC,0x243C,0x243B,0x243A,0x243D,INVALC,INVALC,
INVALC,INVALC,INVALC,0x272A,0x2726,0x272F,INVALC,INVALC,
/* Block 103, Array index 0x1900 */
INVALC,INVALC,INVALC,0x272B,0x2727,0x272E,INVALC,INVALC,
0x2729,0x2725,INVALC,0x272C,INVALC,0x272D,INVALC,INVALC,
0x2731,0x2730,0x2728,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2A70,0x2A76,INVALC,INVALC,
INVALC,0x2A6D,0x2A72,INVALC,INVALC,INVALC,0x2A71,INVALC,
INVALC,INVALC,INVALC,0x2A74,INVALC,INVALC,0x2A79,INVALC,
INVALC,INVALC,0x2A6E,0x2A73,0x2A77,0x2A6F,0x2A6C,INVALC,
INVALC,0x2A78,0x2A75,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2F57,
INVALC,INVALC,0x2F55,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2F58,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x356E,INVALC,0x356D,0x356F,INVALC,INVALC,0x2F56,
INVALC,0x356C,0x3570,INVALC,INVALC,0x356B,INVALC,INVALC,
INVALC,INVALC,0x3C4A,INVALC,0x3C45,INVALC,INVALC,INVALC,
INVALC,0x3C48,0x3C4B,INVALC,INVALC,INVALC,INVALC,INVALC,
0x434D,0x3C49,INVALC,0x3C46,0x3C44,INVALC,INVALC,INVALC,
0x3C47,INVALC,INVALC,INVALC,INVALC,INVALC,0x4345,INVALC,
INVALC,INVALC,0x434A,0x4349,0x4346,INVALC,INVALC,INVALC,
0x4348,INVALC,INVALC,INVALC,0x434C,0x4347,INVALC,INVALC,
INVALC,0x434B,INVALC,INVALC,INVALC,INVALC,INVALC,0x4A5F,
0x4A5E,0x4A5D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x506C,0x506F,INVALC,INVALC,INVALC,INVALC,0x5070,
0x506B,INVALC,0x506D,INVALC,INVALC,0x506A,INVALC,0x506E,
INVALC,INVALC,0x5746,0x5745,INVALC,0x5744,0x573F,INVALC,
0x5740,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x573E,INVALC,0x5741,0x5742,0x5747,INVALC,INVALC,0x5743,
INVALC,INVALC,0x5C7D,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6168,INVALC,0x6166,0x6167,INVALC,INVALC,0x6556,INVALC,
INVALC,INVALC,INVALC,0x687D,0x687E,INVALC,INVALC,INVALC,
0x687C,INVALC,INVALC,0x6F2E,INVALC,0x7038,0x7039,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2732,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 104, Array index 0x1A00 */
INVALC,0x3C4C,INVALC,INVALC,0x4A61,0x4A60,INVALC,INVALC,
INVALC,INVALC,0x2733,INVALC,INVALC,INVALC,INVALC,0x2A7A,
0x2A7B,INVALC,0x2F59,0x2F5A,INVALC,INVALC,INVALC,INVALC,
0x3571,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x434E,0x4641,0x4A62,0x5748,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2257,INVALC,INVALC,INVALC,INVALC,
0x2252,0x2251,0x2254,0x2253,0x2256,INVALC,0x2250,0x2255,
INVALC,INVALC,INVALC,INVALC,INVALC,0x243E,INVALC,0x243F,
0x2443,INVALC,INVALC,0x2447,0x2442,0x2445,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2441,INVALC,INVALC,
INVALC,0x2440,0x2446,INVALC,INVALC,0x2444,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2735,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x273D,INVALC,0x2738,INVALC,
0x2747,0x2748,0x2740,0x2739,INVALC,0x2745,INVALC,INVALC,
INVALC,0x2746,INVALC,0x2744,0x273C,0x2734,0x273B,INVALC,
INVALC,INVALC,INVALC,INVALC,0x273F,0x273E,0x2736,INVALC,
INVALC,0x2742,0x2737,INVALC,0x2749,INVALC,INVALC,INVALC,
0x273A,0x2743,INVALC,INVALC,INVALC,INVALC,INVALC,0x2741,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2B3D,INVALC,
INVALC,INVALC,0x2B38,0x2B2E,INVALC,0x2B2C,INVALC,0x2B27,
INVALC,0x2B34,0x2B21,0x2B23,INVALC,INVALC,INVALC,INVALC,
0x2B26,0x2A7C,0x2B33,0x2B43,INVALC,0x2B28,0x2B3A,INVALC,
0x2A7E,0x2B41,0x2B42,0x2B45,0x2B3C,0x2B2D,0x2B35,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2B25,INVALC,INVALC,0x2B3F,0x2B22,INVALC,INVALC,0x2B2B,
INVALC,INVALC,INVALC,0x2B32,0x2B2A,INVALC,0x2B3E,0x2B36,
INVALC,INVALC,0x2B44,0x2B29,INVALC,0x2B3B,0x2B31,INVALC,
0x2B37,INVALC,0x2A7D,INVALC,INVALC,INVALC,0x2B30,0x2B2F,
0x2B24,INVALC,0x2B40,INVALC,0x2B39,INVALC,INVALC,INVALC,
/* Block 105, Array index 0x1B00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2F6E,INVALC,0x2F6F,INVALC,0x2F63,INVALC,
INVALC,INVALC,0x2F5C,INVALC,0x2F65,0x2F6D,INVALC,0x2F5B,
0x2F76,INVALC,INVALC,INVALC,INVALC,0x2F75,0x2F70,INVALC,
0x2F71,INVALC,INVALC,0x2F67,INVALC,0x2F68,0x2F72,0x2F69,
INVALC,0x2F64,0x2F5E,0x2F5F,0x2F6C,0x2F66,INVALC,INVALC,
INVALC,INVALC,0x2F74,0x2F60,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2F6B,INVALC,INVALC,INVALC,
INVALC,0x2F5D,INVALC,0x2F61,INVALC,0x2F73,0x2F6A,0x2F62,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3628,INVALC,0x3576,0x3577,0x357B,
INVALC,0x362C,0x3629,INVALC,0x3622,0x3621,INVALC,0x3625,
0x3634,0x3572,INVALC,0x3635,0x3627,0x3639,0x362D,INVALC,
0x362B,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3573,
INVALC,0x3632,0x3638,0x3630,0x3637,INVALC,INVALC,0x3624,
0x3574,0x3636,0x3626,INVALC,INVALC,INVALC,0x362F,INVALC,
INVALC,INVALC,INVALC,0x362E,0x3575,INVALC,INVALC,INVALC,
0x3631,INVALC,INVALC,0x357C,0x3633,INVALC,INVALC,INVALC,
INVALC,0x357E,0x362A,0x3579,0x357D,INVALC,0x3578,INVALC,
INVALC,INVALC,0x3623,INVALC,0x3C63,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3C66,0x3C7C,
0x3C71,INVALC,INVALC,INVALC,0x3C60,INVALC,0x3C70,INVALC,
0x3C69,0x3C76,INVALC,0x3C4E,0x3C78,INVALC,0x3C56,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3C50,0x3C72,0x3C73,INVALC,
INVALC,0x3C5E,INVALC,INVALC,0x3C59,INVALC,0x3C74,INVALC,
0x3C6C,0x3C79,0x3C53,0x3C58,0x3C52,INVALC,INVALC,0x3C65,
0x4364,0x3C54,INVALC,0x3C5D,0x3C75,INVALC,0x3C5A,0x3C57,
0x3C68,INVALC,INVALC,INVALC,0x3C6B,0x3C6A,INVALC,INVALC,
/* Block 106, Array index 0x1C00 */
INVALC,INVALC,INVALC,INVALC,0x3C4F,INVALC,0x3C77,0x3C5F,
0x3C61,INVALC,0x3C6E,0x3C6D,0x3C4D,INVALC,INVALC,0x3C55,
0x3C5C,0x3C64,INVALC,0x3C5B,0x3C67,0x3C7A,INVALC,0x3C6F,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3C7B,INVALC,INVALC,
INVALC,INVALC,0x3C51,INVALC,INVALC,INVALC,INVALC,0x4378,
INVALC,INVALC,0x4376,0x4361,0x4366,0x435F,INVALC,0x4372,
0x4351,0x4358,INVALC,0x4370,0x437A,0x4362,INVALC,0x4355,
0x4368,0x436D,0x4359,INVALC,0x436A,0x4356,INVALC,INVALC,
0x435D,0x435E,INVALC,0x4371,0x436F,INVALC,0x4352,0x4374,
INVALC,0x4375,0x4377,INVALC,INVALC,INVALC,0x357A,0x435A,
0x436C,0x435B,INVALC,INVALC,0x4373,INVALC,INVALC,0x4350,
INVALC,INVALC,0x4353,INVALC,INVALC,0x4363,0x434F,INVALC,
INVALC,0x4367,0x4357,INVALC,0x4360,INVALC,INVALC,0x4369,
0x3C62,0x4354,INVALC,INVALC,0x436E,INVALC,0x436B,INVALC,
0x4365,INVALC,0x435C,0x4379,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x452C,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4A70,0x4A6E,INVALC,
0x4B26,0x4A6C,INVALC,0x4A7E,INVALC,INVALC,0x4A68,0x4B25,
INVALC,0x4A6D,0x4A7B,INVALC,INVALC,INVALC,0x4B23,INVALC,
0x4A66,0x4B22,INVALC,INVALC,0x4A77,0x4B29,INVALC,0x4A6F,
INVALC,0x4A71,0x4B21,INVALC,0x4A6A,INVALC,INVALC,0x4A73,
0x4A69,0x4A63,INVALC,0x4A7D,INVALC,0x4B28,0x4A64,INVALC,
INVALC,0x4A79,INVALC,INVALC,0x4A6B,0x4A76,0x4A72,0x4A74,
INVALC,INVALC,0x4B27,INVALC,0x4A75,INVALC,0x4B2A,INVALC,
INVALC,0x4A65,0x4A7A,INVALC,INVALC,INVALC,0x4A67,0x4A7C,
INVALC,INVALC,INVALC,INVALC,0x4A78,INVALC,INVALC,INVALC,
INVALC,0x4B24,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x507C,INVALC,0x5078,0x5074,0x512A,0x5127,
INVALC,INVALC,INVALC,0x512E,0x507B,INVALC,0x5124,INVALC,
INVALC,0x5077,0x5123,INVALC,0x5137,INVALC,0x5134,0x5126,
0x5075,INVALC,INVALC,0x512B,0x512D,INVALC,0x5121,0x507A,
/* Block 107, Array index 0x1D00 */
0x5071,INVALC,INVALC,INVALC,0x5130,INVALC,0x5072,0x5136,
0x5129,0x512F,INVALC,INVALC,INVALC,0x512C,INVALC,0x5133,
INVALC,INVALC,INVALC,INVALC,0x5125,0x5076,0x5138,0x5073,
0x5131,INVALC,INVALC,0x507D,INVALC,0x507E,INVALC,INVALC,
0x5079,INVALC,INVALC,INVALC,INVALC,0x5132,0x5135,0x5122,
0x5755,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x574D,INVALC,0x5749,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5757,0x5762,INVALC,0x574F,0x5758,
0x5128,0x5759,INVALC,INVALC,INVALC,INVALC,0x5768,INVALC,
INVALC,0x574B,INVALC,INVALC,INVALC,0x5766,0x5767,0x575D,
0x575C,0x5754,INVALC,INVALC,0x575E,0x5765,0x5764,INVALC,
INVALC,INVALC,0x5756,0x5753,INVALC,0x5750,0x5763,INVALC,
0x5761,INVALC,INVALC,INVALC,0x575B,INVALC,0x574A,0x574C,
0x574E,0x5760,0x575A,INVALC,INVALC,0x5751,INVALC,0x575F,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5752,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5D31,
INVALC,0x5D22,INVALC,0x5D2D,INVALC,0x5D34,INVALC,0x5D29,
INVALC,0x5D24,INVALC,INVALC,0x5D35,0x5C7E,0x5D2B,INVALC,
INVALC,0x5D30,0x5D36,0x5D2A,INVALC,0x5D2C,0x5D21,INVALC,
INVALC,INVALC,0x5D33,0x5D26,INVALC,INVALC,0x5D28,0x5D25,
INVALC,0x5D27,INVALC,INVALC,0x5D2F,0x5D23,0x5D32,INVALC,
0x5D2E,INVALC,INVALC,INVALC,INVALC,0x6173,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x6172,INVALC,0x616F,0x6170,
INVALC,0x616A,0x616E,INVALC,INVALC,0x616B,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6169,0x616D,0x6171,
INVALC,INVALC,INVALC,0x655C,0x6559,0x6562,INVALC,0x6561,
0x655F,0x655A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x655B,INVALC,INVALC,0x655E,INVALC,0x6563,0x655D,
0x6558,0x616C,INVALC,INVALC,INVALC,INVALC,INVALC,0x6557,
0x6924,INVALC,0x6923,0x6560,INVALC,INVALC,0x6927,0x6928,
0x6922,0x6926,INVALC,0x6921,INVALC,INVALC,INVALC,INVALC,
0x6B5F,0x6925,INVALC,INVALC,0x6B5D,INVALC,INVALC,INVALC,
/* Block 108, Array index 0x1E00 */
0x6B60,INVALC,0x6B5C,0x6B5E,INVALC,INVALC,INVALC,INVALC,
0x6D53,0x6D54,INVALC,0x6D52,INVALC,INVALC,INVALC,0x6F31,
INVALC,0x6F2F,0x6F30,0x703A,INVALC,INVALC,INVALC,0x7123,
0x7121,0x7122,0x7124,INVALC,INVALC,INVALC,0x722B,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x274A,INVALC,INVALC,
0x2B46,INVALC,INVALC,INVALC,0x2F77,0x2F79,INVALC,0x2F78,
INVALC,0x2F7A,INVALC,0x363B,0x2F7B,INVALC,0x363A,0x363C,
0x363D,0x3C7D,INVALC,0x3C7E,0x3D22,INVALC,INVALC,0x3D21,
INVALC,0x4422,0x437E,0x437D,INVALC,0x437C,0x437B,INVALC,
0x4421,INVALC,0x4B2B,0x4B2D,INVALC,0x4B2C,INVALC,INVALC,
INVALC,0x5139,INVALC,INVALC,0x576A,0x5769,0x576B,INVALC,
INVALC,INVALC,INVALC,0x5D37,INVALC,INVALC,0x6174,INVALC,
0x6564,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2F7C,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5259,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x274C,INVALC,
0x274B,INVALC,0x2B47,INVALC,0x2B48,INVALC,INVALC,INVALC,
0x2F7E,INVALC,INVALC,INVALC,0x3642,0x3640,0x3641,0x363F,
INVALC,0x363E,INVALC,INVALC,0x3D23,0x3D26,INVALC,0x3D24,
INVALC,0x3D25,INVALC,0x4423,INVALC,INVALC,0x4B2E,0x4B2F,
0x4B30,INVALC,0x513C,0x513B,INVALC,0x513A,0x513D,0x576C,
INVALC,INVALC,0x576D,0x576E,INVALC,0x5D38,INVALC,INVALC,
0x6565,INVALC,INVALC,0x213F,INVALC,INVALC,0x2B49,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3D27,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4B31,0x4B32,INVALC,INVALC,0x5770,
0x576F,0x6175,0x6F32,INVALC,0x2140,INVALC,INVALC,INVALC,
0x2448,INVALC,INVALC,INVALC,INVALC,INVALC,0x2B4A,INVALC,
0x2B4B,INVALC,INVALC,INVALC,INVALC,INVALC,0x274D,INVALC,
0x2B4C,INVALC,0x3025,0x3024,0x3022,INVALC,0x3021,0x3026,
0x3023,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3D28,INVALC,0x3D29,0x3D2A,INVALC,INVALC,INVALC,0x4427,
0x4428,0x4426,INVALC,0x4424,0x4425,INVALC,0x4B33,0x5140,
/* Block 109, Array index 0x1F00 */
0x513F,0x513E,0x5141,0x5772,0x5771,INVALC,0x5773,INVALC,
INVALC,0x5D39,INVALC,0x6176,0x6566,0x6D55,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2141,0x215F,INVALC,INVALC,
0x2258,0x2449,0x244A,INVALC,INVALC,0x274E,INVALC,INVALC,
0x2B4D,0x2B4E,INVALC,INVALC,INVALC,0x3027,INVALC,INVALC,
INVALC,INVALC,0x3643,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3D2B,INVALC,INVALC,INVALC,INVALC,INVALC,0x2160,INVALC,
INVALC,INVALC,INVALC,0x2163,INVALC,INVALC,INVALC,0x2162,
INVALC,INVALC,INVALC,0x2161,INVALC,INVALC,0x2259,INVALC,
INVALC,INVALC,0x225D,0x225F,0x2260,INVALC,INVALC,0x225C,
INVALC,INVALC,0x225A,INVALC,0x225E,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x225B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x245B,0x2459,0x244C,
INVALC,0x2453,INVALC,0x244D,INVALC,0x2455,INVALC,0x2452,
INVALC,0x2451,INVALC,0x245A,INVALC,INVALC,INVALC,INVALC,
0x244B,INVALC,INVALC,0x245C,INVALC,INVALC,INVALC,INVALC,
0x2765,INVALC,INVALC,INVALC,0x244E,INVALC,INVALC,0x2456,
INVALC,INVALC,0x2763,0x244F,INVALC,INVALC,0x245D,0x2450,
INVALC,INVALC,INVALC,0x274F,INVALC,0x2457,INVALC,INVALC,
INVALC,INVALC,0x2454,INVALC,0x2458,0x2764,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2756,INVALC,INVALC,
0x276B,INVALC,INVALC,INVALC,0x2762,INVALC,0x2754,0x2758,
INVALC,INVALC,0x275B,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2767,INVALC,0x275A,0x275C,INVALC,INVALC,0x275D,0x276A,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2769,INVALC,0x276D,
0x2759,0x276F,0x2760,INVALC,0x2755,INVALC,INVALC,INVALC,
INVALC,0x2753,0x2B57,INVALC,INVALC,0x2761,0x2766,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2757,
INVALC,0x276E,INVALC,0x2751,0x2750,0x275E,0x2752,INVALC,
INVALC,INVALC,0x275F,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x276C,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 110, Array index 0x2000 */
0x2B5E,0x2B61,INVALC,0x2B64,0x2B59,INVALC,INVALC,0x2B67,
0x2B6A,0x2B6C,0x2B56,INVALC,INVALC,0x302C,INVALC,0x2B65,
0x2B6D,0x2B5D,0x2B55,INVALC,INVALC,INVALC,0x3047,INVALC,
0x2B62,0x2B5A,0x2B5C,INVALC,INVALC,0x2B5F,INVALC,0x2B52,
0x2B68,INVALC,0x2B6B,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2B4F,INVALC,INVALC,INVALC,0x2B69,0x2B51,INVALC,0x3041,
0x2768,INVALC,INVALC,0x2B58,0x2B50,INVALC,INVALC,0x2B63,
INVALC,INVALC,0x2B5B,INVALC,0x2B53,INVALC,INVALC,0x2B54,
0x2B66,INVALC,0x2B60,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x302F,INVALC,INVALC,INVALC,INVALC,INVALC,0x3038,0x303E,
0x303A,0x302D,0x3030,0x3029,0x302A,INVALC,INVALC,0x3039,
0x3042,INVALC,INVALC,INVALC,INVALC,0x3031,INVALC,0x3032,
0x303C,INVALC,INVALC,INVALC,INVALC,0x304B,0x302B,INVALC,
INVALC,INVALC,0x3028,0x3049,0x303D,0x304A,0x3044,0x3036,
0x3045,INVALC,0x303F,0x3048,0x3046,INVALC,0x3037,INVALC,
INVALC,INVALC,INVALC,0x3043,INVALC,0x3034,INVALC,INVALC,
0x304C,0x3033,0x302E,INVALC,INVALC,INVALC,INVALC,0x303B,
0x3040,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3645,0x3649,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3647,0x3646,INVALC,INVALC,0x364C,
INVALC,INVALC,0x365E,0x366A,INVALC,0x365B,0x3654,INVALC,
0x3644,INVALC,0x3660,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3650,0x3662,0x365A,INVALC,INVALC,0x3668,INVALC,0x3661,
0x3663,INVALC,INVALC,0x3665,0x364E,0x365F,0x3653,0x3667,
INVALC,INVALC,INVALC,0x3658,0x3656,0x3657,INVALC,0x3652,
0x3651,INVALC,0x364B,0x3669,INVALC,0x3655,INVALC,INVALC,
INVALC,0x364A,INVALC,INVALC,INVALC,0x365C,INVALC,0x3035,
0x365D,INVALC,0x3664,INVALC,0x3659,INVALC,0x364D,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3D2C,0x3666,INVALC,INVALC,
/* Block 111, Array index 0x2100 */
0x364F,INVALC,INVALC,0x3D41,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3D3B,INVALC,INVALC,0x3D2F,
INVALC,INVALC,0x3D4D,INVALC,INVALC,INVALC,INVALC,0x3D51,
0x3D48,INVALC,INVALC,0x3D36,INVALC,INVALC,0x3D42,INVALC,
0x3D4E,0x3D47,INVALC,0x3D3C,INVALC,0x3D59,0x3D5A,INVALC,
INVALC,0x3D4C,INVALC,0x3D40,0x3D32,0x3D33,INVALC,0x3D37,
0x3D3E,0x3D38,INVALC,INVALC,INVALC,0x3D34,0x3D2D,0x3D2E,
INVALC,0x3D30,INVALC,0x3D3D,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3D3F,0x3D57,0x3D4F,INVALC,0x3D55,INVALC,INVALC,
INVALC,INVALC,0x3D5B,INVALC,0x3D45,0x3D39,0x3D43,INVALC,
0x3D49,0x3D46,0x3D35,INVALC,0x3D53,0x3D50,0x3D58,INVALC,
0x3D44,INVALC,INVALC,0x3D4B,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3D4A,INVALC,0x3D3A,0x3648,INVALC,INVALC,0x3D54,
0x3D52,0x3D56,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3D31,INVALC,INVALC,INVALC,INVALC,0x4447,0x4446,0x442C,
INVALC,INVALC,0x4445,0x442F,0x4430,INVALC,INVALC,0x444E,
INVALC,0x4444,INVALC,0x4429,INVALC,INVALC,0x4438,0x442E,
0x4431,0x4449,INVALC,0x4450,0x4448,INVALC,0x443D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x444F,INVALC,
0x443B,0x4432,0x443F,0x444B,INVALC,INVALC,INVALC,0x443A,
INVALC,0x4433,INVALC,INVALC,INVALC,0x4436,0x4440,0x444A,
0x442D,0x4437,INVALC,0x4441,INVALC,INVALC,0x4434,INVALC,
0x442B,0x4439,0x444D,INVALC,INVALC,0x443C,0x4B34,0x443E,
0x444C,INVALC,0x4435,INVALC,INVALC,INVALC,0x442A,INVALC,
0x4443,INVALC,INVALC,INVALC,0x4442,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4B50,INVALC,0x4B45,0x4B4A,INVALC,
INVALC,0x4B36,INVALC,INVALC,INVALC,0x4B35,0x4B56,INVALC,
0x4B39,0x4B49,INVALC,0x4B3B,0x4B59,0x4B55,INVALC,INVALC,
/* Block 112, Array index 0x2200 */
0x515B,INVALC,INVALC,0x4B37,INVALC,0x4B54,INVALC,0x4B51,
0x4B5E,0x4B3D,0x4B46,INVALC,INVALC,0x4B5C,0x4B52,INVALC,
INVALC,INVALC,0x4B44,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4B42,0x4B3F,0x4B40,INVALC,0x4B58,INVALC,0x4B5D,0x4B5B,
INVALC,0x4B5F,INVALC,INVALC,INVALC,0x4B38,0x5143,0x4B41,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4B4B,0x4B3C,INVALC,
0x4B4D,INVALC,INVALC,INVALC,INVALC,0x4B4F,0x4B47,0x4B3A,
INVALC,0x4B57,0x4B5A,0x4B43,0x4B4E,INVALC,INVALC,INVALC,
0x4B4C,0x5142,INVALC,0x4B53,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4B3E,0x514C,
0x5156,INVALC,0x5155,0x5161,INVALC,0x5153,INVALC,0x5157,
INVALC,INVALC,0x514E,INVALC,INVALC,0x515A,0x577B,INVALC,
INVALC,0x515C,0x514B,0x5166,INVALC,INVALC,INVALC,0x515F,
INVALC,0x5163,0x5168,0x515D,0x5151,INVALC,INVALC,INVALC,
INVALC,INVALC,0x5154,0x4B48,INVALC,INVALC,0x5150,0x5167,
INVALC,INVALC,INVALC,0x5169,INVALC,0x515E,0x5144,0x5164,
INVALC,INVALC,0x5152,INVALC,INVALC,0x514D,INVALC,0x5145,
INVALC,0x5149,INVALC,0x5162,0x514A,0x5148,INVALC,INVALC,
0x5160,INVALC,0x5147,0x5159,0x5158,0x5165,0x514F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x577E,INVALC,
INVALC,INVALC,0x582C,0x5776,INVALC,0x5824,INVALC,INVALC,
0x5822,0x5D3B,0x5828,0x582E,0x5827,0x5774,0x5825,0x5830,
0x5832,INVALC,0x5831,INVALC,INVALC,INVALC,INVALC,INVALC,
0x582B,INVALC,0x5826,INVALC,0x5778,0x577D,INVALC,0x582A,
INVALC,INVALC,INVALC,INVALC,0x577C,INVALC,0x5146,0x5777,
0x577A,0x582D,0x5821,0x5775,0x5D3A,0x582F,0x5779,0x5829,
INVALC,INVALC,INVALC,INVALC,0x5D3D,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5D3F,0x5D45,0x5D43,INVALC,
INVALC,INVALC,0x5D46,0x5D3E,INVALC,INVALC,0x5D42,0x5D41,
0x5D47,INVALC,INVALC,INVALC,INVALC,0x5D40,INVALC,INVALC,
INVALC,INVALC,0x5D44,INVALC,0x5D3C,INVALC,INVALC,0x6225,
INVALC,INVALC,INVALC,0x6222,0x6224,INVALC,INVALC,0x617E,
/* Block 113, Array index 0x2300 */
0x6221,0x617A,INVALC,INVALC,0x5823,0x617B,INVALC,0x6177,
INVALC,INVALC,0x6226,INVALC,0x6178,0x6179,0x617D,INVALC,
INVALC,INVALC,INVALC,INVALC,0x617C,INVALC,0x656A,0x6570,
INVALC,0x6567,INVALC,INVALC,0x6572,INVALC,INVALC,INVALC,
0x6569,0x656C,0x656D,0x656E,0x6571,INVALC,0x6223,0x6568,
INVALC,0x656F,0x6934,0x656B,INVALC,INVALC,INVALC,0x692B,
INVALC,0x692E,INVALC,0x6937,0x692D,0x692A,INVALC,0x692C,
0x6930,0x6933,0x6932,0x6936,0x6929,INVALC,INVALC,0x6931,
0x6935,0x6938,0x692F,0x6B61,0x6B62,0x6B66,0x6B67,INVALC,
0x6B64,0x6B65,0x6B63,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6D59,INVALC,INVALC,0x6D56,0x6D57,0x6D58,
INVALC,INVALC,0x6F34,0x6F33,INVALC,0x703D,INVALC,0x703B,
0x703E,0x703C,0x7125,INVALC,INVALC,0x7171,0x715B,INVALC,
0x7170,0x723E,0x723F,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2261,INVALC,INVALC,0x245E,INVALC,INVALC,INVALC,
INVALC,INVALC,0x245F,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2778,0x277A,0x2775,0x2772,0x2774,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2776,INVALC,0x2773,0x2770,INVALC,0x2777,INVALC,
0x2771,INVALC,0x2779,INVALC,INVALC,INVALC,INVALC,0x2B6F,
INVALC,0x2B73,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2B76,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2B72,0x2B71,INVALC,INVALC,0x2B74,0x2B75,INVALC,0x2B6E,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2B70,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x305A,0x305B,0x305C,
INVALC,INVALC,INVALC,0x3051,INVALC,0x3059,0x305E,INVALC,
INVALC,0x304F,0x3055,0x304E,0x3058,INVALC,INVALC,0x3054,
INVALC,INVALC,0x305D,INVALC,0x304D,0x3050,0x3056,INVALC,
0x3057,0x305F,0x3053,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3671,INVALC,INVALC,0x3673,0x366F,INVALC,0x367B,0x366D,
0x367A,INVALC,0x366B,0x3D5F,0x3675,INVALC,INVALC,0x3676,
/* Block 114, Array index 0x2400 */
0x3679,INVALC,0x367D,INVALC,0x3672,INVALC,0x3677,INVALC,
INVALC,INVALC,INVALC,0x367C,0x3670,0x366C,0x367E,INVALC,
0x3674,INVALC,INVALC,0x3678,INVALC,INVALC,INVALC,0x366E,
INVALC,INVALC,INVALC,0x3D69,INVALC,INVALC,0x3D5D,0x3D66,
0x3D5C,INVALC,0x3D64,0x3D62,INVALC,0x3D63,INVALC,INVALC,
0x3D67,INVALC,INVALC,INVALC,INVALC,INVALC,0x3D60,0x3D5E,
INVALC,0x3D61,0x3D65,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3D68,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4456,0x445D,0x445F,0x4465,INVALC,INVALC,0x4451,
INVALC,INVALC,INVALC,0x4460,INVALC,0x4466,INVALC,INVALC,
0x4463,INVALC,0x4453,0x4464,0x4452,INVALC,INVALC,INVALC,
0x445E,INVALC,0x4467,INVALC,INVALC,0x4457,INVALC,0x4462,
0x4455,0x445C,0x4458,0x4454,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x445B,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4461,INVALC,0x4459,INVALC,INVALC,INVALC,INVALC,INVALC,
0x445A,INVALC,INVALC,0x4B67,INVALC,INVALC,INVALC,INVALC,
0x4B63,0x4B69,0x4B65,INVALC,INVALC,0x4B64,0x4B68,0x4B60,
INVALC,0x4B62,INVALC,INVALC,INVALC,INVALC,INVALC,0x4B66,
0x4B61,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4B6A,
INVALC,INVALC,0x516F,0x516C,0x5178,0x5172,0x5174,INVALC,
0x516E,0x5176,INVALC,INVALC,0x5175,0x5173,INVALC,0x5179,
INVALC,0x5170,0x5177,INVALC,INVALC,INVALC,INVALC,0x516B,
0x516D,INVALC,0x516A,0x517A,INVALC,0x5171,INVALC,INVALC,
0x5836,INVALC,INVALC,INVALC,0x5841,0x583F,INVALC,0x5835,
0x5838,0x5839,0x5834,INVALC,INVALC,0x5833,0x5842,0x583D,
INVALC,INVALC,0x583C,0x583A,INVALC,INVALC,INVALC,0x583E,
INVALC,INVALC,INVALC,INVALC,0x583B,INVALC,0x5837,INVALC,
0x5840,INVALC,0x5843,0x5844,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5D48,0x5D4E,INVALC,0x5D4C,INVALC,INVALC,INVALC,
0x5D4A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5D4D,0x5D49,0x5D4B,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6229,INVALC,INVALC,INVALC,0x622B,INVALC,0x6228,
/* Block 115, Array index 0x2500 */
INVALC,0x6227,0x6576,0x622A,INVALC,0x6577,INVALC,0x6575,
INVALC,INVALC,0x6574,INVALC,0x6573,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x6939,0x693A,INVALC,INVALC,INVALC,
INVALC,0x6B6A,0x6B69,INVALC,INVALC,0x6B68,0x6D5A,0x6D5B,
INVALC,INVALC,0x6F35,0x703F,INVALC,INVALC,0x7126,0x722C,
INVALC,0x7240,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2142,
INVALC,0x2B77,0x3060,INVALC,0x4B6B,INVALC,INVALC,INVALC,
INVALC,0x2B78,0x2B79,0x3D6A,INVALC,INVALC,INVALC,0x4468,
INVALC,INVALC,INVALC,0x4B6C,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3D6B,INVALC,INVALC,INVALC,0x2262,INVALC,
INVALC,INVALC,INVALC,0x2460,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x277B,INVALC,0x2B7A,INVALC,0x2B7D,INVALC,
0x2B7B,INVALC,INVALC,0x2B7C,INVALC,INVALC,0x3063,0x3062,
0x3061,INVALC,INVALC,0x3722,0x3723,INVALC,0x3721,0x3724,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3D6F,0x3D6E,INVALC,
0x3D6C,0x3D6D,INVALC,0x3D70,0x446A,0x4469,0x446D,INVALC,
0x446C,0x446B,INVALC,0x4B6F,INVALC,0x4B6E,INVALC,0x4B6D,
0x517B,INVALC,0x517C,INVALC,INVALC,0x5845,0x5846,INVALC,
INVALC,0x657C,INVALC,0x657B,0x657A,0x6578,0x6579,INVALC,
0x693B,0x6D5C,0x7127,INVALC,INVALC,INVALC,0x2164,INVALC,
0x2165,INVALC,INVALC,INVALC,0x2263,0x2264,INVALC,INVALC,
INVALC,INVALC,0x2466,INVALC,INVALC,0x2462,INVALC,0x2461,
INVALC,0x2465,INVALC,0x2463,INVALC,0x2467,0x2464,INVALC,
INVALC,0x2821,0x2B7E,0x277D,0x2826,INVALC,INVALC,INVALC,
INVALC,0x2827,0x2823,INVALC,0x2824,INVALC,0x277C,INVALC,
0x277E,INVALC,0x2825,INVALC,0x2822,INVALC,INVALC,0x2C24,
INVALC,INVALC,INVALC,0x2C27,0x2C21,INVALC,0x2C26,INVALC,
0x2C22,INVALC,0x2C25,0x2C23,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3069,0x3066,INVALC,0x3068,INVALC,
INVALC,INVALC,0x3065,0x306A,INVALC,INVALC,0x3067,0x372C,
/* Block 116, Array index 0x2600 */
0x3064,0x306B,INVALC,INVALC,INVALC,INVALC,INVALC,0x3727,
0x372B,INVALC,0x372A,0x3D72,0x3D7D,INVALC,INVALC,0x372D,
INVALC,0x3728,0x3D71,INVALC,INVALC,INVALC,INVALC,0x3726,
0x3729,INVALC,INVALC,INVALC,INVALC,0x3725,0x372E,INVALC,
INVALC,INVALC,0x3D74,0x3D7B,INVALC,INVALC,0x3D7A,0x3D77,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3D79,INVALC,INVALC,
0x3D73,0x3D75,0x3D78,0x3D76,INVALC,0x3D7C,INVALC,INVALC,
INVALC,INVALC,0x4471,0x4470,0x446E,INVALC,INVALC,INVALC,
0x4472,INVALC,0x446F,0x4B70,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4474,0x4473,INVALC,0x4B73,0x4B71,INVALC,INVALC,
INVALC,0x4B72,0x517E,INVALC,INVALC,INVALC,INVALC,INVALC,
0x517D,0x5228,0x5227,0x5225,INVALC,0x5224,0x5221,0x5222,
0x5223,0x5226,0x5229,INVALC,INVALC,0x584B,0x5848,0x5849,
INVALC,0x5847,0x584D,0x584C,0x584A,INVALC,0x5D50,0x5D51,
INVALC,INVALC,INVALC,0x5D4F,INVALC,INVALC,0x622C,INVALC,
INVALC,INVALC,INVALC,INVALC,0x693D,0x693C,0x6B6B,0x6D5D,
INVALC,0x6F37,0x6F36,0x6F38,INVALC,0x2C28,INVALC,INVALC,
0x372F,INVALC,0x2166,INVALC,INVALC,INVALC,0x2265,INVALC,
INVALC,INVALC,0x246C,0x246A,0x246B,0x2468,INVALC,0x2469,
INVALC,INVALC,INVALC,INVALC,INVALC,0x282F,INVALC,INVALC,
0x282D,0x2829,0x282C,INVALC,0x2828,INVALC,0x282B,INVALC,
INVALC,INVALC,INVALC,INVALC,0x282E,0x282A,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2C30,0x2C2F,0x2C2E,INVALC,
0x2C37,0x2C2D,INVALC,INVALC,0x3070,INVALC,0x2C34,0x2C32,
INVALC,INVALC,0x2C2A,0x2C35,INVALC,0x2C2C,0x2C36,0x2C33,
0x2C2B,INVALC,INVALC,0x2C38,0x2C29,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3075,0x306C,0x3077,INVALC,0x306F,0x307A,
0x307B,0x306D,0x3079,0x3076,0x3074,0x3078,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3072,INVALC,0x306E,INVALC,0x3071,
0x307C,0x3073,INVALC,0x2C31,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x373D,0x3732,0x3730,INVALC,
0x3731,INVALC,0x3738,INVALC,0x3739,0x3735,INVALC,0x373A,
/* Block 117, Array index 0x2700 */
0x3737,0x3734,INVALC,INVALC,0x3733,INVALC,INVALC,0x3736,
0x373E,INVALC,INVALC,0x373C,0x373B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3E24,INVALC,
INVALC,INVALC,0x3E25,INVALC,INVALC,0x3E2B,INVALC,INVALC,
0x3E2D,0x3E26,INVALC,0x3E2A,0x3E29,INVALC,INVALC,INVALC,
INVALC,0x3E2C,INVALC,0x3E23,0x3E21,0x3E27,0x3D7E,INVALC,
0x3E22,0x3E28,0x3E2E,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x447B,INVALC,0x4521,INVALC,0x4475,INVALC,0x4522,INVALC,
INVALC,INVALC,0x4476,0x4477,INVALC,0x4523,0x447E,0x447C,
0x447D,0x4479,0x4478,INVALC,0x4524,INVALC,INVALC,0x447A,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4B74,INVALC,INVALC,INVALC,INVALC,0x4B79,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4B7A,INVALC,
INVALC,0x4B76,0x4B78,0x4B75,INVALC,0x4B77,INVALC,INVALC,
INVALC,0x5233,INVALC,INVALC,0x5232,0x522F,INVALC,0x584E,
INVALC,0x522E,INVALC,INVALC,INVALC,0x5230,0x522D,0x522A,
0x5231,0x522B,0x522C,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5D55,INVALC,0x5852,INVALC,0x5851,0x5853,INVALC,0x5D52,
INVALC,INVALC,0x584F,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5850,0x5854,INVALC,INVALC,INVALC,0x5D59,INVALC,INVALC,
INVALC,INVALC,0x5D56,0x5D54,INVALC,0x5D57,INVALC,0x5D5A,
INVALC,0x5D58,0x5D53,INVALC,INVALC,0x622F,0x6232,0x6621,
0x622D,INVALC,0x693E,0x6233,INVALC,INVALC,0x6231,INVALC,
0x622E,0x6230,0x6234,0x6622,INVALC,0x657E,INVALC,INVALC,
INVALC,INVALC,INVALC,0x657D,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6D5F,INVALC,0x6D61,
0x6D5E,0x6D60,INVALC,0x7040,INVALC,0x2830,0x307D,0x307E,
INVALC,0x4525,INVALC,INVALC,INVALC,0x7041,INVALC,INVALC,
0x2831,INVALC,INVALC,INVALC,0x2C39,INVALC,0x2C3A,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3121,0x3122,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3E2F,INVALC,0x4528,0x4527,0x4526,
/* Block 118, Array index 0x2800 */
0x4B7B,INVALC,0x4B7C,0x4B7D,INVALC,INVALC,INVALC,0x5235,
0x5234,INVALC,INVALC,0x5855,INVALC,INVALC,INVALC,0x5D5E,
0x5D5B,0x5D5C,0x5D5D,0x6236,0x6235,INVALC,0x6623,0x6B6C,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4529,INVALC,INVALC,
INVALC,0x3123,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2266,INVALC,INVALC,INVALC,0x2C3B,0x3E30,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x246E,0x246D,INVALC,INVALC,INVALC,0x2834,0x2832,
0x2833,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2C3C,
0x2C3D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3124,INVALC,INVALC,INVALC,0x3125,
INVALC,INVALC,INVALC,0x3740,0x373F,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3E32,INVALC,INVALC,0x3E31,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x452B,
INVALC,0x452A,INVALC,INVALC,INVALC,0x4B7E,0x5236,INVALC,
0x5856,INVALC,INVALC,INVALC,0x5D5F,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2835,INVALC,INVALC,INVALC,
0x4C21,INVALC,INVALC,INVALC,0x246F,0x2470,INVALC,INVALC,
0x2836,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2C3E,
INVALC,INVALC,0x2C3F,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3126,INVALC,INVALC,INVALC,INVALC,INVALC,0x312C,INVALC,
INVALC,INVALC,0x312D,0x3128,INVALC,INVALC,INVALC,0x312B,
0x312A,0x3127,INVALC,INVALC,0x3129,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3744,0x3745,INVALC,0x3741,0x3743,
0x3747,0x3746,0x3742,INVALC,INVALC,INVALC,INVALC,0x3E3A,
INVALC,INVALC,0x3E34,INVALC,INVALC,0x3E37,INVALC,0x3E38,
INVALC,0x3E35,INVALC,INVALC,0x3E39,INVALC,0x3E36,0x3E33,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4538,INVALC,0x452D,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4539,0x4537,0x4530,
0x4534,0x4533,INVALC,0x4536,0x4532,0x453A,0x4531,INVALC,
/* Block 119, Array index 0x2900 */
INVALC,INVALC,INVALC,0x452F,INVALC,INVALC,INVALC,INVALC,
0x4C23,INVALC,0x4C27,INVALC,0x4C24,INVALC,INVALC,0x452E,
0x4535,0x4C26,INVALC,INVALC,0x4C28,0x4C25,0x4C22,INVALC,
INVALC,0x5239,0x523D,0x523F,0x523B,0x523A,0x5238,INVALC,
INVALC,INVALC,INVALC,0x523C,INVALC,0x5237,INVALC,INVALC,
0x523E,INVALC,INVALC,INVALC,INVALC,0x5858,INVALC,0x5857,
0x585F,0x5859,0x585E,0x585B,INVALC,0x585D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x585C,0x585A,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5D60,INVALC,INVALC,INVALC,0x5D63,
0x5D61,0x5D62,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x623A,INVALC,INVALC,0x623B,INVALC,INVALC,INVALC,0x623C,
INVALC,0x6239,0x623D,INVALC,0x6237,INVALC,INVALC,INVALC,
0x6624,INVALC,INVALC,INVALC,0x6238,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6B6D,INVALC,INVALC,0x6D62,INVALC,INVALC,
0x6F39,INVALC,INVALC,INVALC,INVALC,0x723A,INVALC,INVALC,
INVALC,0x2C40,INVALC,INVALC,INVALC,INVALC,INVALC,0x2267,
INVALC,0x2471,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3749,0x312E,INVALC,INVALC,INVALC,INVALC,0x3748,
INVALC,INVALC,0x3E3C,INVALC,INVALC,0x3E3B,INVALC,INVALC,
INVALC,0x453B,INVALC,0x5243,0x5240,0x5241,0x5242,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5D64,INVALC,0x623E,INVALC,
INVALC,INVALC,0x6940,0x693F,INVALC,0x6D63,INVALC,0x2837,
INVALC,INVALC,INVALC,INVALC,INVALC,0x453C,INVALC,INVALC,
0x4C29,INVALC,INVALC,0x5860,INVALC,0x623F,0x6941,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2C41,INVALC,INVALC,INVALC,
INVALC,0x312F,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x374A,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3E3D,INVALC,INVALC,0x453D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5861,INVALC,
INVALC,0x5D65,INVALC,INVALC,0x6240,0x6942,INVALC,INVALC,
0x283A,0x2839,INVALC,0x2838,INVALC,0x283B,INVALC,0x2C47,
INVALC,INVALC,0x2C49,0x2C48,INVALC,INVALC,INVALC,INVALC,
/* Block 120, Array index 0x2A00 */
INVALC,INVALC,INVALC,0x2C43,0x2C44,0x2C45,INVALC,INVALC,
0x2C42,INVALC,0x2C46,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3132,0x3136,0x3134,0x3133,INVALC,0x3137,INVALC,INVALC,
INVALC,0x3138,0x3139,0x3131,INVALC,0x3130,INVALC,INVALC,
INVALC,INVALC,0x313A,0x3135,INVALC,0x3753,INVALC,0x313B,
INVALC,INVALC,INVALC,INVALC,INVALC,0x374D,INVALC,0x374C,
INVALC,0x374E,0x374F,0x3751,0x3750,0x3755,INVALC,INVALC,
INVALC,0x374B,INVALC,0x3754,INVALC,0x3752,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3E40,0x3E42,0x3E3E,0x3E3F,
INVALC,INVALC,0x3E43,0x3E45,0x3E46,0x3E41,0x3E44,INVALC,
INVALC,INVALC,0x4541,INVALC,0x4546,0x453E,0x4542,INVALC,
INVALC,0x4547,0x4543,INVALC,INVALC,INVALC,INVALC,0x453F,
0x4540,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4545,
INVALC,0x4544,INVALC,INVALC,INVALC,0x4548,0x4C2E,0x4C30,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4C2B,INVALC,0x4C31,INVALC,
0x4C2F,0x4C2A,0x4C2D,0x4C32,INVALC,0x4C2C,INVALC,INVALC,
0x5247,0x5246,INVALC,INVALC,INVALC,0x5244,INVALC,0x5245,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5869,INVALC,0x586B,
INVALC,0x586A,0x5862,0x5866,0x5865,0x5863,INVALC,INVALC,
INVALC,0x5864,0x5867,0x5868,INVALC,INVALC,INVALC,INVALC,
0x5D6D,INVALC,INVALC,0x5D67,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5D6C,0x5D68,INVALC,0x5D6B,0x5D66,0x5D6A,0x5D69,
INVALC,INVALC,0x6242,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6241,INVALC,0x6627,INVALC,INVALC,INVALC,
INVALC,0x6625,0x6626,INVALC,0x6943,0x6946,0x6944,0x6945,
0x6B6E,INVALC,INVALC,INVALC,0x6F3A,0x7042,INVALC,INVALC,
0x7128,0x7129,INVALC,INVALC,INVALC,INVALC,0x3E47,INVALC,
0x4549,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2C4A,
0x2C4B,INVALC,INVALC,INVALC,0x3E48,INVALC,INVALC,INVALC,
0x5D6E,0x6628,0x6947,INVALC,INVALC,INVALC,INVALC,0x2841,
0x283C,0x283E,0x2840,0x283F,0x283D,INVALC,INVALC,INVALC,
/* Block 121, Array index 0x2B00 */
INVALC,INVALC,INVALC,0x2C54,INVALC,0x2C4F,0x2C4C,INVALC,
INVALC,0x2C53,INVALC,INVALC,INVALC,INVALC,0x2C52,0x2C51,
0x2C50,0x2C4D,0x2C4E,0x2C55,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3144,0x313E,0x313C,INVALC,INVALC,0x375C,INVALC,
0x3141,0x3145,0x3147,0x3143,0x313D,INVALC,0x3142,0x3140,
INVALC,0x3148,INVALC,0x3146,INVALC,0x313F,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x375D,INVALC,INVALC,
0x3756,0x3758,0x375A,INVALC,0x375B,0x3759,INVALC,INVALC,
0x375E,INVALC,0x3757,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3E4C,INVALC,0x3E54,INVALC,
0x3E49,INVALC,0x3E55,INVALC,0x3E4A,0x3E4B,INVALC,INVALC,
0x3E53,0x3E52,0x3E4F,INVALC,INVALC,0x3E4D,0x3E50,INVALC,
0x3E51,0x3E4E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4554,INVALC,0x4558,INVALC,INVALC,0x4C38,INVALC,
0x4556,INVALC,INVALC,0x4553,0x454E,0x4550,0x4551,0x454A,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x454D,
INVALC,INVALC,INVALC,INVALC,0x454C,0x454F,0x4557,INVALC,
INVALC,0x4555,0x454B,INVALC,INVALC,INVALC,0x4C3A,INVALC,
0x4C3C,0x4552,0x4C3E,INVALC,0x4C3F,0x4C3B,INVALC,INVALC,
0x4C37,INVALC,0x4C34,0x4C39,0x4C3D,0x4C36,INVALC,INVALC,
INVALC,INVALC,0x4C33,INVALC,0x4C35,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5249,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5250,0x5251,INVALC,INVALC,INVALC,
0x524F,0x5252,INVALC,INVALC,0x524B,0x5248,0x524D,0x524A,
INVALC,0x524C,INVALC,INVALC,0x524E,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5872,INVALC,0x586C,0x5870,0x5876,
0x5877,0x5873,0x5874,0x5871,INVALC,0x586E,INVALC,INVALC,
INVALC,0x586D,0x586F,INVALC,INVALC,0x5875,INVALC,INVALC,
INVALC,INVALC,0x5D75,0x5D6F,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5D77,INVALC,0x5D72,0x5D73,0x5D70,0x5D78,0x5D74,
/* Block 122, Array index 0x2C00 */
INVALC,INVALC,0x5D71,INVALC,0x5D79,0x5D76,INVALC,INVALC,
INVALC,0x6246,INVALC,INVALC,0x6243,INVALC,INVALC,INVALC,
0x6247,0x6249,0x6248,0x6244,0x6245,INVALC,INVALC,0x662D,
INVALC,INVALC,INVALC,0x662A,0x662C,0x6629,0x662E,INVALC,
INVALC,0x662B,INVALC,0x6949,0x694C,0x6948,INVALC,0x694A,
0x694B,0x694D,INVALC,INVALC,INVALC,0x6B6F,INVALC,0x6B71,
INVALC,0x6B70,INVALC,INVALC,INVALC,0x6D64,INVALC,INVALC,
0x7043,0x712A,INVALC,INVALC,INVALC,0x2472,INVALC,0x2843,
INVALC,INVALC,0x2842,INVALC,0x2C5A,0x2C59,INVALC,INVALC,
INVALC,INVALC,0x2C56,0x2C58,0x2C57,INVALC,INVALC,0x314B,
INVALC,0x314F,0x314E,0x314D,0x3149,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x314A,0x314C,INVALC,INVALC,INVALC,
INVALC,0x3765,INVALC,0x3763,0x375F,INVALC,INVALC,0x3760,
INVALC,0x3761,0x3762,0x3764,INVALC,INVALC,INVALC,INVALC,
0x3E59,INVALC,0x3E58,0x3E57,0x3E56,INVALC,INVALC,INVALC,
INVALC,0x455C,INVALC,INVALC,0x4559,0x455B,INVALC,INVALC,
INVALC,INVALC,0x455A,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4C48,INVALC,0x4C41,0x4C42,INVALC,INVALC,INVALC,INVALC,
0x4C4A,INVALC,0x4C49,0x4C46,0x4C45,0x4C44,0x4C43,0x4C47,
0x4C40,INVALC,0x5253,0x5258,0x5256,INVALC,INVALC,INVALC,
0x5255,0x5254,0x5257,INVALC,0x5878,INVALC,INVALC,INVALC,
0x5D7B,INVALC,INVALC,0x5D7A,0x624B,0x624A,INVALC,INVALC,
0x662F,INVALC,0x694E,INVALC,0x6D65,INVALC,0x7045,0x7044,
0x2167,INVALC,INVALC,0x3766,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2844,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2C5C,0x2C5F,0x2C5D,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2C5B,0x2C5E,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3156,0x3158,0x3157,INVALC,
0x3152,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3155,0x3150,0x3151,0x3154,0x3153,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3769,0x376A,
0x3768,INVALC,0x3767,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 123, Array index 0x2D00 */
INVALC,INVALC,0x3E5A,0x3E5C,0x3E5E,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3E5B,INVALC,0x3E5D,INVALC,INVALC,INVALC,
0x4566,0x455D,0x4560,0x4564,INVALC,0x4562,INVALC,0x4561,
0x455E,0x455F,INVALC,0x4565,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4563,INVALC,INVALC,INVALC,0x4C50,INVALC,
0x4C4F,INVALC,INVALC,0x4C4B,INVALC,INVALC,INVALC,0x4C4E,
0x4C4D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x525A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5879,INVALC,INVALC,0x587B,
0x587A,INVALC,0x4C4C,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5E22,INVALC,0x5D7E,INVALC,
0x5E21,INVALC,0x5E23,0x5D7D,0x5D7C,INVALC,INVALC,0x624C,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6630,
0x6631,INVALC,INVALC,INVALC,0x6950,0x6951,0x694F,INVALC,
0x6D66,0x6D67,INVALC,INVALC,INVALC,0x2268,INVALC,INVALC,
0x2845,INVALC,INVALC,0x2846,INVALC,INVALC,0x2C61,INVALC,
0x2C60,INVALC,INVALC,INVALC,INVALC,0x315B,0x3159,0x315F,
INVALC,0x315A,0x315E,0x315C,0x315D,INVALC,INVALC,0x376B,
0x376D,INVALC,INVALC,INVALC,0x376C,INVALC,INVALC,INVALC,
INVALC,0x3E5F,INVALC,INVALC,INVALC,INVALC,0x4569,INVALC,
INVALC,INVALC,0x4568,0x4567,INVALC,INVALC,INVALC,INVALC,
0x4C51,INVALC,INVALC,0x4C52,0x4C53,INVALC,INVALC,INVALC,
INVALC,0x5921,0x525B,0x525D,0x525C,0x587E,0x587C,0x5922,
0x587D,INVALC,INVALC,INVALC,INVALC,INVALC,0x5E24,INVALC,
0x5E25,0x5E26,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2C62,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3160,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3E61,INVALC,0x3E60,INVALC,
INVALC,INVALC,INVALC,0x456A,INVALC,INVALC,0x4C54,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6952,
INVALC,INVALC,INVALC,0x2847,INVALC,INVALC,INVALC,INVALC,
/* Block 124, Array index 0x2E00 */
0x2C63,0x2C64,INVALC,INVALC,0x3162,0x3164,INVALC,INVALC,
0x3166,0x3169,0x3167,INVALC,INVALC,INVALC,0x3168,0x3165,
0x3161,INVALC,0x316A,0x3163,INVALC,INVALC,INVALC,INVALC,
0x3776,INVALC,0x3821,INVALC,INVALC,0x3778,INVALC,INVALC,
INVALC,INVALC,0x3773,0x3822,0x3774,0x3771,INVALC,INVALC,
INVALC,INVALC,0x3777,0x377A,INVALC,0x377B,INVALC,0x377C,
0x3772,0x3779,0x377D,0x3775,0x3770,0x376E,INVALC,INVALC,
0x377E,INVALC,INVALC,0x376F,INVALC,INVALC,INVALC,INVALC,
0x3E68,INVALC,INVALC,INVALC,0x3E64,0x3E6A,INVALC,0x3E63,
0x3E65,INVALC,0x3E62,INVALC,0x3E66,INVALC,0x3E67,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3E69,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4575,INVALC,0x4578,0x456C,0x4571,0x456B,INVALC,
INVALC,0x456F,INVALC,INVALC,INVALC,0x456D,INVALC,INVALC,
0x4574,0x4573,0x4570,0x4572,0x456E,INVALC,0x4577,INVALC,
0x4576,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4C64,INVALC,INVALC,0x4C5F,INVALC,INVALC,
0x4C55,INVALC,0x4C57,INVALC,0x4C5C,0x4C5B,0x4C5E,INVALC,
0x4C59,0x4C58,INVALC,INVALC,INVALC,INVALC,0x4C5A,INVALC,
0x4C60,0x4C62,INVALC,0x4C5D,0x4C56,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4C63,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5261,INVALC,INVALC,0x5263,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5266,INVALC,0x525E,
INVALC,0x5264,INVALC,INVALC,INVALC,INVALC,0x5260,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x5265,0x525F,INVALC,INVALC,0x5262,INVALC,
INVALC,INVALC,INVALC,INVALC,0x592C,0x5927,INVALC,INVALC,
0x5931,INVALC,0x5929,INVALC,0x592F,0x5926,0x5923,0x5932,
INVALC,INVALC,0x592E,0x5924,INVALC,0x5928,INVALC,0x5925,
0x592A,INVALC,0x592D,0x5930,INVALC,INVALC,INVALC,INVALC,
0x5E38,0x5E39,0x5E29,0x5E30,0x5E2E,INVALC,INVALC,INVALC,
0x5E35,0x592B,INVALC,0x5E2C,INVALC,0x5E36,INVALC,0x5E2B,
/* Block 125, Array index 0x2F00 */
0x5E2A,0x5E34,0x5E31,0x5E33,INVALC,0x5E27,0x5E37,INVALC,
INVALC,0x5E32,0x5E3B,0x5E2F,INVALC,INVALC,0x5E2D,0x5E28,
0x5E3A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x624F,INVALC,INVALC,0x624D,0x6253,INVALC,0x6251,
0x6250,INVALC,0x6256,INVALC,INVALC,0x6257,0x6254,INVALC,
0x6255,0x624E,INVALC,INVALC,0x6635,0x6252,INVALC,INVALC,
0x6258,INVALC,INVALC,0x6632,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6634,INVALC,0x6636,0x6633,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6957,INVALC,0x6956,
0x6954,0x6953,0x6955,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x6B73,0x6B72,INVALC,INVALC,0x6D68,
INVALC,0x6D6A,0x6D6C,0x6D6B,0x6D69,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6F3C,0x6F3B,
INVALC,0x712B,0x7046,0x712C,INVALC,INVALC,INVALC,0x715C,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2848,INVALC,INVALC,
0x2C66,0x2C67,0x2C65,INVALC,INVALC,INVALC,INVALC,0x2C68,
0x2C69,0x2C6A,INVALC,INVALC,0x316B,0x3171,INVALC,INVALC,
0x316F,INVALC,0x316D,INVALC,0x316E,0x3170,INVALC,INVALC,
INVALC,0x316C,INVALC,INVALC,0x3823,INVALC,0x3825,INVALC,
0x3824,INVALC,INVALC,INVALC,INVALC,INVALC,0x3E6C,INVALC,
INVALC,0x3E6E,0x3E6B,0x3826,INVALC,INVALC,INVALC,INVALC,
0x3E6D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x457B,
INVALC,INVALC,0x4579,INVALC,0x457A,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4C68,0x4C65,0x4C67,INVALC,INVALC,0x4C66,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5267,INVALC,INVALC,
0x5268,INVALC,INVALC,0x526A,0x5269,INVALC,INVALC,INVALC,
0x5936,0x5937,0x5933,INVALC,0x5934,INVALC,INVALC,0x5935,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5E3C,INVALC,0x6638,INVALC,0x6637,INVALC,0x6958,INVALC,
INVALC,0x6D6E,0x6B74,INVALC,0x6D6D,INVALC,0x712D,0x7172,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2849,INVALC,INVALC,
/* Block 126, Array index 0x3000 */
INVALC,0x2C6D,INVALC,0x2C6B,INVALC,INVALC,INVALC,INVALC,
0x2C6C,INVALC,INVALC,INVALC,0x317C,INVALC,0x3175,0x317B,
INVALC,0x3174,0x317A,0x3178,INVALC,INVALC,0x3177,INVALC,
0x3176,INVALC,INVALC,INVALC,INVALC,0x3173,0x3172,0x3179,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3835,0x382E,INVALC,INVALC,0x382D,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3827,0x382A,INVALC,
0x3829,INVALC,0x382B,0x3834,INVALC,0x3828,0x3831,0x3832,
INVALC,0x382F,INVALC,INVALC,INVALC,0x382C,INVALC,0x3830,
INVALC,INVALC,0x3833,INVALC,INVALC,INVALC,0x3F21,0x3E76,
INVALC,0x3E7D,0x3E7A,0x3E72,0x3E7B,INVALC,0x3E73,INVALC,
0x3E6F,INVALC,INVALC,INVALC,0x3E78,INVALC,INVALC,0x3E7E,
INVALC,INVALC,INVALC,0x3E71,INVALC,INVALC,INVALC,0x3E74,
INVALC,0x3E7C,0x3E75,0x3E79,INVALC,0x3E77,INVALC,0x3E70,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4624,0x4626,0x4628,0x462C,INVALC,0x4622,
0x457E,INVALC,INVALC,0x4627,0x462B,0x4623,0x457D,INVALC,
0x457C,INVALC,INVALC,INVALC,0x4629,0x4621,0x4625,INVALC,
INVALC,INVALC,0x462D,INVALC,0x462A,INVALC,0x4C79,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4C71,INVALC,0x4C7B,
INVALC,0x4D21,INVALC,0x4C6C,INVALC,INVALC,0x4C7C,0x4C69,
INVALC,0x4C7E,0x4C6D,INVALC,INVALC,INVALC,0x4C7D,0x4C77,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4C6A,
INVALC,0x4C78,INVALC,INVALC,0x4C7A,INVALC,INVALC,INVALC,
0x4C6F,0x4C6E,0x4C6B,INVALC,0x4C73,0x4C70,0x4C74,INVALC,
INVALC,0x4D22,INVALC,0x4C75,0x4C76,INVALC,0x4C72,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x526F,
INVALC,INVALC,INVALC,0x526C,INVALC,INVALC,INVALC,0x5278,
INVALC,0x5270,INVALC,INVALC,INVALC,INVALC,0x5273,0x526E,
INVALC,INVALC,0x526D,INVALC,INVALC,INVALC,0x5277,INVALC,
0x5276,0x5275,INVALC,0x503B,INVALC,INVALC,0x5274,0x526B,
INVALC,INVALC,0x5272,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 127, Array index 0x3100 */
INVALC,INVALC,INVALC,0x5271,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5944,0x593B,0x5947,0x593F,0x5945,
INVALC,INVALC,0x5938,0x593E,0x5948,0x5941,0x5946,0x593A,
INVALC,INVALC,0x5942,INVALC,0x5940,INVALC,INVALC,0x593C,
0x593D,0x5939,0x5943,INVALC,0x594A,0x5949,INVALC,INVALC,
INVALC,0x5E47,0x5E43,INVALC,INVALC,0x5E3D,INVALC,INVALC,
0x5E49,INVALC,INVALC,0x5E40,INVALC,INVALC,0x5E4B,INVALC,
0x5E42,INVALC,0x5E4D,0x5E4A,0x5E3E,INVALC,INVALC,INVALC,
0x5E45,INVALC,0x5E3F,INVALC,0x5E4C,INVALC,INVALC,0x5E46,
INVALC,0x5E44,INVALC,INVALC,0x5E48,INVALC,INVALC,INVALC,
0x625A,0x6260,INVALC,0x6263,INVALC,INVALC,0x625B,0x6262,
0x625D,INVALC,INVALC,INVALC,0x6259,INVALC,INVALC,0x625F,
0x6261,INVALC,0x625E,0x625C,INVALC,INVALC,INVALC,INVALC,
0x6642,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x663E,
0x663C,INVALC,0x6640,INVALC,0x6641,0x663A,0x6639,0x663D,
0x663B,INVALC,0x663F,0x6959,INVALC,INVALC,0x695A,INVALC,
0x695C,0x695B,INVALC,INVALC,INVALC,INVALC,0x6B79,0x6B76,
0x6B77,INVALC,0x6B75,0x6B78,INVALC,0x6B7A,INVALC,INVALC,
INVALC,0x6D6F,INVALC,INVALC,INVALC,0x6F3D,INVALC,0x7047,
0x712F,0x7131,0x712E,0x7130,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 128, Array index 0x3200 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3052,INVALC,INVALC,INVALC,INVALC,0x3F22,0x3F23,
INVALC,INVALC,INVALC,0x594B,INVALC,0x5E4E,INVALC,INVALC,
INVALC,INVALC,0x6644,0x6643,INVALC,0x6B7B,INVALC,0x6D70,
INVALC,0x2269,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2C6E,INVALC,INVALC,0x3224,0x317D,0x3223,0x3221,INVALC,
0x3222,0x317E,INVALC,0x3836,INVALC,0x3F24,0x3F25,0x4630,
0x4631,INVALC,INVALC,0x462F,0x4632,0x462E,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4D23,INVALC,INVALC,0x5279,INVALC,
INVALC,INVALC,0x594E,0x594C,0x594D,0x5E51,0x5E50,0x5E4F,
INVALC,INVALC,INVALC,0x6645,INVALC,INVALC,0x6646,0x6D71,
INVALC,0x7048,INVALC,INVALC,INVALC,0x2C70,INVALC,INVALC,
INVALC,0x2C6F,0x3226,INVALC,INVALC,0x3837,0x3225,INVALC,
INVALC,INVALC,INVALC,0x383A,0x3838,0x3839,INVALC,INVALC,
0x3F27,0x3F28,0x3F26,INVALC,INVALC,0x4634,0x4633,0x4635,
INVALC,INVALC,INVALC,INVALC,0x527A,0x527C,INVALC,INVALC,
0x527B,0x594F,INVALC,0x6265,INVALC,0x6264,INVALC,0x6647,
INVALC,INVALC,0x695D,0x6B7C,INVALC,INVALC,0x2C71,INVALC,
0x3229,INVALC,0x3228,0x3227,INVALC,INVALC,INVALC,0x3840,
INVALC,0x3842,0x383B,0x383C,INVALC,0x383D,INVALC,0x3841,
0x383E,0x383F,INVALC,INVALC,INVALC,INVALC,INVALC,0x3F29,
INVALC,INVALC,INVALC,0x4636,0x4637,INVALC,0x4D27,INVALC,
INVALC,INVALC,0x4D24,0x4D25,INVALC,0x4D26,0x5323,INVALC,
0x5324,INVALC,0x5321,0x527E,0x5322,0x527D,INVALC,0x5950,
INVALC,INVALC,0x5E53,INVALC,0x5E52,0x6134,INVALC,0x6266,
0x6267,INVALC,INVALC,INVALC,INVALC,0x6648,0x6649,0x695E,
/* Block 129, Array index 0x3300 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2C72,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2C73,0x2C74,
INVALC,INVALC,INVALC,INVALC,0x2C75,INVALC,0x322A,INVALC,
INVALC,INVALC,INVALC,0x3845,INVALC,INVALC,0x3844,0x3843,
INVALC,0x4638,INVALC,INVALC,0x4D28,INVALC,INVALC,INVALC,
INVALC,0x5952,0x5951,INVALC,0x5E54,INVALC,INVALC,INVALC,
0x6B7D,INVALC,INVALC,INVALC,0x2473,0x284A,INVALC,0x2C76,
INVALC,0x322C,INVALC,INVALC,INVALC,INVALC,0x322B,INVALC,
INVALC,INVALC,INVALC,0x3847,INVALC,INVALC,INVALC,0x3846,
0x3848,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3F2B,
0x3F2C,0x3F2A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4D2A,0x4D29,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5325,INVALC,INVALC,0x5326,
INVALC,INVALC,INVALC,INVALC,0x5953,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6268,INVALC,INVALC,
0x664A,0x695F,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2F7D,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2168,INVALC,INVALC,INVALC,INVALC,0x284B,
0x2476,INVALC,0x2477,INVALC,INVALC,0x2474,INVALC,INVALC,
INVALC,0x2475,INVALC,INVALC,0x2478,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x284D,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2850,0x284C,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x284F,INVALC,INVALC,
0x284E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2C7C,INVALC,INVALC,0x2C7E,INVALC,0x2C78,
0x2C7B,0x2D26,0x2D24,INVALC,INVALC,0x2D2A,INVALC,0x2D27,
0x2C7D,0x2C7A,INVALC,INVALC,0x3F2E,0x2D25,INVALC,0x2D28,
0x2C77,0x2D22,INVALC,INVALC,0x2D23,INVALC,INVALC,INVALC,
0x2C79,INVALC,INVALC,0x2D21,INVALC,INVALC,0x2D29,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x322E,INVALC,INVALC,0x3230,INVALC,INVALC,
INVALC,0x322F,0x322D,0x3232,INVALC,INVALC,0x3F2D,INVALC,
/* Block 130, Array index 0x3400 */
0x3233,0x3231,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3852,INVALC,INVALC,
0x3849,0x384B,INVALC,0x384C,INVALC,0x3854,0x3850,0x384E,
INVALC,0x3851,0x3855,INVALC,INVALC,0x384A,INVALC,0x3853,
INVALC,INVALC,INVALC,INVALC,0x384F,0x384D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3F36,INVALC,INVALC,0x3F34,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3F2F,0x4646,INVALC,INVALC,0x3F33,
INVALC,INVALC,0x3F30,INVALC,INVALC,0x3F35,INVALC,0x3F32,
INVALC,INVALC,0x3F31,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x463E,0x463C,INVALC,0x4642,INVALC,
0x463A,0x4647,0x463F,INVALC,0x4639,INVALC,INVALC,0x4644,
INVALC,0x463D,INVALC,INVALC,INVALC,INVALC,INVALC,0x4645,
INVALC,INVALC,0x4640,INVALC,INVALC,INVALC,0x4643,0x463B,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4D2D,INVALC,INVALC,0x4D2C,0x4D2E,
INVALC,0x4D2B,INVALC,0x4D31,0x4D30,0x4D2F,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x532A,INVALC,0x532D,
INVALC,0x532C,INVALC,INVALC,INVALC,INVALC,0x5329,0x5328,
INVALC,INVALC,0x532B,0x5327,INVALC,INVALC,0x5955,0x595F,
INVALC,INVALC,INVALC,0x5959,0x595B,INVALC,0x5956,INVALC,
0x595A,0x5954,0x595D,INVALC,0x595C,0x5958,INVALC,0x595E,
INVALC,0x5957,INVALC,0x5E55,0x5E5B,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5E56,0x5E59,INVALC,0x5E5A,
INVALC,INVALC,0x5E58,INVALC,0x5E57,INVALC,INVALC,INVALC,
0x626B,0x6269,0x626A,INVALC,INVALC,0x664C,INVALC,0x664B,
INVALC,0x6961,INVALC,0x6960,INVALC,0x6B7E,0x6D72,INVALC,
0x7132,0x7133,INVALC,INVALC,INVALC,INVALC,0x3F37,INVALC,
INVALC,0x5E5C,INVALC,INVALC,INVALC,INVALC,0x3F38,INVALC,
INVALC,INVALC,0x5960,INVALC,INVALC,INVALC,INVALC,0x3F39,
0x3F3A,0x3F3B,INVALC,INVALC,INVALC,INVALC,INVALC,0x2D2B,
/* Block 131, Array index 0x3500 */
INVALC,0x3234,INVALC,INVALC,0x3F3C,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x664D,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3856,INVALC,INVALC,INVALC,0x4D32,0x532E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4648,INVALC,INVALC,
0x2851,0x2D2C,INVALC,INVALC,INVALC,0x3236,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3235,
INVALC,INVALC,0x385B,0x3858,0x385A,INVALC,INVALC,INVALC,
0x3857,INVALC,0x3859,INVALC,0x3F3D,0x3F3E,INVALC,0x3F3F,
0x464B,INVALC,0x464C,INVALC,0x464A,0x464D,INVALC,INVALC,
INVALC,0x4649,INVALC,INVALC,INVALC,INVALC,0x5333,0x532F,
0x5332,0x5334,0x5331,0x5330,INVALC,0x5961,0x5962,0x5963,
INVALC,INVALC,0x5E5E,0x5E5D,0x5E5F,INVALC,0x626D,0x626C,
INVALC,0x664F,INVALC,0x6650,0x664E,INVALC,INVALC,INVALC,
0x6962,0x6963,INVALC,0x6D73,0x6F3E,0x7049,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x385C,0x3F40,INVALC,INVALC,
0x226A,INVALC,INVALC,INVALC,0x226B,0x226D,INVALC,0x226E,
0x226C,INVALC,INVALC,0x2522,0x2523,0x247B,INVALC,INVALC,
INVALC,INVALC,0x2521,INVALC,INVALC,INVALC,0x247C,0x247A,
0x2479,0x247D,INVALC,0x247E,0x2D2D,INVALC,INVALC,INVALC,
0x2856,INVALC,0x2855,0x2857,INVALC,INVALC,0x285C,INVALC,
0x2852,0x2860,0x2866,INVALC,0x2863,INVALC,INVALC,0x2859,
0x285F,0x2861,INVALC,0x2854,INVALC,INVALC,0x285A,INVALC,
INVALC,INVALC,INVALC,INVALC,0x285E,0x2858,0x2865,INVALC,
INVALC,INVALC,0x285D,INVALC,0x285B,INVALC,INVALC,INVALC,
0x2853,INVALC,0x2862,0x2864,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2D34,0x2D37,INVALC,
INVALC,0x2D2E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2D43,0x2D3A,INVALC,INVALC,0x2D42,INVALC,INVALC,INVALC,
0x2D32,INVALC,0x2D41,0x2D36,0x2D39,0x2D46,INVALC,INVALC,
0x2D40,INVALC,0x2D3B,0x2D45,0x2D38,0x2D3C,0x2D3F,INVALC,
INVALC,0x2D30,0x2D44,0x2D3E,INVALC,INVALC,0x2D2F,INVALC,
/* Block 132, Array index 0x3600 */
0x2D33,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2D31,
0x3247,INVALC,INVALC,INVALC,0x2D3D,0x2942,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x324A,INVALC,
INVALC,0x323A,INVALC,0x3245,0x3241,INVALC,0x3254,INVALC,
0x324C,INVALC,0x3242,INVALC,0x324B,0x323C,0x3240,0x3257,
INVALC,0x324F,0x3246,INVALC,0x3255,0x3238,INVALC,0x324E,
INVALC,INVALC,INVALC,0x3237,INVALC,INVALC,INVALC,0x324D,
INVALC,INVALC,0x2D35,0x3F41,0x3248,INVALC,INVALC,0x323E,
INVALC,0x323F,0x3243,INVALC,0x3239,0x3251,INVALC,0x3250,
0x3258,INVALC,INVALC,0x3256,0x3252,0x3249,0x3244,INVALC,
INVALC,0x323B,INVALC,0x3253,INVALC,INVALC,0x323D,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3862,0x3864,0x3869,0x387D,INVALC,
INVALC,INVALC,0x3861,INVALC,INVALC,0x386C,0x3873,0x3879,
INVALC,0x3866,INVALC,0x386D,INVALC,INVALC,INVALC,0x387B,
0x3876,INVALC,INVALC,0x3872,0x386E,0x3860,INVALC,0x3865,
0x385D,INVALC,INVALC,INVALC,0x386A,0x3867,INVALC,0x3877,
INVALC,0x3868,0x3F6A,0x3870,INVALC,0x386F,INVALC,INVALC,
INVALC,INVALC,INVALC,0x385E,0x3863,0x3874,0x387A,INVALC,
0x385F,0x386B,0x3871,INVALC,INVALC,INVALC,0x387C,0x3875,
0x3878,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3F51,
0x3F45,INVALC,0x3F62,0x3F6B,0x3F6E,INVALC,0x3F4D,0x3F66,
0x3F4E,0x3F5C,INVALC,0x3F58,INVALC,INVALC,0x3F59,0x3F42,
INVALC,0x3F67,INVALC,INVALC,INVALC,0x3F64,0x3F5A,0x3F70,
0x3F55,0x466D,INVALC,0x3F73,INVALC,0x3F53,0x3F5F,INVALC,
INVALC,0x3F57,0x3F71,0x3F50,0x3F49,0x3F54,INVALC,0x3F48,
0x3F46,INVALC,0x3F68,0x3F4F,0x3F6C,INVALC,0x3F6D,INVALC,
INVALC,INVALC,INVALC,0x3F63,INVALC,0x3F5B,0x3F4B,INVALC,
INVALC,0x3F43,0x3F65,0x3F6F,0x3F4A,INVALC,0x3F74,0x3F56,
/* Block 133, Array index 0x3700 */
INVALC,0x3F52,INVALC,INVALC,INVALC,INVALC,0x3F61,INVALC,
INVALC,0x3F5D,INVALC,INVALC,INVALC,INVALC,INVALC,0x3F5E,
0x3F4C,0x3F60,0x3F47,0x3F69,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3F72,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3F44,INVALC,INVALC,INVALC,INVALC,
INVALC,0x466C,INVALC,0x4724,INVALC,0x4671,INVALC,0x466F,
0x465A,INVALC,0x466A,0x467E,0x4666,INVALC,0x467D,0x4664,
INVALC,0x4674,0x4665,0x467B,INVALC,INVALC,INVALC,0x464F,
0x4657,INVALC,0x4670,0x4668,0x4723,0x466B,INVALC,0x467C,
INVALC,INVALC,INVALC,0x466E,0x4676,0x465B,0x4675,INVALC,
0x4728,0x4656,0x4677,INVALC,0x4726,INVALC,0x4650,INVALC,
INVALC,0x465E,0x465D,INVALC,INVALC,0x4661,0x4663,0x4672,
0x4725,INVALC,INVALC,INVALC,INVALC,0x4655,INVALC,0x4659,
0x4721,INVALC,INVALC,INVALC,INVALC,INVALC,0x4727,0x4678,
0x4673,INVALC,INVALC,0x4660,0x465F,INVALC,0x4651,INVALC,
0x4669,0x4652,0x4667,INVALC,INVALC,0x465C,0x4722,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4658,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4654,0x467A,0x4653,
INVALC,0x4D5A,INVALC,INVALC,0x4D49,INVALC,INVALC,0x4D33,
0x4D51,INVALC,0x4D42,0x4D4C,INVALC,0x4D45,INVALC,0x4D36,
0x4D54,0x4D35,0x4D48,INVALC,0x4D34,INVALC,INVALC,0x4D46,
0x4D4F,0x4D4D,0x4D41,0x4D3C,0x4D3A,INVALC,0x4D3B,0x4D4E,
0x4D59,0x4D43,INVALC,INVALC,0x4D3E,INVALC,0x4D52,INVALC,
INVALC,0x4D3D,0x4D37,0x4D47,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4D3F,0x4D39,INVALC,INVALC,0x4679,INVALC,0x4D4A,
INVALC,INVALC,INVALC,INVALC,0x4D4B,0x4D40,0x4D38,0x4D53,
0x4D44,INVALC,0x4D57,INVALC,0x4D56,INVALC,0x4D50,0x4D55,
INVALC,INVALC,INVALC,0x4D58,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x535C,
0x535D,0x5350,0x534F,0x534B,INVALC,INVALC,INVALC,0x535F,
0x535E,0x464E,0x5348,0x534C,0x5346,INVALC,0x5359,0x534A,
INVALC,0x5360,0x5343,0x5341,0x534D,0x5357,0x5352,INVALC,
/* Block 134, Array index 0x3800 */
0x5338,INVALC,0x5356,INVALC,INVALC,INVALC,INVALC,0x4662,
0x5344,0x533B,0x533E,0x5364,0x5345,0x533C,0x533A,0x5337,
INVALC,INVALC,0x534E,INVALC,INVALC,0x5349,0x5351,INVALC,
0x5361,0x5365,INVALC,INVALC,0x5340,0x5354,0x5358,0x533D,
0x5362,INVALC,INVALC,INVALC,0x5335,INVALC,0x535B,0x533F,
0x5353,0x5339,0x5347,0x5342,INVALC,INVALC,0x5355,0x5366,
0x5363,0x535A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5336,INVALC,INVALC,0x5974,INVALC,
0x596B,0x596E,INVALC,INVALC,0x5970,0x5965,0x596C,0x5972,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5967,0x5977,INVALC,
INVALC,0x5971,INVALC,0x5968,0x5A22,0x597A,0x5964,0x5E72,
0x596A,INVALC,INVALC,0x5975,INVALC,0x5A21,INVALC,INVALC,
0x597C,0x5969,0x596F,0x5973,0x596D,0x5A23,0x597E,0x597B,
INVALC,INVALC,INVALC,0x5966,0x5A24,INVALC,0x5978,INVALC,
INVALC,0x5976,INVALC,INVALC,INVALC,0x5979,0x5F21,0x5E6C,
0x5E71,0x5E7E,0x5E70,0x5E68,0x5E6D,INVALC,INVALC,INVALC,
0x5E61,0x5E79,0x5E7B,0x5E60,INVALC,0x5E7D,0x5E75,INVALC,
0x5E7C,0x5E6E,INVALC,0x5E66,0x597D,0x5E76,0x5E73,0x5E62,
0x5F23,INVALC,INVALC,INVALC,INVALC,0x5E64,0x5E74,INVALC,
0x5F22,0x5E77,0x5E6A,INVALC,INVALC,0x5E78,0x5E6B,0x5F24,
0x5E65,0x5E6F,0x5E7A,0x5E67,0x5E69,INVALC,INVALC,0x5E63,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x627D,INVALC,0x6273,0x626E,0x6274,0x627E,0x6324,
0x6323,INVALC,INVALC,INVALC,INVALC,0x6275,0x6325,0x6278,
0x6270,INVALC,0x6272,0x6271,0x6277,0x627C,0x626F,0x6276,
0x627B,INVALC,INVALC,0x6279,INVALC,INVALC,0x627A,INVALC,
INVALC,0x6660,0x6321,INVALC,INVALC,INVALC,INVALC,0x6658,
0x665C,0x6654,0x6657,INVALC,0x665F,INVALC,0x6664,0x665D,
INVALC,0x6655,0x6665,0x665E,INVALC,INVALC,0x6662,INVALC,
0x6656,INVALC,INVALC,0x6651,0x6659,0x6653,INVALC,0x6663,
0x6661,0x6652,0x665A,INVALC,INVALC,INVALC,0x696A,INVALC,
0x665B,INVALC,INVALC,INVALC,INVALC,0x696F,0x6967,0x6965,
/* Block 135, Array index 0x3900 */
0x6969,0x6966,INVALC,INVALC,0x696B,0x696D,INVALC,INVALC,
INVALC,0x696C,INVALC,INVALC,0x696E,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6C21,0x6C27,INVALC,0x6968,0x6C26,INVALC,0x6C2D,0x6C24,
0x6C2B,0x6C2A,0x6964,0x6C25,0x6322,0x6C2E,0x6C23,0x6C28,
INVALC,0x6C2C,0x6C22,INVALC,0x6D77,INVALC,0x6C29,INVALC,
INVALC,0x6F43,0x6D78,0x6D76,0x6D74,0x6D75,0x6D79,INVALC,
INVALC,0x6F41,0x6F3F,0x6F44,0x6F42,INVALC,0x6F45,INVALC,
0x6F40,INVALC,INVALC,0x704A,INVALC,INVALC,0x7134,0x7135,
0x7136,INVALC,INVALC,0x7235,0x722D,0x226F,INVALC,INVALC,
INVALC,INVALC,0x325A,0x3259,INVALC,INVALC,0x3921,INVALC,
INVALC,0x387E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4D5B,0x5367,0x5A25,0x5A27,0x5A26,INVALC,INVALC,
0x5F25,0x6326,0x7173,INVALC,INVALC,0x2869,0x286A,0x2868,
0x2867,INVALC,INVALC,0x2D4A,0x2D48,INVALC,INVALC,0x2D47,
INVALC,INVALC,INVALC,INVALC,0x2D49,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x3266,0x3263,0x3261,
INVALC,INVALC,INVALC,0x3264,INVALC,0x325E,0x326D,INVALC,
0x326F,0x325F,INVALC,INVALC,0x3270,0x326B,0x325D,0x3262,
0x326C,0x3268,0x3265,INVALC,INVALC,0x326E,0x3260,INVALC,
INVALC,0x3269,0x325B,INVALC,INVALC,0x3267,INVALC,0x326A,
0x325C,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x3928,INVALC,INVALC,0x392B,0x392E,INVALC,INVALC,0x3923,
0x392C,0x392A,0x3927,0x392F,0x3930,0x3932,0x3933,0x3922,
INVALC,0x3925,0x3924,0x3931,INVALC,0x3926,INVALC,INVALC,
0x3929,INVALC,INVALC,INVALC,0x392D,INVALC,INVALC,INVALC,
INVALC,0x4025,INVALC,0x3F78,INVALC,INVALC,0x472E,0x4023,
0x3F75,INVALC,0x3F7A,INVALC,0x3F7E,0x3F7C,INVALC,INVALC,
INVALC,INVALC,0x3F76,0x3F79,INVALC,INVALC,0x3F77,INVALC,
0x4024,0x4022,0x3F7B,0x3F7D,0x4021,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x472F,0x4735,0x472B,
0x4731,INVALC,0x472D,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 136, Array index 0x3A00 */
INVALC,0x4734,INVALC,INVALC,0x472A,0x4737,INVALC,INVALC,
INVALC,0x4733,INVALC,0x4729,0x472C,0x4736,0x4732,INVALC,
INVALC,0x4D7B,0x4D70,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4D64,0x4D79,0x4D65,INVALC,INVALC,0x4D62,INVALC,
0x4D6B,0x4D63,INVALC,0x4D5D,0x4D78,INVALC,0x4D75,0x4D76,
0x4D5E,INVALC,0x4D6D,INVALC,0x4D67,0x4D6E,0x4D61,INVALC,
0x4D7A,0x4D72,0x4D6C,0x4D5C,INVALC,0x4D73,INVALC,INVALC,
0x4D77,INVALC,0x4D71,INVALC,0x4D6F,INVALC,0x4D69,INVALC,
0x4D60,0x4D68,0x4D74,0x4D66,INVALC,INVALC,0x4D6A,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4730,0x5379,0x5424,
0x5378,0x5374,0x5371,INVALC,0x536F,INVALC,0x5368,INVALC,
0x536E,INVALC,0x5373,0x5370,0x5422,0x537B,0x5375,0x537A,
INVALC,0x5372,0x5427,0x5369,0x536A,0x5423,INVALC,0x5428,
INVALC,0x5429,0x5377,0x4D5F,0x537D,0x5376,0x5421,0x537C,
INVALC,INVALC,INVALC,0x536D,INVALC,0x5426,INVALC,0x536B,
INVALC,0x5A32,0x537E,0x5425,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5A2F,INVALC,INVALC,0x5A39,0x5A35,INVALC,0x5A33,
0x5A2E,0x5A3D,INVALC,INVALC,INVALC,INVALC,INVALC,0x5A2A,
0x5A36,0x5A37,0x5A2D,0x5A2C,0x5A3A,INVALC,0x5A30,0x5A2B,
0x5A31,INVALC,0x5A3C,0x5A29,0x5A3B,0x5A38,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5A34,0x5A28,INVALC,INVALC,INVALC,
INVALC,INVALC,0x5F27,INVALC,0x5F2B,0x5F28,0x5F2F,0x5F35,
0x5F2A,INVALC,0x5F3E,INVALC,0x5F38,0x5F2D,0x5F39,0x5F34,
0x5F3B,0x5F2C,INVALC,INVALC,0x5F2E,0x5F3C,0x5F26,0x5F3A,
INVALC,INVALC,0x5F32,0x5F31,0x5F36,0x5F29,INVALC,INVALC,
INVALC,0x5F30,0x5F37,INVALC,0x5F33,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x6333,0x6331,INVALC,INVALC,0x6337,
0x6335,0x6338,INVALC,0x632A,0x6332,0x633C,0x5F3D,0x632E,
INVALC,0x536C,0x6329,0x6336,0x6330,0x632D,0x6328,0x6327,
0x633B,INVALC,0x632C,0x632B,INVALC,0x6334,INVALC,INVALC,
INVALC,INVALC,INVALC,0x632F,0x633A,INVALC,0x6669,0x666A,
INVALC,INVALC,0x6667,INVALC,0x666F,INVALC,INVALC,0x6671,
/* Block 137, Array index 0x3B00 */
0x6666,0x6339,0x6673,0x6668,INVALC,INVALC,0x666E,INVALC,
0x6670,0x666B,0x6672,0x666D,0x666C,INVALC,INVALC,INVALC,
0x6971,0x6972,INVALC,0x6974,INVALC,INVALC,0x6975,0x6973,
INVALC,0x6970,INVALC,0x6C31,0x6C34,0x6C30,INVALC,INVALC,
0x6C32,INVALC,INVALC,INVALC,0x6C33,0x6D7E,0x6D7C,INVALC,
0x6D7B,0x6C2F,0x6D7D,0x6C35,0x6D7A,INVALC,0x6F48,0x6F26,
0x6F46,INVALC,0x6F47,0x6F49,INVALC,0x704D,INVALC,0x704C,
0x704B,INVALC,INVALC,INVALC,0x715D,0x7175,0x7174,0x7176,
INVALC,0x2D4B,INVALC,0x3271,0x3272,INVALC,INVALC,INVALC,
0x4026,INVALC,0x6C36,0x704E,INVALC,INVALC,0x2D4C,INVALC,
INVALC,INVALC,0x3934,INVALC,INVALC,0x4028,0x4027,INVALC,
INVALC,INVALC,0x542A,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2D4D,
INVALC,0x2D4F,0x2D4E,INVALC,INVALC,0x3273,INVALC,0x327A,
INVALC,0x3278,0x3276,INVALC,0x327D,0x3274,0x3275,INVALC,
INVALC,INVALC,INVALC,INVALC,0x327E,INVALC,0x327C,0x3279,
0x3277,INVALC,INVALC,0x327B,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3935,INVALC,INVALC,0x3945,INVALC,0x3947,INVALC,
INVALC,0x393B,INVALC,0x3946,INVALC,0x3936,INVALC,0x3942,
0x393E,0x3940,0x393A,0x3941,INVALC,INVALC,INVALC,0x393D,
INVALC,0x393C,0x3938,INVALC,0x3943,INVALC,INVALC,0x393F,
0x3937,INVALC,0x3939,INVALC,0x3944,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4033,INVALC,INVALC,INVALC,0x402F,0x4031,
0x402C,0x402B,0x4029,INVALC,0x4030,0x4032,0x402E,INVALC,
0x402D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4035,INVALC,0x4739,0x473F,0x473A,0x473B,INVALC,
0x4740,INVALC,INVALC,INVALC,INVALC,INVALC,0x4738,0x402A,
INVALC,INVALC,0x473E,0x473D,INVALC,INVALC,0x473C,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4D7D,
INVALC,INVALC,INVALC,0x4E2A,0x4E29,INVALC,0x4E24,INVALC,
0x4E28,0x4D7E,0x4E21,INVALC,INVALC,INVALC,0x4E26,0x4D7C,
INVALC,INVALC,0x4E22,0x4E27,0x4E25,INVALC,0x4E23,INVALC,
/* Block 138, Array index 0x3C00 */
INVALC,0x4034,INVALC,INVALC,INVALC,0x542B,0x5432,INVALC,
INVALC,0x5436,INVALC,0x542E,0x542C,INVALC,0x5435,INVALC,
INVALC,0x5434,INVALC,INVALC,0x542D,INVALC,0x5433,0x542F,
0x5430,0x5431,INVALC,INVALC,INVALC,INVALC,0x5A3E,0x5A4A,
INVALC,INVALC,0x5A45,0x5A47,INVALC,INVALC,0x5A3F,0x5A43,
INVALC,0x5A46,INVALC,INVALC,0x5A49,0x5A41,0x5A42,0x5A48,
0x5A40,0x5A44,INVALC,0x5F40,INVALC,0x5F3F,INVALC,0x5F45,
INVALC,INVALC,INVALC,INVALC,0x5F41,INVALC,0x5F42,INVALC,
INVALC,0x5F43,0x5F46,INVALC,INVALC,INVALC,0x6341,INVALC,
INVALC,0x6344,INVALC,0x633E,0x6340,INVALC,INVALC,0x633F,
0x6342,0x6343,0x5F44,0x633D,INVALC,INVALC,INVALC,0x6677,
0x667A,0x667C,0x6675,0x6676,0x6679,0x667B,INVALC,INVALC,
INVALC,0x6678,0x6674,0x6976,INVALC,INVALC,0x6977,INVALC,
INVALC,0x6C38,INVALC,0x6C3A,INVALC,0x6C37,0x6C39,INVALC,
INVALC,0x6E21,INVALC,0x6F4C,0x6F4B,INVALC,0x6F4A,INVALC,
INVALC,0x7137,0x7138,0x713A,0x7139,INVALC,0x2270,INVALC,
INVALC,INVALC,0x3948,INVALC,INVALC,0x4741,INVALC,INVALC,
0x667D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4036,INVALC,0x4038,
0x4037,INVALC,INVALC,0x4742,INVALC,0x4E2B,0x4E2E,0x4E2D,
INVALC,0x4E2C,0x5437,0x5439,0x5438,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5F47,0x5F49,0x5F48,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6721,0x667E,
INVALC,0x6978,INVALC,INVALC,INVALC,INVALC,0x6E23,0x6E22,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2D50,INVALC,0x394B,0x3949,INVALC,
INVALC,0x394A,0x403A,0x403B,0x4749,0x4039,INVALC,0x4743,
0x4747,0x4746,0x4748,INVALC,0x4745,0x4744,0x474A,INVALC,
0x4E31,0x4E2F,INVALC,0x4E30,0x543C,0x543A,INVALC,INVALC,
0x543B,0x5A4B,0x5F4A,0x5F4B,INVALC,INVALC,0x6722,0x6979,
INVALC,INVALC,0x6C3B,0x6E24,INVALC,INVALC,0x6F4D,0x713B,
/* Block 139, Array index 0x3D00 */
INVALC,INVALC,INVALC,INVALC,0x2D51,INVALC,INVALC,0x2D52,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3321,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x394F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x394D,
INVALC,INVALC,INVALC,INVALC,0x394E,INVALC,INVALC,INVALC,
0x394C,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x403E,INVALC,INVALC,INVALC,INVALC,INVALC,0x474F,
0x4040,INVALC,INVALC,INVALC,0x4043,0x4044,INVALC,INVALC,
0x4046,INVALC,0x4048,INVALC,0x4049,0x403D,0x403C,0x404A,
INVALC,0x4047,0x4045,INVALC,INVALC,INVALC,INVALC,0x4041,
0x4042,0x403F,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x474E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4756,0x4753,0x474B,0x4750,
INVALC,INVALC,0x4757,INVALC,INVALC,INVALC,INVALC,0x474D,
INVALC,0x4755,0x4751,0x4754,0x4752,INVALC,0x474C,INVALC,
INVALC,INVALC,INVALC,0x4E34,INVALC,INVALC,INVALC,0x4E36,
INVALC,INVALC,0x4E35,INVALC,INVALC,INVALC,0x4E37,INVALC,
INVALC,0x4E33,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4E32,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x543F,INVALC,0x544B,0x5444,INVALC,0x544C,0x5446,INVALC,
0x5447,INVALC,INVALC,0x544A,INVALC,0x5448,0x543E,INVALC,
0x5A56,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x543D,
INVALC,0x5441,INVALC,0x5440,0x5442,0x5443,INVALC,0x5445,
0x5449,0x544D,INVALC,INVALC,INVALC,0x5A51,0x5A57,0x5A54,
0x5A4C,0x5A58,0x5A4D,INVALC,0x5A53,INVALC,INVALC,INVALC,
0x5A59,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5A5B,
0x5A55,INVALC,0x5A4E,INVALC,0x5A4F,0x5A50,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5A5C,INVALC,INVALC,INVALC,0x5A5A,
/* Block 140, Array index 0x3E00 */
INVALC,INVALC,INVALC,INVALC,INVALC,0x5F50,0x5F59,0x5F56,
0x5F58,INVALC,INVALC,0x5F51,INVALC,0x5F57,INVALC,0x5F53,
INVALC,0x5F4F,0x5F54,0x5F5B,0x5A52,0x5F55,0x5F4E,INVALC,
0x5F4D,INVALC,0x5F5C,INVALC,0x5F5A,INVALC,0x5F4C,INVALC,
INVALC,INVALC,0x5F52,0x6347,0x6355,0x6350,0x6352,0x6346,
INVALC,INVALC,0x6345,INVALC,INVALC,INVALC,0x6354,0x634C,
0x6349,0x634F,INVALC,0x6348,INVALC,0x634A,0x6353,0x6351,
INVALC,INVALC,0x6358,0x6356,0x634D,0x6357,0x634E,INVALC,
0x6726,INVALC,0x672D,INVALC,INVALC,0x6C3E,INVALC,0x634B,
0x6724,INVALC,0x6725,0x672A,INVALC,INVALC,INVALC,INVALC,
0x6723,0x672C,0x672E,0x6727,0x6729,0x672B,0x6728,0x672F,
INVALC,INVALC,INVALC,INVALC,INVALC,0x697C,INVALC,INVALC,
0x697A,INVALC,INVALC,0x697E,INVALC,0x6A21,INVALC,0x6A22,
0x697D,INVALC,0x697B,INVALC,INVALC,0x6A23,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6C3D,0x6C3C,0x6C3F,0x6C40,INVALC,INVALC,0x6E25,0x6E2A,
INVALC,INVALC,0x6E27,INVALC,0x6E26,0x6E29,0x6E28,INVALC,
0x6F51,INVALC,INVALC,0x6F50,0x6F4E,INVALC,0x6F4F,INVALC,
INVALC,INVALC,INVALC,INVALC,0x704F,0x7050,INVALC,INVALC,
0x713C,0x713D,INVALC,INVALC,INVALC,INVALC,0x7177,0x7236,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 141, Array index 0x3F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x3950,INVALC,0x3951,0x4758,0x4E38,0x544E,INVALC,
INVALC,INVALC,0x6359,0x6730,INVALC,0x6F52,INVALC,0x3322,
INVALC,INVALC,0x475A,0x4759,INVALC,0x544F,INVALC,0x5F5D,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x286B,0x3323,
INVALC,INVALC,INVALC,INVALC,0x3952,0x3953,INVALC,0x404B,
INVALC,INVALC,INVALC,INVALC,0x475C,0x475B,0x475D,INVALC,
0x4E39,0x4E3A,INVALC,INVALC,INVALC,INVALC,INVALC,0x5F61,
0x5F5E,0x5F60,0x5F5F,INVALC,INVALC,0x635A,0x6732,0x6731,
0x2524,INVALC,INVALC,0x3324,INVALC,0x3954,INVALC,INVALC,
0x404D,0x404C,INVALC,INVALC,0x475F,0x4760,0x475E,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5450,
0x5A5F,0x5A5D,0x5A5E,INVALC,0x5F63,0x5F62,INVALC,0x635D,
0x635C,0x635B,0x6733,INVALC,0x7178,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3326,0x3325,0x3955,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4050,INVALC,INVALC,INVALC,INVALC,0x4052,INVALC,INVALC,
INVALC,0x4051,0x404E,INVALC,INVALC,INVALC,0x404F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4761,INVALC,INVALC,0x4E3C,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4E3B,INVALC,0x4E3D,
INVALC,0x5453,0x5455,INVALC,INVALC,0x5456,INVALC,0x5452,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5451,INVALC,0x5457,
0x5454,INVALC,INVALC,INVALC,INVALC,INVALC,0x5A61,INVALC,
0x5A63,0x5A62,INVALC,0x5A64,INVALC,0x5A60,INVALC,INVALC,
INVALC,0x5F64,INVALC,INVALC,INVALC,INVALC,0x635E,INVALC,
/* Block 142, Array index 0x4000 */
0x6361,INVALC,0x6360,INVALC,0x635F,INVALC,0x6734,0x6735,
INVALC,0x6736,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6C41,INVALC,INVALC,INVALC,0x6C42,0x6E2B,INVALC,INVALC,
INVALC,0x6F53,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4762,0x4763,INVALC,INVALC,0x5A65,INVALC,0x5A66,0x5F65,
INVALC,INVALC,0x2D53,INVALC,INVALC,INVALC,0x3327,INVALC,
0x3328,0x3958,INVALC,0x3957,INVALC,0x3956,INVALC,INVALC,
0x4054,INVALC,INVALC,INVALC,0x4053,INVALC,INVALC,INVALC,
INVALC,0x4055,INVALC,INVALC,0x4765,0x4768,0x4766,0x4767,
0x476B,0x4764,0x476C,0x4769,0x476A,INVALC,0x4E3E,INVALC,
INVALC,INVALC,INVALC,0x545B,0x5459,INVALC,INVALC,INVALC,
0x5458,0x545A,INVALC,INVALC,INVALC,0x5A67,INVALC,0x5A68,
INVALC,INVALC,0x6738,0x673A,0x6737,0x6739,0x6A24,0x6C43,
INVALC,INVALC,0x715E,INVALC,INVALC,0x3329,0x332B,0x332A,
INVALC,0x395B,INVALC,INVALC,0x3959,INVALC,INVALC,0x395C,
INVALC,0x395D,0x395A,INVALC,INVALC,0x4061,INVALC,0x4059,
0x405F,INVALC,INVALC,INVALC,INVALC,0x4058,INVALC,0x405C,
0x4772,INVALC,INVALC,0x4057,INVALC,0x405D,0x405A,0x4060,
0x4056,0x405E,INVALC,INVALC,0x405B,INVALC,INVALC,INVALC,
0x476E,INVALC,0x4775,0x4774,INVALC,INVALC,INVALC,0x4776,
INVALC,0x4773,INVALC,0x4778,0x476F,INVALC,0x4771,INVALC,
0x476D,0x4770,0x4777,INVALC,0x4779,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4E43,0x4E49,0x4E41,
/* Block 143, Array index 0x4100 */
0x4E4A,INVALC,0x4E40,0x4E45,0x4E4B,0x4E48,0x4E47,0x4E46,
INVALC,0x4E3F,0x4E44,INVALC,INVALC,0x4E42,INVALC,INVALC,
INVALC,0x5464,0x5469,0x546B,0x5468,0x5461,0x5463,0x546D,
0x546A,0x5465,0x546E,0x5462,0x546C,INVALC,INVALC,INVALC,
0x545C,INVALC,INVALC,0x545D,0x545F,0x545E,0x5466,0x5467,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5460,INVALC,
0x5A72,INVALC,INVALC,0x5A69,INVALC,INVALC,0x5A6E,INVALC,
0x5A6B,INVALC,INVALC,INVALC,0x5A6F,0x5A70,0x5A6A,0x5A73,
0x5A6C,0x5A71,INVALC,INVALC,INVALC,0x5A6D,INVALC,0x5F6B,
INVALC,INVALC,INVALC,INVALC,0x5F6A,0x5F67,0x5F66,INVALC,
0x5F69,INVALC,INVALC,0x5F68,0x636F,INVALC,0x6366,0x6365,
INVALC,INVALC,0x636B,0x636A,0x6362,0x636D,0x6367,INVALC,
0x6364,0x636C,0x6363,INVALC,INVALC,0x6368,INVALC,0x6369,
INVALC,0x636E,0x673E,INVALC,INVALC,0x673B,INVALC,0x673F,
INVALC,INVALC,INVALC,0x673D,INVALC,INVALC,INVALC,INVALC,
0x673C,INVALC,INVALC,0x6740,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x6A27,INVALC,0x6A25,INVALC,
0x6A26,INVALC,INVALC,INVALC,0x6C45,INVALC,0x6C44,INVALC,
0x6E30,INVALC,0x6E2F,INVALC,0x6E2D,0x6E2C,0x6E31,0x6E32,
0x6F54,INVALC,0x6E2E,INVALC,INVALC,0x7054,0x7051,0x7052,
0x7053,INVALC,INVALC,0x7140,0x713F,0x713E,0x715F,INVALC,
0x722E,0x7179,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5A74,INVALC,INVALC,
INVALC,INVALC,0x6741,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x717A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x332C,INVALC,0x332D,INVALC,INVALC,INVALC,0x3962,
0x395E,INVALC,INVALC,INVALC,0x3961,0x3960,0x395F,INVALC,
0x3963,0x3964,INVALC,INVALC,INVALC,0x4068,0x4066,0x406A,
0x406B,0x4071,INVALC,0x406D,0x406F,INVALC,0x4067,0x4062,
INVALC,0x406E,INVALC,INVALC,0x4070,0x4069,0x406C,0x4063,
INVALC,0x4065,0x4064,INVALC,INVALC,INVALC,INVALC,0x477B,
/* Block 144, Array index 0x4200 */
0x477D,0x477C,0x4823,INVALC,INVALC,0x477E,0x477A,0x4821,
0x4822,INVALC,INVALC,0x4824,INVALC,0x4E4F,0x4E4E,INVALC,
0x4E4C,0x4E4D,INVALC,INVALC,INVALC,INVALC,0x5475,0x5476,
0x5471,INVALC,0x5472,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5473,INVALC,INVALC,0x5474,0x5470,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x546F,INVALC,0x5A76,INVALC,
INVALC,INVALC,0x5A78,INVALC,0x5A7B,0x5A77,0x5A75,0x5A7A,
INVALC,0x5A79,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5F6D,INVALC,INVALC,0x5F6C,INVALC,INVALC,0x6370,0x6371,
0x6372,INVALC,INVALC,0x6373,INVALC,INVALC,INVALC,0x6744,
0x6745,0x6743,0x6742,0x6746,INVALC,0x6A2B,0x6A29,0x6A2A,
0x6A2C,0x6A28,0x6A2D,0x6C47,INVALC,0x6C48,0x6C46,INVALC,
0x6E33,INVALC,0x6E34,0x6F56,0x6F55,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x6747,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2526,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2525,INVALC,0x286D,INVALC,0x286F,INVALC,INVALC,
INVALC,INVALC,0x286C,0x286E,INVALC,0x2871,0x2870,0x2872,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x2D57,0x2D55,INVALC,0x2D54,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2D56,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x332F,0x3335,INVALC,
INVALC,INVALC,INVALC,0x3332,0x3334,INVALC,0x332E,0x3331,
/* Block 145, Array index 0x4300 */
INVALC,INVALC,0x3330,INVALC,0x3333,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3966,0x3969,INVALC,INVALC,INVALC,
INVALC,0x3967,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3968,INVALC,INVALC,INVALC,
INVALC,0x396A,INVALC,INVALC,0x3965,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4072,INVALC,0x4074,
INVALC,INVALC,INVALC,INVALC,0x4073,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4829,INVALC,0x4826,
INVALC,INVALC,INVALC,INVALC,0x4827,INVALC,INVALC,INVALC,
INVALC,0x4828,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x4825,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x547A,
INVALC,INVALC,INVALC,0x547B,INVALC,INVALC,INVALC,0x5479,
0x5478,INVALC,INVALC,0x5477,INVALC,INVALC,0x5A7C,INVALC,
INVALC,0x5A7D,INVALC,0x5A7E,INVALC,INVALC,0x5F6F,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5F6E,0x5B21,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6A2E,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x2275,INVALC,INVALC,0x2272,
0x2273,0x2271,INVALC,0x2274,INVALC,INVALC,0x252A,0x2527,
0x252C,0x2528,INVALC,INVALC,INVALC,0x2529,INVALC,0x252B,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2875,
0x2877,INVALC,0x2873,0x2876,0x2874,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2D59,0x2D5D,0x2D5A,
INVALC,INVALC,INVALC,INVALC,INVALC,0x2D5C,INVALC,0x2D5E,
0x2D60,INVALC,INVALC,0x2D5F,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3971,0x2D5B,0x3336,0x333F,
0x333D,0x3338,0x3339,0x333E,0x3340,INVALC,INVALC,0x333B,
0x3337,INVALC,INVALC,0x333A,0x3341,0x333C,INVALC,INVALC,
INVALC,0x3974,0x396C,0x3972,0x3973,INVALC,INVALC,0x396B,
0x396D,0x2D58,0x396F,0x3970,0x396E,INVALC,INVALC,INVALC,
INVALC,0x407B,0x5B22,0x407C,0x4079,INVALC,INVALC,0x4078,
/* Block 146, Array index 0x4400 */
0x407E,0x407D,INVALC,0x4123,0x4077,0x4122,0x4075,0x4121,
0x407A,INVALC,INVALC,0x4830,INVALC,0x482B,0x4831,0x482C,
0x482A,0x482D,INVALC,INVALC,0x482F,INVALC,0x482E,INVALC,
INVALC,INVALC,0x4E56,0x4E59,0x4E51,0x4E55,INVALC,0x4E54,
0x4E52,0x4E58,0x4E53,0x4E50,0x4E57,INVALC,0x5523,INVALC,
0x6374,0x547E,0x5521,0x547D,0x4076,INVALC,0x5524,0x547C,
INVALC,INVALC,0x5522,0x5B23,INVALC,0x5B24,0x5B25,INVALC,
0x5F70,INVALC,0x6375,0x6376,INVALC,INVALC,0x6377,0x6749,
0x6748,0x6A30,INVALC,0x6A2F,0x6C4A,0x6C4B,0x6C49,0x6E35,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3343,0x3344,
0x3342,INVALC,INVALC,0x3978,INVALC,0x3979,0x3975,INVALC,
0x3976,INVALC,0x3977,INVALC,INVALC,INVALC,INVALC,0x4126,
0x4128,0x4124,0x4127,INVALC,0x4125,INVALC,INVALC,INVALC,
0x4279,INVALC,INVALC,INVALC,INVALC,INVALC,0x4832,0x4833,
INVALC,INVALC,0x4E5B,0x4E5D,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4E5C,0x4E5A,INVALC,INVALC,INVALC,INVALC,INVALC,
0x552B,0x5528,0x5529,INVALC,0x552A,0x5525,0x5526,INVALC,
INVALC,INVALC,0x5527,INVALC,INVALC,0x5B29,INVALC,0x5B2A,
0x5B27,0x5B28,INVALC,0x5B26,INVALC,INVALC,INVALC,INVALC,
INVALC,0x5F74,0x5F71,0x5F73,INVALC,0x5F77,INVALC,0x5F75,
0x5F78,0x5F76,0x5F72,INVALC,INVALC,0x6379,INVALC,0x637A,
0x6378,INVALC,0x637C,INVALC,INVALC,0x674B,INVALC,0x637B,
0x674A,INVALC,0x6A33,0x6A34,INVALC,0x6A32,INVALC,0x6A31,
INVALC,0x6C4C,INVALC,INVALC,0x6F57,0x7056,0x7055,INVALC,
INVALC,INVALC,0x7057,0x7160,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x2D62,0x2D61,0x3345,INVALC,INVALC,
INVALC,INVALC,0x3347,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3346,INVALC,0x3A21,INVALC,INVALC,INVALC,
0x3A26,INVALC,0x3A23,0x3A24,0x397A,INVALC,0x3A27,INVALC,
INVALC,0x397C,INVALC,0x397D,0x397B,INVALC,INVALC,0x3A25,
0x397E,0x3A22,INVALC,INVALC,INVALC,0x4134,INVALC,0x4133,
/* Block 147, Array index 0x4500 */
0x4131,0x4129,0x4138,0x412C,0x4136,0x413D,0x4135,INVALC,
INVALC,INVALC,0x412A,INVALC,0x4130,INVALC,INVALC,0x412F,
INVALC,INVALC,0x4132,INVALC,INVALC,INVALC,0x413E,0x413C,
INVALC,0x413B,0x412D,INVALC,0x4139,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x413A,0x412B,0x412E,0x4137,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4F22,0x483D,INVALC,
0x4836,0x4849,0x4852,0x4839,INVALC,INVALC,0x4846,INVALC,
INVALC,INVALC,0x4837,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x483F,INVALC,
0x4834,INVALC,0x483E,INVALC,0x4850,INVALC,0x484E,0x4842,
0x484C,INVALC,0x4835,0x484F,0x484A,INVALC,0x4851,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x483B,INVALC,
0x4843,0x4847,INVALC,0x484B,INVALC,0x483A,0x4838,0x4844,
INVALC,INVALC,INVALC,INVALC,0x4841,0x4840,INVALC,0x4845,
0x4848,INVALC,0x484D,INVALC,INVALC,INVALC,0x4E60,INVALC,
INVALC,0x4E6A,0x4E62,INVALC,INVALC,0x4E73,0x4E7B,0x4E6C,
INVALC,INVALC,0x4E70,0x483C,INVALC,INVALC,0x4E77,0x4E7C,
0x4E74,INVALC,0x4E76,0x4F21,0x4E78,0x4E66,0x4E6F,INVALC,
INVALC,INVALC,INVALC,INVALC,0x4E64,0x4E71,INVALC,0x4E6B,
INVALC,0x4E79,0x4E68,0x4E61,INVALC,0x4E7E,INVALC,INVALC,
0x4E63,0x4E75,0x4E72,0x4E6D,0x4E5F,0x4E5E,0x4E67,0x4E7A,
INVALC,0x4E7D,0x4E65,0x4E69,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x554D,0x5549,0x5531,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x552F,INVALC,0x553B,0x552D,0x552E,INVALC,0x554C,INVALC,
0x553E,0x5543,0x553D,0x5B3C,0x5539,0x5541,0x553F,0x5532,
0x552C,0x5547,INVALC,0x5548,INVALC,0x5542,INVALC,0x5537,
0x5535,0x5530,INVALC,INVALC,INVALC,0x5538,0x5545,0x5534,
0x5544,0x554A,INVALC,INVALC,INVALC,INVALC,0x5540,0x5546,
0x553C,0x5536,INVALC,INVALC,INVALC,INVALC,0x4E6E,0x553A,
INVALC,0x5533,INVALC,INVALC,INVALC,INVALC,INVALC,0x5B41,
INVALC,0x5B40,0x5B3E,0x5B50,INVALC,INVALC,0x5B4D,0x5B45,
/* Block 148, Array index 0x4600 */
0x5B4F,0x5B37,0x5B43,INVALC,INVALC,INVALC,0x5B2F,INVALC,
0x5B2D,0x5B4E,INVALC,0x5B4C,0x5B4B,0x5B3B,0x5B3A,0x5B30,
INVALC,INVALC,0x5B36,0x5B3F,0x5B4A,INVALC,0x5B51,INVALC,
INVALC,INVALC,INVALC,0x5B34,INVALC,0x5B3D,0x5B2C,0x5B2E,
INVALC,INVALC,INVALC,0x5B35,0x5B44,0x554B,INVALC,0x5B2B,
INVALC,0x5B46,0x5B49,INVALC,INVALC,0x5B39,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5B42,0x5B48,INVALC,INVALC,
0x5B32,0x5B47,INVALC,INVALC,0x5B33,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5B38,0x5F7E,
INVALC,0x6025,INVALC,INVALC,0x602B,INVALC,0x6039,0x6031,
0x6026,0x6027,0x6030,INVALC,INVALC,0x602F,0x5F7D,0x602E,
0x6022,0x603A,INVALC,INVALC,0x6023,INVALC,0x6036,INVALC,
0x6028,0x6035,INVALC,0x6037,0x5F7C,INVALC,INVALC,0x6038,
INVALC,INVALC,0x602C,INVALC,INVALC,0x6029,INVALC,INVALC,
INVALC,0x6032,INVALC,INVALC,INVALC,INVALC,0x6024,0x6033,
INVALC,0x602D,0x5B31,0x6034,0x6021,INVALC,INVALC,INVALC,
0x642F,INVALC,INVALC,0x5F7A,INVALC,INVALC,INVALC,INVALC,
0x642C,0x6425,INVALC,INVALC,0x637E,0x6430,0x6427,0x602A,
INVALC,0x6432,0x6421,INVALC,INVALC,0x642B,INVALC,INVALC,
INVALC,0x642D,INVALC,0x6423,INVALC,0x6424,0x6429,0x642E,
INVALC,0x5F79,INVALC,0x6437,0x6434,0x6761,0x642A,0x6426,
0x6435,0x6756,0x6428,INVALC,INVALC,INVALC,INVALC,0x5F7B,
INVALC,0x6431,0x6433,INVALC,0x6436,0x637D,INVALC,0x6422,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x675F,INVALC,0x674F,INVALC,0x675D,INVALC,INVALC,0x674D,
INVALC,INVALC,0x6758,INVALC,0x6754,INVALC,0x675E,0x674E,
0x6751,INVALC,0x6760,INVALC,0x6759,0x675C,INVALC,INVALC,
INVALC,0x6755,0x6750,INVALC,INVALC,INVALC,0x674C,INVALC,
INVALC,INVALC,INVALC,0x675B,INVALC,INVALC,0x6757,0x6762,
INVALC,INVALC,INVALC,INVALC,0x6753,INVALC,0x675A,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6A41,0x6A50,0x6A43,
0x6A4A,0x6752,0x6A48,0x6A37,0x6A4E,INVALC,0x6A3B,0x6A4D,
/* Block 149, Array index 0x4700 */
0x6A42,INVALC,INVALC,INVALC,INVALC,INVALC,0x6A52,0x6A44,
INVALC,0x6A49,0x6A4C,0x6A35,0x6A4F,0x6A40,0x6A45,0x6A39,
0x6A3D,0x6A51,0x6A47,0x6A36,0x6A3A,0x6A3C,0x6A46,INVALC,
INVALC,0x6A3F,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6A38,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6A3E,0x6C50,0x6C54,INVALC,0x6C56,INVALC,INVALC,INVALC,
0x6C52,0x6C58,INVALC,INVALC,INVALC,INVALC,0x6C4F,0x6C55,
INVALC,0x6C53,INVALC,0x6C4E,0x6A4B,0x6C51,INVALC,0x6C4D,
0x6C57,INVALC,INVALC,INVALC,INVALC,0x6E3C,0x6E3F,0x6E3B,
0x6E3D,0x6E3E,0x6E38,0x6E39,0x6E36,INVALC,INVALC,0x6E3A,
0x6E37,INVALC,INVALC,INVALC,INVALC,0x6F59,INVALC,0x6F5B,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6F5A,0x6F5C,INVALC,
INVALC,INVALC,0x6F58,INVALC,INVALC,INVALC,INVALC,INVALC,
0x7059,0x705A,INVALC,0x7058,INVALC,0x7142,0x7141,0x7143,
INVALC,0x7144,INVALC,0x7145,0x7161,0x7164,0x7163,INVALC,
0x7162,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x7230,0x7231,0x722F,0x7237,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 150, Array index 0x4800 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3A28,0x413F,0x554E,0x6763,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3A29,INVALC,
0x3A2A,INVALC,INVALC,INVALC,0x4141,0x4140,INVALC,INVALC,
0x4142,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4856,0x4854,INVALC,0x4855,0x4853,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5550,0x554F,INVALC,0x5551,INVALC,
0x5552,INVALC,INVALC,INVALC,INVALC,0x5B59,0x5B57,0x6040,
INVALC,0x5B55,0x5B56,INVALC,0x5B52,0x5B5A,0x5B54,0x5B58,
0x603C,INVALC,INVALC,0x603E,INVALC,0x603F,INVALC,0x603B,
INVALC,0x603D,INVALC,INVALC,INVALC,0x5B53,INVALC,INVALC,
INVALC,0x643A,0x6438,0x6439,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6764,0x6765,INVALC,INVALC,0x6A53,0x6A55,
0x6A54,INVALC,INVALC,0x6C5B,0x6C5A,0x6C59,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 151, Array index 0x4900 */
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x2169,INVALC,
0x2278,INVALC,0x2276,0x2279,0x2277,INVALC,INVALC,INVALC,
0x252E,INVALC,INVALC,INVALC,INVALC,0x2530,INVALC,0x252F,
0x252D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x2878,0x287B,INVALC,0x287A,0x2879,INVALC,INVALC,
INVALC,INVALC,INVALC,0x287C,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x2D67,INVALC,INVALC,INVALC,0x2D68,0x2D64,
INVALC,0x2D65,INVALC,0x2D66,0x2D63,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3348,INVALC,INVALC,0x3349,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x3A2D,INVALC,0x3A2C,INVALC,0x3A2F,
INVALC,0x3A2E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x3A2B,INVALC,0x4144,INVALC,
0x4148,INVALC,INVALC,0x4147,INVALC,INVALC,INVALC,0x4143,
0x4145,0x4146,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4859,0x4857,0x4858,INVALC,INVALC,INVALC,0x485A,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4F23,INVALC,
INVALC,0x4F24,0x5554,INVALC,0x5553,INVALC,INVALC,INVALC,
INVALC,0x5B5B,INVALC,INVALC,0x6043,INVALC,0x6041,INVALC,
0x6042,INVALC,INVALC,0x643B,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x334A,INVALC,INVALC,0x3A30,
INVALC,INVALC,0x4149,0x414B,INVALC,INVALC,INVALC,INVALC,
0x414A,INVALC,INVALC,INVALC,INVALC,INVALC,0x485B,INVALC,
INVALC,INVALC,INVALC,0x5555,0x5B5C,INVALC,INVALC,0x643C,
0x6440,INVALC,0x643D,INVALC,INVALC,0x6441,INVALC,0x643F,
INVALC,0x6766,INVALC,INVALC,INVALC,0x705B,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x414D,0x414C,INVALC,INVALC,INVALC,0x485F,INVALC,INVALC,
0x485E,INVALC,0x485C,INVALC,INVALC,0x485D,INVALC,0x4F25,
/* Block 152, Array index 0x4A00 */
INVALC,INVALC,0x5558,INVALC,INVALC,0x5556,INVALC,INVALC,
0x5557,INVALC,INVALC,0x5B5D,INVALC,INVALC,INVALC,INVALC,
0x5B5F,INVALC,0x5B5E,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6046,0x6048,INVALC,INVALC,INVALC,0x6047,INVALC,0x6045,
0x6044,INVALC,0x6443,0x6442,INVALC,0x6444,0x676B,INVALC,
0x676A,0x6767,INVALC,0x6768,0x6769,INVALC,0x6A56,0x6A57,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6C5C,INVALC,INVALC,
INVALC,INVALC,0x6C5D,INVALC,INVALC,INVALC,INVALC,0x6E40,
INVALC,INVALC,INVALC,0x705D,INVALC,INVALC,0x705C,0x705E,
INVALC,0x7146,INVALC,0x717B,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4F26,INVALC,0x5559,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x3A31,INVALC,0x414E,INVALC,0x4150,INVALC,
0x414F,INVALC,0x4863,0x4860,INVALC,INVALC,INVALC,0x4861,
0x4862,INVALC,0x4F28,0x4F2D,INVALC,0x4F27,0x4F29,0x4F30,
0x4F2B,0x4F2F,0x4F2C,0x4F2A,0x4F2E,INVALC,INVALC,INVALC,
0x555C,INVALC,0x555A,INVALC,INVALC,INVALC,0x555B,INVALC,
INVALC,INVALC,INVALC,INVALC,0x5B62,INVALC,INVALC,0x5B61,
INVALC,0x5B60,0x6049,INVALC,0x604B,0x604D,0x604C,INVALC,
INVALC,0x604A,0x644B,INVALC,0x6449,0x644C,INVALC,INVALC,
0x6447,INVALC,0x644A,0x6448,0x6445,INVALC,0x6446,INVALC,
INVALC,INVALC,INVALC,0x676C,INVALC,INVALC,0x676E,0x676D,
INVALC,0x6A58,INVALC,0x6A59,INVALC,INVALC,INVALC,0x6C5E,
INVALC,INVALC,INVALC,INVALC,0x6F5D,0x6F5E,INVALC,0x705F,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4F32,0x4F31,0x555E,
0x555D,INVALC,INVALC,INVALC,0x604F,0x604E,0x644F,0x644D,
0x6450,0x644E,INVALC,INVALC,INVALC,0x676F,0x6770,0x6771,
INVALC,0x6C5F,INVALC,0x6E41,INVALC,0x7060,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5B63,0x6050,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5B64,INVALC,0x6451,INVALC,INVALC,0x6A5A,0x6A5B,INVALC,
/* Block 153, Array index 0x4B00 */
0x6F5F,INVALC,INVALC,INVALC,0x3A32,INVALC,INVALC,0x4151,
INVALC,INVALC,INVALC,INVALC,INVALC,0x4865,0x4866,0x4864,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4F33,INVALC,
INVALC,INVALC,INVALC,0x5565,INVALC,0x5560,0x555F,INVALC,
0x5564,INVALC,INVALC,INVALC,INVALC,INVALC,0x5561,0x5566,
0x5563,0x5562,INVALC,INVALC,INVALC,INVALC,INVALC,0x5B66,
INVALC,INVALC,0x5B67,INVALC,INVALC,0x5B65,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6051,INVALC,0x6056,0x6052,0x6055,INVALC,INVALC,
0x5E41,0x6054,0x6053,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6452,0x6453,0x6454,INVALC,INVALC,INVALC,INVALC,0x6775,
INVALC,0x6773,INVALC,INVALC,0x6772,0x6774,INVALC,0x6A5F,
0x6A5C,INVALC,0x6A5D,0x6A5E,0x6C60,INVALC,INVALC,INVALC,
INVALC,0x6E43,0x6E42,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x7147,0x717C,0x717D,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x4152,INVALC,INVALC,0x4867,0x4F34,0x4F35,INVALC,
INVALC,INVALC,0x5567,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6455,INVALC,INVALC,0x6778,INVALC,0x6777,0x6779,0x6776,
0x6C63,0x6A60,0x6A61,INVALC,INVALC,INVALC,0x6C62,INVALC,
INVALC,0x6C61,INVALC,0x6E44,0x717E,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x334B,INVALC,0x3A33,INVALC,INVALC,
INVALC,INVALC,INVALC,0x4153,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4868,INVALC,
INVALC,0x4869,0x5569,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 154, Array index 0x4C00 */
0x4F37,INVALC,0x4F36,INVALC,INVALC,INVALC,INVALC,0x4F38,
0x5568,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x556A,INVALC,INVALC,0x556B,0x556E,0x556C,0x556D,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x5B69,
INVALC,INVALC,INVALC,INVALC,0x5B68,0x6057,INVALC,0x5B6A,
INVALC,0x5B6B,0x605A,0x6058,0x6059,0x605E,INVALC,0x605D,
0x6060,0x605F,0x605C,0x605B,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6458,INVALC,0x6457,INVALC,INVALC,INVALC,
INVALC,0x6456,INVALC,0x677C,INVALC,INVALC,INVALC,0x677B,
0x677A,INVALC,INVALC,0x6A66,0x6A65,INVALC,0x6A63,INVALC,
0x6A62,INVALC,INVALC,0x6A67,0x6E45,INVALC,0x6C65,INVALC,
0x6C64,0x6A64,INVALC,0x6E46,INVALC,INVALC,INVALC,0x7148,
INVALC,0x7221,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x3A34,
0x6061,INVALC,INVALC,INVALC,0x4F3A,0x4F39,0x5B6C,INVALC,
INVALC,0x6063,INVALC,0x6062,INVALC,INVALC,0x677D,0x677E,
INVALC,INVALC,INVALC,0x7222,INVALC,INVALC,INVALC,0x486A,
0x486C,INVALC,0x486B,INVALC,INVALC,0x486D,INVALC,INVALC,
INVALC,0x4F3C,0x4F3E,0x4F3D,INVALC,0x4F40,INVALC,INVALC,
INVALC,INVALC,0x4F3F,0x4F3B,INVALC,INVALC,INVALC,0x4F41,
INVALC,0x5575,INVALC,0x5578,0x557A,0x5570,0x5574,0x5571,
INVALC,INVALC,INVALC,0x5572,0x5573,INVALC,0x5576,0x5579,
0x5577,INVALC,INVALC,INVALC,0x556F,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x5B72,0x5B70,0x5B6F,INVALC,0x5B75,
INVALC,0x5B74,0x5B73,INVALC,0x5B6E,INVALC,0x5B6D,INVALC,
0x5B71,INVALC,INVALC,INVALC,0x6066,INVALC,0x606A,0x6067,
0x6069,0x6068,0x6065,0x606B,0x606E,0x606C,0x606D,INVALC,
/* Block 155, Array index 0x4D00 */
INVALC,INVALC,0x6064,0x606F,0x645D,0x6460,0x6462,0x6461,
INVALC,0x645B,0x645F,0x645A,INVALC,0x645C,INVALC,0x6459,
INVALC,0x645E,INVALC,INVALC,0x682D,0x6822,INVALC,INVALC,
INVALC,INVALC,0x6821,0x6826,0x682C,0x6824,0x682B,INVALC,
0x6828,INVALC,0x6827,0x682A,0x6825,0x6823,INVALC,0x6829,
INVALC,0x6A6E,0x6A6C,INVALC,0x6A6B,0x6A71,0x6A6F,INVALC,
INVALC,0x6A6A,0x6A68,INVALC,0x6A69,INVALC,0x6A6D,INVALC,
0x6A70,0x6C66,0x6C6C,INVALC,INVALC,0x6C67,INVALC,0x6C6D,
INVALC,0x6C6B,0x6C6A,INVALC,0x6C69,INVALC,0x6C68,INVALC,
0x6E4C,0x6E4E,0x6E4D,INVALC,0x6E4A,INVALC,0x6E47,0x6E4B,
0x6E50,INVALC,0x6E4F,0x6E48,0x6E49,INVALC,0x6F60,INVALC,
INVALC,0x6F61,INVALC,INVALC,INVALC,INVALC,0x7061,INVALC,
0x7165,INVALC,INVALC,INVALC,0x7223,INVALC,0x7224,0x7225,
0x7233,0x7232,INVALC,0x723B,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x486F,INVALC,0x486E,INVALC,INVALC,
INVALC,0x4F42,INVALC,0x557B,0x5B78,INVALC,INVALC,INVALC,
INVALC,0x5B76,INVALC,0x5B79,INVALC,INVALC,0x6070,0x5B77,
0x6463,INVALC,0x682E,INVALC,INVALC,INVALC,0x6A74,0x6A72,
INVALC,INVALC,0x6A73,INVALC,INVALC,0x6C6E,INVALC,INVALC,
0x6E51,INVALC,INVALC,INVALC,INVALC,0x7062,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,0x6464,INVALC,INVALC,0x334C,
INVALC,INVALC,INVALC,0x4F43,INVALC,INVALC,INVALC,0x4F44,
INVALC,INVALC,INVALC,0x557D,0x557C,INVALC,INVALC,INVALC,
INVALC,0x5622,0x5621,0x557E,INVALC,INVALC,0x5B7A,0x5B7D,
INVALC,0x5B7C,0x5B7B,INVALC,0x6074,0x6072,0x6071,INVALC,
/* Block 156, Array index 0x4E00 */
INVALC,0x6073,INVALC,INVALC,0x6466,0x6467,INVALC,INVALC,
0x6465,INVALC,0x6830,0x682F,0x6832,INVALC,0x6831,INVALC,
0x6A75,0x6A77,0x6A76,INVALC,INVALC,0x6C6F,0x6C72,0x6C70,
0x6C71,0x6E52,INVALC,INVALC,INVALC,INVALC,0x6F62,0x6F63,
0x6F64,INVALC,INVALC,INVALC,0x7226,INVALC,INVALC,INVALC,
INVALC,0x6468,INVALC,0x6E53,INVALC,INVALC,0x7166,0x334D,
INVALC,INVALC,INVALC,0x5B7E,INVALC,0x6469,INVALC,0x6833,
INVALC,INVALC,0x6C73,0x6E54,INVALC,INVALC,0x4F45,0x4F46,
INVALC,INVALC,INVALC,0x5624,INVALC,INVALC,0x5623,INVALC,
0x6075,INVALC,0x646A,0x646C,0x646B,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6C74,INVALC,INVALC,0x6E56,0x6E55,INVALC,
INVALC,0x7063,INVALC,0x4870,INVALC,INVALC,INVALC,0x4F49,
0x4F47,0x4F48,INVALC,INVALC,0x562D,INVALC,0x5628,0x5625,
0x562C,INVALC,INVALC,INVALC,0x562E,INVALC,INVALC,INVALC,
0x562B,0x5627,INVALC,INVALC,0x5626,0x562A,0x5629,INVALC,
INVALC,INVALC,0x5C2B,0x5C26,0x5C24,0x5C2D,0x5C25,INVALC,
0x5C21,INVALC,0x5C27,INVALC,INVALC,0x5C22,0x607E,0x5C23,
0x5C2E,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5C2A,INVALC,0x5C29,0x5C28,INVALC,0x5C2C,INVALC,INVALC,
INVALC,INVALC,0x6076,0x6079,INVALC,INVALC,0x6078,INVALC,
0x6122,0x607B,0x6121,INVALC,0x607D,0x607C,0x607A,INVALC,
0x6077,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6123,
INVALC,INVALC,INVALC,INVALC,INVALC,0x6472,0x6475,INVALC,
0x6473,0x6477,INVALC,INVALC,INVALC,0x6478,INVALC,0x6470,
INVALC,0x6471,INVALC,0x646F,0x6476,INVALC,0x646E,0x646D,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,0x6474,0x683C,0x6842,INVALC,0x683D,
INVALC,0x6840,0x6844,INVALC,0x683F,INVALC,0x6837,INVALC,
0x6836,0x6843,0x683A,INVALC,0x6838,0x6841,0x6839,INVALC,
INVALC,INVALC,0x6834,0x6835,0x683E,INVALC,INVALC,INVALC,
0x683B,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6A7A,
0x6A7D,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
/* Block 157, Array index 0x4F00 */
INVALC,INVALC,INVALC,INVALC,INVALC,0x6A7B,0x6B23,0x6B21,
0x6A79,0x6B26,INVALC,0x6A78,INVALC,INVALC,0x6B22,INVALC,
INVALC,INVALC,0x6A7C,INVALC,0x6B25,INVALC,INVALC,0x6B24,
INVALC,INVALC,INVALC,INVALC,0x6C77,0x6C76,INVALC,INVALC,
INVALC,0x6C7D,INVALC,0x6C79,0x6C7C,INVALC,INVALC,INVALC,
0x6C7A,0x6C7B,INVALC,0x6C75,0x6C78,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6E61,0x6E5C,0x6E60,INVALC,0x6E63,0x6E5F,
INVALC,0x6E5B,INVALC,INVALC,0x6E5E,0x6E62,INVALC,0x6E59,
0x6A7E,0x6E5D,INVALC,INVALC,0x6E5A,INVALC,0x6E57,INVALC,
0x6E58,INVALC,0x6F68,0x6F6A,0x6F6D,0x6F69,0x6F6E,INVALC,
0x6F67,INVALC,0x6F65,INVALC,INVALC,0x6F6B,INVALC,INVALC,
0x6F66,0x6F6C,INVALC,INVALC,INVALC,INVALC,0x7068,INVALC,
0x7069,INVALC,0x7067,0x7064,INVALC,INVALC,0x7066,0x7065,
0x7149,INVALC,INVALC,INVALC,INVALC,0x714B,0x714A,INVALC,
INVALC,0x7169,INVALC,0x7168,0x7167,0x716A,INVALC,INVALC,
INVALC,0x7238,0x723C,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x4154,0x4873,
INVALC,INVALC,0x4871,INVALC,INVALC,0x4872,INVALC,INVALC,
INVALC,0x4F4A,0x4F4B,INVALC,INVALC,0x4F4C,INVALC,0x5633,
INVALC,0x5636,0x5630,0x5637,0x562F,0x5631,INVALC,0x5632,
/* Block 158, Array index 0x5000 */
0x5635,INVALC,INVALC,INVALC,0x563A,0x5639,INVALC,0x5634,
0x5638,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x5C38,INVALC,INVALC,INVALC,0x5C33,INVALC,INVALC,0x5C30,
0x5C36,0x5C39,INVALC,INVALC,INVALC,0x5C35,0x5C32,0x5C3A,
0x5C31,INVALC,0x5C37,INVALC,INVALC,0x5C2F,INVALC,INVALC,
INVALC,0x5C34,INVALC,INVALC,INVALC,0x6135,0x6128,0x6129,
0x612C,0x612A,INVALC,0x6124,INVALC,INVALC,0x6127,0x6131,
0x612B,INVALC,INVALC,INVALC,INVALC,0x6133,0x6130,INVALC,
0x6132,0x6125,0x612E,0x612F,INVALC,0x612D,INVALC,INVALC,
INVALC,INVALC,0x647C,0x647E,0x6523,INVALC,INVALC,0x647B,
INVALC,INVALC,0x6525,0x647A,0x6526,INVALC,0x6522,0x6524,
0x6528,0x6521,0x6529,0x647D,0x6479,INVALC,INVALC,0x6527,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,0x6126,
0x685E,0x6855,INVALC,0x6851,INVALC,INVALC,INVALC,0x685A,
0x6854,0x684A,INVALC,0x6857,0x6852,0x6853,INVALC,0x6845,
0x684C,0x685B,INVALC,0x6858,INVALC,0x6850,INVALC,0x685C,
0x684B,0x6846,0x6859,INVALC,0x6848,0x6856,0x684D,0x685D,
0x6849,INVALC,0x6847,0x684E,0x684F,INVALC,INVALC,INVALC,
0x6B2D,INVALC,0x6B2B,INVALC,0x6B30,INVALC,0x6B3C,0x6B33,
0x6B2C,0x6B28,0x6B35,0x6B2E,0x6B31,0x6B2A,0x6B38,0x6B27,
0x6B2F,0x6B34,0x6B36,0x6B39,0x6B29,INVALC,0x6B3D,0x6B3E,
0x6B37,0x6B3B,0x6B32,INVALC,0x6D2F,0x6D32,INVALC,INVALC,
INVALC,0x6D31,0x6D36,0x6D34,INVALC,0x6D2B,0x6D21,0x6C7E,
INVALC,0x6D2D,0x6D2E,0x6D2A,0x6D22,INVALC,0x6D27,0x6B3A,
INVALC,0x6D23,INVALC,0x6D29,INVALC,0x6D28,INVALC,0x6D24,
0x6D30,INVALC,0x6D25,0x6E68,0x6D33,0x6D35,0x6D2C,0x6D26,
0x6E69,0x6E6B,0x6E65,INVALC,INVALC,0x6E72,0x6E70,INVALC,
0x6E6F,0x6E6E,0x6E67,0x6E64,0x6E6A,0x6E73,0x6E66,0x6E6C,
INVALC,0x6F77,0x6F7C,0x6F72,0x6F75,INVALC,0x6F79,INVALC,
0x7022,0x6E6D,INVALC,0x6F73,0x6F7D,0x7023,0x6F78,0x6F71,
0x6F7B,INVALC,0x6F7A,0x7021,0x6F7E,0x6E71,0x6F76,0x6F70,
0x6F74,INVALC,INVALC,0x6F6F,INVALC,0x7074,0x706B,0x7073,
/* Block 159, Array index 0x5100 */
0x7070,0x7071,0x706A,0x706D,0x7075,0x706F,0x706E,0x706C,
INVALC,0x7072,INVALC,0x714C,INVALC,0x714D,INVALC,0x714F,
0x714E,0x7151,0x7150,0x716C,0x716B,0x7227,INVALC,0x7228,
INVALC,0x7234,INVALC,INVALC,INVALC,0x723D,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,0x6D37,INVALC,INVALC,INVALC,INVALC,INVALC,
0x4874,INVALC,INVALC,0x563B,INVALC,INVALC,0x5C3C,0x5C3D,
0x5C3B,0x6137,0x6136,INVALC,0x652B,0x6138,0x652A,INVALC,
INVALC,0x6860,INVALC,INVALC,0x685F,INVALC,INVALC,INVALC,
INVALC,0x6B3F,0x6B41,0x6B40,0x6D38,INVALC,INVALC,INVALC,
0x7076,0x7152,INVALC,INVALC,0x7241,INVALC,INVALC,0x4F4D,
INVALC,INVALC,INVALC,INVALC,INVALC,0x5C3F,0x5C3E,INVALC,
0x6139,INVALC,INVALC,INVALC,INVALC,INVALC,0x6E74,0x7239,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6861,INVALC,0x7024,INVALC,INVALC,INVALC,INVALC,INVALC,
0x613A,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x7025,INVALC,INVALC,0x563C,INVALC,0x5C40,0x5C41,INVALC,
INVALC,INVALC,0x613B,INVALC,INVALC,INVALC,INVALC,0x652C,
INVALC,INVALC,INVALC,INVALC,0x6B43,0x6B42,0x6B45,0x6B44,
INVALC,INVALC,INVALC,0x6D39,INVALC,0x6D3B,0x6D3A,INVALC,
0x6E75,INVALC,0x7026,0x7027,INVALC,0x7153,0x716D,INVALC,
INVALC,0x4155,0x5C42,0x613C,0x6862,0x4875,INVALC,0x613D,
/* Block 160, Array index 0x5200 */
0x652E,0x652D,INVALC,INVALC,INVALC,INVALC,0x7028,INVALC,
INVALC,0x7154,0x716E,INVALC,INVALC,INVALC,INVALC,0x563D,
0x563E,INVALC,0x5C43,INVALC,INVALC,INVALC,0x652F,INVALC,
0x6D3D,INVALC,0x6D3E,0x6D3C,0x7029,INVALC,0x7077,INVALC,
INVALC,INVALC,0x6140,0x613F,0x613E,0x6530,INVALC,INVALC,
0x6534,0x6533,0x6532,0x6531,INVALC,0x6863,0x6B47,INVALC,
0x6B46,0x6D3F,0x6E78,0x6E77,INVALC,0x6E76,0x702C,0x702B,
0x702A,INVALC,INVALC,INVALC,INVALC,0x5C44,INVALC,INVALC,
0x6864,0x6865,0x6E79,0x702D,INVALC,INVALC,0x7078,0x7155,
0x7229,0x7243,INVALC,INVALC,0x6535,0x6866,0x6D40,0x702E,
INVALC,INVALC,INVALC,INVALC,0x6141,0x6536,0x6867,0x6868,
0x6869,0x6B4C,INVALC,0x6B48,INVALC,0x6B4B,0x6B4A,INVALC,
0x6B49,INVALC,INVALC,INVALC,0x6D42,0x6D41,INVALC,INVALC,
INVALC,INVALC,INVALC,0x6E7A,INVALC,INVALC,0x7031,0x7032,
0x7030,0x702F,INVALC,INVALC,0x7079,0x707A,0x707B,INVALC,
0x7156,0x7159,0x7158,0x7157,INVALC,INVALC,0x7242,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,0x6B4D,0x6D43,INVALC,INVALC,0x6E7B,INVALC,INVALC,
0x7244,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
0x6142,INVALC,0x6E7C,INVALC,0x716F,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,
};
#endif /* ICONV_FROM_UCS_CCS_CNS11643_PLANE2 && !defined (TABLE_USE_SIZE_OPTIMIZATION) */
/*
* 16-bit UCS -> cns11643_plane2 size-optimized table (27768 bytes).
* ======================================================================
*/
#if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) \
&& (defined (TABLE_USE_SIZE_OPTIMIZATION))
static _CONST __uint16_t
from_ucs_size_cns11643_plane2[] =
{
0x027E, /* Ranges number */
0x0B48, /* Unranged codes number */
0x1FAC, /* First unranged code index */
/* Ranges list: first code, last Code, array index. */
/* Array index: 0x0003 */ 0x4F12, 0x4F14, 0x077D,
/* Array index: 0x0006 */ 0x4F74, 0x4F89, 0x0780,
/* Array index: 0x0009 */ 0x4F94, 0x4F9E, 0x0796,
/* Array index: 0x000C */ 0x4FB9, 0x4FBB, 0x07A1,
/* Array index: 0x000F */ 0x4FF4, 0x4FF7, 0x07A4,
/* Array index: 0x0012 */ 0x502F, 0x5037, 0x07A8,
/* Array index: 0x0015 */ 0x505B, 0x506B, 0x07B1,
/* Array index: 0x0018 */ 0x509B, 0x509E, 0x07C2,
/* Array index: 0x001B */ 0x50C6, 0x50CB, 0x07C6,
/* Array index: 0x001E */ 0x50FD, 0x50FF, 0x07CC,
/* Array index: 0x0021 */ 0x5106, 0x510C, 0x07CF,
/* Array index: 0x0024 */ 0x5122, 0x5126, 0x07D6,
/* Array index: 0x0027 */ 0x512D, 0x5135, 0x07DB,
/* Array index: 0x002A */ 0x5231, 0x5235, 0x07E4,
/* Array index: 0x002D */ 0x525E, 0x5262, 0x07E9,
/* Array index: 0x0030 */ 0x526B, 0x526E, 0x07EE,
/* Array index: 0x0033 */ 0x5278, 0x527C, 0x07F2,
/* Array index: 0x0036 */ 0x5296, 0x5299, 0x07F7,
/* Array index: 0x0039 */ 0x5309, 0x530B, 0x07FB,
/* Array index: 0x003C */ 0x5394, 0x5399, 0x07FE,
/* Array index: 0x003F */ 0x5460, 0x5467, 0x0804,
/* Array index: 0x0042 */ 0x547E, 0x5482, 0x080C,
/* Array index: 0x0045 */ 0x54A0, 0x54A2, 0x0811,
/* Array index: 0x0048 */ 0x5503, 0x5505, 0x0814,
/* Array index: 0x004B */ 0x5508, 0x5512, 0x0817,
/* Array index: 0x004E */ 0x5532, 0x5536, 0x0822,
/* Array index: 0x0051 */ 0x554D, 0x5552, 0x0827,
/* Array index: 0x0054 */ 0x5575, 0x5577, 0x082D,
/* Array index: 0x0057 */ 0x558C, 0x5595, 0x0830,
/* Array index: 0x005A */ 0x55A1, 0x55A8, 0x083A,
/* Array index: 0x005D */ 0x55BF, 0x55C4, 0x0842,
/* Array index: 0x0060 */ 0x55C8, 0x55D6, 0x0848,
/* Array index: 0x0063 */ 0x563D, 0x564C, 0x0857,
/* Array index: 0x0066 */ 0x567E, 0x5686, 0x0867,
/* Array index: 0x0069 */ 0x5697, 0x569D, 0x0870,
/* Array index: 0x006C */ 0x56A6, 0x56AD, 0x0877,
/* Array index: 0x006F */ 0x571A, 0x5723, 0x087F,
/* Array index: 0x0072 */ 0x576D, 0x5776, 0x0889,
/* Array index: 0x0075 */ 0x5794, 0x579F, 0x0893,
/* Array index: 0x0078 */ 0x57B5, 0x57C1, 0x089F,
/* Array index: 0x007B */ 0x57E1, 0x5801, 0x08AC,
/* Array index: 0x007E */ 0x5807, 0x5810, 0x08CD,
/* Array index: 0x0081 */ 0x5825, 0x582E, 0x08D7,
/* Array index: 0x0084 */ 0x5832, 0x583F, 0x08E1,
/* Array index: 0x0087 */ 0x584D, 0x584F, 0x08EF,
/* Array index: 0x008A */ 0x5863, 0x5865, 0x08F2,
/* Array index: 0x008D */ 0x587A, 0x587C, 0x08F5,
/* Array index: 0x0090 */ 0x5886, 0x5891, 0x08F8,
/* Array index: 0x0093 */ 0x590C, 0x590E, 0x0904,
/* Array index: 0x0096 */ 0x5970, 0x5972, 0x0907,
/* Array index: 0x0099 */ 0x597B, 0x5980, 0x090A,
/* Array index: 0x009C */ 0x598E, 0x5990, 0x0910,
/* Array index: 0x009F */ 0x59A0, 0x59A2, 0x0913,
/* Array index: 0x00A2 */ 0x59B1, 0x59B6, 0x0916,
/* Array index: 0x00A5 */ 0x59DD, 0x59E1, 0x091C,
/* Array index: 0x00A8 */ 0x59ED, 0x59F7, 0x0921,
/* Array index: 0x00AB */ 0x59FA, 0x5A00, 0x092C,
/* Array index: 0x00AE */ 0x5A15, 0x5A19, 0x0933,
/* Array index: 0x00B1 */ 0x5A35, 0x5A39, 0x0938,
/* Array index: 0x00B4 */ 0x5A42, 0x5A48, 0x093D,
/* Array index: 0x00B7 */ 0x5A4C, 0x5A60, 0x0944,
/* Array index: 0x00BA */ 0x5A78, 0x5A7D, 0x0959,
/* Array index: 0x00BD */ 0x5A8A, 0x5A97, 0x095F,
/* Array index: 0x00C0 */ 0x5A9C, 0x5A9F, 0x096D,
/* Array index: 0x00C3 */ 0x5AAC, 0x5ABB, 0x0971,
/* Array index: 0x00C6 */ 0x5AC4, 0x5ACD, 0x0981,
/* Array index: 0x00C9 */ 0x5AD9, 0x5AE2, 0x098B,
/* Array index: 0x00CC */ 0x5AE8, 0x5AEE, 0x0995,
/* Array index: 0x00CF */ 0x5AF3, 0x5AF9, 0x099C,
/* Array index: 0x00D2 */ 0x5AFF, 0x5B07, 0x09A3,
/* Array index: 0x00D5 */ 0x5B13, 0x5B1B, 0x09AC,
/* Array index: 0x00D8 */ 0x5B23, 0x5B2F, 0x09B5,
/* Array index: 0x00DB */ 0x5B3C, 0x5B3F, 0x09C2,
/* Array index: 0x00DE */ 0x5B47, 0x5B4E, 0x09C6,
/* Array index: 0x00E1 */ 0x5BCA, 0x5BCE, 0x09CE,
/* Array index: 0x00E4 */ 0x5C7A, 0x5C7E, 0x09D3,
/* Array index: 0x00E7 */ 0x5C86, 0x5C95, 0x09D8,
/* Array index: 0x00EA */ 0x5C9F, 0x5CB0, 0x09E8,
/* Array index: 0x00ED */ 0x5CC6, 0x5CDF, 0x09FA,
/* Array index: 0x00F0 */ 0x5CF7, 0x5CF9, 0x0A14,
/* Array index: 0x00F3 */ 0x5D0B, 0x5D0F, 0x0A17,
/* Array index: 0x00F6 */ 0x5D1D, 0x5D20, 0x0A1C,
/* Array index: 0x00F9 */ 0x5D2E, 0x5D4B, 0x0A20,
/* Array index: 0x00FC */ 0x5D79, 0x5D82, 0x0A3E,
/* Array index: 0x00FF */ 0x5D86, 0x5D8A, 0x0A48,
/* Array index: 0x0102 */ 0x5D9C, 0x5DA2, 0x0A4D,
/* Array index: 0x0105 */ 0x5DA7, 0x5DB7, 0x0A54,
/* Array index: 0x0108 */ 0x5E20, 0x5E24, 0x0A65,
/* Array index: 0x010B */ 0x5E4A, 0x5E4F, 0x0A6A,
/* Array index: 0x010E */ 0x5E66, 0x5E70, 0x0A70,
/* Array index: 0x0111 */ 0x5E88, 0x5E8D, 0x0A7B,
/* Array index: 0x0114 */ 0x5EA2, 0x5EA5, 0x0A81,
/* Array index: 0x0117 */ 0x5EAE, 0x5EB4, 0x0A85,
/* Array index: 0x011A */ 0x5EC5, 0x5EC7, 0x0A8C,
/* Array index: 0x011D */ 0x5ED1, 0x5EDE, 0x0A8F,
/* Array index: 0x0120 */ 0x5EE5, 0x5EE9, 0x0A9D,
/* Array index: 0x0123 */ 0x5EEE, 0x5EF2, 0x0AA2,
/* Array index: 0x0126 */ 0x5F22, 0x5F24, 0x0AA7,
/* Array index: 0x0129 */ 0x5FBB, 0x5FC1, 0x0AAA,
/* Array index: 0x012C */ 0x5FCF, 0x5FD5, 0x0AB1,
/* Array index: 0x012F */ 0x5FE1, 0x5FE5, 0x0AB8,
/* Array index: 0x0132 */ 0x5FED, 0x5FEF, 0x0ABD,
/* Array index: 0x0135 */ 0x6009, 0x6013, 0x0AC0,
/* Array index: 0x0138 */ 0x602C, 0x6034, 0x0ACB,
/* Array index: 0x013B */ 0x6040, 0x6049, 0x0AD4,
/* Array index: 0x013E */ 0x605A, 0x605F, 0x0ADE,
/* Array index: 0x0141 */ 0x6086, 0x608A, 0x0AE4,
/* Array index: 0x0144 */ 0x609B, 0x609D, 0x0AE9,
/* Array index: 0x0147 */ 0x60BE, 0x60CF, 0x0AEC,
/* Array index: 0x014A */ 0x6103, 0x6105, 0x0AFE,
/* Array index: 0x014D */ 0x6128, 0x612F, 0x0B01,
/* Array index: 0x0150 */ 0x6152, 0x6156, 0x0B09,
/* Array index: 0x0153 */ 0x6171, 0x6174, 0x0B0E,
/* Array index: 0x0156 */ 0x6189, 0x618D, 0x0B12,
/* Array index: 0x0159 */ 0x61AD, 0x61B5, 0x0B17,
/* Array index: 0x015C */ 0x61DE, 0x61E0, 0x0B20,
/* Array index: 0x015F */ 0x61E4, 0x61F1, 0x0B23,
/* Array index: 0x0162 */ 0x6223, 0x622D, 0x0B31,
/* Array index: 0x0165 */ 0x625E, 0x6266, 0x0B3C,
/* Array index: 0x0168 */ 0x6270, 0x6274, 0x0B45,
/* Array index: 0x016B */ 0x62A9, 0x62B8, 0x0B4A,
/* Array index: 0x016E */ 0x62F5, 0x62FB, 0x0B5A,
/* Array index: 0x0171 */ 0x630B, 0x6315, 0x0B61,
/* Array index: 0x0174 */ 0x6332, 0x633C, 0x0B6C,
/* Array index: 0x0177 */ 0x6340, 0x634B, 0x0B77,
/* Array index: 0x017A */ 0x6354, 0x635A, 0x0B83,
/* Array index: 0x017D */ 0x636D, 0x6370, 0x0B8A,
/* Array index: 0x0180 */ 0x638D, 0x6391, 0x0B8E,
/* Array index: 0x0183 */ 0x639C, 0x639F, 0x0B93,
/* Array index: 0x0186 */ 0x63AB, 0x63B1, 0x0B97,
/* Array index: 0x0189 */ 0x63C2, 0x63CE, 0x0B9E,
/* Array index: 0x018C */ 0x63D5, 0x63E0, 0x0BAB,
/* Array index: 0x018F */ 0x63E4, 0x63E8, 0x0BB7,
/* Array index: 0x0192 */ 0x63EF, 0x63F6, 0x0BBC,
/* Array index: 0x0195 */ 0x6409, 0x6412, 0x0BC4,
/* Array index: 0x0198 */ 0x641F, 0x6428, 0x0BCE,
/* Array index: 0x019B */ 0x642E, 0x6430, 0x0BD8,
/* Array index: 0x019E */ 0x643F, 0x6443, 0x0BDB,
/* Array index: 0x01A1 */ 0x6459, 0x6461, 0x0BE0,
/* Array index: 0x01A4 */ 0x6470, 0x6477, 0x0BE9,
/* Array index: 0x01A7 */ 0x6489, 0x648C, 0x0BF1,
/* Array index: 0x01AA */ 0x6496, 0x6498, 0x0BF5,
/* Array index: 0x01AD */ 0x649C, 0x64A0, 0x0BF8,
/* Array index: 0x01B0 */ 0x650C, 0x6510, 0x0BFD,
/* Array index: 0x01B3 */ 0x6513, 0x6517, 0x0C02,
/* Array index: 0x01B6 */ 0x6520, 0x6526, 0x0C07,
/* Array index: 0x01B9 */ 0x6564, 0x656A, 0x0C0E,
/* Array index: 0x01BC */ 0x6579, 0x6581, 0x0C15,
/* Array index: 0x01BF */ 0x65C2, 0x65C6, 0x0C1E,
/* Array index: 0x01C2 */ 0x65DA, 0x65E1, 0x0C23,
/* Array index: 0x01C5 */ 0x65EE, 0x65F5, 0x0C2B,
/* Array index: 0x01C8 */ 0x65FB, 0x65FD, 0x0C33,
/* Array index: 0x01CB */ 0x6603, 0x6612, 0x0C36,
/* Array index: 0x01CE */ 0x6632, 0x663A, 0x0C46,
/* Array index: 0x01D1 */ 0x6678, 0x667C, 0x0C4F,
/* Array index: 0x01D4 */ 0x668A, 0x668C, 0x0C54,
/* Array index: 0x01D7 */ 0x669F, 0x66A1, 0x0C57,
/* Array index: 0x01DA */ 0x66BA, 0x66C0, 0x0C5A,
/* Array index: 0x01DD */ 0x66C8, 0x66CC, 0x0C61,
/* Array index: 0x01E0 */ 0x670F, 0x6713, 0x0C66,
/* Array index: 0x01E3 */ 0x6720, 0x6723, 0x0C6B,
/* Array index: 0x01E6 */ 0x6738, 0x673F, 0x0C6F,
/* Array index: 0x01E9 */ 0x6747, 0x674D, 0x0C77,
/* Array index: 0x01EC */ 0x6776, 0x677D, 0x0C7E,
/* Array index: 0x01EF */ 0x6781, 0x6786, 0x0C86,
/* Array index: 0x01F2 */ 0x678C, 0x6794, 0x0C8C,
/* Array index: 0x01F5 */ 0x67B7, 0x67BB, 0x0C95,
/* Array index: 0x01F8 */ 0x67C0, 0x67CE, 0x0C9A,
/* Array index: 0x01FB */ 0x67E3, 0x67FC, 0x0CA9,
/* Array index: 0x01FE */ 0x681C, 0x6820, 0x0CC3,
/* Array index: 0x0201 */ 0x682B, 0x6835, 0x0CC8,
/* Array index: 0x0204 */ 0x684B, 0x684F, 0x0CD3,
/* Array index: 0x0207 */ 0x686B, 0x6880, 0x0CD8,
/* Array index: 0x020A */ 0x6887, 0x6892, 0x0CEE,
/* Array index: 0x020D */ 0x68A9, 0x68AE, 0x0CFA,
/* Array index: 0x0210 */ 0x68C6, 0x68C8, 0x0D00,
/* Array index: 0x0213 */ 0x68D0, 0x68D6, 0x0D03,
/* Array index: 0x0216 */ 0x68DC, 0x68DE, 0x0D0A,
/* Array index: 0x0219 */ 0x68E6, 0x68F8, 0x0D0D,
/* Array index: 0x021C */ 0x6904, 0x6917, 0x0D20,
/* Array index: 0x021F */ 0x6932, 0x6959, 0x0D34,
/* Array index: 0x0222 */ 0x696F, 0x6971, 0x0D5C,
/* Array index: 0x0225 */ 0x698D, 0x699A, 0x0D5F,
/* Array index: 0x0228 */ 0x69AF, 0x69B6, 0x0D6D,
/* Array index: 0x022B */ 0x69BC, 0x69BF, 0x0D75,
/* Array index: 0x022E */ 0x69E2, 0x69E7, 0x0D79,
/* Array index: 0x0231 */ 0x69F4, 0x6A00, 0x0D7F,
/* Array index: 0x0234 */ 0x6A04, 0x6A09, 0x0D8C,
/* Array index: 0x0237 */ 0x6A14, 0x6A18, 0x0D92,
/* Array index: 0x023A */ 0x6A25, 0x6A28, 0x0D97,
/* Array index: 0x023D */ 0x6A3B, 0x6A41, 0x0D9B,
/* Array index: 0x0240 */ 0x6A4D, 0x6A56, 0x0DA2,
/* Array index: 0x0243 */ 0x6A5A, 0x6A60, 0x0DAC,
/* Array index: 0x0246 */ 0x6A64, 0x6A6A, 0x0DB3,
/* Array index: 0x0249 */ 0x6A8C, 0x6A96, 0x0DBA,
/* Array index: 0x024C */ 0x6AA4, 0x6AA8, 0x0DC5,
/* Array index: 0x024F */ 0x6AB6, 0x6ABA, 0x0DCA,
/* Array index: 0x0252 */ 0x6AC5, 0x6AD1, 0x0DCF,
/* Array index: 0x0255 */ 0x6ADC, 0x6AE1, 0x0DDC,
/* Array index: 0x0258 */ 0x6AE7, 0x6AF3, 0x0DE2,
/* Array index: 0x025B */ 0x6B0F, 0x6B1A, 0x0DEF,
/* Array index: 0x025E */ 0x6B33, 0x6B3C, 0x0DFB,
/* Array index: 0x0261 */ 0x6B3F, 0x6B4D, 0x0E05,
/* Array index: 0x0264 */ 0x6B54, 0x6B56, 0x0E14,
/* Array index: 0x0267 */ 0x6B8C, 0x6BAD, 0x0E17,
/* Array index: 0x026A */ 0x6BC3, 0x6BCC, 0x0E39,
/* Array index: 0x026D */ 0x6BE0, 0x6BE8, 0x0E43,
/* Array index: 0x0270 */ 0x6BF7, 0x6C06, 0x0E4C,
/* Array index: 0x0273 */ 0x6C09, 0x6C0D, 0x0E5C,
/* Array index: 0x0276 */ 0x6C14, 0x6C1A, 0x0E61,
/* Array index: 0x0279 */ 0x6C4A, 0x6C4C, 0x0E68,
/* Array index: 0x027C */ 0x6C65, 0x6C73, 0x0E6B,
/* Array index: 0x027F */ 0x6CCD, 0x6CD4, 0x0E7A,
/* Array index: 0x0282 */ 0x6CE9, 0x6CEE, 0x0E82,
/* Array index: 0x0285 */ 0x6D00, 0x6D0A, 0x0E88,
/* Array index: 0x0288 */ 0x6D0D, 0x6D12, 0x0E93,
/* Array index: 0x028B */ 0x6D16, 0x6D1A, 0x0E99,
/* Array index: 0x028E */ 0x6D2C, 0x6D34, 0x0E9E,
/* Array index: 0x0291 */ 0x6D5E, 0x6D68, 0x0EA7,
/* Array index: 0x0294 */ 0x6D7A, 0x6D86, 0x0EB2,
/* Array index: 0x0297 */ 0x6D90, 0x6D92, 0x0EBF,
/* Array index: 0x029A */ 0x6DBA, 0x6DC2, 0x0EC2,
/* Array index: 0x029D */ 0x6DC8, 0x6DCA, 0x0ECB,
/* Array index: 0x02A0 */ 0x6DCF, 0x6DE5, 0x0ECE,
/* Array index: 0x02A3 */ 0x6E39, 0x6E4B, 0x0EE5,
/* Array index: 0x02A6 */ 0x6E51, 0x6E55, 0x0EF8,
/* Array index: 0x02A9 */ 0x6E5A, 0x6E68, 0x0EFD,
/* Array index: 0x02AC */ 0x6E73, 0x6E79, 0x0F0C,
/* Array index: 0x02AF */ 0x6E8D, 0x6E94, 0x0F13,
/* Array index: 0x02B2 */ 0x6E9E, 0x6EA6, 0x0F1B,
/* Array index: 0x02B5 */ 0x6EAE, 0x6EB3, 0x0F24,
/* Array index: 0x02B8 */ 0x6EBD, 0x6EC3, 0x0F2A,
/* Array index: 0x02BB */ 0x6EC6, 0x6ED2, 0x0F31,
/* Array index: 0x02BE */ 0x6EF5, 0x6EFD, 0x0F3E,
/* Array index: 0x02C1 */ 0x6F05, 0x6F0E, 0x0F47,
/* Array index: 0x02C4 */ 0x6F18, 0x6F27, 0x0F51,
/* Array index: 0x02C7 */ 0x6F35, 0x6F3C, 0x0F61,
/* Array index: 0x02CA */ 0x6F4E, 0x6F57, 0x0F69,
/* Array index: 0x02CD */ 0x6F5D, 0x6F63, 0x0F73,
/* Array index: 0x02D0 */ 0x6F67, 0x6F6C, 0x0F7A,
/* Array index: 0x02D3 */ 0x6F7B, 0x6F7F, 0x0F80,
/* Array index: 0x02D6 */ 0x6F89, 0x6F8D, 0x0F85,
/* Array index: 0x02D9 */ 0x6F90, 0x6F96, 0x0F8A,
/* Array index: 0x02DC */ 0x6FA8, 0x6FB2, 0x0F91,
/* Array index: 0x02DF */ 0x6FC4, 0x6FCF, 0x0F9C,
/* Array index: 0x02E2 */ 0x6FDC, 0x6FDE, 0x0FA8,
/* Array index: 0x02E5 */ 0x6FE2, 0x6FE8, 0x0FAB,
/* Array index: 0x02E8 */ 0x6FFB, 0x7007, 0x0FB2,
/* Array index: 0x02EB */ 0x700A, 0x700E, 0x0FBF,
/* Array index: 0x02EE */ 0x7020, 0x702B, 0x0FC4,
/* Array index: 0x02F1 */ 0x7031, 0x704A, 0x0FD0,
/* Array index: 0x02F4 */ 0x7055, 0x706A, 0x0FEA,
/* Array index: 0x02F7 */ 0x7082, 0x7086, 0x1000,
/* Array index: 0x02FA */ 0x70C5, 0x70C7, 0x1005,
/* Array index: 0x02FD */ 0x70CD, 0x70D4, 0x1008,
/* Array index: 0x0300 */ 0x70DA, 0x70E2, 0x1010,
/* Array index: 0x0303 */ 0x70F3, 0x7106, 0x1019,
/* Array index: 0x0306 */ 0x710B, 0x7110, 0x102D,
/* Array index: 0x0309 */ 0x711E, 0x7125, 0x1033,
/* Array index: 0x030C */ 0x712E, 0x7132, 0x103B,
/* Array index: 0x030F */ 0x7141, 0x7144, 0x1040,
/* Array index: 0x0312 */ 0x7150, 0x7154, 0x1044,
/* Array index: 0x0315 */ 0x715D, 0x7163, 0x1049,
/* Array index: 0x0318 */ 0x7180, 0x7189, 0x1050,
/* Array index: 0x031B */ 0x719A, 0x71AA, 0x105A,
/* Array index: 0x031E */ 0x71AF, 0x71B5, 0x106B,
/* Array index: 0x0321 */ 0x71BC, 0x71CB, 0x1072,
/* Array index: 0x0324 */ 0x71F0, 0x71F2, 0x1082,
/* Array index: 0x0327 */ 0x71FF, 0x7207, 0x1085,
/* Array index: 0x032A */ 0x7219, 0x7229, 0x108E,
/* Array index: 0x032D */ 0x7249, 0x724B, 0x109F,
/* Array index: 0x0330 */ 0x7276, 0x727F, 0x10A2,
/* Array index: 0x0333 */ 0x7285, 0x729E, 0x10AC,
/* Array index: 0x0336 */ 0x72A1, 0x72AA, 0x10C6,
/* Array index: 0x0339 */ 0x72C5, 0x72CC, 0x10D0,
/* Array index: 0x033C */ 0x72FA, 0x7301, 0x10D8,
/* Array index: 0x033F */ 0x7307, 0x730C, 0x10E0,
/* Array index: 0x0342 */ 0x7330, 0x7335, 0x10E6,
/* Array index: 0x0345 */ 0x733A, 0x733C, 0x10EC,
/* Array index: 0x0348 */ 0x7349, 0x734D, 0x10EF,
/* Array index: 0x034B */ 0x7358, 0x736F, 0x10F4,
/* Array index: 0x034E */ 0x737C, 0x7385, 0x110C,
/* Array index: 0x0351 */ 0x7392, 0x7397, 0x1116,
/* Array index: 0x0354 */ 0x73A0, 0x73A6, 0x111C,
/* Array index: 0x0357 */ 0x73B4, 0x73B9, 0x1123,
/* Array index: 0x035A */ 0x73C2, 0x73CC, 0x1129,
/* Array index: 0x035D */ 0x73D2, 0x73DD, 0x1134,
/* Array index: 0x0360 */ 0x73E5, 0x73EB, 0x1140,
/* Array index: 0x0363 */ 0x73F4, 0x7401, 0x1147,
/* Array index: 0x0366 */ 0x7420, 0x7424, 0x1155,
/* Array index: 0x0369 */ 0x7429, 0x7432, 0x115A,
/* Array index: 0x036C */ 0x744A, 0x7454, 0x1164,
/* Array index: 0x036F */ 0x7471, 0x7475, 0x116F,
/* Array index: 0x0372 */ 0x7485, 0x748A, 0x1174,
/* Array index: 0x0375 */ 0x74B1, 0x74BB, 0x117A,
/* Array index: 0x0378 */ 0x74BE, 0x74C5, 0x1185,
/* Array index: 0x037B */ 0x74D5, 0x74E1, 0x118D,
/* Array index: 0x037E */ 0x74FB, 0x7503, 0x119A,
/* Array index: 0x0381 */ 0x750F, 0x7517, 0x11A3,
/* Array index: 0x0384 */ 0x753E, 0x7540, 0x11AC,
/* Array index: 0x0387 */ 0x75BF, 0x75C1, 0x11AF,
/* Array index: 0x038A */ 0x75CB, 0x75D2, 0x11B2,
/* Array index: 0x038D */ 0x75F5, 0x75FE, 0x11BA,
/* Array index: 0x0390 */ 0x760F, 0x761E, 0x11C4,
/* Array index: 0x0393 */ 0x762D, 0x7635, 0x11D4,
/* Array index: 0x0396 */ 0x7647, 0x7649, 0x11DD,
/* Array index: 0x0399 */ 0x7699, 0x769E, 0x11E0,
/* Array index: 0x039C */ 0x7703, 0x7705, 0x11E6,
/* Array index: 0x039F */ 0x7710, 0x771D, 0x11E9,
/* Array index: 0x03A2 */ 0x772F, 0x7735, 0x11F7,
/* Array index: 0x03A5 */ 0x7744, 0x774E, 0x11FE,
/* Array index: 0x03A8 */ 0x7752, 0x775A, 0x1209,
/* Array index: 0x03AB */ 0x776D, 0x776F, 0x1212,
/* Array index: 0x03AE */ 0x777E, 0x7789, 0x1215,
/* Array index: 0x03B1 */ 0x7797, 0x77A3, 0x1221,
/* Array index: 0x03B4 */ 0x77B1, 0x77B7, 0x122E,
/* Array index: 0x03B7 */ 0x77C9, 0x77D0, 0x1235,
/* Array index: 0x03BA */ 0x77F0, 0x77F2, 0x123D,
/* Array index: 0x03BD */ 0x77F7, 0x77FC, 0x1240,
/* Array index: 0x03C0 */ 0x780E, 0x7813, 0x1246,
/* Array index: 0x03C3 */ 0x7821, 0x7823, 0x124C,
/* Array index: 0x03C6 */ 0x7826, 0x7835, 0x124F,
/* Array index: 0x03C9 */ 0x7848, 0x784D, 0x125F,
/* Array index: 0x03CC */ 0x7864, 0x7871, 0x1265,
/* Array index: 0x03CF */ 0x7883, 0x7887, 0x1273,
/* Array index: 0x03D2 */ 0x7894, 0x789A, 0x1278,
/* Array index: 0x03D5 */ 0x789E, 0x78A5, 0x127F,
/* Array index: 0x03D8 */ 0x78A8, 0x78AD, 0x1287,
/* Array index: 0x03DB */ 0x78C8, 0x78D1, 0x128D,
/* Array index: 0x03DE */ 0x78DB, 0x78E5, 0x1297,
/* Array index: 0x03E1 */ 0x78F9, 0x78FF, 0x12A2,
/* Array index: 0x03E4 */ 0x7910, 0x7914, 0x12A9,
/* Array index: 0x03E7 */ 0x791B, 0x791E, 0x12AE,
/* Array index: 0x03EA */ 0x7921, 0x7929, 0x12B2,
/* Array index: 0x03ED */ 0x794A, 0x794C, 0x12BB,
/* Array index: 0x03F0 */ 0x794F, 0x7954, 0x12BE,
/* Array index: 0x03F3 */ 0x7967, 0x796B, 0x12C4,
/* Array index: 0x03F6 */ 0x7970, 0x7974, 0x12C9,
/* Array index: 0x03F9 */ 0x7990, 0x79A4, 0x12CE,
/* Array index: 0x03FC */ 0x79AB, 0x79AD, 0x12E3,
/* Array index: 0x03FF */ 0x79B4, 0x79B8, 0x12E6,
/* Array index: 0x0402 */ 0x79CD, 0x79CF, 0x12EB,
/* Array index: 0x0405 */ 0x79DC, 0x79E0, 0x12EE,
/* Array index: 0x0408 */ 0x79EA, 0x79EE, 0x12F3,
/* Array index: 0x040B */ 0x79F6, 0x79FA, 0x12F8,
/* Array index: 0x040E */ 0x7A02, 0x7A04, 0x12FD,
/* Array index: 0x0411 */ 0x7A10, 0x7A1B, 0x1300,
/* Array index: 0x0414 */ 0x7A58, 0x7A5C, 0x130C,
/* Array index: 0x0417 */ 0x7A6C, 0x7A71, 0x1311,
/* Array index: 0x041A */ 0x7A85, 0x7A90, 0x1317,
/* Array index: 0x041D */ 0x7AB1, 0x7AB8, 0x1323,
/* Array index: 0x0420 */ 0x7B04, 0x7B13, 0x132B,
/* Array index: 0x0423 */ 0x7B22, 0x7B25, 0x133B,
/* Array index: 0x0426 */ 0x7B2D, 0x7B35, 0x133F,
/* Array index: 0x0429 */ 0x7B44, 0x7B4E, 0x1348,
/* Array index: 0x042C */ 0x7B61, 0x7B66, 0x1353,
/* Array index: 0x042F */ 0x7B70, 0x7B78, 0x1359,
/* Array index: 0x0432 */ 0x7B8A, 0x7B91, 0x1362,
/* Array index: 0x0435 */ 0x7B98, 0x7B9C, 0x136A,
/* Array index: 0x0438 */ 0x7BDA, 0x7BEB, 0x136F,
/* Array index: 0x043B */ 0x7BF0, 0x7BF4, 0x1381,
/* Array index: 0x043E */ 0x7BFD, 0x7C10, 0x1386,
/* Array index: 0x0441 */ 0x7C1C, 0x7C2D, 0x139A,
/* Array index: 0x0444 */ 0x7C45, 0x7C4A, 0x13AC,
/* Array index: 0x0447 */ 0x7C57, 0x7C5C, 0x13B2,
/* Array index: 0x044A */ 0x7C66, 0x7C6B, 0x13B8,
/* Array index: 0x044D */ 0x7C78, 0x7C7A, 0x13BE,
/* Array index: 0x0450 */ 0x7C7F, 0x7C85, 0x13C1,
/* Array index: 0x0453 */ 0x7CA1, 0x7CA3, 0x13C8,
/* Array index: 0x0456 */ 0x7CBA, 0x7CBC, 0x13CB,
/* Array index: 0x0459 */ 0x7CD0, 0x7CD4, 0x13CE,
/* Array index: 0x045C */ 0x7D0E, 0x7D13, 0x13D3,
/* Array index: 0x045F */ 0x7D1D, 0x7D1F, 0x13D9,
/* Array index: 0x0462 */ 0x7D3A, 0x7D41, 0x13DC,
/* Array index: 0x0465 */ 0x7D4E, 0x7D58, 0x13E4,
/* Array index: 0x0468 */ 0x7D67, 0x7D6F, 0x13EF,
/* Array index: 0x046B */ 0x7D7A, 0x7D8E, 0x13F8,
/* Array index: 0x046E */ 0x7DA6, 0x7DAA, 0x140D,
/* Array index: 0x0471 */ 0x7DC0, 0x7DC6, 0x1412,
/* Array index: 0x0474 */ 0x7E0B, 0x7E17, 0x1419,
/* Array index: 0x0477 */ 0x7E1F, 0x7E25, 0x1426,
/* Array index: 0x047A */ 0x7E38, 0x7E3C, 0x142D,
/* Array index: 0x047D */ 0x7E56, 0x7E58, 0x1432,
/* Array index: 0x0480 */ 0x7E5F, 0x7E63, 0x1435,
/* Array index: 0x0483 */ 0x7E72, 0x7E7B, 0x143A,
/* Array index: 0x0486 */ 0x7E86, 0x7E8D, 0x1444,
/* Array index: 0x0489 */ 0x7E95, 0x7E9B, 0x144C,
/* Array index: 0x048C */ 0x7F5B, 0x7F6D, 0x1453,
/* Array index: 0x048F */ 0x7F7A, 0x7F7F, 0x1466,
/* Array index: 0x0492 */ 0x7F9B, 0x7FA7, 0x146C,
/* Array index: 0x0495 */ 0x7FC7, 0x7FD1, 0x1479,
/* Array index: 0x0498 */ 0x7FE2, 0x7FEF, 0x1484,
/* Array index: 0x049B */ 0x7FF4, 0x7FF8, 0x1492,
/* Array index: 0x049E */ 0x7FFD, 0x7FFF, 0x1497,
/* Array index: 0x04A1 */ 0x804F, 0x8051, 0x149A,
/* Array index: 0x04A4 */ 0x80C5, 0x80CA, 0x149D,
/* Array index: 0x04A7 */ 0x80CD, 0x80D9, 0x14A3,
/* Array index: 0x04AA */ 0x80F9, 0x80FB, 0x14B0,
/* Array index: 0x04AD */ 0x811B, 0x8122, 0x14B3,
/* Array index: 0x04B0 */ 0x815E, 0x8164, 0x14BB,
/* Array index: 0x04B3 */ 0x8189, 0x818D, 0x14C2,
/* Array index: 0x04B6 */ 0x81AE, 0x81BC, 0x14C7,
/* Array index: 0x04B9 */ 0x81D0, 0x81D2, 0x14D6,
/* Array index: 0x04BC */ 0x81DD, 0x81E1, 0x14D9,
/* Array index: 0x04BF */ 0x81F7, 0x81F9, 0x14DE,
/* Array index: 0x04C2 */ 0x8232, 0x8234, 0x14E1,
/* Array index: 0x04C5 */ 0x823C, 0x8245, 0x14E4,
/* Array index: 0x04C8 */ 0x824E, 0x8264, 0x14EE,
/* Array index: 0x04CB */ 0x8268, 0x826D, 0x1505,
/* Array index: 0x04CE */ 0x827C, 0x8285, 0x150B,
/* Array index: 0x04D1 */ 0x828E, 0x8294, 0x1515,
/* Array index: 0x04D4 */ 0x829E, 0x82AB, 0x151C,
/* Array index: 0x04D7 */ 0x82B4, 0x82B6, 0x152A,
/* Array index: 0x04DA */ 0x82E8, 0x82ED, 0x152D,
/* Array index: 0x04DD */ 0x82F0, 0x82FB, 0x1533,
/* Array index: 0x04E0 */ 0x8322, 0x832F, 0x153F,
/* Array index: 0x04E3 */ 0x833A, 0x833C, 0x154D,
/* Array index: 0x04E6 */ 0x8341, 0x834E, 0x1550,
/* Array index: 0x04E9 */ 0x8373, 0x8376, 0x155E,
/* Array index: 0x04EC */ 0x837D, 0x8383, 0x1562,
/* Array index: 0x04EF */ 0x8387, 0x8390, 0x1569,
/* Array index: 0x04F2 */ 0x8397, 0x839D, 0x1573,
/* Array index: 0x04F5 */ 0x83A3, 0x83B0, 0x157A,
/* Array index: 0x04F8 */ 0x83BF, 0x83EE, 0x1588,
/* Array index: 0x04FB */ 0x83F5, 0x8401, 0x15B8,
/* Array index: 0x04FE */ 0x840F, 0x8413, 0x15C5,
/* Array index: 0x0501 */ 0x842F, 0x843B, 0x15CA,
/* Array index: 0x0504 */ 0x843F, 0x8460, 0x15D7,
/* Array index: 0x0507 */ 0x846E, 0x847E, 0x15F9,
/* Array index: 0x050A */ 0x848D, 0x8491, 0x160A,
/* Array index: 0x050D */ 0x8497, 0x84B1, 0x160F,
/* Array index: 0x0510 */ 0x84B9, 0x84BB, 0x162A,
/* Array index: 0x0513 */ 0x84CC, 0x84D7, 0x162D,
/* Array index: 0x0516 */ 0x84E7, 0x8502, 0x1639,
/* Array index: 0x0519 */ 0x8507, 0x850F, 0x1655,
/* Array index: 0x051C */ 0x8515, 0x8520, 0x165E,
/* Array index: 0x051F */ 0x8524, 0x8531, 0x166A,
/* Array index: 0x0522 */ 0x8540, 0x8547, 0x1678,
/* Array index: 0x0525 */ 0x8551, 0x8558, 0x1680,
/* Array index: 0x0528 */ 0x8560, 0x8567, 0x1688,
/* Array index: 0x052B */ 0x8575, 0x8590, 0x1690,
/* Array index: 0x052E */ 0x8595, 0x85A4, 0x16AC,
/* Array index: 0x0531 */ 0x85B1, 0x85B8, 0x16BC,
/* Array index: 0x0534 */ 0x85BD, 0x85C8, 0x16C4,
/* Array index: 0x0537 */ 0x85D7, 0x85E3, 0x16D0,
/* Array index: 0x053A */ 0x85EB, 0x85F2, 0x16DD,
/* Array index: 0x053D */ 0x85FD, 0x8605, 0x16E5,
/* Array index: 0x0540 */ 0x8618, 0x8640, 0x16EE,
/* Array index: 0x0543 */ 0x8646, 0x864D, 0x1717,
/* Array index: 0x0546 */ 0x8661, 0x8674, 0x171F,
/* Array index: 0x0549 */ 0x8685, 0x8687, 0x1733,
/* Array index: 0x054C */ 0x868D, 0x86A2, 0x1736,
/* Array index: 0x054F */ 0x86B3, 0x86C5, 0x174C,
/* Array index: 0x0552 */ 0x86D6, 0x86DD, 0x175F,
/* Array index: 0x0555 */ 0x86E6, 0x86EC, 0x1767,
/* Array index: 0x0558 */ 0x86F5, 0x86FA, 0x176E,
/* Array index: 0x055B */ 0x8709, 0x8712, 0x1774,
/* Array index: 0x055E */ 0x8719, 0x871B, 0x177E,
/* Array index: 0x0561 */ 0x8720, 0x8735, 0x1781,
/* Array index: 0x0564 */ 0x873E, 0x8743, 0x1797,
/* Array index: 0x0567 */ 0x874D, 0x876F, 0x179D,
/* Array index: 0x056A */ 0x8777, 0x877B, 0x17C0,
/* Array index: 0x056D */ 0x8784, 0x8789, 0x17C5,
/* Array index: 0x0570 */ 0x878F, 0x879D, 0x17CB,
/* Array index: 0x0573 */ 0x87AA, 0x87C5, 0x17DA,
/* Array index: 0x0576 */ 0x87D3, 0x87ED, 0x17F6,
/* Array index: 0x0579 */ 0x87F3, 0x87F7, 0x1811,
/* Array index: 0x057C */ 0x87FF, 0x8803, 0x1816,
/* Array index: 0x057F */ 0x8806, 0x880C, 0x181B,
/* Array index: 0x0582 */ 0x8819, 0x881D, 0x1822,
/* Array index: 0x0585 */ 0x8824, 0x8844, 0x1827,
/* Array index: 0x0588 */ 0x8871, 0x8876, 0x1848,
/* Array index: 0x058B */ 0x887C, 0x8880, 0x184E,
/* Array index: 0x058E */ 0x8895, 0x889B, 0x1853,
/* Array index: 0x0591 */ 0x88B6, 0x88C0, 0x185A,
/* Array index: 0x0594 */ 0x88C9, 0x88D0, 0x1865,
/* Array index: 0x0597 */ 0x88EE, 0x88F2, 0x186D,
/* Array index: 0x059A */ 0x88F6, 0x88FE, 0x1872,
/* Array index: 0x059D */ 0x8914, 0x8919, 0x187B,
/* Array index: 0x05A0 */ 0x892C, 0x8937, 0x1881,
/* Array index: 0x05A3 */ 0x894B, 0x8963, 0x188D,
/* Array index: 0x05A6 */ 0x8979, 0x897E, 0x18A6,
/* Array index: 0x05A9 */ 0x899B, 0x89A4, 0x18AC,
/* Array index: 0x05AC */ 0x89AD, 0x89AF, 0x18B6,
/* Array index: 0x05AF */ 0x89D5, 0x89FF, 0x18B9,
/* Array index: 0x05B2 */ 0x8A4A, 0x8A52, 0x18E4,
/* Array index: 0x05B5 */ 0x8A57, 0x8A59, 0x18ED,
/* Array index: 0x05B8 */ 0x8A74, 0x8A77, 0x18F0,
/* Array index: 0x05BB */ 0x8A7F, 0x8A86, 0x18F4,
/* Array index: 0x05BE */ 0x8ABA, 0x8AC0, 0x18FC,
/* Array index: 0x05C1 */ 0x8AD1, 0x8AE4, 0x1903,
/* Array index: 0x05C4 */ 0x8B05, 0x8B08, 0x1917,
/* Array index: 0x05C7 */ 0x8B0F, 0x8B27, 0x191B,
/* Array index: 0x05CA */ 0x8B2E, 0x8B42, 0x1934,
/* Array index: 0x05CD */ 0x8B47, 0x8B4B, 0x1949,
/* Array index: 0x05D0 */ 0x8B50, 0x8B57, 0x194E,
/* Array index: 0x05D3 */ 0x8B78, 0x8B7F, 0x1956,
/* Array index: 0x05D6 */ 0x8B82, 0x8B8E, 0x195E,
/* Array index: 0x05D9 */ 0x8C39, 0x8C3E, 0x196B,
/* Array index: 0x05DC */ 0x8C64, 0x8C69, 0x1971,
/* Array index: 0x05DF */ 0x8C6F, 0x8C78, 0x1977,
/* Array index: 0x05E2 */ 0x8C80, 0x8C86, 0x1981,
/* Array index: 0x05E5 */ 0x8C8F, 0x8C9C, 0x1988,
/* Array index: 0x05E8 */ 0x8CA3, 0x8CA5, 0x1996,
/* Array index: 0x05EB */ 0x8D8C, 0x8D96, 0x1999,
/* Array index: 0x05EE */ 0x8DAA, 0x8DAF, 0x19A4,
/* Array index: 0x05F1 */ 0x8DB5, 0x8DB9, 0x19AA,
/* Array index: 0x05F4 */ 0x8DD3, 0x8DD9, 0x19AF,
/* Array index: 0x05F7 */ 0x8DEE, 0x8DF4, 0x19B6,
/* Array index: 0x05FA */ 0x8DFD, 0x8E0A, 0x19BD,
/* Array index: 0x05FD */ 0x8E11, 0x8E1C, 0x19CB,
/* Array index: 0x0600 */ 0x8E23, 0x8E27, 0x19D7,
/* Array index: 0x0603 */ 0x8E3C, 0x8E41, 0x19DC,
/* Array index: 0x0606 */ 0x8E4C, 0x8E62, 0x19E2,
/* Array index: 0x0609 */ 0x8E92, 0x8EA9, 0x19F9,
/* Array index: 0x060C */ 0x8EDC, 0x8EFA, 0x1A11,
/* Array index: 0x060F */ 0x8EFF, 0x8F08, 0x1A30,
/* Array index: 0x0612 */ 0x8F0D, 0x8F11, 0x1A3A,
/* Array index: 0x0615 */ 0x8F16, 0x8F1A, 0x1A3F,
/* Array index: 0x0618 */ 0x8F32, 0x8F39, 0x1A44,
/* Array index: 0x061B */ 0x8F46, 0x8F48, 0x1A4C,
/* Array index: 0x061E */ 0x8F4F, 0x8F64, 0x1A4F,
/* Array index: 0x0621 */ 0x8FD2, 0x8FD7, 0x1A65,
/* Array index: 0x0624 */ 0x8FFB, 0x8FFF, 0x1A6B,
/* Array index: 0x0627 */ 0x9097, 0x90A1, 0x1A70,
/* Array index: 0x062A */ 0x90AF, 0x90B4, 0x1A7B,
/* Array index: 0x062D */ 0x90BD, 0x90BF, 0x1A81,
/* Array index: 0x0630 */ 0x90D4, 0x90F4, 0x1A84,
/* Array index: 0x0633 */ 0x90F9, 0x9108, 0x1AA5,
/* Array index: 0x0636 */ 0x910B, 0x9111, 0x1AB5,
/* Array index: 0x0639 */ 0x911A, 0x9147, 0x1ABC,
/* Array index: 0x063C */ 0x914E, 0x9150, 0x1AEA,
/* Array index: 0x063F */ 0x915F, 0x9164, 0x1AED,
/* Array index: 0x0642 */ 0x9180, 0x9186, 0x1AF3,
/* Array index: 0x0645 */ 0x918D, 0x9193, 0x1AFA,
/* Array index: 0x0648 */ 0x9199, 0x91A2, 0x1B01,
/* Array index: 0x064B */ 0x91AF, 0x91BE, 0x1B0B,
/* Array index: 0x064E */ 0x91D3, 0x91D5, 0x1B1B,
/* Array index: 0x0651 */ 0x91E8, 0x91EE, 0x1B1E,
/* Array index: 0x0654 */ 0x91F3, 0x91F9, 0x1B25,
/* Array index: 0x0657 */ 0x91FD, 0x9206, 0x1B2C,
/* Array index: 0x065A */ 0x9216, 0x921C, 0x1B36,
/* Array index: 0x065D */ 0x9224, 0x9227, 0x1B3D,
/* Array index: 0x0660 */ 0x922D, 0x9233, 0x1B41,
/* Array index: 0x0663 */ 0x924C, 0x9256, 0x1B48,
/* Array index: 0x0666 */ 0x9263, 0x9267, 0x1B53,
/* Array index: 0x0669 */ 0x926C, 0x9272, 0x1B58,
/* Array index: 0x066C */ 0x9279, 0x928E, 0x1B5F,
/* Array index: 0x066F */ 0x9297, 0x92AB, 0x1B75,
/* Array index: 0x0672 */ 0x92B4, 0x92B6, 0x1B8A,
/* Array index: 0x0675 */ 0x92C0, 0x92E1, 0x1B8D,
/* Array index: 0x0678 */ 0x92E6, 0x92E9, 0x1BAF,
/* Array index: 0x067B */ 0x92F7, 0x9302, 0x1BB3,
/* Array index: 0x067E */ 0x9308, 0x9316, 0x1BBF,
/* Array index: 0x0681 */ 0x931B, 0x932A, 0x1BCE,
/* Array index: 0x0684 */ 0x934C, 0x9359, 0x1BDE,
/* Array index: 0x0687 */ 0x9360, 0x9364, 0x1BEC,
/* Array index: 0x068A */ 0x9376, 0x937C, 0x1BF1,
/* Array index: 0x068D */ 0x9388, 0x9392, 0x1BF8,
/* Array index: 0x0690 */ 0x939B, 0x93AA, 0x1C03,
/* Array index: 0x0693 */ 0x93B1, 0x93B7, 0x1C13,
/* Array index: 0x0696 */ 0x93CC, 0x93D5, 0x1C1A,
/* Array index: 0x0699 */ 0x93F5, 0x9400, 0x1C24,
/* Array index: 0x069C */ 0x9406, 0x9416, 0x1C30,
/* Array index: 0x069F */ 0x9428, 0x942C, 0x1C41,
/* Array index: 0x06A2 */ 0x9439, 0x9440, 0x1C46,
/* Array index: 0x06A5 */ 0x9445, 0x9450, 0x1C4E,
/* Array index: 0x06A8 */ 0x946B, 0x9478, 0x1C5A,
/* Array index: 0x06AB */ 0x9480, 0x9483, 0x1C68,
/* Array index: 0x06AE */ 0x957A, 0x957D, 0x1C6C,
/* Array index: 0x06B1 */ 0x959B, 0x959F, 0x1C70,
/* Array index: 0x06B4 */ 0x95B5, 0x95C0, 0x1C75,
/* Array index: 0x06B7 */ 0x95D1, 0x95D3, 0x1C81,
/* Array index: 0x06BA */ 0x95DA, 0x95E5, 0x1C84,
/* Array index: 0x06BD */ 0x9620, 0x9624, 0x1C90,
/* Array index: 0x06C0 */ 0x9639, 0x963D, 0x1C95,
/* Array index: 0x06C3 */ 0x9687, 0x9689, 0x1C9A,
/* Array index: 0x06C6 */ 0x9691, 0x9693, 0x1C9D,
/* Array index: 0x06C9 */ 0x971F, 0x972F, 0x1CA0,
/* Array index: 0x06CC */ 0x9777, 0x9784, 0x1CB1,
/* Array index: 0x06CF */ 0x9799, 0x97A5, 0x1CBF,
/* Array index: 0x06D2 */ 0x97A8, 0x97AE, 0x1CCC,
/* Array index: 0x06D5 */ 0x97CD, 0x97E5, 0x1CD3,
/* Array index: 0x06D8 */ 0x980D, 0x980F, 0x1CEC,
/* Array index: 0x06DB */ 0x9826, 0x9829, 0x1CEF,
/* Array index: 0x06DE */ 0x9841, 0x984A, 0x1CF3,
/* Array index: 0x06E1 */ 0x9850, 0x9852, 0x1CFD,
/* Array index: 0x06E4 */ 0x985C, 0x9864, 0x1D00,
/* Array index: 0x06E7 */ 0x9872, 0x9874, 0x1D09,
/* Array index: 0x06EA */ 0x98AC, 0x98AE, 0x1D0C,
/* Array index: 0x06ED */ 0x98BB, 0x98C2, 0x1D0F,
/* Array index: 0x06F0 */ 0x9914, 0x9917, 0x1D17,
/* Array index: 0x06F3 */ 0x9927, 0x9933, 0x1D1B,
/* Array index: 0x06F6 */ 0x999C, 0x999E, 0x1D28,
/* Array index: 0x06F9 */ 0x99B9, 0x99BD, 0x1D2B,
/* Array index: 0x06FC */ 0x99C9, 0x99CF, 0x1D30,
/* Array index: 0x06FF */ 0x99D3, 0x99D8, 0x1D37,
/* Array index: 0x0702 */ 0x99E3, 0x99F0, 0x1D3D,
/* Array index: 0x0705 */ 0x99F4, 0x9A15, 0x1D4B,
/* Array index: 0x0708 */ 0x9A1A, 0x9A3A, 0x1D6D,
/* Array index: 0x070B */ 0x9A46, 0x9A56, 0x1D8E,
/* Array index: 0x070E */ 0x9A64, 0x9A6B, 0x1D9F,
/* Array index: 0x0711 */ 0x9ABE, 0x9AC2, 0x1DA7,
/* Array index: 0x0714 */ 0x9AF1, 0x9AFE, 0x1DAC,
/* Array index: 0x0717 */ 0x9B08, 0x9B19, 0x1DBA,
/* Array index: 0x071A */ 0x9B1E, 0x9B20, 0x1DCC,
/* Array index: 0x071D */ 0x9B48, 0x9B4C, 0x1DCF,
/* Array index: 0x0720 */ 0x9B5F, 0x9B61, 0x1DD4,
/* Array index: 0x0723 */ 0x9B64, 0x9B68, 0x1DD7,
/* Array index: 0x0726 */ 0x9B70, 0x9B88, 0x1DDC,
/* Array index: 0x0729 */ 0x9B9E, 0x9BA8, 0x1DF5,
/* Array index: 0x072C */ 0x9BB5, 0x9BB9, 0x1E00,
/* Array index: 0x072F */ 0x9BC3, 0x9BC7, 0x1E05,
/* Array index: 0x0732 */ 0x9BD3, 0x9BEC, 0x1E0A,
/* Array index: 0x0735 */ 0x9C05, 0x9C0B, 0x1E24,
/* Array index: 0x0738 */ 0x9C28, 0x9C2C, 0x1E2B,
/* Array index: 0x073B */ 0x9C32, 0x9C41, 0x1E30,
/* Array index: 0x073E */ 0x9C48, 0x9C52, 0x1E40,
/* Array index: 0x0741 */ 0x9C62, 0x9C68, 0x1E4B,
/* Array index: 0x0744 */ 0x9C71, 0x9C75, 0x1E52,
/* Array index: 0x0747 */ 0x9CF7, 0x9D00, 0x1E57,
/* Array index: 0x074A */ 0x9D04, 0x9D08, 0x1E61,
/* Array index: 0x074D */ 0x9D17, 0x9D22, 0x1E66,
/* Array index: 0x0750 */ 0x9D2D, 0x9D38, 0x1E72,
/* Array index: 0x0753 */ 0x9D3D, 0x9D45, 0x1E7E,
/* Array index: 0x0756 */ 0x9D4A, 0x9D4C, 0x1E87,
/* Array index: 0x0759 */ 0x9D52, 0x9D5C, 0x1E8A,
/* Array index: 0x075C */ 0x9D67, 0x9D8C, 0x1E95,
/* Array index: 0x075F */ 0x9D94, 0x9DF8, 0x1EBB,
/* Array index: 0x0762 */ 0x9DFB, 0x9E19, 0x1F20,
/* Array index: 0x0765 */ 0x9E86, 0x9E8E, 0x1F3F,
/* Array index: 0x0768 */ 0x9E99, 0x9E9C, 0x1F48,
/* Array index: 0x076B */ 0x9EE4, 0x9EE7, 0x1F4C,
/* Array index: 0x076E */ 0x9EF2, 0x9F01, 0x1F50,
/* Array index: 0x0771 */ 0x9F18, 0x9F38, 0x1F60,
/* Array index: 0x0774 */ 0x9F40, 0x9F4F, 0x1F81,
/* Array index: 0x0777 */ 0x9F54, 0x9F60, 0x1F91,
/* Array index: 0x077A */ 0x9F6E, 0x9F7B, 0x1F9E,
/* Ranges content */
/* Range 0x4F12 - 0x4F14, array index: 0x077D */
0x217A,0x2177,0x216E,
/* Range 0x4F74 - 0x4F89, array index: 0x0780 */
0x2539,INVALC,0x2538,0x253C,0x2543,0x2541,INVALC,INVALC,
0x2533,0x2535,INVALC,INVALC,0x2536,0x2542,0x2549,INVALC,
0x253B,0x2534,INVALC,0x2537,INVALC,0x253A,
/* Range 0x4F94 - 0x4F9E, array index: 0x0796 */
0x2546,0x254A,INVALC,0x253E,0x2532,INVALC,0x2540,INVALC,
0x2545,INVALC,0x2547,
/* Range 0x4FB9 - 0x4FBB, array index: 0x07A1 */
0x2930,0x292E,0x2929,
/* Range 0x4FF4 - 0x4FF7, array index: 0x07A4 */
0x2D71,0x2D70,0x2D75,0x2D76,
/* Range 0x502F - 0x5037, array index: 0x07A8 */
0x2D7C,0x2D6E,0x2D7D,INVALC,0x2D72,INVALC,0x2D7B,INVALC,
0x2D73,
/* Range 0x505B - 0x506B, array index: 0x07B1 */
0x335B,INVALC,0x3356,0x3352,0x3360,0x3353,0x3351,0x335D,
0x3363,0x3364,INVALC,INVALC,INVALC,0x3A3F,0x3361,0x3350,
0x3362,
/* Range 0x509B - 0x509E, array index: 0x07C2 */
0x3A35,0x3A40,0x3A3E,0x3A38,
/* Range 0x50C6 - 0x50CB, array index: 0x07C6 */
0x415B,INVALC,0x4160,0x4167,0x415E,0x4166,
/* Range 0x50FD - 0x50FF, array index: 0x07CC */
0x4F58,0x4F55,0x4F4E,
/* Range 0x5106 - 0x510C, array index: 0x07CF */
0x4F52,0x4F53,INVALC,INVALC,0x4F59,0x4F56,0x4F57,
/* Range 0x5122 - 0x5126, array index: 0x07D6 */
0x5C47,INVALC,0x5C48,0x5C46,0x5C45,
/* Range 0x512D - 0x5135, array index: 0x07DB */
0x6144,0x6145,INVALC,0x4F50,0x6143,INVALC,INVALC,0x6537,
0x6538,
/* Range 0x5231 - 0x5235, array index: 0x07E4 */
0x2554,0x2551,0x2552,INVALC,0x2550,
/* Range 0x525E - 0x5262, array index: 0x07E9 */
0x2E2C,0x2E2D,INVALC,0x2E29,0x2E2F,
/* Range 0x526B - 0x526E, array index: 0x07EE */
0x336C,0x336E,0x336D,0x336F,
/* Range 0x5278 - 0x527C, array index: 0x07F2 */
0x416C,INVALC,0x416B,0x416D,0x416E,
/* Range 0x5296 - 0x5299, array index: 0x07F7 */
0x6539,0x6B51,0x6B50,0x6E7E,
/* Range 0x5309 - 0x530B, array index: 0x07FB */
0x2333,0x2556,0x2557,
/* Range 0x5394 - 0x5399, array index: 0x07FE */
0x255A,INVALC,0x2939,0x2938,0x293B,0x293A,
/* Range 0x5460 - 0x5467, array index: 0x0804 */
0x256B,0x256A,INVALC,0x256D,0x256F,0x2564,0x2567,0x256E,
/* Range 0x547E - 0x5482, array index: 0x080C */
0x2563,0x255C,INVALC,0x255D,0x255F,
/* Range 0x54A0 - 0x54A2, array index: 0x0811 */
0x2949,0x293D,0x294C,
/* Range 0x5503 - 0x5505, array index: 0x0814 */
0x2E48,0x2E3C,0x2E40,
/* Range 0x5508 - 0x5512, array index: 0x0817 */
0x2E3D,INVALC,0x2E42,0x2E49,0x3424,INVALC,0x2E47,INVALC,
INVALC,0x2E3F,0x2E36,
/* Range 0x5532 - 0x5536, array index: 0x0822 */
0x3425,INVALC,0x3379,0x337E,0x337D,
/* Range 0x554D - 0x5552, array index: 0x0827 */
0x3377,0x3427,INVALC,0x3378,0x337B,0x3422,
/* Range 0x5575 - 0x5577, array index: 0x082D */
0x3374,0x3375,0x3A4E,
/* Range 0x558C - 0x5595, array index: 0x0830 */
0x3A5A,0x417C,0x3A5F,0x3A53,INVALC,0x3A4A,0x3A57,0x3A51,
INVALC,0x3A5D,
/* Range 0x55A1 - 0x55A8, array index: 0x083A */
0x3A5E,0x3A50,0x3A56,0x3A58,0x3A4C,0x3A5B,INVALC,0x3A4B,
/* Range 0x55BF - 0x55C4, array index: 0x0842 */
0x417A,0x4176,INVALC,0x4227,0x416F,0x4178,
/* Range 0x55C8 - 0x55D6, array index: 0x0848 */
0x4223,INVALC,0x4174,0x4173,0x4171,0x4225,INVALC,0x417D,
0x4172,INVALC,0x417B,INVALC,0x4177,0x417E,0x4222,
/* Range 0x563D - 0x564C, array index: 0x0857 */
0x4F6A,0x4F6C,INVALC,0x4F68,0x4F62,0x4F5F,INVALC,INVALC,
0x3A4F,0x4F65,INVALC,0x4F5E,0x4F64,0x4F63,INVALC,0x4F60,
/* Range 0x567E - 0x5686, array index: 0x0867 */
0x5C52,0x5C54,INVALC,0x5C55,0x5C53,0x5C51,0x5C50,INVALC,
0x5C4F,
/* Range 0x5697 - 0x569D, array index: 0x0870 */
0x6148,0x6146,0x614B,0x6149,INVALC,0x6147,0x614A,
/* Range 0x56A6 - 0x56AD, array index: 0x0877 */
0x653E,0x653F,INVALC,INVALC,0x6540,0x653C,0x6541,0x653D,
/* Range 0x571A - 0x5723, array index: 0x087F */
0x4F70,0x5652,0x5651,INVALC,0x715A,INVALC,0x2139,INVALC,
0x214F,0x2150,
/* Range 0x576D - 0x5776, array index: 0x0889 */
0x2574,INVALC,0x2572,0x2577,0x2576,0x2573,0x257C,0x257D,
0x257A,0x2578,
/* Range 0x5794 - 0x579F, array index: 0x0893 */
0x2959,0x295F,INVALC,0x2956,0x295A,0x295C,0x295E,0x2958,
INVALC,0x2957,0x2952,0x2953,
/* Range 0x57B5 - 0x57C1, array index: 0x089F */
0x2951,0x2E55,INVALC,0x2E54,0x2E59,0x2E50,INVALC,0x2E53,
0x2E52,INVALC,0x2E56,INVALC,0x2E5A,
/* Range 0x57E1 - 0x5801, array index: 0x08AC */
0x3444,0x3432,0x3440,INVALC,0x3442,INVALC,0x3448,INVALC,
0x344C,INVALC,INVALC,0x3443,0x3437,0x343F,INVALC,0x344D,
0x344B,0x3441,0x343C,0x3435,0x3A68,0x3433,INVALC,0x343A,
INVALC,INVALC,0x3430,0x3446,0x3438,INVALC,INVALC,0x3436,
0x3449,
/* Range 0x5807 - 0x5810, array index: 0x08CD */
0x343E,0x3439,INVALC,INVALC,0x343B,0x344A,0x344E,0x3445,
INVALC,0x3447,
/* Range 0x5825 - 0x582E, array index: 0x08D7 */
0x3A6A,INVALC,0x3A65,0x3A67,0x3A61,INVALC,INVALC,0x3A74,
0x3A73,0x3A70,
/* Range 0x5832 - 0x583F, array index: 0x08E1 */
0x2E4D,0x3A6D,INVALC,INVALC,0x3A6F,0x3A62,0x3A72,0x3A71,
INVALC,0x3A75,INVALC,0x4236,INVALC,0x3A6E,
/* Range 0x584D - 0x584F, array index: 0x08EF */
0x422D,0x4231,0x422C,
/* Range 0x5863 - 0x5865, array index: 0x08F2 */
0x4237,0x422B,0x4234,
/* Range 0x587A - 0x587C, array index: 0x08F5 */
0x4946,0x494D,0x493E,
/* Range 0x5886 - 0x5891, array index: 0x08F8 */
0x4941,0x4947,0x494C,0x493D,INVALC,0x4945,INVALC,INVALC,
0x4949,0x494F,0x493F,0x4948,
/* Range 0x590C - 0x590E, array index: 0x0904 */
0x2623,0x2961,0x2E5B,
/* Range 0x5970 - 0x5972, array index: 0x0907 */
0x614C,0x6D48,0x6F23,
/* Range 0x597B - 0x5980, array index: 0x090A */
0x222F,0x222D,INVALC,0x2230,0x2232,0x222C,
/* Range 0x598E - 0x5990, array index: 0x0910 */
0x2356,0x2359,0x2358,
/* Range 0x59A0 - 0x59A2, array index: 0x0913 */
0x2354,0x235B,0x2357,
/* Range 0x59B1 - 0x59B6, array index: 0x0916 */
0x2630,0x2629,INVALC,0x2634,0x2625,0x262C,
/* Range 0x59DD - 0x59E1, array index: 0x091C */
0x2968,0x2964,INVALC,0x2974,0x2963,
/* Range 0x59ED - 0x59F7, array index: 0x0921 */
0x2977,0x2965,INVALC,INVALC,0x2967,0x296E,0x2972,0x2976,
0x2973,0x296C,0x296F,
/* Range 0x59FA - 0x5A00, array index: 0x092C */
0x2969,INVALC,0x296B,0x296A,0x2975,INVALC,0x2966,
/* Range 0x5A15 - 0x5A19, array index: 0x0933 */
0x2E61,0x2E5E,0x2E63,INVALC,0x2E5D,
/* Range 0x5A35 - 0x5A39, array index: 0x0938 */
0x3457,INVALC,0x3B26,0x3456,0x3469,
/* Range 0x5A42 - 0x5A48, array index: 0x093D */
0x3470,0x3460,0x3463,INVALC,INVALC,0x346D,0x3465,
/* Range 0x5A4C - 0x5A60, array index: 0x0944 */
0x346A,0x3468,INVALC,INVALC,0x3459,0x346E,0x3462,0x345D,
INVALC,0x3453,0x346F,0x345F,0x3452,INVALC,INVALC,0x3464,
0x3471,0x3461,0x3455,0x345A,0x3451,
/* Range 0x5A78 - 0x5A7D, array index: 0x0959 */
0x3A7D,INVALC,0x3A7A,0x3B2D,0x3B21,0x3B2E,
/* Range 0x5A8A - 0x5A97, array index: 0x095F */
0x3B28,0x3B2B,0x3B2F,INVALC,0x3466,0x3B31,0x424D,INVALC,
INVALC,0x3B32,0x3A78,0x3B24,INVALC,0x3B29,
/* Range 0x5A9C - 0x5A9F, array index: 0x096D */
0x3B30,0x3B33,0x3A7C,0x3A79,
/* Range 0x5AAC - 0x5ABB, array index: 0x0971 */
0x3B23,INVALC,0x3B25,0x3A77,0x4241,0x423F,INVALC,INVALC,
0x4249,0x4240,0x424A,0x4246,0x423E,0x424C,0x423D,0x4244,
/* Range 0x5AC4 - 0x5ACD, array index: 0x0981 */
0x423B,INVALC,0x4245,0x423A,0x4243,INVALC,0x4248,0x423C,
INVALC,0x424B,
/* Range 0x5AD9 - 0x5AE2, array index: 0x098B */
0x4961,0x4957,0x495D,0x4952,0x4960,0x495F,0x4963,0x495C,
INVALC,0x495B,
/* Range 0x5AE8 - 0x5AEE, array index: 0x0995 */
0x4962,INVALC,0x4956,0x4959,0x495E,0x4958,0x4953,
/* Range 0x5AF3 - 0x5AF9, array index: 0x099C */
0x495A,0x4F7C,INVALC,0x5021,0x4F7E,0x5023,0x5025,
/* Range 0x5AFF - 0x5B07, array index: 0x09A3 */
0x4F7B,INVALC,0x5026,0x5024,0x5022,INVALC,0x5028,INVALC,
0x5027,
/* Range 0x5B13 - 0x5B1B, array index: 0x09AC */
0x5660,0x565F,INVALC,0x5662,0x565B,INVALC,0x565C,0x5664,
0x565D,
/* Range 0x5B23 - 0x5B2F, array index: 0x09B5 */
0x5C5D,INVALC,0x5C5B,0x5C60,0x5C5F,0x5663,INVALC,INVALC,
INVALC,0x5C5E,0x5C5A,0x5C62,0x5C61,
/* Range 0x5B3C - 0x5B3F, array index: 0x09C2 */
0x614D,0x6546,0x6547,0x6548,
/* Range 0x5B47 - 0x5B4E, array index: 0x09C6 */
0x6B56,0x6B55,INVALC,INVALC,0x6D49,0x6D4A,0x6F24,0x7035,
/* Range 0x5BCA - 0x5BCE, array index: 0x09CE */
0x3B39,0x3B36,INVALC,0x3B35,0x3B3A,
/* Range 0x5C7A - 0x5C7E, array index: 0x09D3 */
0x2237,0x2238,0x2236,INVALC,0x2239,
/* Range 0x5C86 - 0x5C95, array index: 0x09D8 */
0x2367,INVALC,0x2362,0x2364,0x2366,0x2363,INVALC,0x2360,
INVALC,0x2361,INVALC,INVALC,0x2365,0x2368,INVALC,0x2369,
/* Range 0x5C9F - 0x5CB0, array index: 0x09E8 */
0x2643,0x263E,INVALC,0x2646,0x2644,0x263D,0x264A,0x264D,
0x2648,0x2641,INVALC,0x2647,INVALC,0x2642,0x2645,0x263C,
0x2640,0x264C,
/* Range 0x5CC6 - 0x5CDF, array index: 0x09FA */
0x2A2C,0x2A25,0x2A2B,0x2A24,0x2A26,0x297E,0x297C,INVALC,
0x2A2D,0x2A2A,0x297A,INVALC,INVALC,0x2A28,0x2A29,INVALC,
0x2A27,0x297D,0x297B,INVALC,0x2A23,0x2A21,INVALC,INVALC,
0x2A22,0x2A2E,
/* Range 0x5CF7 - 0x5CF9, array index: 0x0A14 */
0x2E72,0x2A2F,0x2E74,
/* Range 0x5D0B - 0x5D0F, array index: 0x0A17 */
0x3478,0x347C,0x347E,INVALC,0x3523,
/* Range 0x5D1D - 0x5D20, array index: 0x0A1C */
0x3479,0x3477,0x3527,0x347B,
/* Range 0x5D2E - 0x5D4B, array index: 0x0A20 */
0x3528,INVALC,0x3524,0x3B4B,0x3B52,0x3B47,INVALC,0x3B43,
0x3B53,0x3B3D,0x3B50,0x3B4E,0x3B48,INVALC,0x3B51,0x3B4A,
INVALC,0x3B42,0x3B54,0x3B40,0x3B4D,0x3B3E,INVALC,0x3B55,
INVALC,INVALC,INVALC,0x3B4F,0x4255,0x3B41,
/* Range 0x5D79 - 0x5D82, array index: 0x0A3E */
0x4975,0x496C,INVALC,0x4973,0x496A,0x4972,0x4976,0x4969,
0x496D,0x4968,
/* Range 0x5D86 - 0x5D8A, array index: 0x0A48 */
0x496B,INVALC,0x4971,0x4970,0x496F,
/* Range 0x5D9C - 0x5DA2, array index: 0x0A4D */
0x5033,INVALC,0x5036,0x502D,0x5032,0x5034,0x502F,
/* Range 0x5DA7 - 0x5DB7, array index: 0x0A54 */
0x566B,0x5670,0x566A,0x566F,INVALC,0x5668,0x5672,0x566E,
0x5673,0x566D,0x5669,0x5671,INVALC,0x5674,0x566C,INVALC,
0x5C66,
/* Range 0x5E20 - 0x5E24, array index: 0x0A65 */
0x2A34,0x2A31,0x2A32,0x2A33,0x2A35,
/* Range 0x5E4A - 0x5E4F, array index: 0x0A6A */
0x4260,0x4262,INVALC,0x4261,0x425F,0x425E,
/* Range 0x5E66 - 0x5E70, array index: 0x0A70 */
0x5677,0x5675,0x5676,0x5037,0x5C68,INVALC,0x5C67,0x6151,
0x6152,0x5678,0x654A,
/* Range 0x5E88 - 0x5E8D, array index: 0x0A7B */
0x2370,0x236E,INVALC,0x236D,0x236F,0x2371,
/* Range 0x5EA2 - 0x5EA5, array index: 0x0A81 */
0x2A38,0x2A3A,0x2A37,0x2A3B,
/* Range 0x5EAE - 0x5EB4, array index: 0x0A85 */
0x2E78,INVALC,0x2A36,0x352B,0x352E,0x352F,0x352C,
/* Range 0x5EC5 - 0x5EC7, array index: 0x0A8C */
0x4263,0x4265,0x4267,
/* Range 0x5ED1 - 0x5EDE, array index: 0x0A8F */
0x497B,0x4A23,INVALC,0x4A24,0x4A21,INVALC,0x497C,0x497A,
0x4A22,INVALC,0x503C,0x497E,INVALC,0x503D,
/* Range 0x5EE5 - 0x5EE9, array index: 0x0A9D */
0x567D,0x567B,0x567A,0x567C,0x5679,
/* Range 0x5EEE - 0x5EF2, array index: 0x0AA2 */
0x6872,0x6873,INVALC,0x6B59,0x6D4D,
/* Range 0x5F22 - 0x5F24, array index: 0x0AA7 */
0x2652,0x2653,0x2654,
/* Range 0x5FBB - 0x5FC1, array index: 0x0AAA */
0x5722,0x5721,INVALC,0x5C69,0x654B,0x6874,0x6875,
/* Range 0x5FCF - 0x5FD5, array index: 0x0AB1 */
0x2242,0x2378,0x2377,0x2376,INVALC,0x2241,0x2240,
/* Range 0x5FE1 - 0x5FE5, array index: 0x0AB8 */
0x237D,INVALC,0x2421,0x237E,0x265A,
/* Range 0x5FED - 0x5FEF, array index: 0x0ABD */
0x2379,0x237B,0x2423,
/* Range 0x6009 - 0x6013, array index: 0x0AC0 */
0x266E,0x2661,0x265F,0x266D,0x2668,INVALC,INVALC,0x2669,
0x266C,INVALC,0x266B,
/* Range 0x602C - 0x6034, array index: 0x0ACB */
0x2666,0x265B,0x266A,INVALC,INVALC,INVALC,0x265E,0x2663,
0x2660,
/* Range 0x6040 - 0x6049, array index: 0x0AD4 */
0x2A4B,0x2F23,0x2A4C,INVALC,0x2A4F,0x2A45,INVALC,0x2A47,
INVALC,0x2A48,
/* Range 0x605A - 0x605F, array index: 0x0ADE */
0x2F21,0x2A49,INVALC,0x2E7E,0x2A44,0x2A4D,
/* Range 0x6086 - 0x608A, array index: 0x0AE4 */
0x3537,0x2F2E,0x2F25,INVALC,0x3535,
/* Range 0x609B - 0x609D, array index: 0x0AE9 */
0x2F2C,0x2F2F,0x2F29,
/* Range 0x60BE - 0x60CF, array index: 0x0AEC */
0x3538,0x3546,0x3549,0x3B6C,INVALC,0x3547,0x3B61,INVALC,
INVALC,INVALC,0x3541,0x3B5C,0x3545,INVALC,0x3B5E,0x3548,
0x3B60,0x353D,
/* Range 0x6103 - 0x6105, array index: 0x0AFE */
0x3B6D,0x3B72,0x3B66,
/* Range 0x6128 - 0x612F, array index: 0x0B01 */
0x4A2A,0x4276,INVALC,0x426E,0x4A29,INVALC,0x4272,0x4274,
/* Range 0x6152 - 0x6156, array index: 0x0B09 */
0x4A2F,0x4A30,0x4A35,INVALC,0x4A3C,
/* Range 0x6171 - 0x6174, array index: 0x0B0E */
0x4A2D,0x4A31,0x4A2E,0x4A34,
/* Range 0x6189 - 0x618D, array index: 0x0B12 */
0x5047,INVALC,0x5041,0x572E,0x5050,
/* Range 0x61AD - 0x61B5, array index: 0x0B17 */
0x504B,INVALC,0x504A,0x5045,0x5044,INVALC,0x5052,0x5727,
0x5C6B,
/* Range 0x61DE - 0x61E0, array index: 0x0B20 */
0x5C72,0x6154,0x5C6E,
/* Range 0x61E4 - 0x61F1, array index: 0x0B23 */
0x5C70,0x5C6F,INVALC,0x5C6D,0x5C71,0x615C,0x6158,0x615A,
INVALC,0x6155,0x6156,INVALC,0x6159,0x6157,
/* Range 0x6223 - 0x622D, array index: 0x0B31 */
0x427A,0x427C,0x427B,INVALC,0x4A3E,INVALC,0x4A3D,INVALC,
0x4A3F,INVALC,0x5053,
/* Range 0x625E - 0x6266, array index: 0x0B3C */
0x2244,INVALC,0x224A,0x2246,0x2248,INVALC,0x2245,0x224C,
0x2247,
/* Range 0x6270 - 0x6274, array index: 0x0B45 */
0x2432,0x242F,0x2437,INVALC,0x2438,
/* Range 0x62A9 - 0x62B8, array index: 0x0B4A */
0x267D,0x2676,INVALC,INVALC,0x2672,0x2679,0x267B,0x267E,
INVALC,INVALC,0x267A,0x2673,INVALC,0x2677,INVALC,0x2721,
/* Range 0x62F5 - 0x62FB, array index: 0x0B5A */
0x2A58,0x2A60,INVALC,0x2A5F,0x2A5C,0x2A64,0x2A66,
/* Range 0x630B - 0x6315, array index: 0x0B61 */
0x2A57,0x2A5E,0x2A56,0x2A59,0x2A5D,0x2F34,INVALC,INVALC,
0x2A62,0x2A63,0x2A65,
/* Range 0x6332 - 0x633C, array index: 0x0B6C */
0x354A,0x2F48,0x2F42,INVALC,0x2F39,INVALC,0x2F4B,0x2F3C,
INVALC,0x3561,0x2F3F,
/* Range 0x6340 - 0x634B, array index: 0x0B77 */
0x2F4D,0x2F41,INVALC,0x2F3A,0x2F37,0x2F38,INVALC,0x2F47,
0x2F4E,INVALC,0x2F3E,0x2F3D,
/* Range 0x6354 - 0x635A, array index: 0x0B83 */
0x2F44,INVALC,0x2F35,0x2F4C,0x2F43,0x2F45,0x2F49,
/* Range 0x636D - 0x6370, array index: 0x0B8A */
0x355D,0x3559,0x3556,0x3568,
/* Range 0x638D - 0x6391, array index: 0x0B8E */
0x3567,0x3555,INVALC,0x3558,0x3566,
/* Range 0x639C - 0x639F, array index: 0x0B93 */
0x355C,0x3552,0x3550,0x3562,
/* Range 0x63AB - 0x63B1, array index: 0x0B97 */
0x3554,INVALC,0x3551,0x355E,0x355A,0x3B77,0x3B76,
/* Range 0x63C2 - 0x63CE, array index: 0x0B9E */
0x3C2F,0x3B7C,0x3C2C,0x427D,INVALC,0x3C30,0x3C33,INVALC,
0x3C21,0x3C32,0x3C31,INVALC,0x3B78,
/* Range 0x63D5 - 0x63E0, array index: 0x0BAB */
0x3C24,INVALC,0x3C35,0x3C2D,0x3C36,INVALC,INVALC,0x3C2B,
0x3C2A,INVALC,0x3C28,0x3C22,
/* Range 0x63E4 - 0x63E8, array index: 0x0BB7 */
0x2F3B,0x3B79,INVALC,0x433D,0x3B7A,
/* Range 0x63EF - 0x63F6, array index: 0x0BBC */
0x3B7B,0x3C34,0x427E,0x3C25,0x3B7E,INVALC,0x3C26,0x3C23,
/* Range 0x6409 - 0x6412, array index: 0x0BC4 */
0x4324,0x4337,0x433C,0x4330,INVALC,0x4341,INVALC,0x4322,
INVALC,0x4323,
/* Range 0x641F - 0x6428, array index: 0x0BCE */
0x4329,0x4325,0x4340,0x432E,0x432F,0x4326,0x433A,0x4331,
0x433B,0x4333,
/* Range 0x642E - 0x6430, array index: 0x0BD8 */
0x433F,0x4336,0x4332,
/* Range 0x643F - 0x6443, array index: 0x0BDB */
0x4A55,0x4339,0x4334,INVALC,0x4328,
/* Range 0x6459 - 0x6461, array index: 0x0BE0 */
0x4A58,INVALC,0x4A42,0x4A4F,0x4A43,0x4A4E,INVALC,0x4A52,
0x3C27,
/* Range 0x6470 - 0x6477, array index: 0x0BE9 */
0x5055,INVALC,0x4A46,0x4A47,0x4A44,0x4A49,0x4A45,0x4A5A,
/* Range 0x6489 - 0x648C, array index: 0x0BF1 */
0x5735,0x505D,0x505C,0x505E,
/* Range 0x6496 - 0x6498, array index: 0x0BF5 */
0x5056,0x5059,0x5063,
/* Range 0x649C - 0x64A0, array index: 0x0BF8 */
0x505A,0x3B7D,INVALC,0x5060,0x5057,
/* Range 0x650C - 0x6510, array index: 0x0BFD */
0x6551,0x654F,0x6552,INVALC,0x654E,
/* Range 0x6513 - 0x6517, array index: 0x0C02 */
0x687A,INVALC,0x6879,0x6878,0x6877,
/* Range 0x6520 - 0x6526, array index: 0x0C07 */
0x6D4F,0x6D4E,0x6D51,INVALC,INVALC,0x6F2C,0x6D50,
/* Range 0x6564 - 0x656A, array index: 0x0C0E */
0x3C3A,0x3C3D,INVALC,0x3C38,0x3C3C,INVALC,0x3C39,
/* Range 0x6579 - 0x6581, array index: 0x0C15 */
0x5066,0x5065,0x5067,0x573C,INVALC,INVALC,0x573B,0x5C7A,
0x5C79,
/* Range 0x65C2 - 0x65C6, array index: 0x0C1E */
0x2F54,0x2F52,0x2F53,INVALC,0x2F51,
/* Range 0x65DA - 0x65E1, array index: 0x0C23 */
0x5C7C,0x6165,INVALC,0x6555,0x6554,0x687B,INVALC,0x213E,
/* Range 0x65EE - 0x65F5, array index: 0x0C2B */
0x224F,0x224E,0x2439,INVALC,0x243C,0x243B,0x243A,0x243D,
/* Range 0x65FB - 0x65FD, array index: 0x0C33 */
0x272A,0x2726,0x272F,
/* Range 0x6603 - 0x6612, array index: 0x0C36 */
0x272B,0x2727,0x272E,INVALC,INVALC,0x2729,0x2725,INVALC,
0x272C,INVALC,0x272D,INVALC,INVALC,0x2731,0x2730,0x2728,
/* Range 0x6632 - 0x663A, array index: 0x0C46 */
0x2A6E,0x2A73,0x2A77,0x2A6F,0x2A6C,INVALC,INVALC,0x2A78,
0x2A75,
/* Range 0x6678 - 0x667C, array index: 0x0C4F */
0x434D,0x3C49,INVALC,0x3C46,0x3C44,
/* Range 0x668A - 0x668C, array index: 0x0C54 */
0x434A,0x4349,0x4346,
/* Range 0x669F - 0x66A1, array index: 0x0C57 */
0x4A5F,0x4A5E,0x4A5D,
/* Range 0x66BA - 0x66C0, array index: 0x0C5A */
0x5746,0x5745,INVALC,0x5744,0x573F,INVALC,0x5740,
/* Range 0x66C8 - 0x66CC, array index: 0x0C61 */
0x573E,INVALC,0x5741,0x5742,0x5747,
/* Range 0x670F - 0x6713, array index: 0x0C66 */
0x2A7A,0x2A7B,INVALC,0x2F59,0x2F5A,
/* Range 0x6720 - 0x6723, array index: 0x0C6B */
0x434E,0x4641,0x4A62,0x5748,
/* Range 0x6738 - 0x673F, array index: 0x0C6F */
0x2252,0x2251,0x2254,0x2253,0x2256,INVALC,0x2250,0x2255,
/* Range 0x6747 - 0x674D, array index: 0x0C77 */
0x243F,0x2443,INVALC,INVALC,0x2447,0x2442,0x2445,
/* Range 0x6776 - 0x677D, array index: 0x0C7E */
0x2738,INVALC,0x2747,0x2748,0x2740,0x2739,INVALC,0x2745,
/* Range 0x6781 - 0x6786, array index: 0x0C86 */
0x2746,INVALC,0x2744,0x273C,0x2734,0x273B,
/* Range 0x678C - 0x6794, array index: 0x0C8C */
0x273F,0x273E,0x2736,INVALC,INVALC,0x2742,0x2737,INVALC,
0x2749,
/* Range 0x67B7 - 0x67BB, array index: 0x0C95 */
0x2B27,INVALC,0x2B34,0x2B21,0x2B23,
/* Range 0x67C0 - 0x67CE, array index: 0x0C9A */
0x2B26,0x2A7C,0x2B33,0x2B43,INVALC,0x2B28,0x2B3A,INVALC,
0x2A7E,0x2B41,0x2B42,0x2B45,0x2B3C,0x2B2D,0x2B35,
/* Range 0x67E3 - 0x67FC, array index: 0x0CA9 */
0x2B32,0x2B2A,INVALC,0x2B3E,0x2B36,INVALC,INVALC,0x2B44,
0x2B29,INVALC,0x2B3B,0x2B31,INVALC,0x2B37,INVALC,0x2A7D,
INVALC,INVALC,INVALC,0x2B30,0x2B2F,0x2B24,INVALC,0x2B40,
INVALC,0x2B39,
/* Range 0x681C - 0x6820, array index: 0x0CC3 */
0x2F65,0x2F6D,INVALC,0x2F5B,0x2F76,
/* Range 0x682B - 0x6835, array index: 0x0CC8 */
0x2F67,INVALC,0x2F68,0x2F72,0x2F69,INVALC,0x2F64,0x2F5E,
0x2F5F,0x2F6C,0x2F66,
/* Range 0x684B - 0x684F, array index: 0x0CD3 */
0x2F61,INVALC,0x2F73,0x2F6A,0x2F62,
/* Range 0x686B - 0x6880, array index: 0x0CD8 */
0x3628,INVALC,0x3576,0x3577,0x357B,INVALC,0x362C,0x3629,
INVALC,0x3622,0x3621,INVALC,0x3625,0x3634,0x3572,INVALC,
0x3635,0x3627,0x3639,0x362D,INVALC,0x362B,
/* Range 0x6887 - 0x6892, array index: 0x0CEE */
0x3573,INVALC,0x3632,0x3638,0x3630,0x3637,INVALC,INVALC,
0x3624,0x3574,0x3636,0x3626,
/* Range 0x68A9 - 0x68AE, array index: 0x0CFA */
0x357E,0x362A,0x3579,0x357D,INVALC,0x3578,
/* Range 0x68C6 - 0x68C8, array index: 0x0D00 */
0x3C66,0x3C7C,0x3C71,
/* Range 0x68D0 - 0x68D6, array index: 0x0D03 */
0x3C69,0x3C76,INVALC,0x3C4E,0x3C78,INVALC,0x3C56,
/* Range 0x68DC - 0x68DE, array index: 0x0D0A */
0x3C50,0x3C72,0x3C73,
/* Range 0x68E6 - 0x68F8, array index: 0x0D0D */
0x3C74,INVALC,0x3C6C,0x3C79,0x3C53,0x3C58,0x3C52,INVALC,
INVALC,0x3C65,0x4364,0x3C54,INVALC,0x3C5D,0x3C75,INVALC,
0x3C5A,0x3C57,0x3C68,
/* Range 0x6904 - 0x6917, array index: 0x0D20 */
0x3C4F,INVALC,0x3C77,0x3C5F,0x3C61,INVALC,0x3C6E,0x3C6D,
0x3C4D,INVALC,INVALC,0x3C55,0x3C5C,0x3C64,INVALC,0x3C5B,
0x3C67,0x3C7A,INVALC,0x3C6F,
/* Range 0x6932 - 0x6959, array index: 0x0D34 */
0x4376,0x4361,0x4366,0x435F,INVALC,0x4372,0x4351,0x4358,
INVALC,0x4370,0x437A,0x4362,INVALC,0x4355,0x4368,0x436D,
0x4359,INVALC,0x436A,0x4356,INVALC,INVALC,0x435D,0x435E,
INVALC,0x4371,0x436F,INVALC,0x4352,0x4374,INVALC,0x4375,
0x4377,INVALC,INVALC,INVALC,0x357A,0x435A,0x436C,0x435B,
/* Range 0x696F - 0x6971, array index: 0x0D5C */
0x4369,0x3C62,0x4354,
/* Range 0x698D - 0x699A, array index: 0x0D5F */
0x4A70,0x4A6E,INVALC,0x4B26,0x4A6C,INVALC,0x4A7E,INVALC,
INVALC,0x4A68,0x4B25,INVALC,0x4A6D,0x4A7B,
/* Range 0x69AF - 0x69B6, array index: 0x0D6D */
0x4A73,0x4A69,0x4A63,INVALC,0x4A7D,INVALC,0x4B28,0x4A64,
/* Range 0x69BC - 0x69BF, array index: 0x0D75 */
0x4A6B,0x4A76,0x4A72,0x4A74,
/* Range 0x69E2 - 0x69E7, array index: 0x0D79 */
0x507C,INVALC,0x5078,0x5074,0x512A,0x5127,
/* Range 0x69F4 - 0x6A00, array index: 0x0D7F */
0x5137,INVALC,0x5134,0x5126,0x5075,INVALC,INVALC,0x512B,
0x512D,INVALC,0x5121,0x507A,0x5071,
/* Range 0x6A04 - 0x6A09, array index: 0x0D8C */
0x5130,INVALC,0x5072,0x5136,0x5129,0x512F,
/* Range 0x6A14 - 0x6A18, array index: 0x0D92 */
0x5125,0x5076,0x5138,0x5073,0x5131,
/* Range 0x6A25 - 0x6A28, array index: 0x0D97 */
0x5132,0x5135,0x5122,0x5755,
/* Range 0x6A3B - 0x6A41, array index: 0x0D9B */
0x5757,0x5762,INVALC,0x574F,0x5758,0x5128,0x5759,
/* Range 0x6A4D - 0x6A56, array index: 0x0DA2 */
0x5766,0x5767,0x575D,0x575C,0x5754,INVALC,INVALC,0x575E,
0x5765,0x5764,
/* Range 0x6A5A - 0x6A60, array index: 0x0DAC */
0x5756,0x5753,INVALC,0x5750,0x5763,INVALC,0x5761,
/* Range 0x6A64 - 0x6A6A, array index: 0x0DB3 */
0x575B,INVALC,0x574A,0x574C,0x574E,0x5760,0x575A,
/* Range 0x6A8C - 0x6A96, array index: 0x0DBA */
0x5D35,0x5C7E,0x5D2B,INVALC,INVALC,0x5D30,0x5D36,0x5D2A,
INVALC,0x5D2C,0x5D21,
/* Range 0x6AA4 - 0x6AA8, array index: 0x0DC5 */
0x5D2F,0x5D23,0x5D32,INVALC,0x5D2E,
/* Range 0x6AB6 - 0x6ABA, array index: 0x0DCA */
0x616F,0x6170,INVALC,0x616A,0x616E,
/* Range 0x6AC5 - 0x6AD1, array index: 0x0DCF */
0x6169,0x616D,0x6171,INVALC,INVALC,INVALC,0x655C,0x6559,
0x6562,INVALC,0x6561,0x655F,0x655A,
/* Range 0x6ADC - 0x6AE1, array index: 0x0DDC */
0x655E,INVALC,0x6563,0x655D,0x6558,0x616C,
/* Range 0x6AE7 - 0x6AF3, array index: 0x0DE2 */
0x6557,0x6924,INVALC,0x6923,0x6560,INVALC,INVALC,0x6927,
0x6928,0x6922,0x6926,INVALC,0x6921,
/* Range 0x6B0F - 0x6B1A, array index: 0x0DEF */
0x6F31,INVALC,0x6F2F,0x6F30,0x703A,INVALC,INVALC,INVALC,
0x7123,0x7121,0x7122,0x7124,
/* Range 0x6B33 - 0x6B3C, array index: 0x0DFB */
0x363B,0x2F7B,INVALC,0x363A,0x363C,0x363D,0x3C7D,INVALC,
0x3C7E,0x3D22,
/* Range 0x6B3F - 0x6B4D, array index: 0x0E05 */
0x3D21,INVALC,0x4422,0x437E,0x437D,INVALC,0x437C,0x437B,
INVALC,0x4421,INVALC,0x4B2B,0x4B2D,INVALC,0x4B2C,
/* Range 0x6B54 - 0x6B56, array index: 0x0E14 */
0x576A,0x5769,0x576B,
/* Range 0x6B8C - 0x6BAD, array index: 0x0E17 */
0x3642,0x3640,0x3641,0x363F,INVALC,0x363E,INVALC,INVALC,
0x3D23,0x3D26,INVALC,0x3D24,INVALC,0x3D25,INVALC,0x4423,
INVALC,INVALC,0x4B2E,0x4B2F,0x4B30,INVALC,0x513C,0x513B,
INVALC,0x513A,0x513D,0x576C,INVALC,INVALC,0x576D,0x576E,
INVALC,0x5D38,
/* Range 0x6BC3 - 0x6BCC, array index: 0x0E39 */
0x4B31,0x4B32,INVALC,INVALC,0x5770,0x576F,0x6175,0x6F32,
INVALC,0x2140,
/* Range 0x6BE0 - 0x6BE8, array index: 0x0E43 */
0x2B4C,INVALC,0x3025,0x3024,0x3022,INVALC,0x3021,0x3026,
0x3023,
/* Range 0x6BF7 - 0x6C06, array index: 0x0E4C */
0x4427,0x4428,0x4426,INVALC,0x4424,0x4425,INVALC,0x4B33,
0x5140,0x513F,0x513E,0x5141,0x5772,0x5771,INVALC,0x5773,
/* Range 0x6C09 - 0x6C0D, array index: 0x0E5C */
0x5D39,INVALC,0x6176,0x6566,0x6D55,
/* Range 0x6C14 - 0x6C1A, array index: 0x0E61 */
0x2141,0x215F,INVALC,INVALC,0x2258,0x2449,0x244A,
/* Range 0x6C4A - 0x6C4C, array index: 0x0E68 */
0x225D,0x225F,0x2260,
/* Range 0x6C65 - 0x6C73, array index: 0x0E6B */
0x245B,0x2459,0x244C,INVALC,0x2453,INVALC,0x244D,INVALC,
0x2455,INVALC,0x2452,INVALC,0x2451,INVALC,0x245A,
/* Range 0x6CCD - 0x6CD4, array index: 0x0E7A */
0x2769,INVALC,0x276D,0x2759,0x276F,0x2760,INVALC,0x2755,
/* Range 0x6CE9 - 0x6CEE, array index: 0x0E82 */
0x276E,INVALC,0x2751,0x2750,0x275E,0x2752,
/* Range 0x6D00 - 0x6D0A, array index: 0x0E88 */
0x2B5E,0x2B61,INVALC,0x2B64,0x2B59,INVALC,INVALC,0x2B67,
0x2B6A,0x2B6C,0x2B56,
/* Range 0x6D0D - 0x6D12, array index: 0x0E93 */
0x302C,INVALC,0x2B65,0x2B6D,0x2B5D,0x2B55,
/* Range 0x6D16 - 0x6D1A, array index: 0x0E99 */
0x3047,INVALC,0x2B62,0x2B5A,0x2B5C,
/* Range 0x6D2C - 0x6D34, array index: 0x0E9E */
0x2B69,0x2B51,INVALC,0x3041,0x2768,INVALC,INVALC,0x2B58,
0x2B50,
/* Range 0x6D5E - 0x6D68, array index: 0x0EA7 */
0x3038,0x303E,0x303A,0x302D,0x3030,0x3029,0x302A,INVALC,
INVALC,0x3039,0x3042,
/* Range 0x6D7A - 0x6D86, array index: 0x0EB2 */
0x3028,0x3049,0x303D,0x304A,0x3044,0x3036,0x3045,INVALC,
0x303F,0x3048,0x3046,INVALC,0x3037,
/* Range 0x6D90 - 0x6D92, array index: 0x0EBF */
0x304C,0x3033,0x302E,
/* Range 0x6DBA - 0x6DC2, array index: 0x0EC2 */
0x365E,0x366A,INVALC,0x365B,0x3654,INVALC,0x3644,INVALC,
0x3660,
/* Range 0x6DC8 - 0x6DCA, array index: 0x0ECB */
0x3650,0x3662,0x365A,
/* Range 0x6DCF - 0x6DE5, array index: 0x0ECE */
0x3661,0x3663,INVALC,INVALC,0x3665,0x364E,0x365F,0x3653,
0x3667,INVALC,INVALC,INVALC,0x3658,0x3656,0x3657,INVALC,
0x3652,0x3651,INVALC,0x364B,0x3669,INVALC,0x3655,
/* Range 0x6E39 - 0x6E4B, array index: 0x0EE5 */
0x3D4C,INVALC,0x3D40,0x3D32,0x3D33,INVALC,0x3D37,0x3D3E,
0x3D38,INVALC,INVALC,INVALC,0x3D34,0x3D2D,0x3D2E,INVALC,
0x3D30,INVALC,0x3D3D,
/* Range 0x6E51 - 0x6E55, array index: 0x0EF8 */
0x3D3F,0x3D57,0x3D4F,INVALC,0x3D55,
/* Range 0x6E5A - 0x6E68, array index: 0x0EFD */
0x3D5B,INVALC,0x3D45,0x3D39,0x3D43,INVALC,0x3D49,0x3D46,
0x3D35,INVALC,0x3D53,0x3D50,0x3D58,INVALC,0x3D44,
/* Range 0x6E73 - 0x6E79, array index: 0x0F0C */
0x3D3A,0x3648,INVALC,INVALC,0x3D54,0x3D52,0x3D56,
/* Range 0x6E8D - 0x6E94, array index: 0x0F13 */
0x4447,0x4446,0x442C,INVALC,INVALC,0x4445,0x442F,0x4430,
/* Range 0x6E9E - 0x6EA6, array index: 0x0F1B */
0x4438,0x442E,0x4431,0x4449,INVALC,0x4450,0x4448,INVALC,
0x443D,
/* Range 0x6EAE - 0x6EB3, array index: 0x0F24 */
0x444F,INVALC,0x443B,0x4432,0x443F,0x444B,
/* Range 0x6EBD - 0x6EC3, array index: 0x0F2A */
0x4436,0x4440,0x444A,0x442D,0x4437,INVALC,0x4441,
/* Range 0x6EC6 - 0x6ED2, array index: 0x0F31 */
0x4434,INVALC,0x442B,0x4439,0x444D,INVALC,INVALC,0x443C,
0x4B34,0x443E,0x444C,INVALC,0x4435,
/* Range 0x6EF5 - 0x6EFD, array index: 0x0F3E */
0x4B35,0x4B56,INVALC,0x4B39,0x4B49,INVALC,0x4B3B,0x4B59,
0x4B55,
/* Range 0x6F05 - 0x6F0E, array index: 0x0F47 */
0x4B54,INVALC,0x4B51,0x4B5E,0x4B3D,0x4B46,INVALC,INVALC,
0x4B5C,0x4B52,
/* Range 0x6F18 - 0x6F27, array index: 0x0F51 */
0x4B42,0x4B3F,0x4B40,INVALC,0x4B58,INVALC,0x4B5D,0x4B5B,
INVALC,0x4B5F,INVALC,INVALC,INVALC,0x4B38,0x5143,0x4B41,
/* Range 0x6F35 - 0x6F3C, array index: 0x0F61 */
0x4B4F,0x4B47,0x4B3A,INVALC,0x4B57,0x4B5A,0x4B43,0x4B4E,
/* Range 0x6F4E - 0x6F57, array index: 0x0F69 */
0x4B3E,0x514C,0x5156,INVALC,0x5155,0x5161,INVALC,0x5153,
INVALC,0x5157,
/* Range 0x6F5D - 0x6F63, array index: 0x0F73 */
0x515A,0x577B,INVALC,INVALC,0x515C,0x514B,0x5166,
/* Range 0x6F67 - 0x6F6C, array index: 0x0F7A */
0x515F,INVALC,0x5163,0x5168,0x515D,0x5151,
/* Range 0x6F7B - 0x6F7F, array index: 0x0F80 */
0x5169,INVALC,0x515E,0x5144,0x5164,
/* Range 0x6F89 - 0x6F8D, array index: 0x0F85 */
0x5149,INVALC,0x5162,0x514A,0x5148,
/* Range 0x6F90 - 0x6F96, array index: 0x0F8A */
0x5160,INVALC,0x5147,0x5159,0x5158,0x5165,0x514F,
/* Range 0x6FA8 - 0x6FB2, array index: 0x0F91 */
0x5822,0x5D3B,0x5828,0x582E,0x5827,0x5774,0x5825,0x5830,
0x5832,INVALC,0x5831,
/* Range 0x6FC4 - 0x6FCF, array index: 0x0F9C */
0x577C,INVALC,0x5146,0x5777,0x577A,0x582D,0x5821,0x5775,
0x5D3A,0x582F,0x5779,0x5829,
/* Range 0x6FDC - 0x6FDE, array index: 0x0FA8 */
0x5D3F,0x5D45,0x5D43,
/* Range 0x6FE2 - 0x6FE8, array index: 0x0FAB */
0x5D46,0x5D3E,INVALC,INVALC,0x5D42,0x5D41,0x5D47,
/* Range 0x6FFB - 0x7007, array index: 0x0FB2 */
0x6222,0x6224,INVALC,INVALC,0x617E,0x6221,0x617A,INVALC,
INVALC,0x5823,0x617B,INVALC,0x6177,
/* Range 0x700A - 0x700E, array index: 0x0FBF */
0x6226,INVALC,0x6178,0x6179,0x617D,
/* Range 0x7020 - 0x702B, array index: 0x0FC4 */
0x6569,0x656C,0x656D,0x656E,0x6571,INVALC,0x6223,0x6568,
INVALC,0x656F,0x6934,0x656B,
/* Range 0x7031 - 0x704A, array index: 0x0FD0 */
0x692E,INVALC,0x6937,0x692D,0x692A,INVALC,0x692C,0x6930,
0x6933,0x6932,0x6936,0x6929,INVALC,INVALC,0x6931,0x6935,
0x6938,0x692F,0x6B61,0x6B62,0x6B66,0x6B67,INVALC,0x6B64,
0x6B65,0x6B63,
/* Range 0x7055 - 0x706A, array index: 0x0FEA */
0x6D56,0x6D57,0x6D58,INVALC,INVALC,0x6F34,0x6F33,INVALC,
0x703D,INVALC,0x703B,0x703E,0x703C,0x7125,INVALC,INVALC,
0x7171,0x715B,INVALC,0x7170,0x723E,0x723F,
/* Range 0x7082 - 0x7086, array index: 0x1000 */
0x2778,0x277A,0x2775,0x2772,0x2774,
/* Range 0x70C5 - 0x70C7, array index: 0x1005 */
0x305A,0x305B,0x305C,
/* Range 0x70CD - 0x70D4, array index: 0x1008 */
0x3059,0x305E,INVALC,INVALC,0x304F,0x3055,0x304E,0x3058,
/* Range 0x70DA - 0x70E2, array index: 0x1010 */
0x305D,INVALC,0x304D,0x3050,0x3056,INVALC,0x3057,0x305F,
0x3053,
/* Range 0x70F3 - 0x7106, array index: 0x1019 */
0x3673,0x366F,INVALC,0x367B,0x366D,0x367A,INVALC,0x366B,
0x3D5F,0x3675,INVALC,INVALC,0x3676,0x3679,INVALC,0x367D,
INVALC,0x3672,INVALC,0x3677,
/* Range 0x710B - 0x7110, array index: 0x102D */
0x367C,0x3670,0x366C,0x367E,INVALC,0x3674,
/* Range 0x711E - 0x7125, array index: 0x1033 */
0x3D5D,0x3D66,0x3D5C,INVALC,0x3D64,0x3D62,INVALC,0x3D63,
/* Range 0x712E - 0x7132, array index: 0x103B */
0x3D60,0x3D5E,INVALC,0x3D61,0x3D65,
/* Range 0x7141 - 0x7144, array index: 0x1040 */
0x4456,0x445D,0x445F,0x4465,
/* Range 0x7150 - 0x7154, array index: 0x1044 */
0x4463,INVALC,0x4453,0x4464,0x4452,
/* Range 0x715D - 0x7163, array index: 0x1049 */
0x4457,INVALC,0x4462,0x4455,0x445C,0x4458,0x4454,
/* Range 0x7180 - 0x7189, array index: 0x1050 */
0x4B63,0x4B69,0x4B65,INVALC,INVALC,0x4B64,0x4B68,0x4B60,
INVALC,0x4B62,
/* Range 0x719A - 0x71AA, array index: 0x105A */
0x516F,0x516C,0x5178,0x5172,0x5174,INVALC,0x516E,0x5176,
INVALC,INVALC,0x5175,0x5173,INVALC,0x5179,INVALC,0x5170,
0x5177,
/* Range 0x71AF - 0x71B5, array index: 0x106B */
0x516B,0x516D,INVALC,0x516A,0x517A,INVALC,0x5171,
/* Range 0x71BC - 0x71CB, array index: 0x1072 */
0x5841,0x583F,INVALC,0x5835,0x5838,0x5839,0x5834,INVALC,
INVALC,0x5833,0x5842,0x583D,INVALC,INVALC,0x583C,0x583A,
/* Range 0x71F0 - 0x71F2, array index: 0x1082 */
0x5D4D,0x5D49,0x5D4B,
/* Range 0x71FF - 0x7207, array index: 0x1085 */
0x6228,INVALC,0x6227,0x6576,0x622A,INVALC,0x6577,INVALC,
0x6575,
/* Range 0x7219 - 0x7229, array index: 0x108E */
0x6B6A,0x6B69,INVALC,INVALC,0x6B68,0x6D5A,0x6D5B,INVALC,
INVALC,0x6F35,0x703F,INVALC,INVALC,0x7126,0x722C,INVALC,
0x7240,
/* Range 0x7249 - 0x724B, array index: 0x109F */
0x2B78,0x2B79,0x3D6A,
/* Range 0x7276 - 0x727F, array index: 0x10A2 */
0x3063,0x3062,0x3061,INVALC,INVALC,0x3722,0x3723,INVALC,
0x3721,0x3724,
/* Range 0x7285 - 0x729E, array index: 0x10AC */
0x3D6F,0x3D6E,INVALC,0x3D6C,0x3D6D,INVALC,0x3D70,0x446A,
0x4469,0x446D,INVALC,0x446C,0x446B,INVALC,0x4B6F,INVALC,
0x4B6E,INVALC,0x4B6D,0x517B,INVALC,0x517C,INVALC,INVALC,
0x5845,0x5846,
/* Range 0x72A1 - 0x72AA, array index: 0x10C6 */
0x657C,INVALC,0x657B,0x657A,0x6578,0x6579,INVALC,0x693B,
0x6D5C,0x7127,
/* Range 0x72C5 - 0x72CC, array index: 0x10D0 */
0x2467,0x2464,INVALC,INVALC,0x2821,0x2B7E,0x277D,0x2826,
/* Range 0x72FA - 0x7301, array index: 0x10D8 */
0x3065,0x306A,INVALC,INVALC,0x3067,0x372C,0x3064,0x306B,
/* Range 0x7307 - 0x730C, array index: 0x10E0 */
0x3727,0x372B,INVALC,0x372A,0x3D72,0x3D7D,
/* Range 0x7330 - 0x7335, array index: 0x10E6 */
0x3D73,0x3D75,0x3D78,0x3D76,INVALC,0x3D7C,
/* Range 0x733A - 0x733C, array index: 0x10EC */
0x4471,0x4470,0x446E,
/* Range 0x7349 - 0x734D, array index: 0x10EF */
0x4474,0x4473,INVALC,0x4B73,0x4B71,
/* Range 0x7358 - 0x736F, array index: 0x10F4 */
0x517D,0x5228,0x5227,0x5225,INVALC,0x5224,0x5221,0x5222,
0x5223,0x5226,0x5229,INVALC,INVALC,0x584B,0x5848,0x5849,
INVALC,0x5847,0x584D,0x584C,0x584A,INVALC,0x5D50,0x5D51,
/* Range 0x737C - 0x7385, array index: 0x110C */
0x693D,0x693C,0x6B6B,0x6D5D,INVALC,0x6F37,0x6F36,0x6F38,
INVALC,0x2C28,
/* Range 0x7392 - 0x7397, array index: 0x1116 */
0x246C,0x246A,0x246B,0x2468,INVALC,0x2469,
/* Range 0x73A0 - 0x73A6, array index: 0x111C */
0x282D,0x2829,0x282C,INVALC,0x2828,INVALC,0x282B,
/* Range 0x73B4 - 0x73B9, array index: 0x1123 */
0x2C30,0x2C2F,0x2C2E,INVALC,0x2C37,0x2C2D,
/* Range 0x73C2 - 0x73CC, array index: 0x1129 */
0x2C2A,0x2C35,INVALC,0x2C2C,0x2C36,0x2C33,0x2C2B,INVALC,
INVALC,0x2C38,0x2C29,
/* Range 0x73D2 - 0x73DD, array index: 0x1134 */
0x3075,0x306C,0x3077,INVALC,0x306F,0x307A,0x307B,0x306D,
0x3079,0x3076,0x3074,0x3078,
/* Range 0x73E5 - 0x73EB, array index: 0x1140 */
0x306E,INVALC,0x3071,0x307C,0x3073,INVALC,0x2C31,
/* Range 0x73F4 - 0x7401, array index: 0x1147 */
0x373D,0x3732,0x3730,INVALC,0x3731,INVALC,0x3738,INVALC,
0x3739,0x3735,INVALC,0x373A,0x3737,0x3734,
/* Range 0x7420 - 0x7424, array index: 0x1155 */
0x3E2D,0x3E26,INVALC,0x3E2A,0x3E29,
/* Range 0x7429 - 0x7432, array index: 0x115A */
0x3E2C,INVALC,0x3E23,0x3E21,0x3E27,0x3D7E,INVALC,0x3E22,
0x3E28,0x3E2E,
/* Range 0x744A - 0x7454, array index: 0x1164 */
0x4476,0x4477,INVALC,0x4523,0x447E,0x447C,0x447D,0x4479,
0x4478,INVALC,0x4524,
/* Range 0x7471 - 0x7475, array index: 0x116F */
0x4B76,0x4B78,0x4B75,INVALC,0x4B77,
/* Range 0x7485 - 0x748A, array index: 0x1174 */
0x5230,0x522D,0x522A,0x5231,0x522B,0x522C,
/* Range 0x74B1 - 0x74BB, array index: 0x117A */
0x5D58,0x5D53,INVALC,INVALC,0x622F,0x6232,0x6621,0x622D,
INVALC,0x693E,0x6233,
/* Range 0x74BE - 0x74C5, array index: 0x1185 */
0x6231,INVALC,0x622E,0x6230,0x6234,0x6622,INVALC,0x657E,
/* Range 0x74D5 - 0x74E1, array index: 0x118D */
0x6D5F,INVALC,0x6D61,0x6D5E,0x6D60,INVALC,0x7040,INVALC,
0x2830,0x307D,0x307E,INVALC,0x4525,
/* Range 0x74FB - 0x7503, array index: 0x119A */
0x3E2F,INVALC,0x4528,0x4527,0x4526,0x4B7B,INVALC,0x4B7C,
0x4B7D,
/* Range 0x750F - 0x7517, array index: 0x11A3 */
0x5D5E,0x5D5B,0x5D5C,0x5D5D,0x6236,0x6235,INVALC,0x6623,
0x6B6C,
/* Range 0x753E - 0x7540, array index: 0x11AC */
0x2834,0x2832,0x2833,
/* Range 0x75BF - 0x75C1, array index: 0x11AF */
0x312B,0x312A,0x3127,
/* Range 0x75CB - 0x75D2, array index: 0x11B2 */
0x3744,0x3745,INVALC,0x3741,0x3743,0x3747,0x3746,0x3742,
/* Range 0x75F5 - 0x75FE, array index: 0x11BA */
0x4539,0x4537,0x4530,0x4534,0x4533,INVALC,0x4536,0x4532,
0x453A,0x4531,
/* Range 0x760F - 0x761E, array index: 0x11C4 */
0x452E,0x4535,0x4C26,INVALC,INVALC,0x4C28,0x4C25,0x4C22,
INVALC,INVALC,0x5239,0x523D,0x523F,0x523B,0x523A,0x5238,
/* Range 0x762D - 0x7635, array index: 0x11D4 */
0x5858,INVALC,0x5857,0x585F,0x5859,0x585E,0x585B,INVALC,
0x585D,
/* Range 0x7647 - 0x7649, array index: 0x11DD */
0x5D63,0x5D61,0x5D62,
/* Range 0x7699 - 0x769E, array index: 0x11E0 */
0x453B,INVALC,0x5243,0x5240,0x5241,0x5242,
/* Range 0x7703 - 0x7705, array index: 0x11E6 */
0x2C43,0x2C44,0x2C45,
/* Range 0x7710 - 0x771D, array index: 0x11E9 */
0x3132,0x3136,0x3134,0x3133,INVALC,0x3137,INVALC,INVALC,
INVALC,0x3138,0x3139,0x3131,INVALC,0x3130,
/* Range 0x772F - 0x7735, array index: 0x11F7 */
0x374C,INVALC,0x374E,0x374F,0x3751,0x3750,0x3755,
/* Range 0x7744 - 0x774E, array index: 0x11FE */
0x3E40,0x3E42,0x3E3E,0x3E3F,INVALC,INVALC,0x3E43,0x3E45,
0x3E46,0x3E41,0x3E44,
/* Range 0x7752 - 0x775A, array index: 0x1209 */
0x4541,INVALC,0x4546,0x453E,0x4542,INVALC,INVALC,0x4547,
0x4543,
/* Range 0x776D - 0x776F, array index: 0x1212 */
0x4548,0x4C2E,0x4C30,
/* Range 0x777E - 0x7789, array index: 0x1215 */
0x4C31,INVALC,0x4C2F,0x4C2A,0x4C2D,0x4C32,INVALC,0x4C2C,
INVALC,INVALC,0x5247,0x5246,
/* Range 0x7797 - 0x77A3, array index: 0x1221 */
0x586B,INVALC,0x586A,0x5862,0x5866,0x5865,0x5863,INVALC,
INVALC,INVALC,0x5864,0x5867,0x5868,
/* Range 0x77B1 - 0x77B7, array index: 0x122E */
0x5D6C,0x5D68,INVALC,0x5D6B,0x5D66,0x5D6A,0x5D69,
/* Range 0x77C9 - 0x77D0, array index: 0x1235 */
0x6625,0x6626,INVALC,0x6943,0x6946,0x6944,0x6945,0x6B6E,
/* Range 0x77F0 - 0x77F2, array index: 0x123D */
0x5D6E,0x6628,0x6947,
/* Range 0x77F7 - 0x77FC, array index: 0x1240 */
0x2841,0x283C,0x283E,0x2840,0x283F,0x283D,
/* Range 0x780E - 0x7813, array index: 0x1246 */
0x2C52,0x2C51,0x2C50,0x2C4D,0x2C4E,0x2C55,
/* Range 0x7821 - 0x7823, array index: 0x124C */
0x3144,0x313E,0x313C,
/* Range 0x7826 - 0x7835, array index: 0x124F */
0x375C,INVALC,0x3141,0x3145,0x3147,0x3143,0x313D,INVALC,
0x3142,0x3140,INVALC,0x3148,INVALC,0x3146,INVALC,0x313F,
/* Range 0x7848 - 0x784D, array index: 0x125F */
0x3756,0x3758,0x375A,INVALC,0x375B,0x3759,
/* Range 0x7864 - 0x7871, array index: 0x1265 */
0x3E4A,0x3E4B,INVALC,INVALC,0x3E53,0x3E52,0x3E4F,INVALC,
INVALC,0x3E4D,0x3E50,INVALC,0x3E51,0x3E4E,
/* Range 0x7883 - 0x7887, array index: 0x1273 */
0x4553,0x454E,0x4550,0x4551,0x454A,
/* Range 0x7894 - 0x789A, array index: 0x1278 */
0x454C,0x454F,0x4557,INVALC,INVALC,0x4555,0x454B,
/* Range 0x789E - 0x78A5, array index: 0x127F */
0x4C3A,INVALC,0x4C3C,0x4552,0x4C3E,INVALC,0x4C3F,0x4C3B,
/* Range 0x78A8 - 0x78AD, array index: 0x1287 */
0x4C37,INVALC,0x4C34,0x4C39,0x4C3D,0x4C36,
/* Range 0x78C8 - 0x78D1, array index: 0x128D */
0x524F,0x5252,INVALC,INVALC,0x524B,0x5248,0x524D,0x524A,
INVALC,0x524C,
/* Range 0x78DB - 0x78E5, array index: 0x1297 */
0x5872,INVALC,0x586C,0x5870,0x5876,0x5877,0x5873,0x5874,
0x5871,INVALC,0x586E,
/* Range 0x78F9 - 0x78FF, array index: 0x12A2 */
0x5D77,INVALC,0x5D72,0x5D73,0x5D70,0x5D78,0x5D74,
/* Range 0x7910 - 0x7914, array index: 0x12A9 */
0x6247,0x6249,0x6248,0x6244,0x6245,
/* Range 0x791B - 0x791E, array index: 0x12AE */
0x662A,0x662C,0x6629,0x662E,
/* Range 0x7921 - 0x7929, array index: 0x12B2 */
0x662B,INVALC,0x6949,0x694C,0x6948,INVALC,0x694A,0x694B,
0x694D,
/* Range 0x794A - 0x794C, array index: 0x12BB */
0x2C56,0x2C58,0x2C57,
/* Range 0x794F - 0x7954, array index: 0x12BE */
0x314B,INVALC,0x314F,0x314E,0x314D,0x3149,
/* Range 0x7967 - 0x796B, array index: 0x12C4 */
0x3760,INVALC,0x3761,0x3762,0x3764,
/* Range 0x7970 - 0x7974, array index: 0x12C9 */
0x3E59,INVALC,0x3E58,0x3E57,0x3E56,
/* Range 0x7990 - 0x79A4, array index: 0x12CE */
0x4C4A,INVALC,0x4C49,0x4C46,0x4C45,0x4C44,0x4C43,0x4C47,
0x4C40,INVALC,0x5253,0x5258,0x5256,INVALC,INVALC,INVALC,
0x5255,0x5254,0x5257,INVALC,0x5878,
/* Range 0x79AB - 0x79AD, array index: 0x12E3 */
0x5D7A,0x624B,0x624A,
/* Range 0x79B4 - 0x79B8, array index: 0x12E6 */
0x6D65,INVALC,0x7045,0x7044,0x2167,
/* Range 0x79CD - 0x79CF, array index: 0x12EB */
0x2C5C,0x2C5F,0x2C5D,
/* Range 0x79DC - 0x79E0, array index: 0x12EE */
0x3156,0x3158,0x3157,INVALC,0x3152,
/* Range 0x79EA - 0x79EE, array index: 0x12F3 */
0x3155,0x3150,0x3151,0x3154,0x3153,
/* Range 0x79F6 - 0x79FA, array index: 0x12F8 */
0x3769,0x376A,0x3768,INVALC,0x3767,
/* Range 0x7A02 - 0x7A04, array index: 0x12FD */
0x3E5A,0x3E5C,0x3E5E,
/* Range 0x7A10 - 0x7A1B, array index: 0x1300 */
0x4566,0x455D,0x4560,0x4564,INVALC,0x4562,INVALC,0x4561,
0x455E,0x455F,INVALC,0x4565,
/* Range 0x7A58 - 0x7A5C, array index: 0x130C */
0x5E21,INVALC,0x5E23,0x5D7D,0x5D7C,
/* Range 0x7A6C - 0x7A71, array index: 0x1311 */
0x6950,0x6951,0x694F,INVALC,0x6D66,0x6D67,
/* Range 0x7A85 - 0x7A90, array index: 0x1317 */
0x315B,0x3159,0x315F,INVALC,0x315A,0x315E,0x315C,0x315D,
INVALC,INVALC,0x376B,0x376D,
/* Range 0x7AB1 - 0x7AB8, array index: 0x1323 */
0x5921,0x525B,0x525D,0x525C,0x587E,0x587C,0x5922,0x587D,
/* Range 0x7B04 - 0x7B13, array index: 0x132B */
0x3162,0x3164,INVALC,INVALC,0x3166,0x3169,0x3167,INVALC,
INVALC,INVALC,0x3168,0x3165,0x3161,INVALC,0x316A,0x3163,
/* Range 0x7B22 - 0x7B25, array index: 0x133B */
0x3773,0x3822,0x3774,0x3771,
/* Range 0x7B2D - 0x7B35, array index: 0x133F */
0x377B,INVALC,0x377C,0x3772,0x3779,0x377D,0x3775,0x3770,
0x376E,
/* Range 0x7B44 - 0x7B4E, array index: 0x1348 */
0x3E64,0x3E6A,INVALC,0x3E63,0x3E65,INVALC,0x3E62,INVALC,
0x3E66,INVALC,0x3E67,
/* Range 0x7B61 - 0x7B66, array index: 0x1353 */
0x4575,INVALC,0x4578,0x456C,0x4571,0x456B,
/* Range 0x7B70 - 0x7B78, array index: 0x1359 */
0x4574,0x4573,0x4570,0x4572,0x456E,INVALC,0x4577,INVALC,
0x4576,
/* Range 0x7B8A - 0x7B91, array index: 0x1362 */
0x4C57,INVALC,0x4C5C,0x4C5B,0x4C5E,INVALC,0x4C59,0x4C58,
/* Range 0x7B98 - 0x7B9C, array index: 0x136A */
0x4C60,0x4C62,INVALC,0x4C5D,0x4C56,
/* Range 0x7BDA - 0x7BEB, array index: 0x136F */
0x5929,INVALC,0x592F,0x5926,0x5923,0x5932,INVALC,INVALC,
0x592E,0x5924,INVALC,0x5928,INVALC,0x5925,0x592A,INVALC,
0x592D,0x5930,
/* Range 0x7BF0 - 0x7BF4, array index: 0x1381 */
0x5E38,0x5E39,0x5E29,0x5E30,0x5E2E,
/* Range 0x7BFD - 0x7C10, array index: 0x1386 */
0x5E36,INVALC,0x5E2B,0x5E2A,0x5E34,0x5E31,0x5E33,INVALC,
0x5E27,0x5E37,INVALC,INVALC,0x5E32,0x5E3B,0x5E2F,INVALC,
INVALC,0x5E2D,0x5E28,0x5E3A,
/* Range 0x7C1C - 0x7C2D, array index: 0x139A */
0x624D,0x6253,INVALC,0x6251,0x6250,INVALC,0x6256,INVALC,
INVALC,0x6257,0x6254,INVALC,0x6255,0x624E,INVALC,INVALC,
0x6635,0x6252,
/* Range 0x7C45 - 0x7C4A, array index: 0x13AC */
0x6957,INVALC,0x6956,0x6954,0x6953,0x6955,
/* Range 0x7C57 - 0x7C5C, array index: 0x13B2 */
0x6D68,INVALC,0x6D6A,0x6D6C,0x6D6B,0x6D69,
/* Range 0x7C66 - 0x7C6B, array index: 0x13B8 */
0x6F3C,0x6F3B,INVALC,0x712B,0x7046,0x712C,
/* Range 0x7C78 - 0x7C7A, array index: 0x13BE */
0x2C66,0x2C67,0x2C65,
/* Range 0x7C7F - 0x7C85, array index: 0x13C1 */
0x2C68,0x2C69,0x2C6A,INVALC,INVALC,0x316B,0x3171,
/* Range 0x7CA1 - 0x7CA3, array index: 0x13C8 */
0x3E6E,0x3E6B,0x3826,
/* Range 0x7CBA - 0x7CBC, array index: 0x13CB */
0x4C68,0x4C65,0x4C67,
/* Range 0x7CD0 - 0x7CD4, array index: 0x13CE */
0x5936,0x5937,0x5933,INVALC,0x5934,
/* Range 0x7D0E - 0x7D13, array index: 0x13D3 */
0x3175,0x317B,INVALC,0x3174,0x317A,0x3178,
/* Range 0x7D1D - 0x7D1F, array index: 0x13D9 */
0x3173,0x3172,0x3179,
/* Range 0x7D3A - 0x7D41, array index: 0x13DC */
0x382B,0x3834,INVALC,0x3828,0x3831,0x3832,INVALC,0x382F,
/* Range 0x7D4E - 0x7D58, array index: 0x13E4 */
0x3F21,0x3E76,INVALC,0x3E7D,0x3E7A,0x3E72,0x3E7B,INVALC,
0x3E73,INVALC,0x3E6F,
/* Range 0x7D67 - 0x7D6F, array index: 0x13EF */
0x3E74,INVALC,0x3E7C,0x3E75,0x3E79,INVALC,0x3E77,INVALC,
0x3E70,
/* Range 0x7D7A - 0x7D8E, array index: 0x13F8 */
0x4624,0x4626,0x4628,0x462C,INVALC,0x4622,0x457E,INVALC,
INVALC,0x4627,0x462B,0x4623,0x457D,INVALC,0x457C,INVALC,
INVALC,INVALC,0x4629,0x4621,0x4625,
/* Range 0x7DA6 - 0x7DAA, array index: 0x140D */
0x4C7C,0x4C69,INVALC,0x4C7E,0x4C6D,
/* Range 0x7DC0 - 0x7DC6, array index: 0x1412 */
0x4C6F,0x4C6E,0x4C6B,INVALC,0x4C73,0x4C70,0x4C74,
/* Range 0x7E0B - 0x7E17, array index: 0x1419 */
0x5944,0x593B,0x5947,0x593F,0x5945,INVALC,INVALC,0x5938,
0x593E,0x5948,0x5941,0x5946,0x593A,
/* Range 0x7E1F - 0x7E25, array index: 0x1426 */
0x593C,0x593D,0x5939,0x5943,INVALC,0x594A,0x5949,
/* Range 0x7E38 - 0x7E3C, array index: 0x142D */
0x5E42,INVALC,0x5E4D,0x5E4A,0x5E3E,
/* Range 0x7E56 - 0x7E58, array index: 0x1432 */
0x625B,0x6262,0x625D,
/* Range 0x7E5F - 0x7E63, array index: 0x1435 */
0x625F,0x6261,INVALC,0x625E,0x625C,
/* Range 0x7E72 - 0x7E7B, array index: 0x143A */
0x6640,INVALC,0x6641,0x663A,0x6639,0x663D,0x663B,INVALC,
0x663F,0x6959,
/* Range 0x7E86 - 0x7E8D, array index: 0x1444 */
0x6B79,0x6B76,0x6B77,INVALC,0x6B75,0x6B78,INVALC,0x6B7A,
/* Range 0x7E95 - 0x7E9B, array index: 0x144C */
0x6F3D,INVALC,0x7047,0x712F,0x7131,0x712E,0x7130,
/* Range 0x7F5B - 0x7F6D, array index: 0x1453 */
0x3224,0x317D,0x3223,0x3221,INVALC,0x3222,0x317E,INVALC,
0x3836,INVALC,0x3F24,0x3F25,0x4630,0x4631,INVALC,INVALC,
0x462F,0x4632,0x462E,
/* Range 0x7F7A - 0x7F7F, array index: 0x1466 */
0x594E,0x594C,0x594D,0x5E51,0x5E50,0x5E4F,
/* Range 0x7F9B - 0x7FA7, array index: 0x146C */
0x383A,0x3838,0x3839,INVALC,INVALC,0x3F27,0x3F28,0x3F26,
INVALC,INVALC,0x4634,0x4633,0x4635,
/* Range 0x7FC7 - 0x7FD1, array index: 0x1479 */
0x3840,INVALC,0x3842,0x383B,0x383C,INVALC,0x383D,INVALC,
0x3841,0x383E,0x383F,
/* Range 0x7FE2 - 0x7FEF, array index: 0x1484 */
0x4D24,0x4D25,INVALC,0x4D26,0x5323,INVALC,0x5324,INVALC,
0x5321,0x527E,0x5322,0x527D,INVALC,0x5950,
/* Range 0x7FF4 - 0x7FF8, array index: 0x1492 */
0x5E52,0x6134,INVALC,0x6266,0x6267,
/* Range 0x7FFD - 0x7FFF, array index: 0x1497 */
0x6648,0x6649,0x695E,
/* Range 0x804F - 0x8051, array index: 0x149A */
0x3F2B,0x3F2C,0x3F2A,
/* Range 0x80C5 - 0x80CA, array index: 0x149D */
0x2C7E,INVALC,0x2C78,0x2C7B,0x2D26,0x2D24,
/* Range 0x80CD - 0x80D9, array index: 0x14A3 */
0x2D2A,INVALC,0x2D27,0x2C7D,0x2C7A,INVALC,INVALC,0x3F2E,
0x2D25,INVALC,0x2D28,0x2C77,0x2D22,
/* Range 0x80F9 - 0x80FB, array index: 0x14B0 */
0x322F,0x322D,0x3232,
/* Range 0x811B - 0x8122, array index: 0x14B3 */
0x384C,INVALC,0x3854,0x3850,0x384E,INVALC,0x3851,0x3855,
/* Range 0x815E - 0x8164, array index: 0x14BB */
0x4642,INVALC,0x463A,0x4647,0x463F,INVALC,0x4639,
/* Range 0x8189 - 0x818D, array index: 0x14C2 */
0x4D2B,INVALC,0x4D31,0x4D30,0x4D2F,
/* Range 0x81AE - 0x81BC, array index: 0x14C7 */
0x5956,INVALC,0x595A,0x5954,0x595D,INVALC,0x595C,0x5958,
INVALC,0x595E,INVALC,0x5957,INVALC,0x5E55,0x5E5B,
/* Range 0x81D0 - 0x81D2, array index: 0x14D6 */
0x626B,0x6269,0x626A,
/* Range 0x81DD - 0x81E1, array index: 0x14D9 */
0x6B7E,0x6D72,INVALC,0x7132,0x7133,
/* Range 0x81F7 - 0x81F9, array index: 0x14DE */
0x3F39,0x3F3A,0x3F3B,
/* Range 0x8232 - 0x8234, array index: 0x14E1 */
0x385B,0x3858,0x385A,
/* Range 0x823C - 0x8245, array index: 0x14E4 */
0x3F3D,0x3F3E,INVALC,0x3F3F,0x464B,INVALC,0x464C,INVALC,
0x464A,0x464D,
/* Range 0x824E - 0x8264, array index: 0x14EE */
0x5333,0x532F,0x5332,0x5334,0x5331,0x5330,INVALC,0x5961,
0x5962,0x5963,INVALC,INVALC,0x5E5E,0x5E5D,0x5E5F,INVALC,
0x626D,0x626C,INVALC,0x664F,INVALC,0x6650,0x664E,
/* Range 0x8268 - 0x826D, array index: 0x1505 */
0x6962,0x6963,INVALC,0x6D73,0x6F3E,0x7049,
/* Range 0x827C - 0x8285, array index: 0x150B */
0x226B,0x226D,INVALC,0x226E,0x226C,INVALC,INVALC,0x2522,
0x2523,0x247B,
/* Range 0x828E - 0x8294, array index: 0x1515 */
0x247C,0x247A,0x2479,0x247D,INVALC,0x247E,0x2D2D,
/* Range 0x829E - 0x82AB, array index: 0x151C */
0x285C,INVALC,0x2852,0x2860,0x2866,INVALC,0x2863,INVALC,
INVALC,0x2859,0x285F,0x2861,INVALC,0x2854,
/* Range 0x82B4 - 0x82B6, array index: 0x152A */
0x285E,0x2858,0x2865,
/* Range 0x82E8 - 0x82ED, array index: 0x152D */
0x2D32,INVALC,0x2D41,0x2D36,0x2D39,0x2D46,
/* Range 0x82F0 - 0x82FB, array index: 0x1533 */
0x2D40,INVALC,0x2D3B,0x2D45,0x2D38,0x2D3C,0x2D3F,INVALC,
INVALC,0x2D30,0x2D44,0x2D3E,
/* Range 0x8322 - 0x832F, array index: 0x153F */
0x3242,INVALC,0x324B,0x323C,0x3240,0x3257,INVALC,0x324F,
0x3246,INVALC,0x3255,0x3238,INVALC,0x324E,
/* Range 0x833A - 0x833C, array index: 0x154D */
0x2D35,0x3F41,0x3248,
/* Range 0x8341 - 0x834E, array index: 0x1550 */
0x323F,0x3243,INVALC,0x3239,0x3251,INVALC,0x3250,0x3258,
INVALC,INVALC,0x3256,0x3252,0x3249,0x3244,
/* Range 0x8373 - 0x8376, array index: 0x155E */
0x3862,0x3864,0x3869,0x387D,
/* Range 0x837D - 0x8383, array index: 0x1562 */
0x386C,0x3873,0x3879,INVALC,0x3866,INVALC,0x386D,
/* Range 0x8387 - 0x8390, array index: 0x1569 */
0x387B,0x3876,INVALC,INVALC,0x3872,0x386E,0x3860,INVALC,
0x3865,0x385D,
/* Range 0x8397 - 0x839D, array index: 0x1573 */
0x3877,INVALC,0x3868,0x3F6A,0x3870,INVALC,0x386F,
/* Range 0x83A3 - 0x83B0, array index: 0x157A */
0x385E,0x3863,0x3874,0x387A,INVALC,0x385F,0x386B,0x3871,
INVALC,INVALC,INVALC,0x387C,0x3875,0x3878,
/* Range 0x83BF - 0x83EE, array index: 0x1588 */
0x3F51,0x3F45,INVALC,0x3F62,0x3F6B,0x3F6E,INVALC,0x3F4D,
0x3F66,0x3F4E,0x3F5C,INVALC,0x3F58,INVALC,INVALC,0x3F59,
0x3F42,INVALC,0x3F67,INVALC,INVALC,INVALC,0x3F64,0x3F5A,
0x3F70,0x3F55,0x466D,INVALC,0x3F73,INVALC,0x3F53,0x3F5F,
INVALC,INVALC,0x3F57,0x3F71,0x3F50,0x3F49,0x3F54,INVALC,
0x3F48,0x3F46,INVALC,0x3F68,0x3F4F,0x3F6C,INVALC,0x3F6D,
/* Range 0x83F5 - 0x8401, array index: 0x15B8 */
0x3F5B,0x3F4B,INVALC,INVALC,0x3F43,0x3F65,0x3F6F,0x3F4A,
INVALC,0x3F74,0x3F56,INVALC,0x3F52,
/* Range 0x840F - 0x8413, array index: 0x15C5 */
0x3F5E,0x3F4C,0x3F60,0x3F47,0x3F69,
/* Range 0x842F - 0x843B, array index: 0x15CA */
0x466F,0x465A,INVALC,0x466A,0x467E,0x4666,INVALC,0x467D,
0x4664,INVALC,0x4674,0x4665,0x467B,
/* Range 0x843F - 0x8460, array index: 0x15D7 */
0x464F,0x4657,INVALC,0x4670,0x4668,0x4723,0x466B,INVALC,
0x467C,INVALC,INVALC,INVALC,0x466E,0x4676,0x465B,0x4675,
INVALC,0x4728,0x4656,0x4677,INVALC,0x4726,INVALC,0x4650,
INVALC,INVALC,0x465E,0x465D,INVALC,INVALC,0x4661,0x4663,
0x4672,0x4725,
/* Range 0x846E - 0x847E, array index: 0x15F9 */
0x4727,0x4678,0x4673,INVALC,INVALC,0x4660,0x465F,INVALC,
0x4651,INVALC,0x4669,0x4652,0x4667,INVALC,INVALC,0x465C,
0x4722,
/* Range 0x848D - 0x8491, array index: 0x160A */
0x4654,0x467A,0x4653,INVALC,0x4D5A,
/* Range 0x8497 - 0x84B1, array index: 0x160F */
0x4D33,0x4D51,INVALC,0x4D42,0x4D4C,INVALC,0x4D45,INVALC,
0x4D36,0x4D54,0x4D35,0x4D48,INVALC,0x4D34,INVALC,INVALC,
0x4D46,0x4D4F,0x4D4D,0x4D41,0x4D3C,0x4D3A,INVALC,0x4D3B,
0x4D4E,0x4D59,0x4D43,
/* Range 0x84B9 - 0x84BB, array index: 0x162A */
0x4D3D,0x4D37,0x4D47,
/* Range 0x84CC - 0x84D7, array index: 0x162D */
0x4D4B,0x4D40,0x4D38,0x4D53,0x4D44,INVALC,0x4D57,INVALC,
0x4D56,INVALC,0x4D50,0x4D55,
/* Range 0x84E7 - 0x8502, array index: 0x1639 */
0x535C,0x535D,0x5350,0x534F,0x534B,INVALC,INVALC,INVALC,
0x535F,0x535E,0x464E,0x5348,0x534C,0x5346,INVALC,0x5359,
0x534A,INVALC,0x5360,0x5343,0x5341,0x534D,0x5357,0x5352,
INVALC,0x5338,INVALC,0x5356,
/* Range 0x8507 - 0x850F, array index: 0x1655 */
0x4662,0x5344,0x533B,0x533E,0x5364,0x5345,0x533C,0x533A,
0x5337,
/* Range 0x8515 - 0x8520, array index: 0x165E */
0x5349,0x5351,INVALC,0x5361,0x5365,INVALC,INVALC,0x5340,
0x5354,0x5358,0x533D,0x5362,
/* Range 0x8524 - 0x8531, array index: 0x166A */
0x5335,INVALC,0x535B,0x533F,0x5353,0x5339,0x5347,0x5342,
INVALC,INVALC,0x5355,0x5366,0x5363,0x535A,
/* Range 0x8540 - 0x8547, array index: 0x1678 */
0x596B,0x596E,INVALC,INVALC,0x5970,0x5965,0x596C,0x5972,
/* Range 0x8551 - 0x8558, array index: 0x1680 */
0x5971,INVALC,0x5968,0x5A22,0x597A,0x5964,0x5E72,0x596A,
/* Range 0x8560 - 0x8567, array index: 0x1688 */
0x597C,0x5969,0x596F,0x5973,0x596D,0x5A23,0x597E,0x597B,
/* Range 0x8575 - 0x8590, array index: 0x1690 */
0x5979,0x5F21,0x5E6C,0x5E71,0x5E7E,0x5E70,0x5E68,0x5E6D,
INVALC,INVALC,INVALC,0x5E61,0x5E79,0x5E7B,0x5E60,INVALC,
0x5E7D,0x5E75,INVALC,0x5E7C,0x5E6E,INVALC,0x5E66,0x597D,
0x5E76,0x5E73,0x5E62,0x5F23,
/* Range 0x8595 - 0x85A4, array index: 0x16AC */
0x5E64,0x5E74,INVALC,0x5F22,0x5E77,0x5E6A,INVALC,INVALC,
0x5E78,0x5E6B,0x5F24,0x5E65,0x5E6F,0x5E7A,0x5E67,0x5E69,
/* Range 0x85B1 - 0x85B8, array index: 0x16BC */
0x627D,INVALC,0x6273,0x626E,0x6274,0x627E,0x6324,0x6323,
/* Range 0x85BD - 0x85C8, array index: 0x16C4 */
0x6275,0x6325,0x6278,0x6270,INVALC,0x6272,0x6271,0x6277,
0x627C,0x626F,0x6276,0x627B,
/* Range 0x85D7 - 0x85E3, array index: 0x16D0 */
0x6658,0x665C,0x6654,0x6657,INVALC,0x665F,INVALC,0x6664,
0x665D,INVALC,0x6655,0x6665,0x665E,
/* Range 0x85EB - 0x85F2, array index: 0x16DD */
0x6651,0x6659,0x6653,INVALC,0x6663,0x6661,0x6652,0x665A,
/* Range 0x85FD - 0x8605, array index: 0x16E5 */
0x696F,0x6967,0x6965,0x6969,0x6966,INVALC,INVALC,0x696B,
0x696D,
/* Range 0x8618 - 0x8640, array index: 0x16EE */
0x6C21,0x6C27,INVALC,0x6968,0x6C26,INVALC,0x6C2D,0x6C24,
0x6C2B,0x6C2A,0x6964,0x6C25,0x6322,0x6C2E,0x6C23,0x6C28,
INVALC,0x6C2C,0x6C22,INVALC,0x6D77,INVALC,0x6C29,INVALC,
INVALC,0x6F43,0x6D78,0x6D76,0x6D74,0x6D75,0x6D79,INVALC,
INVALC,0x6F41,0x6F3F,0x6F44,0x6F42,INVALC,0x6F45,INVALC,
0x6F40,
/* Range 0x8646 - 0x864D, array index: 0x1717 */
0x7134,0x7135,0x7136,INVALC,INVALC,0x7235,0x722D,0x226F,
/* Range 0x8661 - 0x8674, array index: 0x171F */
0x4D5B,0x5367,0x5A25,0x5A27,0x5A26,INVALC,INVALC,0x5F25,
0x6326,0x7173,INVALC,INVALC,0x2869,0x286A,0x2868,0x2867,
INVALC,INVALC,0x2D4A,0x2D48,
/* Range 0x8685 - 0x8687, array index: 0x1733 */
0x3266,0x3263,0x3261,
/* Range 0x868D - 0x86A2, array index: 0x1736 */
0x325E,0x326D,INVALC,0x326F,0x325F,INVALC,INVALC,0x3270,
0x326B,0x325D,0x3262,0x326C,0x3268,0x3265,INVALC,INVALC,
0x326E,0x3260,INVALC,INVALC,0x3269,0x325B,
/* Range 0x86B3 - 0x86C5, array index: 0x174C */
0x392B,0x392E,INVALC,INVALC,0x3923,0x392C,0x392A,0x3927,
0x392F,0x3930,0x3932,0x3933,0x3922,INVALC,0x3925,0x3924,
0x3931,INVALC,0x3926,
/* Range 0x86D6 - 0x86DD, array index: 0x175F */
0x472E,0x4023,0x3F75,INVALC,0x3F7A,INVALC,0x3F7E,0x3F7C,
/* Range 0x86E6 - 0x86EC, array index: 0x1767 */
0x3F77,INVALC,0x4024,0x4022,0x3F7B,0x3F7D,0x4021,
/* Range 0x86F5 - 0x86FA, array index: 0x176E */
0x472F,0x4735,0x472B,0x4731,INVALC,0x472D,
/* Range 0x8709 - 0x8712, array index: 0x1774 */
0x4733,INVALC,0x4729,0x472C,0x4736,0x4732,INVALC,INVALC,
0x4D7B,0x4D70,
/* Range 0x8719 - 0x871B, array index: 0x177E */
0x4D64,0x4D79,0x4D65,
/* Range 0x8720 - 0x8735, array index: 0x1781 */
0x4D6B,0x4D63,INVALC,0x4D5D,0x4D78,INVALC,0x4D75,0x4D76,
0x4D5E,INVALC,0x4D6D,INVALC,0x4D67,0x4D6E,0x4D61,INVALC,
0x4D7A,0x4D72,0x4D6C,0x4D5C,INVALC,0x4D73,
/* Range 0x873E - 0x8743, array index: 0x1797 */
0x4D69,INVALC,0x4D60,0x4D68,0x4D74,0x4D66,
/* Range 0x874D - 0x876F, array index: 0x179D */
0x4730,0x5379,0x5424,0x5378,0x5374,0x5371,INVALC,0x536F,
INVALC,0x5368,INVALC,0x536E,INVALC,0x5373,0x5370,0x5422,
0x537B,0x5375,0x537A,INVALC,0x5372,0x5427,0x5369,0x536A,
0x5423,INVALC,0x5428,INVALC,0x5429,0x5377,0x4D5F,0x537D,
0x5376,0x5421,0x537C,
/* Range 0x8777 - 0x877B, array index: 0x17C0 */
0x536B,INVALC,0x5A32,0x537E,0x5425,
/* Range 0x8784 - 0x8789, array index: 0x17C5 */
0x5A39,0x5A35,INVALC,0x5A33,0x5A2E,0x5A3D,
/* Range 0x878F - 0x879D, array index: 0x17CB */
0x5A2A,0x5A36,0x5A37,0x5A2D,0x5A2C,0x5A3A,INVALC,0x5A30,
0x5A2B,0x5A31,INVALC,0x5A3C,0x5A29,0x5A3B,0x5A38,
/* Range 0x87AA - 0x87C5, array index: 0x17DA */
0x5F27,INVALC,0x5F2B,0x5F28,0x5F2F,0x5F35,0x5F2A,INVALC,
0x5F3E,INVALC,0x5F38,0x5F2D,0x5F39,0x5F34,0x5F3B,0x5F2C,
INVALC,INVALC,0x5F2E,0x5F3C,0x5F26,0x5F3A,INVALC,INVALC,
0x5F32,0x5F31,0x5F36,0x5F29,
/* Range 0x87D3 - 0x87ED, array index: 0x17F6 */
0x6333,0x6331,INVALC,INVALC,0x6337,0x6335,0x6338,INVALC,
0x632A,0x6332,0x633C,0x5F3D,0x632E,INVALC,0x536C,0x6329,
0x6336,0x6330,0x632D,0x6328,0x6327,0x633B,INVALC,0x632C,
0x632B,INVALC,0x6334,
/* Range 0x87F3 - 0x87F7, array index: 0x1811 */
0x632F,0x633A,INVALC,0x6669,0x666A,
/* Range 0x87FF - 0x8803, array index: 0x1816 */
0x6671,0x6666,0x6339,0x6673,0x6668,
/* Range 0x8806 - 0x880C, array index: 0x181B */
0x666E,INVALC,0x6670,0x666B,0x6672,0x666D,0x666C,
/* Range 0x8819 - 0x881D, array index: 0x1822 */
0x6970,INVALC,0x6C31,0x6C34,0x6C30,
/* Range 0x8824 - 0x8844, array index: 0x1827 */
0x6C33,0x6D7E,0x6D7C,INVALC,0x6D7B,0x6C2F,0x6D7D,0x6C35,
0x6D7A,INVALC,0x6F48,0x6F26,0x6F46,INVALC,0x6F47,0x6F49,
INVALC,0x704D,INVALC,0x704C,0x704B,INVALC,INVALC,INVALC,
0x715D,0x7175,0x7174,0x7176,INVALC,0x2D4B,INVALC,0x3271,
0x3272,
/* Range 0x8871 - 0x8876, array index: 0x1848 */
0x3278,0x3276,INVALC,0x327D,0x3274,0x3275,
/* Range 0x887C - 0x8880, array index: 0x184E */
0x327E,INVALC,0x327C,0x3279,0x3277,
/* Range 0x8895 - 0x889B, array index: 0x1853 */
0x3936,INVALC,0x3942,0x393E,0x3940,0x393A,0x3941,
/* Range 0x88B6 - 0x88C0, array index: 0x185A */
0x402F,0x4031,0x402C,0x402B,0x4029,INVALC,0x4030,0x4032,
0x402E,INVALC,0x402D,
/* Range 0x88C9 - 0x88D0, array index: 0x1865 */
0x4035,INVALC,0x4739,0x473F,0x473A,0x473B,INVALC,0x4740,
/* Range 0x88EE - 0x88F2, array index: 0x186D */
0x4E24,INVALC,0x4E28,0x4D7E,0x4E21,
/* Range 0x88F6 - 0x88FE, array index: 0x1872 */
0x4E26,0x4D7C,INVALC,INVALC,0x4E22,0x4E27,0x4E25,INVALC,
0x4E23,
/* Range 0x8914 - 0x8919, array index: 0x187B */
0x542D,INVALC,0x5433,0x542F,0x5430,0x5431,
/* Range 0x892C - 0x8937, array index: 0x1881 */
0x5A49,0x5A41,0x5A42,0x5A48,0x5A40,0x5A44,INVALC,0x5F40,
INVALC,0x5F3F,INVALC,0x5F45,
/* Range 0x894B - 0x8963, array index: 0x188D */
0x633E,0x6340,INVALC,INVALC,0x633F,0x6342,0x6343,0x5F44,
0x633D,INVALC,INVALC,INVALC,0x6677,0x667A,0x667C,0x6675,
0x6676,0x6679,0x667B,INVALC,INVALC,INVALC,0x6678,0x6674,
0x6976,
/* Range 0x8979 - 0x897E, array index: 0x18A6 */
0x7137,0x7138,0x713A,0x7139,INVALC,0x2270,
/* Range 0x899B - 0x89A4, array index: 0x18AC */
0x4742,INVALC,0x4E2B,0x4E2E,0x4E2D,INVALC,0x4E2C,0x5437,
0x5439,0x5438,
/* Range 0x89AD - 0x89AF, array index: 0x18B6 */
0x5F47,0x5F49,0x5F48,
/* Range 0x89D5 - 0x89FF, array index: 0x18B9 */
0x394B,0x3949,INVALC,INVALC,0x394A,0x403A,0x403B,0x4749,
0x4039,INVALC,0x4743,0x4747,0x4746,0x4748,INVALC,0x4745,
0x4744,0x474A,INVALC,0x4E31,0x4E2F,INVALC,0x4E30,0x543C,
0x543A,INVALC,INVALC,0x543B,0x5A4B,0x5F4A,0x5F4B,INVALC,
INVALC,0x6722,0x6979,INVALC,INVALC,0x6C3B,0x6E24,INVALC,
INVALC,0x6F4D,0x713B,
/* Range 0x8A4A - 0x8A52, array index: 0x18E4 */
0x4048,INVALC,0x4049,0x403D,0x403C,0x404A,INVALC,0x4047,
0x4045,
/* Range 0x8A57 - 0x8A59, array index: 0x18ED */
0x4041,0x4042,0x403F,
/* Range 0x8A74 - 0x8A77, array index: 0x18F0 */
0x4756,0x4753,0x474B,0x4750,
/* Range 0x8A7F - 0x8A86, array index: 0x18F4 */
0x474D,INVALC,0x4755,0x4751,0x4754,0x4752,INVALC,0x474C,
/* Range 0x8ABA - 0x8AC0, array index: 0x18FC */
0x544B,0x5444,INVALC,0x544C,0x5446,INVALC,0x5447,
/* Range 0x8AD1 - 0x8AE4, array index: 0x1903 */
0x5441,INVALC,0x5440,0x5442,0x5443,INVALC,0x5445,0x5449,
0x544D,INVALC,INVALC,INVALC,0x5A51,0x5A57,0x5A54,0x5A4C,
0x5A58,0x5A4D,INVALC,0x5A53,
/* Range 0x8B05 - 0x8B08, array index: 0x1917 */
0x5F50,0x5F59,0x5F56,0x5F58,
/* Range 0x8B0F - 0x8B27, array index: 0x191B */
0x5F53,INVALC,0x5F4F,0x5F54,0x5F5B,0x5A52,0x5F55,0x5F4E,
INVALC,0x5F4D,INVALC,0x5F5C,INVALC,0x5F5A,INVALC,0x5F4C,
INVALC,INVALC,INVALC,0x5F52,0x6347,0x6355,0x6350,0x6352,
0x6346,
/* Range 0x8B2E - 0x8B42, array index: 0x1934 */
0x6354,0x634C,0x6349,0x634F,INVALC,0x6348,INVALC,0x634A,
0x6353,0x6351,INVALC,INVALC,0x6358,0x6356,0x634D,0x6357,
0x634E,INVALC,0x6726,INVALC,0x672D,
/* Range 0x8B47 - 0x8B4B, array index: 0x1949 */
0x634B,0x6724,INVALC,0x6725,0x672A,
/* Range 0x8B50 - 0x8B57, array index: 0x194E */
0x6723,0x672C,0x672E,0x6727,0x6729,0x672B,0x6728,0x672F,
/* Range 0x8B78 - 0x8B7F, array index: 0x1956 */
0x6C3D,0x6C3C,0x6C3F,0x6C40,INVALC,INVALC,0x6E25,0x6E2A,
/* Range 0x8B82 - 0x8B8E, array index: 0x195E */
0x6E27,INVALC,0x6E26,0x6E29,0x6E28,INVALC,0x6F51,INVALC,
INVALC,0x6F50,0x6F4E,INVALC,0x6F4F,
/* Range 0x8C39 - 0x8C3E, array index: 0x196B */
0x3950,INVALC,0x3951,0x4758,0x4E38,0x544E,
/* Range 0x8C64 - 0x8C69, array index: 0x1971 */
0x475C,0x475B,0x475D,INVALC,0x4E39,0x4E3A,
/* Range 0x8C6F - 0x8C78, array index: 0x1977 */
0x5F61,0x5F5E,0x5F60,0x5F5F,INVALC,INVALC,0x635A,0x6732,
0x6731,0x2524,
/* Range 0x8C80 - 0x8C86, array index: 0x1981 */
0x404D,0x404C,INVALC,INVALC,0x475F,0x4760,0x475E,
/* Range 0x8C8F - 0x8C9C, array index: 0x1988 */
0x5450,0x5A5F,0x5A5D,0x5A5E,INVALC,0x5F63,0x5F62,INVALC,
0x635D,0x635C,0x635B,0x6733,INVALC,0x7178,
/* Range 0x8CA3 - 0x8CA5, array index: 0x1996 */
0x3326,0x3325,0x3955,
/* Range 0x8D8C - 0x8D96, array index: 0x1999 */
0x4765,0x4768,0x4766,0x4767,0x476B,0x4764,0x476C,0x4769,
0x476A,INVALC,0x4E3E,
/* Range 0x8DAA - 0x8DAF, array index: 0x19A4 */
0x6738,0x673A,0x6737,0x6739,0x6A24,0x6C43,
/* Range 0x8DB5 - 0x8DB9, array index: 0x19AA */
0x3329,0x332B,0x332A,INVALC,0x395B,
/* Range 0x8DD3 - 0x8DD9, array index: 0x19AF */
0x4057,INVALC,0x405D,0x405A,0x4060,0x4056,0x405E,
/* Range 0x8DEE - 0x8DF4, array index: 0x19B6 */
0x4771,INVALC,0x476D,0x4770,0x4777,INVALC,0x4779,
/* Range 0x8DFD - 0x8E0A, array index: 0x19BD */
0x4E43,0x4E49,0x4E41,0x4E4A,INVALC,0x4E40,0x4E45,0x4E4B,
0x4E48,0x4E47,0x4E46,INVALC,0x4E3F,0x4E44,
/* Range 0x8E11 - 0x8E1C, array index: 0x19CB */
0x5464,0x5469,0x546B,0x5468,0x5461,0x5463,0x546D,0x546A,
0x5465,0x546E,0x5462,0x546C,
/* Range 0x8E23 - 0x8E27, array index: 0x19D7 */
0x545D,0x545F,0x545E,0x5466,0x5467,
/* Range 0x8E3C - 0x8E41, array index: 0x19DC */
0x5A6F,0x5A70,0x5A6A,0x5A73,0x5A6C,0x5A71,
/* Range 0x8E4C - 0x8E62, array index: 0x19E2 */
0x5F6A,0x5F67,0x5F66,INVALC,0x5F69,INVALC,INVALC,0x5F68,
0x636F,INVALC,0x6366,0x6365,INVALC,INVALC,0x636B,0x636A,
0x6362,0x636D,0x6367,INVALC,0x6364,0x636C,0x6363,
/* Range 0x8E92 - 0x8EA9, array index: 0x19F9 */
0x6E2F,INVALC,0x6E2D,0x6E2C,0x6E31,0x6E32,0x6F54,INVALC,
0x6E2E,INVALC,INVALC,0x7054,0x7051,0x7052,0x7053,INVALC,
INVALC,0x7140,0x713F,0x713E,0x715F,INVALC,0x722E,0x7179,
/* Range 0x8EDC - 0x8EFA, array index: 0x1A11 */
0x3961,0x3960,0x395F,INVALC,0x3963,0x3964,INVALC,INVALC,
INVALC,0x4068,0x4066,0x406A,0x406B,0x4071,INVALC,0x406D,
0x406F,INVALC,0x4067,0x4062,INVALC,0x406E,INVALC,INVALC,
0x4070,0x4069,0x406C,0x4063,INVALC,0x4065,0x4064,
/* Range 0x8EFF - 0x8F08, array index: 0x1A30 */
0x477B,0x477D,0x477C,0x4823,INVALC,INVALC,0x477E,0x477A,
0x4821,0x4822,
/* Range 0x8F0D - 0x8F11, array index: 0x1A3A */
0x4E4F,0x4E4E,INVALC,0x4E4C,0x4E4D,
/* Range 0x8F16 - 0x8F1A, array index: 0x1A3F */
0x5475,0x5476,0x5471,INVALC,0x5472,
/* Range 0x8F32 - 0x8F39, array index: 0x1A44 */
0x5A78,INVALC,0x5A7B,0x5A77,0x5A75,0x5A7A,INVALC,0x5A79,
/* Range 0x8F46 - 0x8F48, array index: 0x1A4C */
0x6370,0x6371,0x6372,
/* Range 0x8F4F - 0x8F64, array index: 0x1A4F */
0x6744,0x6745,0x6743,0x6742,0x6746,INVALC,0x6A2B,0x6A29,
0x6A2A,0x6A2C,0x6A28,0x6A2D,0x6C47,INVALC,0x6C48,0x6C46,
INVALC,0x6E33,INVALC,0x6E34,0x6F56,0x6F55,
/* Range 0x8FD2 - 0x8FD7, array index: 0x1A65 */
0x286C,0x286E,INVALC,0x2871,0x2870,0x2872,
/* Range 0x8FFB - 0x8FFF, array index: 0x1A6B */
0x3332,0x3334,INVALC,0x332E,0x3331,
/* Range 0x9097 - 0x90A1, array index: 0x1A70 */
0x2272,0x2273,0x2271,INVALC,0x2274,INVALC,INVALC,0x252A,
0x2527,0x252C,0x2528,
/* Range 0x90AF - 0x90B4, array index: 0x1A7B */
0x2875,0x2877,INVALC,0x2873,0x2876,0x2874,
/* Range 0x90BD - 0x90BF, array index: 0x1A81 */
0x2D59,0x2D5D,0x2D5A,
/* Range 0x90D4 - 0x90F4, array index: 0x1A84 */
0x3971,0x2D5B,0x3336,0x333F,0x333D,0x3338,0x3339,0x333E,
0x3340,INVALC,INVALC,0x333B,0x3337,INVALC,INVALC,0x333A,
0x3341,0x333C,INVALC,INVALC,INVALC,0x3974,0x396C,0x3972,
0x3973,INVALC,INVALC,0x396B,0x396D,0x2D58,0x396F,0x3970,
0x396E,
/* Range 0x90F9 - 0x9108, array index: 0x1AA5 */
0x407B,0x5B22,0x407C,0x4079,INVALC,INVALC,0x4078,0x407E,
0x407D,INVALC,0x4123,0x4077,0x4122,0x4075,0x4121,0x407A,
/* Range 0x910B - 0x9111, array index: 0x1AB5 */
0x4830,INVALC,0x482B,0x4831,0x482C,0x482A,0x482D,
/* Range 0x911A - 0x9147, array index: 0x1ABC */
0x4E56,0x4E59,0x4E51,0x4E55,INVALC,0x4E54,0x4E52,0x4E58,
0x4E53,0x4E50,0x4E57,INVALC,0x5523,INVALC,0x6374,0x547E,
0x5521,0x547D,0x4076,INVALC,0x5524,0x547C,INVALC,INVALC,
0x5522,0x5B23,INVALC,0x5B24,0x5B25,INVALC,0x5F70,INVALC,
0x6375,0x6376,INVALC,INVALC,0x6377,0x6749,0x6748,0x6A30,
INVALC,0x6A2F,0x6C4A,0x6C4B,0x6C49,0x6E35,
/* Range 0x914E - 0x9150, array index: 0x1AEA */
0x3343,0x3344,0x3342,
/* Range 0x915F - 0x9164, array index: 0x1AED */
0x4126,0x4128,0x4124,0x4127,INVALC,0x4125,
/* Range 0x9180 - 0x9186, array index: 0x1AF3 */
0x552B,0x5528,0x5529,INVALC,0x552A,0x5525,0x5526,
/* Range 0x918D - 0x9193, array index: 0x1AFA */
0x5B29,INVALC,0x5B2A,0x5B27,0x5B28,INVALC,0x5B26,
/* Range 0x9199 - 0x91A2, array index: 0x1B01 */
0x5F74,0x5F71,0x5F73,INVALC,0x5F77,INVALC,0x5F75,0x5F78,
0x5F76,0x5F72,
/* Range 0x91AF - 0x91BE, array index: 0x1B0B */
0x637B,0x674A,INVALC,0x6A33,0x6A34,INVALC,0x6A32,INVALC,
0x6A31,INVALC,0x6C4C,INVALC,INVALC,0x6F57,0x7056,0x7055,
/* Range 0x91D3 - 0x91D5, array index: 0x1B1B */
0x2D62,0x2D61,0x3345,
/* Range 0x91E8 - 0x91EE, array index: 0x1B1E */
0x3A26,INVALC,0x3A23,0x3A24,0x397A,INVALC,0x3A27,
/* Range 0x91F3 - 0x91F9, array index: 0x1B25 */
0x397D,0x397B,INVALC,INVALC,0x3A25,0x397E,0x3A22,
/* Range 0x91FD - 0x9206, array index: 0x1B2C */
0x4134,INVALC,0x4133,0x4131,0x4129,0x4138,0x412C,0x4136,
0x413D,0x4135,
/* Range 0x9216 - 0x921C, array index: 0x1B36 */
0x413E,0x413C,INVALC,0x413B,0x412D,INVALC,0x4139,
/* Range 0x9224 - 0x9227, array index: 0x1B3D */
0x413A,0x412B,0x412E,0x4137,
/* Range 0x922D - 0x9233, array index: 0x1B41 */
0x4F22,0x483D,INVALC,0x4836,0x4849,0x4852,0x4839,
/* Range 0x924C - 0x9256, array index: 0x1B48 */
0x4850,INVALC,0x484E,0x4842,0x484C,INVALC,0x4835,0x484F,
0x484A,INVALC,0x4851,
/* Range 0x9263 - 0x9267, array index: 0x1B53 */
0x484B,INVALC,0x483A,0x4838,0x4844,
/* Range 0x926C - 0x9272, array index: 0x1B58 */
0x4841,0x4840,INVALC,0x4845,0x4848,INVALC,0x484D,
/* Range 0x9279 - 0x928E, array index: 0x1B5F */
0x4E6A,0x4E62,INVALC,INVALC,0x4E73,0x4E7B,0x4E6C,INVALC,
INVALC,0x4E70,0x483C,INVALC,INVALC,0x4E77,0x4E7C,0x4E74,
INVALC,0x4E76,0x4F21,0x4E78,0x4E66,0x4E6F,
/* Range 0x9297 - 0x92AB, array index: 0x1B75 */
0x4E6B,INVALC,0x4E79,0x4E68,0x4E61,INVALC,0x4E7E,INVALC,
INVALC,0x4E63,0x4E75,0x4E72,0x4E6D,0x4E5F,0x4E5E,0x4E67,
0x4E7A,INVALC,0x4E7D,0x4E65,0x4E69,
/* Range 0x92B4 - 0x92B6, array index: 0x1B8A */
0x554D,0x5549,0x5531,
/* Range 0x92C0 - 0x92E1, array index: 0x1B8D */
0x552F,INVALC,0x553B,0x552D,0x552E,INVALC,0x554C,INVALC,
0x553E,0x5543,0x553D,0x5B3C,0x5539,0x5541,0x553F,0x5532,
0x552C,0x5547,INVALC,0x5548,INVALC,0x5542,INVALC,0x5537,
0x5535,0x5530,INVALC,INVALC,INVALC,0x5538,0x5545,0x5534,
0x5544,0x554A,
/* Range 0x92E6 - 0x92E9, array index: 0x1BAF */
0x5540,0x5546,0x553C,0x5536,
/* Range 0x92F7 - 0x9302, array index: 0x1BB3 */
0x5B41,INVALC,0x5B40,0x5B3E,0x5B50,INVALC,INVALC,0x5B4D,
0x5B45,0x5B4F,0x5B37,0x5B43,
/* Range 0x9308 - 0x9316, array index: 0x1BBF */
0x5B2D,0x5B4E,INVALC,0x5B4C,0x5B4B,0x5B3B,0x5B3A,0x5B30,
INVALC,INVALC,0x5B36,0x5B3F,0x5B4A,INVALC,0x5B51,
/* Range 0x931B - 0x932A, array index: 0x1BCE */
0x5B34,INVALC,0x5B3D,0x5B2C,0x5B2E,INVALC,INVALC,INVALC,
0x5B35,0x5B44,0x554B,INVALC,0x5B2B,INVALC,0x5B46,0x5B49,
/* Range 0x934C - 0x9359, array index: 0x1BDE */
0x602B,INVALC,0x6039,0x6031,0x6026,0x6027,0x6030,INVALC,
INVALC,0x602F,0x5F7D,0x602E,0x6022,0x603A,
/* Range 0x9360 - 0x9364, array index: 0x1BEC */
0x6028,0x6035,INVALC,0x6037,0x5F7C,
/* Range 0x9376 - 0x937C, array index: 0x1BF1 */
0x6024,0x6033,INVALC,0x602D,0x5B31,0x6034,0x6021,
/* Range 0x9388 - 0x9392, array index: 0x1BF8 */
0x642C,0x6425,INVALC,INVALC,0x637E,0x6430,0x6427,0x602A,
INVALC,0x6432,0x6421,
/* Range 0x939B - 0x93AA, array index: 0x1C03 */
0x6423,INVALC,0x6424,0x6429,0x642E,INVALC,0x5F79,INVALC,
0x6437,0x6434,0x6761,0x642A,0x6426,0x6435,0x6756,0x6428,
/* Range 0x93B1 - 0x93B7, array index: 0x1C13 */
0x6431,0x6433,INVALC,0x6436,0x637D,INVALC,0x6422,
/* Range 0x93CC - 0x93D5, array index: 0x1C1A */
0x6754,INVALC,0x675E,0x674E,0x6751,INVALC,0x6760,INVALC,
0x6759,0x675C,
/* Range 0x93F5 - 0x9400, array index: 0x1C24 */
0x6A41,0x6A50,0x6A43,0x6A4A,0x6752,0x6A48,0x6A37,0x6A4E,
INVALC,0x6A3B,0x6A4D,0x6A42,
/* Range 0x9406 - 0x9416, array index: 0x1C30 */
0x6A52,0x6A44,INVALC,0x6A49,0x6A4C,0x6A35,0x6A4F,0x6A40,
0x6A45,0x6A39,0x6A3D,0x6A51,0x6A47,0x6A36,0x6A3A,0x6A3C,
0x6A46,
/* Range 0x9428 - 0x942C, array index: 0x1C41 */
0x6A3E,0x6C50,0x6C54,INVALC,0x6C56,
/* Range 0x9439 - 0x9440, array index: 0x1C46 */
0x6C53,INVALC,0x6C4E,0x6A4B,0x6C51,INVALC,0x6C4D,0x6C57,
/* Range 0x9445 - 0x9450, array index: 0x1C4E */
0x6E3C,0x6E3F,0x6E3B,0x6E3D,0x6E3E,0x6E38,0x6E39,0x6E36,
INVALC,INVALC,0x6E3A,0x6E37,
/* Range 0x946B - 0x9478, array index: 0x1C5A */
0x7058,INVALC,0x7142,0x7141,0x7143,INVALC,0x7144,INVALC,
0x7145,0x7161,0x7164,0x7163,INVALC,0x7162,
/* Range 0x9480 - 0x9483, array index: 0x1C68 */
0x7230,0x7231,0x722F,0x7237,
/* Range 0x957A - 0x957D, array index: 0x1C6C */
0x3A28,0x413F,0x554E,0x6763,
/* Range 0x959B - 0x959F, array index: 0x1C70 */
0x4856,0x4854,INVALC,0x4855,0x4853,
/* Range 0x95B5 - 0x95C0, array index: 0x1C75 */
0x5B59,0x5B57,0x6040,INVALC,0x5B55,0x5B56,INVALC,0x5B52,
0x5B5A,0x5B54,0x5B58,0x603C,
/* Range 0x95D1 - 0x95D3, array index: 0x1C81 */
0x643A,0x6438,0x6439,
/* Range 0x95DA - 0x95E5, array index: 0x1C84 */
0x6764,0x6765,INVALC,INVALC,0x6A53,0x6A55,0x6A54,INVALC,
INVALC,0x6C5B,0x6C5A,0x6C59,
/* Range 0x9620 - 0x9624, array index: 0x1C90 */
0x2278,INVALC,0x2276,0x2279,0x2277,
/* Range 0x9639 - 0x963D, array index: 0x1C95 */
0x2878,0x287B,INVALC,0x287A,0x2879,
/* Range 0x9687 - 0x9689, array index: 0x1C9A */
0x4143,0x4145,0x4146,
/* Range 0x9691 - 0x9693, array index: 0x1C9D */
0x4859,0x4857,0x4858,
/* Range 0x971F - 0x972F, array index: 0x1CA0 */
0x6045,0x6044,INVALC,0x6443,0x6442,INVALC,0x6444,0x676B,
INVALC,0x676A,0x6767,INVALC,0x6768,0x6769,INVALC,0x6A56,
0x6A57,
/* Range 0x9777 - 0x9784, array index: 0x1CB1 */
0x4861,0x4862,INVALC,0x4F28,0x4F2D,INVALC,0x4F27,0x4F29,
0x4F30,0x4F2B,0x4F2F,0x4F2C,0x4F2A,0x4F2E,
/* Range 0x9799 - 0x97A5, array index: 0x1CBF */
0x5B60,0x6049,INVALC,0x604B,0x604D,0x604C,INVALC,INVALC,
0x604A,0x644B,INVALC,0x6449,0x644C,
/* Range 0x97A8 - 0x97AE, array index: 0x1CCC */
0x6447,INVALC,0x644A,0x6448,0x6445,INVALC,0x6446,
/* Range 0x97CD - 0x97E5, array index: 0x1CD3 */
0x4F32,0x4F31,0x555E,0x555D,INVALC,INVALC,INVALC,0x604F,
0x604E,0x644F,0x644D,0x6450,0x644E,INVALC,INVALC,INVALC,
0x676F,0x6770,0x6771,INVALC,0x6C5F,INVALC,0x6E41,INVALC,
0x7060,
/* Range 0x980D - 0x980F, array index: 0x1CEC */
0x4865,0x4866,0x4864,
/* Range 0x9826 - 0x9829, array index: 0x1CEF */
0x5561,0x5566,0x5563,0x5562,
/* Range 0x9841 - 0x984A, array index: 0x1CF3 */
0x6051,INVALC,0x6056,0x6052,0x6055,INVALC,INVALC,0x5E41,
0x6054,0x6053,
/* Range 0x9850 - 0x9852, array index: 0x1CFD */
0x6452,0x6453,0x6454,
/* Range 0x985C - 0x9864, array index: 0x1D00 */
0x6772,0x6774,INVALC,0x6A5F,0x6A5C,INVALC,0x6A5D,0x6A5E,
0x6C60,
/* Range 0x9872 - 0x9874, array index: 0x1D09 */
0x7147,0x717C,0x717D,
/* Range 0x98AC - 0x98AE, array index: 0x1D0C */
0x4867,0x4F34,0x4F35,
/* Range 0x98BB - 0x98C2, array index: 0x1D0F */
0x6778,INVALC,0x6777,0x6779,0x6776,0x6C63,0x6A60,0x6A61,
/* Range 0x9914 - 0x9917, array index: 0x1D17 */
0x556B,0x556E,0x556C,0x556D,
/* Range 0x9927 - 0x9933, array index: 0x1D1B */
0x5B6A,INVALC,0x5B6B,0x605A,0x6058,0x6059,0x605E,INVALC,
0x605D,0x6060,0x605F,0x605C,0x605B,
/* Range 0x999C - 0x999E, array index: 0x1D28 */
0x4F3A,0x4F39,0x5B6C,
/* Range 0x99B9 - 0x99BD, array index: 0x1D2B */
0x4F3C,0x4F3E,0x4F3D,INVALC,0x4F40,
/* Range 0x99C9 - 0x99CF, array index: 0x1D30 */
0x5575,INVALC,0x5578,0x557A,0x5570,0x5574,0x5571,
/* Range 0x99D3 - 0x99D8, array index: 0x1D37 */
0x5572,0x5573,INVALC,0x5576,0x5579,0x5577,
/* Range 0x99E3 - 0x99F0, array index: 0x1D3D */
0x5B72,0x5B70,0x5B6F,INVALC,0x5B75,INVALC,0x5B74,0x5B73,
INVALC,0x5B6E,INVALC,0x5B6D,INVALC,0x5B71,
/* Range 0x99F4 - 0x9A15, array index: 0x1D4B */
0x6066,INVALC,0x606A,0x6067,0x6069,0x6068,0x6065,0x606B,
0x606E,0x606C,0x606D,INVALC,INVALC,INVALC,0x6064,0x606F,
0x645D,0x6460,0x6462,0x6461,INVALC,0x645B,0x645F,0x645A,
INVALC,0x645C,INVALC,0x6459,INVALC,0x645E,INVALC,INVALC,
0x682D,0x6822,
/* Range 0x9A1A - 0x9A3A, array index: 0x1D6D */
0x6821,0x6826,0x682C,0x6824,0x682B,INVALC,0x6828,INVALC,
0x6827,0x682A,0x6825,0x6823,INVALC,0x6829,INVALC,0x6A6E,
0x6A6C,INVALC,0x6A6B,0x6A71,0x6A6F,INVALC,INVALC,0x6A6A,
0x6A68,INVALC,0x6A69,INVALC,0x6A6D,INVALC,0x6A70,0x6C66,
0x6C6C,
/* Range 0x9A46 - 0x9A56, array index: 0x1D8E */
0x6C68,INVALC,0x6E4C,0x6E4E,0x6E4D,INVALC,0x6E4A,INVALC,
0x6E47,0x6E4B,0x6E50,INVALC,0x6E4F,0x6E48,0x6E49,INVALC,
0x6F60,
/* Range 0x9A64 - 0x9A6B, array index: 0x1D9F */
0x7223,INVALC,0x7224,0x7225,0x7233,0x7232,INVALC,0x723B,
/* Range 0x9ABE - 0x9AC2, array index: 0x1DA7 */
0x6070,0x5B77,0x6463,INVALC,0x682E,
/* Range 0x9AF1 - 0x9AFE, array index: 0x1DAC */
0x5622,0x5621,0x557E,INVALC,INVALC,0x5B7A,0x5B7D,INVALC,
0x5B7C,0x5B7B,INVALC,0x6074,0x6072,0x6071,
/* Range 0x9B08 - 0x9B19, array index: 0x1DBA */
0x6465,INVALC,0x6830,0x682F,0x6832,INVALC,0x6831,INVALC,
0x6A75,0x6A77,0x6A76,INVALC,INVALC,0x6C6F,0x6C72,0x6C70,
0x6C71,0x6E52,
/* Range 0x9B1E - 0x9B20, array index: 0x1DCC */
0x6F62,0x6F63,0x6F64,
/* Range 0x9B48 - 0x9B4C, array index: 0x1DCF */
0x6075,INVALC,0x646A,0x646C,0x646B,
/* Range 0x9B5F - 0x9B61, array index: 0x1DD4 */
0x4F49,0x4F47,0x4F48,
/* Range 0x9B64 - 0x9B68, array index: 0x1DD7 */
0x562D,INVALC,0x5628,0x5625,0x562C,
/* Range 0x9B70 - 0x9B88, array index: 0x1DDC */
0x562B,0x5627,INVALC,INVALC,0x5626,0x562A,0x5629,INVALC,
INVALC,INVALC,0x5C2B,0x5C26,0x5C24,0x5C2D,0x5C25,INVALC,
0x5C21,INVALC,0x5C27,INVALC,INVALC,0x5C22,0x607E,0x5C23,
0x5C2E,
/* Range 0x9B9E - 0x9BA8, array index: 0x1DF5 */
0x6078,INVALC,0x6122,0x607B,0x6121,INVALC,0x607D,0x607C,
0x607A,INVALC,0x6077,
/* Range 0x9BB5 - 0x9BB9, array index: 0x1E00 */
0x6472,0x6475,INVALC,0x6473,0x6477,
/* Range 0x9BC3 - 0x9BC7, array index: 0x1E05 */
0x646F,0x6476,INVALC,0x646E,0x646D,
/* Range 0x9BD3 - 0x9BEC, array index: 0x1E0A */
0x6474,0x683C,0x6842,INVALC,0x683D,INVALC,0x6840,0x6844,
INVALC,0x683F,INVALC,0x6837,INVALC,0x6836,0x6843,0x683A,
INVALC,0x6838,0x6841,0x6839,INVALC,INVALC,INVALC,0x6834,
0x6835,0x683E,
/* Range 0x9C05 - 0x9C0B, array index: 0x1E24 */
0x6A7B,0x6B23,0x6B21,0x6A79,0x6B26,INVALC,0x6A78,
/* Range 0x9C28 - 0x9C2C, array index: 0x1E2B */
0x6C7A,0x6C7B,INVALC,0x6C75,0x6C78,
/* Range 0x9C32 - 0x9C41, array index: 0x1E30 */
0x6E61,0x6E5C,0x6E60,INVALC,0x6E63,0x6E5F,INVALC,0x6E5B,
INVALC,INVALC,0x6E5E,0x6E62,INVALC,0x6E59,0x6A7E,0x6E5D,
/* Range 0x9C48 - 0x9C52, array index: 0x1E40 */
0x6E58,INVALC,0x6F68,0x6F6A,0x6F6D,0x6F69,0x6F6E,INVALC,
0x6F67,INVALC,0x6F65,
/* Range 0x9C62 - 0x9C68, array index: 0x1E4B */
0x7067,0x7064,INVALC,INVALC,0x7066,0x7065,0x7149,
/* Range 0x9C71 - 0x9C75, array index: 0x1E52 */
0x7169,INVALC,0x7168,0x7167,0x716A,
/* Range 0x9CF7 - 0x9D00, array index: 0x1E57 */
0x5633,INVALC,0x5636,0x5630,0x5637,0x562F,0x5631,INVALC,
0x5632,0x5635,
/* Range 0x9D04 - 0x9D08, array index: 0x1E61 */
0x563A,0x5639,INVALC,0x5634,0x5638,
/* Range 0x9D17 - 0x9D22, array index: 0x1E66 */
0x5C30,0x5C36,0x5C39,INVALC,INVALC,INVALC,0x5C35,0x5C32,
0x5C3A,0x5C31,INVALC,0x5C37,
/* Range 0x9D2D - 0x9D38, array index: 0x1E72 */
0x6135,0x6128,0x6129,0x612C,0x612A,INVALC,0x6124,INVALC,
INVALC,0x6127,0x6131,0x612B,
/* Range 0x9D3D - 0x9D45, array index: 0x1E7E */
0x6133,0x6130,INVALC,0x6132,0x6125,0x612E,0x612F,INVALC,
0x612D,
/* Range 0x9D4A - 0x9D4C, array index: 0x1E87 */
0x647C,0x647E,0x6523,
/* Range 0x9D52 - 0x9D5C, array index: 0x1E8A */
0x6525,0x647A,0x6526,INVALC,0x6522,0x6524,0x6528,0x6521,
0x6529,0x647D,0x6479,
/* Range 0x9D67 - 0x9D8C, array index: 0x1E95 */
0x6126,0x685E,0x6855,INVALC,0x6851,INVALC,INVALC,INVALC,
0x685A,0x6854,0x684A,INVALC,0x6857,0x6852,0x6853,INVALC,
0x6845,0x684C,0x685B,INVALC,0x6858,INVALC,0x6850,INVALC,
0x685C,0x684B,0x6846,0x6859,INVALC,0x6848,0x6856,0x684D,
0x685D,0x6849,INVALC,0x6847,0x684E,0x684F,
/* Range 0x9D94 - 0x9DF8, array index: 0x1EBB */
0x6B30,INVALC,0x6B3C,0x6B33,0x6B2C,0x6B28,0x6B35,0x6B2E,
0x6B31,0x6B2A,0x6B38,0x6B27,0x6B2F,0x6B34,0x6B36,0x6B39,
0x6B29,INVALC,0x6B3D,0x6B3E,0x6B37,0x6B3B,0x6B32,INVALC,
0x6D2F,0x6D32,INVALC,INVALC,INVALC,0x6D31,0x6D36,0x6D34,
INVALC,0x6D2B,0x6D21,0x6C7E,INVALC,0x6D2D,0x6D2E,0x6D2A,
0x6D22,INVALC,0x6D27,0x6B3A,INVALC,0x6D23,INVALC,0x6D29,
INVALC,0x6D28,INVALC,0x6D24,0x6D30,INVALC,0x6D25,0x6E68,
0x6D33,0x6D35,0x6D2C,0x6D26,0x6E69,0x6E6B,0x6E65,INVALC,
INVALC,0x6E72,0x6E70,INVALC,0x6E6F,0x6E6E,0x6E67,0x6E64,
0x6E6A,0x6E73,0x6E66,0x6E6C,INVALC,0x6F77,0x6F7C,0x6F72,
0x6F75,INVALC,0x6F79,INVALC,0x7022,0x6E6D,INVALC,0x6F73,
0x6F7D,0x7023,0x6F78,0x6F71,0x6F7B,INVALC,0x6F7A,0x7021,
0x6F7E,0x6E71,0x6F76,0x6F70,0x6F74,
/* Range 0x9DFB - 0x9E19, array index: 0x1F20 */
0x6F6F,INVALC,0x7074,0x706B,0x7073,0x7070,0x7071,0x706A,
0x706D,0x7075,0x706F,0x706E,0x706C,INVALC,0x7072,INVALC,
0x714C,INVALC,0x714D,INVALC,0x714F,0x714E,0x7151,0x7150,
0x716C,0x716B,0x7227,INVALC,0x7228,INVALC,0x7234,
/* Range 0x9E86 - 0x9E8E, array index: 0x1F3F */
0x5C3C,0x5C3D,0x5C3B,0x6137,0x6136,INVALC,0x652B,0x6138,
0x652A,
/* Range 0x9E99 - 0x9E9C, array index: 0x1F48 */
0x6B3F,0x6B41,0x6B40,0x6D38,
/* Range 0x9EE4 - 0x9EE7, array index: 0x1F4C */
0x6B43,0x6B42,0x6B45,0x6B44,
/* Range 0x9EF2 - 0x9F01, array index: 0x1F50 */
0x7026,0x7027,INVALC,0x7153,0x716D,INVALC,INVALC,0x4155,
0x5C42,0x613C,0x6862,0x4875,INVALC,0x613D,0x652E,0x652D,
/* Range 0x9F18 - 0x9F38, array index: 0x1F60 */
0x6D3D,INVALC,0x6D3E,0x6D3C,0x7029,INVALC,0x7077,INVALC,
INVALC,INVALC,0x6140,0x613F,0x613E,0x6530,INVALC,INVALC,
0x6534,0x6533,0x6532,0x6531,INVALC,0x6863,0x6B47,INVALC,
0x6B46,0x6D3F,0x6E78,0x6E77,INVALC,0x6E76,0x702C,0x702B,
0x702A,
/* Range 0x9F40 - 0x9F4F, array index: 0x1F81 */
0x6864,0x6865,0x6E79,0x702D,INVALC,INVALC,0x7078,0x7155,
0x7229,0x7243,INVALC,INVALC,0x6535,0x6866,0x6D40,0x702E,
/* Range 0x9F54 - 0x9F60, array index: 0x1F91 */
0x6141,0x6536,0x6867,0x6868,0x6869,0x6B4C,INVALC,0x6B48,
INVALC,0x6B4B,0x6B4A,INVALC,0x6B49,
/* Range 0x9F6E - 0x9F7B, array index: 0x1F9E */
0x7031,0x7032,0x7030,0x702F,INVALC,INVALC,0x7079,0x707A,
0x707B,INVALC,0x7156,0x7159,0x7158,0x7157,
/* Unranged codes (638 codes) */
/* Array index: 0x1FAC */ 0x4E07,0x2126,
/* Array index: 0x1FAC */ 0x4E0C,0x2127,
/* Array index: 0x1FAC */ 0x4E0E,0x212F,
/* Array index: 0x1FAC */ 0x4E0F,0x212D,
/* Array index: 0x1FAC */ 0x4E2E,0x2130,
/* Array index: 0x1FAC */ 0x4E31,0x2143,
/* Array index: 0x1FAC */ 0x4E33,0x2531,
/* Array index: 0x1FAC */ 0x4E3C,0x2144,
/* Array index: 0x1FAC */ 0x4E42,0x2121,
/* Array index: 0x1FAC */ 0x4E47,0x2128,
/* Array index: 0x1FAC */ 0x4E5C,0x2122,
/* Array index: 0x1FAC */ 0x4E7F,0x334E,
/* Array index: 0x1FAC */ 0x4E83,0x4156,
/* Array index: 0x1FAC */ 0x4E84,0x4157,
/* Array index: 0x1FAC */ 0x4E8D,0x2129,
/* Array index: 0x1FAC */ 0x4E93,0x2131,
/* Array index: 0x1FAC */ 0x4EB6,0x4158,
/* Array index: 0x1FAC */ 0x4EB9,0x6D44,
/* Array index: 0x1FAC */ 0x4EC2,0x2132,
/* Array index: 0x1FAC */ 0x4EC8,0x2134,
/* Array index: 0x1FAC */ 0x4EC9,0x2133,
/* Array index: 0x1FAC */ 0x4EDA,0x214A,
/* Array index: 0x1FAC */ 0x4EDC,0x2146,
/* Array index: 0x1FAC */ 0x4EDD,0x2149,
/* Array index: 0x1FAC */ 0x4EE1,0x2148,
/* Array index: 0x1FAC */ 0x4EE8,0x2145,
/* Array index: 0x1FAC */ 0x4EE9,0x2147,
/* Array index: 0x1FAC */ 0x4EF1,0x216F,
/* Array index: 0x1FAC */ 0x4EF4,0x2179,
/* Array index: 0x1FAC */ 0x4EF5,0x216D,
/* Array index: 0x1FAC */ 0x4EF7,0x2171,
/* Array index: 0x1FAC */ 0x4F00,0x2170,
/* Array index: 0x1FAC */ 0x4F02,0x2174,
/* Array index: 0x1FAC */ 0x4F04,0x2178,
/* Array index: 0x1FAC */ 0x4F05,0x2175,
/* Array index: 0x1FAC */ 0x4F08,0x2172,
/* Array index: 0x1FAC */ 0x4F0E,0x216A,
/* Array index: 0x1FAC */ 0x4F18,0x216B,
/* Array index: 0x1FAC */ 0x4F1D,0x2173,
/* Array index: 0x1FAC */ 0x4F22,0x2176,
/* Array index: 0x1FAC */ 0x4F2C,0x216C,
/* Array index: 0x1FAC */ 0x4F2D,0x2328,
/* Array index: 0x1FAC */ 0x4F33,0x2329,
/* Array index: 0x1FAC */ 0x4F3B,0x227B,
/* Array index: 0x1FAC */ 0x4F3E,0x2322,
/* Array index: 0x1FAC */ 0x4F3F,0x232A,
/* Array index: 0x1FAC */ 0x4F41,0x2326,
/* Array index: 0x1FAC */ 0x4F49,0x227D,
/* Array index: 0x1FAC */ 0x4F4C,0x253D,
/* Array index: 0x1FAC */ 0x4F52,0x2324,
/* Array index: 0x1FAC */ 0x4F53,0x227E,
/* Array index: 0x1FAC */ 0x4F56,0x227A,
/* Array index: 0x1FAC */ 0x4F58,0x2327,
/* Array index: 0x1FAC */ 0x4F5F,0x2325,
/* Array index: 0x1FAC */ 0x4F61,0x232B,
/* Array index: 0x1FAC */ 0x4F62,0x227C,
/* Array index: 0x1FAC */ 0x4F64,0x2321,
/* Array index: 0x1FAC */ 0x4F67,0x2323,
/* Array index: 0x1FAC */ 0x4F6A,0x253F,
/* Array index: 0x1FAC */ 0x4F6B,0x254B,
/* Array index: 0x1FAC */ 0x4F6E,0x254C,
/* Array index: 0x1FAC */ 0x4F90,0x2544,
/* Array index: 0x1FAC */ 0x4F92,0x2548,
/* Array index: 0x1FAC */ 0x4FB2,0x2922,
/* Array index: 0x1FAC */ 0x4FB3,0x292A,
/* Array index: 0x1FAC */ 0x4FC0,0x292F,
/* Array index: 0x1FAC */ 0x4FC1,0x2925,
/* Array index: 0x1FAC */ 0x4FC5,0x287E,
/* Array index: 0x1FAC */ 0x4FC7,0x292C,
/* Array index: 0x1FAC */ 0x4FC9,0x2923,
/* Array index: 0x1FAC */ 0x4FCB,0x2924,
/* Array index: 0x1FAC */ 0x4FCD,0x287D,
/* Array index: 0x1FAC */ 0x4FD3,0x2921,
/* Array index: 0x1FAC */ 0x4FD4,0x2926,
/* Array index: 0x1FAC */ 0x4FD6,0x292D,
/* Array index: 0x1FAC */ 0x4FD9,0x2928,
/* Array index: 0x1FAC */ 0x4FDB,0x292B,
/* Array index: 0x1FAC */ 0x4FDC,0x2927,
/* Array index: 0x1FAC */ 0x4FEC,0x2931,
/* Array index: 0x1FAC */ 0x5005,0x2D6A,
/* Array index: 0x1FAC */ 0x5007,0x2D6B,
/* Array index: 0x1FAC */ 0x500E,0x2D7E,
/* Array index: 0x1FAC */ 0x5013,0x2D6C,
/* Array index: 0x1FAC */ 0x5015,0x335E,
/* Array index: 0x1FAC */ 0x5017,0x2D77,
/* Array index: 0x1FAC */ 0x501B,0x2D6F,
/* Array index: 0x1FAC */ 0x501C,0x2D78,
/* Array index: 0x1FAC */ 0x501E,0x2D69,
/* Array index: 0x1FAC */ 0x5020,0x2D79,
/* Array index: 0x1FAC */ 0x5022,0x2D6D,
/* Array index: 0x1FAC */ 0x5027,0x2D7A,
/* Array index: 0x1FAC */ 0x502C,0x2D74,
/* Array index: 0x1FAC */ 0x5040,0x3366,
/* Array index: 0x1FAC */ 0x5041,0x335A,
/* Array index: 0x1FAC */ 0x5045,0x335F,
/* Array index: 0x1FAC */ 0x5046,0x3365,
/* Array index: 0x1FAC */ 0x5048,0x3358,
/* Array index: 0x1FAC */ 0x504A,0x335C,
/* Array index: 0x1FAC */ 0x504B,0x3355,
/* Array index: 0x1FAC */ 0x504D,0x3359,
/* Array index: 0x1FAC */ 0x5051,0x336A,
/* Array index: 0x1FAC */ 0x5053,0x3354,
/* Array index: 0x1FAC */ 0x5057,0x3369,
/* Array index: 0x1FAC */ 0x506E,0x3367,
/* Array index: 0x1FAC */ 0x5070,0x334F,
/* Array index: 0x1FAC */ 0x5072,0x3357,
/* Array index: 0x1FAC */ 0x5073,0x3368,
/* Array index: 0x1FAC */ 0x5082,0x3A42,
/* Array index: 0x1FAC */ 0x5083,0x3A3B,
/* Array index: 0x1FAC */ 0x5087,0x3A43,
/* Array index: 0x1FAC */ 0x508B,0x3A39,
/* Array index: 0x1FAC */ 0x508C,0x3A3C,
/* Array index: 0x1FAC */ 0x508E,0x3A3D,
/* Array index: 0x1FAC */ 0x5092,0x3A41,
/* Array index: 0x1FAC */ 0x5094,0x3A37,
/* Array index: 0x1FAC */ 0x5095,0x3A36,
/* Array index: 0x1FAC */ 0x50A3,0x3A3A,
/* Array index: 0x1FAC */ 0x50AE,0x415C,
/* Array index: 0x1FAC */ 0x50B0,0x4162,
/* Array index: 0x1FAC */ 0x50B1,0x4165,
/* Array index: 0x1FAC */ 0x50B4,0x415F,
/* Array index: 0x1FAC */ 0x50B6,0x4168,
/* Array index: 0x1FAC */ 0x50B8,0x4169,
/* Array index: 0x1FAC */ 0x50BA,0x4164,
/* Array index: 0x1FAC */ 0x50BD,0x4159,
/* Array index: 0x1FAC */ 0x50BF,0x415A,
/* Array index: 0x1FAC */ 0x50C1,0x4163,
/* Array index: 0x1FAC */ 0x50C2,0x4161,
/* Array index: 0x1FAC */ 0x50C4,0x415D,
/* Array index: 0x1FAC */ 0x50D3,0x4921,
/* Array index: 0x1FAC */ 0x50D4,0x4877,
/* Array index: 0x1FAC */ 0x50D7,0x4878,
/* Array index: 0x1FAC */ 0x50DB,0x487B,
/* Array index: 0x1FAC */ 0x50DD,0x487D,
/* Array index: 0x1FAC */ 0x50E0,0x4926,
/* Array index: 0x1FAC */ 0x50E3,0x4925,
/* Array index: 0x1FAC */ 0x50E4,0x487E,
/* Array index: 0x1FAC */ 0x50E6,0x4876,
/* Array index: 0x1FAC */ 0x50E8,0x4879,
/* Array index: 0x1FAC */ 0x50EA,0x487C,
/* Array index: 0x1FAC */ 0x50EC,0x4922,
/* Array index: 0x1FAC */ 0x50EF,0x4924,
/* Array index: 0x1FAC */ 0x50F0,0x4923,
/* Array index: 0x1FAC */ 0x50F3,0x487A,
/* Array index: 0x1FAC */ 0x50F6,0x4F54,
/* Array index: 0x1FAC */ 0x50F8,0x4F51,
/* Array index: 0x1FAC */ 0x5103,0x4F4F,
/* Array index: 0x1FAC */ 0x5111,0x5643,
/* Array index: 0x1FAC */ 0x5113,0x5640,
/* Array index: 0x1FAC */ 0x5117,0x5641,
/* Array index: 0x1FAC */ 0x511A,0x5642,
/* Array index: 0x1FAC */ 0x511C,0x563F,
/* Array index: 0x1FAC */ 0x5120,0x5C49,
/* Array index: 0x1FAC */ 0x5129,0x5C4A,
/* Array index: 0x1FAC */ 0x5139,0x6B4F,
/* Array index: 0x1FAC */ 0x513A,0x6B4E,
/* Array index: 0x1FAC */ 0x513D,0x6E7D,
/* Array index: 0x1FAC */ 0x515A,0x2E21,
/* Array index: 0x1FAC */ 0x515F,0x3A44,
/* Array index: 0x1FAC */ 0x5187,0x212E,
/* Array index: 0x1FAC */ 0x518F,0x232C,
/* Array index: 0x1FAC */ 0x5193,0x2E23,
/* Array index: 0x1FAC */ 0x5194,0x2E22,
/* Array index: 0x1FAC */ 0x5198,0x2135,
/* Array index: 0x1FAC */ 0x519E,0x254D,
/* Array index: 0x1FAC */ 0x51B1,0x217B,
/* Array index: 0x1FAC */ 0x51B9,0x232D,
/* Array index: 0x1FAC */ 0x51BC,0x254E,
/* Array index: 0x1FAC */ 0x51BE,0x254F,
/* Array index: 0x1FAC */ 0x51C4,0x2E25,
/* Array index: 0x1FAC */ 0x51C5,0x2E26,
/* Array index: 0x1FAC */ 0x51C8,0x2E27,
/* Array index: 0x1FAC */ 0x51CA,0x2E24,
/* Array index: 0x1FAC */ 0x51CE,0x2E28,
/* Array index: 0x1FAC */ 0x51D0,0x336B,
/* Array index: 0x1FAC */ 0x51D4,0x3A45,
/* Array index: 0x1FAC */ 0x51D7,0x416A,
/* Array index: 0x1FAC */ 0x51D8,0x4927,
/* Array index: 0x1FAC */ 0x51DE,0x5644,
/* Array index: 0x1FAC */ 0x51F5,0x2123,
/* Array index: 0x1FAC */ 0x5209,0x214C,
/* Array index: 0x1FAC */ 0x520C,0x214B,
/* Array index: 0x1FAC */ 0x5210,0x217D,
/* Array index: 0x1FAC */ 0x5213,0x217C,
/* Array index: 0x1FAC */ 0x521C,0x232E,
/* Array index: 0x1FAC */ 0x521E,0x232F,
/* Array index: 0x1FAC */ 0x5221,0x2330,
/* Array index: 0x1FAC */ 0x5244,0x2932,
/* Array index: 0x1FAC */ 0x5246,0x2553,
/* Array index: 0x1FAC */ 0x5249,0x2933,
/* Array index: 0x1FAC */ 0x5252,0x2E2B,
/* Array index: 0x1FAC */ 0x5255,0x2E2E,
/* Array index: 0x1FAC */ 0x525A,0x2E2A,
/* Array index: 0x1FAC */ 0x5280,0x4928,
/* Array index: 0x1FAC */ 0x5281,0x4929,
/* Array index: 0x1FAC */ 0x5284,0x4C61,
/* Array index: 0x1FAC */ 0x528B,0x4F5A,
/* Array index: 0x1FAC */ 0x528C,0x4F5B,
/* Array index: 0x1FAC */ 0x52A6,0x217E,
/* Array index: 0x1FAC */ 0x52AD,0x2331,
/* Array index: 0x1FAC */ 0x52AE,0x2332,
/* Array index: 0x1FAC */ 0x52BC,0x2555,
/* Array index: 0x1FAC */ 0x52C0,0x2934,
/* Array index: 0x1FAC */ 0x52C2,0x2935,
/* Array index: 0x1FAC */ 0x52CD,0x2E30,
/* Array index: 0x1FAC */ 0x52D3,0x3371,
/* Array index: 0x1FAC */ 0x52D6,0x3370,
/* Array index: 0x1FAC */ 0x52E9,0x492A,
/* Array index: 0x1FAC */ 0x52EB,0x492B,
/* Array index: 0x1FAC */ 0x52EF,0x4F5D,
/* Array index: 0x1FAC */ 0x52F1,0x4F5C,
/* Array index: 0x1FAC */ 0x52F4,0x5C4B,
/* Array index: 0x1FAC */ 0x52F7,0x653A,
/* Array index: 0x1FAC */ 0x52FC,0x2136,
/* Array index: 0x1FAC */ 0x530E,0x2E31,
/* Array index: 0x1FAC */ 0x5311,0x3A47,
/* Array index: 0x1FAC */ 0x5312,0x3A46,
/* Array index: 0x1FAC */ 0x531A,0x2124,
/* Array index: 0x1FAC */ 0x531C,0x214D,
/* Array index: 0x1FAC */ 0x531F,0x2222,
/* Array index: 0x1FAC */ 0x5322,0x2221,
/* Array index: 0x1FAC */ 0x532D,0x3372,
/* Array index: 0x1FAC */ 0x5330,0x492C,
/* Array index: 0x1FAC */ 0x5334,0x5645,
/* Array index: 0x1FAC */ 0x5337,0x686A,
/* Array index: 0x1FAC */ 0x533C,0x2558,
/* Array index: 0x1FAC */ 0x533D,0x2936,
/* Array index: 0x1FAC */ 0x534C,0x214E,
/* Array index: 0x1FAC */ 0x534D,0x2223,
/* Array index: 0x1FAC */ 0x5363,0x2334,
/* Array index: 0x1FAC */ 0x536C,0x2137,
/* Array index: 0x1FAC */ 0x5372,0x2335,
/* Array index: 0x1FAC */ 0x537C,0x2937,
/* Array index: 0x1FAC */ 0x5382,0x2125,
/* Array index: 0x1FAC */ 0x538A,0x2224,
/* Array index: 0x1FAC */ 0x538E,0x2336,
/* Array index: 0x1FAC */ 0x538F,0x2337,
/* Array index: 0x1FAC */ 0x5392,0x2559,
/* Array index: 0x1FAC */ 0x539C,0x3373,
/* Array index: 0x1FAC */ 0x539E,0x2E32,
/* Array index: 0x1FAC */ 0x53A4,0x3A48,
/* Array index: 0x1FAC */ 0x53A7,0x3A49,
/* Array index: 0x1FAC */ 0x53AC,0x492D,
/* Array index: 0x1FAC */ 0x53B4,0x653B,
/* Array index: 0x1FAC */ 0x53B9,0x2138,
/* Array index: 0x1FAC */ 0x53E1,0x5646,
/* Array index: 0x1FAC */ 0x5407,0x2225,
/* Array index: 0x1FAC */ 0x5418,0x2340,
/* Array index: 0x1FAC */ 0x5419,0x233D,
/* Array index: 0x1FAC */ 0x541C,0x233E,
/* Array index: 0x1FAC */ 0x5424,0x2345,
/* Array index: 0x1FAC */ 0x5425,0x233F,
/* Array index: 0x1FAC */ 0x5428,0x2344,
/* Array index: 0x1FAC */ 0x542A,0x233A,
/* Array index: 0x1FAC */ 0x5430,0x2338,
/* Array index: 0x1FAC */ 0x5437,0x2339,
/* Array index: 0x1FAC */ 0x543D,0x2341,
/* Array index: 0x1FAC */ 0x5441,0x2343,
/* Array index: 0x1FAC */ 0x5445,0x233C,
/* Array index: 0x1FAC */ 0x5447,0x2346,
/* Array index: 0x1FAC */ 0x544F,0x2342,
/* Array index: 0x1FAC */ 0x5454,0x233B,
/* Array index: 0x1FAC */ 0x546B,0x2561,
/* Array index: 0x1FAC */ 0x546C,0x2565,
/* Array index: 0x1FAC */ 0x546F,0x2569,
/* Array index: 0x1FAC */ 0x5470,0x294A,
/* Array index: 0x1FAC */ 0x5472,0x294E,
/* Array index: 0x1FAC */ 0x5474,0x2566,
/* Array index: 0x1FAC */ 0x547A,0x2562,
/* Array index: 0x1FAC */ 0x5487,0x255B,
/* Array index: 0x1FAC */ 0x5488,0x2560,
/* Array index: 0x1FAC */ 0x548D,0x2568,
/* Array index: 0x1FAC */ 0x5491,0x255E,
/* Array index: 0x1FAC */ 0x5498,0x256C,
/* Array index: 0x1FAC */ 0x54A5,0x293F,
/* Array index: 0x1FAC */ 0x54AD,0x293E,
/* Array index: 0x1FAC */ 0x54AE,0x2944,
/* Array index: 0x1FAC */ 0x54B0,0x2950,
/* Array index: 0x1FAC */ 0x54B6,0x2946,
/* Array index: 0x1FAC */ 0x54B7,0x2943,
/* Array index: 0x1FAC */ 0x54BA,0x293C,
/* Array index: 0x1FAC */ 0x54BC,0x294B,
/* Array index: 0x1FAC */ 0x54BE,0x294D,
/* Array index: 0x1FAC */ 0x54C3,0x2941,
/* Array index: 0x1FAC */ 0x54C5,0x2947,
/* Array index: 0x1FAC */ 0x54C6,0x2948,
/* Array index: 0x1FAC */ 0x54CF,0x2940,
/* Array index: 0x1FAC */ 0x54D6,0x2945,
/* Array index: 0x1FAC */ 0x54DE,0x294F,
/* Array index: 0x1FAC */ 0x54E0,0x2E46,
/* Array index: 0x1FAC */ 0x54E2,0x2E34,
/* Array index: 0x1FAC */ 0x54E4,0x2E39,
/* Array index: 0x1FAC */ 0x54E7,0x2E37,
/* Array index: 0x1FAC */ 0x54EB,0x2E3E,
/* Array index: 0x1FAC */ 0x54F1,0x2E41,
/* Array index: 0x1FAC */ 0x54F3,0x2E38,
/* Array index: 0x1FAC */ 0x54F7,0x2E44,
/* Array index: 0x1FAC */ 0x54F8,0x2E45,
/* Array index: 0x1FAC */ 0x54FB,0x2E43,
/* Array index: 0x1FAC */ 0x54FF,0x2E3B,
/* Array index: 0x1FAC */ 0x5517,0x2E35,
/* Array index: 0x1FAC */ 0x551A,0x2E3A,
/* Array index: 0x1FAC */ 0x5526,0x2E33,
/* Array index: 0x1FAC */ 0x552A,0x337A,
/* Array index: 0x1FAC */ 0x552D,0x342A,
/* Array index: 0x1FAC */ 0x5530,0x3421,
/* Array index: 0x1FAC */ 0x5539,0x3428,
/* Array index: 0x1FAC */ 0x553B,0x342B,
/* Array index: 0x1FAC */ 0x553C,0x3376,
/* Array index: 0x1FAC */ 0x5540,0x342C,
/* Array index: 0x1FAC */ 0x5545,0x3423,
/* Array index: 0x1FAC */ 0x5548,0x3429,
/* Array index: 0x1FAC */ 0x554B,0x342D,
/* Array index: 0x1FAC */ 0x5562,0x337C,
/* Array index: 0x1FAC */ 0x5565,0x3426,
/* Array index: 0x1FAC */ 0x557D,0x3A59,
/* Array index: 0x1FAC */ 0x557F,0x3A5C,
/* Array index: 0x1FAC */ 0x5581,0x3A55,
/* Array index: 0x1FAC */ 0x5588,0x3A52,
/* Array index: 0x1FAC */ 0x55AD,0x3A4D,
/* Array index: 0x1FAC */ 0x55B5,0x3A54,
/* Array index: 0x1FAC */ 0x55D9,0x4226,
/* Array index: 0x1FAC */ 0x55DB,0x4170,
/* Array index: 0x1FAC */ 0x55DD,0x4175,
/* Array index: 0x1FAC */ 0x55E2,0x4221,
/* Array index: 0x1FAC */ 0x55E9,0x4179,
/* Array index: 0x1FAC */ 0x55F2,0x4224,
/* Array index: 0x1FAC */ 0x55F9,0x493C,
/* Array index: 0x1FAC */ 0x55FA,0x4938,
/* Array index: 0x1FAC */ 0x55FC,0x4932,
/* Array index: 0x1FAC */ 0x55FF,0x493B,
/* Array index: 0x1FAC */ 0x5601,0x4935,
/* Array index: 0x1FAC */ 0x5602,0x4937,
/* Array index: 0x1FAC */ 0x5604,0x493A,
/* Array index: 0x1FAC */ 0x560C,0x4930,
/* Array index: 0x1FAC */ 0x560F,0x4933,
/* Array index: 0x1FAC */ 0x5612,0x4931,
/* Array index: 0x1FAC */ 0x5613,0x4936,
/* Array index: 0x1FAC */ 0x5615,0x492F,
/* Array index: 0x1FAC */ 0x561C,0x4934,
/* Array index: 0x1FAC */ 0x561D,0x4939,
/* Array index: 0x1FAC */ 0x5627,0x492E,
/* Array index: 0x1FAC */ 0x562A,0x4F6E,
/* Array index: 0x1FAC */ 0x562C,0x4F6B,
/* Array index: 0x1FAC */ 0x5633,0x4F69,
/* Array index: 0x1FAC */ 0x5635,0x4F61,
/* Array index: 0x1FAC */ 0x5638,0x4F6D,
/* Array index: 0x1FAC */ 0x563A,0x4F6F,
/* Array index: 0x1FAC */ 0x5658,0x4F66,
/* Array index: 0x1FAC */ 0x565A,0x4F67,
/* Array index: 0x1FAC */ 0x565E,0x564F,
/* Array index: 0x1FAC */ 0x5660,0x5648,
/* Array index: 0x1FAC */ 0x5663,0x564C,
/* Array index: 0x1FAC */ 0x5666,0x564B,
/* Array index: 0x1FAC */ 0x566D,0x564D,
/* Array index: 0x1FAC */ 0x566E,0x5649,
/* Array index: 0x1FAC */ 0x5670,0x5647,
/* Array index: 0x1FAC */ 0x5672,0x564E,
/* Array index: 0x1FAC */ 0x5673,0x564A,
/* Array index: 0x1FAC */ 0x5677,0x5650,
/* Array index: 0x1FAC */ 0x568C,0x5C4D,
/* Array index: 0x1FAC */ 0x568D,0x5C4E,
/* Array index: 0x1FAC */ 0x5693,0x5C4C,
/* Array index: 0x1FAC */ 0x56B2,0x686B,
/* Array index: 0x1FAC */ 0x56B3,0x686D,
/* Array index: 0x1FAC */ 0x56B5,0x686C,
/* Array index: 0x1FAC */ 0x56BD,0x6B53,
/* Array index: 0x1FAC */ 0x56BE,0x6B54,
/* Array index: 0x1FAC */ 0x56C3,0x6B52,
/* Array index: 0x1FAC */ 0x56C5,0x6D46,
/* Array index: 0x1FAC */ 0x56C6,0x6D45,
/* Array index: 0x1FAC */ 0x56CB,0x6D47,
/* Array index: 0x1FAC */ 0x56CD,0x7034,
/* Array index: 0x1FAC */ 0x56D3,0x7033,
/* Array index: 0x1FAC */ 0x56D4,0x707C,
/* Array index: 0x1FAC */ 0x56D7,0x212A,
/* Array index: 0x1FAC */ 0x56DF,0x2227,
/* Array index: 0x1FAC */ 0x56E1,0x2226,
/* Array index: 0x1FAC */ 0x56E5,0x2349,
/* Array index: 0x1FAC */ 0x56E7,0x2348,
/* Array index: 0x1FAC */ 0x56EE,0x2347,
/* Array index: 0x1FAC */ 0x56F7,0x2570,
/* Array index: 0x1FAC */ 0x56F9,0x2571,
/* Array index: 0x1FAC */ 0x5701,0x2E4A,
/* Array index: 0x1FAC */ 0x5702,0x2E4B,
/* Array index: 0x1FAC */ 0x5707,0x342F,
/* Array index: 0x1FAC */ 0x570A,0x342E,
/* Array index: 0x1FAC */ 0x570C,0x3A60,
/* Array index: 0x1FAC */ 0x5714,0x4228,
/* Array index: 0x1FAC */ 0x572A,0x2229,
/* Array index: 0x1FAC */ 0x572E,0x2228,
/* Array index: 0x1FAC */ 0x5734,0x222A,
/* Array index: 0x1FAC */ 0x5741,0x234A,
/* Array index: 0x1FAC */ 0x5745,0x234B,
/* Array index: 0x1FAC */ 0x5749,0x234D,
/* Array index: 0x1FAC */ 0x574B,0x234E,
/* Array index: 0x1FAC */ 0x574C,0x234C,
/* Array index: 0x1FAC */ 0x5752,0x234F,
/* Array index: 0x1FAC */ 0x5762,0x257E,
/* Array index: 0x1FAC */ 0x5768,0x2621,
/* Array index: 0x1FAC */ 0x576B,0x2575,
/* Array index: 0x1FAC */ 0x577B,0x257B,
/* Array index: 0x1FAC */ 0x577D,0x2622,
/* Array index: 0x1FAC */ 0x5780,0x2579,
/* Array index: 0x1FAC */ 0x578C,0x2955,
/* Array index: 0x1FAC */ 0x578F,0x295B,
/* Array index: 0x1FAC */ 0x57A4,0x2954,
/* Array index: 0x1FAC */ 0x57A5,0x295D,
/* Array index: 0x1FAC */ 0x57C6,0x2E51,
/* Array index: 0x1FAC */ 0x57C7,0x2E57,
/* Array index: 0x1FAC */ 0x57CC,0x2E4C,
/* Array index: 0x1FAC */ 0x57CF,0x343D,
/* Array index: 0x1FAC */ 0x57D0,0x2E58,
/* Array index: 0x1FAC */ 0x57D2,0x2E4F,
/* Array index: 0x1FAC */ 0x57D5,0x2E4E,
/* Array index: 0x1FAC */ 0x57DC,0x3434,
/* Array index: 0x1FAC */ 0x5804,0x344F,
/* Array index: 0x1FAC */ 0x5814,0x3431,
/* Array index: 0x1FAC */ 0x5819,0x3A63,
/* Array index: 0x1FAC */ 0x581B,0x3A6C,
/* Array index: 0x1FAC */ 0x581C,0x3A6B,
/* Array index: 0x1FAC */ 0x581E,0x3A64,
/* Array index: 0x1FAC */ 0x5823,0x3A66,
/* Array index: 0x1FAC */ 0x5848,0x3A69,
/* Array index: 0x1FAC */ 0x5849,0x422E,
/* Array index: 0x1FAC */ 0x5853,0x4229,
/* Array index: 0x1FAC */ 0x5855,0x4230,
/* Array index: 0x1FAC */ 0x5859,0x4233,
/* Array index: 0x1FAC */ 0x585B,0x4235,
/* Array index: 0x1FAC */ 0x585D,0x4232,
/* Array index: 0x1FAC */ 0x5868,0x422A,
/* Array index: 0x1FAC */ 0x586F,0x422F,
/* Array index: 0x1FAC */ 0x5871,0x4238,
/* Array index: 0x1FAC */ 0x5874,0x4944,
/* Array index: 0x1FAC */ 0x5876,0x494A,
/* Array index: 0x1FAC */ 0x587F,0x4943,
/* Array index: 0x1FAC */ 0x5881,0x4942,
/* Array index: 0x1FAC */ 0x5882,0x494B,
/* Array index: 0x1FAC */ 0x5894,0x494E,
/* Array index: 0x1FAC */ 0x5898,0x4940,
/* Array index: 0x1FAC */ 0x589D,0x4F72,
/* Array index: 0x1FAC */ 0x58A0,0x4F74,
/* Array index: 0x1FAC */ 0x58A1,0x4F79,
/* Array index: 0x1FAC */ 0x58A3,0x4F75,
/* Array index: 0x1FAC */ 0x58A5,0x4F78,
/* Array index: 0x1FAC */ 0x58AB,0x4F71,
/* Array index: 0x1FAC */ 0x58AC,0x4F77,
/* Array index: 0x1FAC */ 0x58AF,0x4F76,
/* Array index: 0x1FAC */ 0x58B1,0x4F73,
/* Array index: 0x1FAC */ 0x58BA,0x5657,
/* Array index: 0x1FAC */ 0x58BC,0x5659,
/* Array index: 0x1FAC */ 0x58BD,0x5654,
/* Array index: 0x1FAC */ 0x58BF,0x5656,
/* Array index: 0x1FAC */ 0x58C2,0x5658,
/* Array index: 0x1FAC */ 0x58C6,0x565A,
/* Array index: 0x1FAC */ 0x58C8,0x5653,
/* Array index: 0x1FAC */ 0x58C9,0x5655,
/* Array index: 0x1FAC */ 0x58CF,0x5C58,
/* Array index: 0x1FAC */ 0x58D2,0x5C59,
/* Array index: 0x1FAC */ 0x58D4,0x5C57,
/* Array index: 0x1FAC */ 0x58D6,0x5C56,
/* Array index: 0x1FAC */ 0x58DA,0x6542,
/* Array index: 0x1FAC */ 0x58DB,0x6544,
/* Array index: 0x1FAC */ 0x58DD,0x6543,
/* Array index: 0x1FAC */ 0x58E3,0x686E,
/* Array index: 0x1FAC */ 0x58E7,0x6F22,
/* Array index: 0x1FAC */ 0x58E8,0x6F21,
/* Array index: 0x1FAC */ 0x58F4,0x2960,
/* Array index: 0x1FAC */ 0x58FC,0x4239,
/* Array index: 0x1FAC */ 0x58FE,0x4950,
/* Array index: 0x1FAC */ 0x58FF,0x4F7A,
/* Array index: 0x1FAC */ 0x5903,0x213A,
/* Array index: 0x1FAC */ 0x5906,0x2350,
/* Array index: 0x1FAC */ 0x5912,0x6545,
/* Array index: 0x1FAC */ 0x5917,0x2151,
/* Array index: 0x1FAC */ 0x592C,0x213B,
/* Array index: 0x1FAC */ 0x592F,0x2152,
/* Array index: 0x1FAC */ 0x593C,0x222B,
/* Array index: 0x1FAC */ 0x5940,0x2351,
/* Array index: 0x1FAC */ 0x5945,0x2624,
/* Array index: 0x1FAC */ 0x594A,0x2E5C,
/* Array index: 0x1FAC */ 0x5953,0x2962,
/* Array index: 0x1FAC */ 0x595C,0x3450,
/* Array index: 0x1FAC */ 0x5961,0x3A76,
/* Array index: 0x1FAC */ 0x596B,0x4951,
/* Array index: 0x1FAC */ 0x5977,0x2231,
/* Array index: 0x1FAC */ 0x5985,0x222E,
/* Array index: 0x1FAC */ 0x5997,0x2355,
/* Array index: 0x1FAC */ 0x5998,0x2353,
/* Array index: 0x1FAC */ 0x59A6,0x2352,
/* Array index: 0x1FAC */ 0x59A7,0x235A,
/* Array index: 0x1FAC */ 0x59BA,0x2626,
/* Array index: 0x1FAC */ 0x59BC,0x262D,
/* Array index: 0x1FAC */ 0x59BD,0x2631,
/* Array index: 0x1FAC */ 0x59C0,0x2632,
/* Array index: 0x1FAC */ 0x59C1,0x262B,
/* Array index: 0x1FAC */ 0x59C3,0x262E,
/* Array index: 0x1FAC */ 0x59C7,0x2635,
/* Array index: 0x1FAC */ 0x59C8,0x2633,
/* Array index: 0x1FAC */ 0x59CC,0x262A,
/* Array index: 0x1FAC */ 0x59CE,0x2628,
/* Array index: 0x1FAC */ 0x59CF,0x2627,
/* Array index: 0x1FAC */ 0x59D6,0x262F,
/* Array index: 0x1FAC */ 0x59DB,0x2970,
/* Array index: 0x1FAC */ 0x59E4,0x296D,
/* Array index: 0x1FAC */ 0x59E9,0x2971,
/* Array index: 0x1FAC */ 0x5A0A,0x2E64,
/* Array index: 0x1FAC */ 0x5A0F,0x2E62,
/* Array index: 0x1FAC */ 0x5A1E,0x2E65,
/* Array index: 0x1FAC */ 0x5A2D,0x2E5F,
/* Array index: 0x1FAC */ 0x5A2E,0x2E60,
/* Array index: 0x1FAC */ 0x5A33,0x2E66,
/* Array index: 0x1FAC */ 0x5A3E,0x3467,
/* Array index: 0x1FAC */ 0x5A64,0x345E,
/* Array index: 0x1FAC */ 0x5A65,0x345B,
/* Array index: 0x1FAC */ 0x5A67,0x3454,
/* Array index: 0x1FAC */ 0x5A69,0x346C,
/* Array index: 0x1FAC */ 0x5A6C,0x345C,
/* Array index: 0x1FAC */ 0x5A6D,0x3458,
/* Array index: 0x1FAC */ 0x5A70,0x346B,
/* Array index: 0x1FAC */ 0x5A83,0x3B2A,
/* Array index: 0x1FAC */ 0x5A84,0x3B27,
/* Array index: 0x1FAC */ 0x5AA2,0x3A7B,
/* Array index: 0x1FAC */ 0x5AA5,0x3B22,
/* Array index: 0x1FAC */ 0x5AA6,0x3A7E,
/* Array index: 0x1FAC */ 0x5AA9,0x3B2C,
/* Array index: 0x1FAC */ 0x5ABF,0x4242,
/* Array index: 0x1FAC */ 0x5AC0,0x4247,
/* Array index: 0x1FAC */ 0x5AD5,0x4955,
/* Array index: 0x1FAC */ 0x5AE5,0x4954,
/* Array index: 0x1FAC */ 0x5AFD,0x4F7D,
/* Array index: 0x1FAC */ 0x5B0F,0x5029,
/* Array index: 0x1FAC */ 0x5B10,0x5661,
/* Array index: 0x1FAC */ 0x5B1E,0x5666,
/* Array index: 0x1FAC */ 0x5B20,0x5665,
/* Array index: 0x1FAC */ 0x5B21,0x565E,
/* Array index: 0x1FAC */ 0x5B32,0x5C5C,
/* Array index: 0x1FAC */ 0x5B45,0x686F,
/* Array index: 0x1FAC */ 0x5B56,0x2233,
/* Array index: 0x1FAC */ 0x5B62,0x2636,
/* Array index: 0x1FAC */ 0x5B65,0x2637,
/* Array index: 0x1FAC */ 0x5B6C,0x2E67,
/* Array index: 0x1FAC */ 0x5B6E,0x3473,
/* Array index: 0x1FAC */ 0x5B72,0x3472,
/* Array index: 0x1FAC */ 0x5B77,0x4964,
/* Array index: 0x1FAC */ 0x5B7B,0x5C63,
/* Array index: 0x1FAC */ 0x5B81,0x2153,
/* Array index: 0x1FAC */ 0x5B84,0x2154,
/* Array index: 0x1FAC */ 0x5B8E,0x235C,
/* Array index: 0x1FAC */ 0x5B92,0x235D,
/* Array index: 0x1FAC */ 0x5B93,0x2638,
/* Array index: 0x1FAC */ 0x5B95,0x2639,
/* Array index: 0x1FAC */ 0x5BA7,0x2E68,
/* Array index: 0x1FAC */ 0x5BA8,0x2978,
/* Array index: 0x1FAC */ 0x5BAC,0x2E6A,
/* Array index: 0x1FAC */ 0x5BAD,0x2E69,
/* Array index: 0x1FAC */ 0x5BC0,0x3475,
/* Array index: 0x1FAC */ 0x5BC1,0x3474,
/* Array index: 0x1FAC */ 0x5BD1,0x3B38,
/* Array index: 0x1FAC */ 0x5BD4,0x3B37,
/* Array index: 0x1FAC */ 0x5BD6,0x424E,
/* Array index: 0x1FAC */ 0x5BD8,0x424F,
/* Array index: 0x1FAC */ 0x5BD9,0x4250,
/* Array index: 0x1FAC */ 0x5BE0,0x4965,
/* Array index: 0x1FAC */ 0x5BE3,0x4966,
/* Array index: 0x1FAC */ 0x5BEA,0x3B34,
/* Array index: 0x1FAC */ 0x5BEF,0x5667,
/* Array index: 0x1FAC */ 0x5BF1,0x5C64,
/* Array index: 0x1FAC */ 0x5BF2,0x5C65,
/* Array index: 0x1FAC */ 0x5C03,0x2E6B,
/* Array index: 0x1FAC */ 0x5C0C,0x3B3B,
/* Array index: 0x1FAC */ 0x5C10,0x213C,
/* Array index: 0x1FAC */ 0x5C12,0x2155,
/* Array index: 0x1FAC */ 0x5C15,0x2234,
/* Array index: 0x1FAC */ 0x5C1F,0x4251,
/* Array index: 0x1FAC */ 0x5C25,0x2235,
/* Array index: 0x1FAC */ 0x5C28,0x235E,
/* Array index: 0x1FAC */ 0x5C2A,0x235F,
/* Array index: 0x1FAC */ 0x5C30,0x3B3C,
/* Array index: 0x1FAC */ 0x5C33,0x4252,
/* Array index: 0x1FAC */ 0x5C3B,0x2156,
/* Array index: 0x1FAC */ 0x5C44,0x263A,
/* Array index: 0x1FAC */ 0x5C47,0x263B,
/* Array index: 0x1FAC */ 0x5C4C,0x2979,
/* Array index: 0x1FAC */ 0x5C54,0x2E6D,
/* Array index: 0x1FAC */ 0x5C56,0x2E6C,
/* Array index: 0x1FAC */ 0x5C59,0x3476,
/* Array index: 0x1FAC */ 0x5C63,0x4967,
/* Array index: 0x1FAC */ 0x5C67,0x502A,
/* Array index: 0x1FAC */ 0x5C69,0x614E,
/* Array index: 0x1FAC */ 0x5C6A,0x614F,
/* Array index: 0x1FAC */ 0x5C6D,0x7036,
/* Array index: 0x1FAC */ 0x5C6E,0x212B,
/* Array index: 0x1FAC */ 0x5C73,0x2158,
/* Array index: 0x1FAC */ 0x5C74,0x2157,
/* Array index: 0x1FAC */ 0x5C9D,0x2649,
/* Array index: 0x1FAC */ 0x5CB5,0x263F,
/* Array index: 0x1FAC */ 0x5CB6,0x264B,
/* Array index: 0x1FAC */ 0x5CEC,0x2E6E,
/* Array index: 0x1FAC */ 0x5CEE,0x2E70,
/* Array index: 0x1FAC */ 0x5CF1,0x2E71,
/* Array index: 0x1FAC */ 0x5CFF,0x2E6F,
/* Array index: 0x1FAC */ 0x5D00,0x2E73,
/* Array index: 0x1FAC */ 0x5D12,0x3525,
/* Array index: 0x1FAC */ 0x5D1A,0x347A,
/* Array index: 0x1FAC */ 0x5D23,0x3526,
/* Array index: 0x1FAC */ 0x5D25,0x3522,
/* Array index: 0x1FAC */ 0x5D26,0x3521,
/* Array index: 0x1FAC */ 0x5D28,0x347D,
/* Array index: 0x1FAC */ 0x5D4E,0x3B45,
/* Array index: 0x1FAC */ 0x5D51,0x3B44,
/* Array index: 0x1FAC */ 0x5D52,0x3B49,
/* Array index: 0x1FAC */ 0x5D55,0x3B46,
/* Array index: 0x1FAC */ 0x5D59,0x3B4C,
/* Array index: 0x1FAC */ 0x5D5E,0x4259,
/* Array index: 0x1FAC */ 0x5D62,0x425C,
/* Array index: 0x1FAC */ 0x5D63,0x4254,
/* Array index: 0x1FAC */ 0x5D65,0x4256,
/* Array index: 0x1FAC */ 0x5D67,0x425B,
/* Array index: 0x1FAC */ 0x5D68,0x425A,
/* Array index: 0x1FAC */ 0x5D6B,0x3B3F,
/* Array index: 0x1FAC */ 0x5D6C,0x4258,
/* Array index: 0x1FAC */ 0x5D71,0x4253,
/* Array index: 0x1FAC */ 0x5D72,0x4257,
/* Array index: 0x1FAC */ 0x5D77,0x496E,
/* Array index: 0x1FAC */ 0x5D8D,0x4974,
/* Array index: 0x1FAC */ 0x5D92,0x502E,
/* Array index: 0x1FAC */ 0x5D93,0x5030,
/* Array index: 0x1FAC */ 0x5D95,0x5031,
/* Array index: 0x1FAC */ 0x5D97,0x502C,
/* Array index: 0x1FAC */ 0x5D99,0x502B,
/* Array index: 0x1FAC */ 0x5D9A,0x5035,
/* Array index: 0x1FAC */ 0x5DC0,0x6150,
/* Array index: 0x1FAC */ 0x5DC2,0x643E,
/* Array index: 0x1FAC */ 0x5DC3,0x6549,
/* Array index: 0x1FAC */ 0x5DC6,0x6870,
/* Array index: 0x1FAC */ 0x5DC7,0x6871,
/* Array index: 0x1FAC */ 0x5DCB,0x6B57,
/* Array index: 0x1FAC */ 0x5DCF,0x6B58,
/* Array index: 0x1FAC */ 0x5DD1,0x6D4C,
/* Array index: 0x1FAC */ 0x5DD5,0x6D4B,
/* Array index: 0x1FAC */ 0x5DD8,0x6F25,
/* Array index: 0x1FAC */ 0x5DDF,0x223A,
/* Array index: 0x1FAC */ 0x5DE0,0x236A,
/* Array index: 0x1FAC */ 0x5DF0,0x425D,
/* Array index: 0x1FAC */ 0x5DF9,0x2A30,
/* Array index: 0x1FAC */ 0x5DFF,0x213D,
/* Array index: 0x1FAC */ 0x5E04,0x2159,
/* Array index: 0x1FAC */ 0x5E0A,0x236B,
/* Array index: 0x1FAC */ 0x5E0E,0x236C,
/* Array index: 0x1FAC */ 0x5E14,0x264F,
/* Array index: 0x1FAC */ 0x5E17,0x264E,
/* Array index: 0x1FAC */ 0x5E19,0x2650,
/* Array index: 0x1FAC */ 0x5E28,0x2E76,
/* Array index: 0x1FAC */ 0x5E29,0x2E75,
/* Array index: 0x1FAC */ 0x5E34,0x352A,
/* Array index: 0x1FAC */ 0x5E3E,0x3529,
/* Array index: 0x1FAC */ 0x5E41,0x3B57,
/* Array index: 0x1FAC */ 0x5E44,0x3B56,
/* Array index: 0x1FAC */ 0x5E53,0x4979,
/* Array index: 0x1FAC */ 0x5E58,0x4977,
/* Array index: 0x1FAC */ 0x5E59,0x4978,
/* Array index: 0x1FAC */ 0x5E5C,0x503A,
/* Array index: 0x1FAC */ 0x5E5D,0x5038,
/* Array index: 0x1FAC */ 0x5E60,0x5039,
/* Array index: 0x1FAC */ 0x5E75,0x223B,
/* Array index: 0x1FAC */ 0x5E80,0x215A,
/* Array index: 0x1FAC */ 0x5E82,0x215B,
/* Array index: 0x1FAC */ 0x5E84,0x223C,
/* Array index: 0x1FAC */ 0x5E9B,0x2A39,
/* Array index: 0x1FAC */ 0x5EA8,0x2E77,
/* Array index: 0x1FAC */ 0x5EAA,0x2E79,
/* Array index: 0x1FAC */ 0x5EAC,0x2E7A,
/* Array index: 0x1FAC */ 0x5EB9,0x352D,
/* Array index: 0x1FAC */ 0x5ECB,0x4266,
/* Array index: 0x1FAC */ 0x5ECC,0x4264,
/* Array index: 0x1FAC */ 0x5ECE,0x497D,
/* Array index: 0x1FAC */ 0x5EE1,0x503E,
/* Array index: 0x1FAC */ 0x5F02,0x223D,
/* Array index: 0x1FAC */ 0x5F05,0x2372,
/* Array index: 0x1FAC */ 0x5F07,0x2A3C,
/* Array index: 0x1FAC */ 0x5F1A,0x223E,
/* Array index: 0x1FAC */ 0x5F1D,0x2373,
/* Array index: 0x1FAC */ 0x5F28,0x2651,
/* Array index: 0x1FAC */ 0x5F2E,0x2A3D,
/* Array index: 0x1FAC */ 0x5F30,0x2E7C,
/* Array index: 0x1FAC */ 0x5F33,0x2E7B,
/* Array index: 0x1FAC */ 0x5F36,0x3530,
/* Array index: 0x1FAC */ 0x5F38,0x3531,
/* Array index: 0x1FAC */ 0x5F40,0x4268,
/* Array index: 0x1FAC */ 0x5F43,0x4A26,
/* Array index: 0x1FAC */ 0x5F44,0x4A25,
/* Array index: 0x1FAC */ 0x5F49,0x503F,
/* Array index: 0x1FAC */ 0x5F4B,0x567E,
/* Array index: 0x1FAC */ 0x5F4F,0x6F27,
/* Array index: 0x1FAC */ 0x5F54,0x2655,
/* Array index: 0x1FAC */ 0x5F56,0x2A3E,
/* Array index: 0x1FAC */ 0x5F58,0x3B58,
/* Array index: 0x1FAC */ 0x5F67,0x2E7D,
/* Array index: 0x1FAC */ 0x5F6F,0x4A27,
/* Array index: 0x1FAC */ 0x5F73,0x212C,
/* Array index: 0x1FAC */ 0x5F74,0x223F,
/* Array index: 0x1FAC */ 0x5F76,0x2375,
/* Array index: 0x1FAC */ 0x5F78,0x2374,
/* Array index: 0x1FAC */ 0x5F7D,0x2658,
/* Array index: 0x1FAC */ 0x5F7E,0x2657,
/* Array index: 0x1FAC */ 0x5F82,0x2656,
/* Array index: 0x1FAC */ 0x5F86,0x2A3F,
/* Array index: 0x1FAC */ 0x5F96,0x3533,
/* Array index: 0x1FAC */ 0x5F9B,0x3532,
/* Array index: 0x1FAC */ 0x5F9F,0x3534,
/* Array index: 0x1FAC */ 0x5FA5,0x3B5A,
/* Array index: 0x1FAC */ 0x5FA6,0x3B59,
/* Array index: 0x1FAC */ 0x5FAB,0x3B5B,
/* Array index: 0x1FAC */ 0x5FAD,0x426A,
/* Array index: 0x1FAC */ 0x5FAF,0x4269,
/* Array index: 0x1FAC */ 0x5FB2,0x5040,
/* Array index: 0x1FAC */ 0x5FB6,0x4A28,
/* Array index: 0x1FAC */ 0x5FC9,0x215C,
/* Array index: 0x1FAC */ 0x5FDE,0x2659,
/* Array index: 0x1FAC */ 0x5FE8,0x237A,
/* Array index: 0x1FAC */ 0x5FF3,0x237C,
/* Array index: 0x1FAC */ 0x5FF4,0x2427,
/* Array index: 0x1FAC */ 0x5FF7,0x2424,
/* Array index: 0x1FAC */ 0x5FFA,0x2422,
/* Array index: 0x1FAC */ 0x5FFB,0x2425,
/* Array index: 0x1FAC */ 0x6000,0x2426,
/* Array index: 0x1FAC */ 0x6017,0x2662,
/* Array index: 0x1FAC */ 0x6019,0x265D,
/* Array index: 0x1FAC */ 0x601A,0x2664,
/* Array index: 0x1FAC */ 0x601C,0x266F,
/* Array index: 0x1FAC */ 0x601E,0x2665,
/* Array index: 0x1FAC */ 0x6022,0x2667,
/* Array index: 0x1FAC */ 0x6024,0x2A4E,
/* Array index: 0x1FAC */ 0x6026,0x265C,
/* Array index: 0x1FAC */ 0x6037,0x2A40,
/* Array index: 0x1FAC */ 0x6039,0x2A41,
/* Array index: 0x1FAC */ 0x604C,0x2A4A,
/* Array index: 0x1FAC */ 0x6053,0x2A46,
/* Array index: 0x1FAC */ 0x6054,0x2A42,
/* Array index: 0x1FAC */ 0x6058,0x2A50,
/* Array index: 0x1FAC */ 0x6066,0x2A51,
/* Array index: 0x1FAC */ 0x6067,0x2F22,
/* Array index: 0x1FAC */ 0x606E,0x2A52,
/* Array index: 0x1FAC */ 0x6072,0x2A43,
/* Array index: 0x1FAC */ 0x6080,0x2F26,
/* Array index: 0x1FAC */ 0x6081,0x2F28,
/* Array index: 0x1FAC */ 0x6083,0x2F2A,
/* Array index: 0x1FAC */ 0x608E,0x2F30,
/* Array index: 0x1FAC */ 0x6090,0x3536,
/* Array index: 0x1FAC */ 0x6092,0x2F27,
/* Array index: 0x1FAC */ 0x6095,0x2F2B,
/* Array index: 0x1FAC */ 0x6097,0x2F2D,
/* Array index: 0x1FAC */ 0x60A2,0x2F24,
/* Array index: 0x1FAC */ 0x60B0,0x3539,
/* Array index: 0x1FAC */ 0x60B1,0x3542,
/* Array index: 0x1FAC */ 0x60B7,0x3544,
/* Array index: 0x1FAC */ 0x60B9,0x3B5D,
/* Array index: 0x1FAC */ 0x60BA,0x353A,
/* Array index: 0x1FAC */ 0x60D3,0x353B,
/* Array index: 0x1FAC */ 0x60D4,0x353C,
/* Array index: 0x1FAC */ 0x60D9,0x353F,
/* Array index: 0x1FAC */ 0x60DB,0x3543,
/* Array index: 0x1FAC */ 0x60DD,0x3540,
/* Array index: 0x1FAC */ 0x60E2,0x3B5F,
/* Array index: 0x1FAC */ 0x60E4,0x353E,
/* Array index: 0x1FAC */ 0x60F2,0x3B63,
/* Array index: 0x1FAC */ 0x60F5,0x3B67,
/* Array index: 0x1FAC */ 0x60F7,0x426B,
/* Array index: 0x1FAC */ 0x60F8,0x3B69,
/* Array index: 0x1FAC */ 0x60FC,0x3B6A,
/* Array index: 0x1FAC */ 0x60FE,0x3B6B,
/* Array index: 0x1FAC */ 0x60FF,0x3B71,
/* Array index: 0x1FAC */ 0x610A,0x3B64,
/* Array index: 0x1FAC */ 0x610B,0x3B73,
/* Array index: 0x1FAC */ 0x6110,0x3B70,
/* Array index: 0x1FAC */ 0x6113,0x3B68,
/* Array index: 0x1FAC */ 0x6114,0x3B62,
/* Array index: 0x1FAC */ 0x6116,0x3B65,
/* Array index: 0x1FAC */ 0x6118,0x3B6E,
/* Array index: 0x1FAC */ 0x611D,0x3B6F,
/* Array index: 0x1FAC */ 0x6132,0x4271,
/* Array index: 0x1FAC */ 0x6136,0x4270,
/* Array index: 0x1FAC */ 0x613B,0x4A39,
/* Array index: 0x1FAC */ 0x6140,0x4277,
/* Array index: 0x1FAC */ 0x6141,0x4A2B,
/* Array index: 0x1FAC */ 0x6145,0x426F,
/* Array index: 0x1FAC */ 0x6146,0x4273,
/* Array index: 0x1FAC */ 0x6149,0x426C,
/* Array index: 0x1FAC */ 0x614A,0x426D,
/* Array index: 0x1FAC */ 0x614F,0x4275,
/* Array index: 0x1FAC */ 0x615B,0x4A37,
/* Array index: 0x1FAC */ 0x615E,0x4A2C,
/* Array index: 0x1FAC */ 0x6161,0x4A3B,
/* Array index: 0x1FAC */ 0x6165,0x4A38,
/* Array index: 0x1FAC */ 0x6166,0x5051,
/* Array index: 0x1FAC */ 0x616A,0x4A3A,
/* Array index: 0x1FAC */ 0x616C,0x4A32,
/* Array index: 0x1FAC */ 0x6179,0x5043,
/* Array index: 0x1FAC */ 0x617A,0x4A36,
/* Array index: 0x1FAC */ 0x6180,0x4A33,
/* Array index: 0x1FAC */ 0x6183,0x5042,
/* Array index: 0x1FAC */ 0x6192,0x504D,
/* Array index: 0x1FAC */ 0x6193,0x5049,
/* Array index: 0x1FAC */ 0x6196,0x5725,
/* Array index: 0x1FAC */ 0x619B,0x5048,
/* Array index: 0x1FAC */ 0x619D,0x5723,
/* Array index: 0x1FAC */ 0x619F,0x504C,
/* Array index: 0x1FAC */ 0x61A1,0x504F,
/* Array index: 0x1FAC */ 0x61A2,0x5046,
/* Array index: 0x1FAC */ 0x61A8,0x5724,
/* Array index: 0x1FAC */ 0x61AA,0x504E,
/* Array index: 0x1FAC */ 0x61B8,0x572D,
/* Array index: 0x1FAC */ 0x61BA,0x572B,
/* Array index: 0x1FAC */ 0x61BC,0x5C6C,
/* Array index: 0x1FAC */ 0x61BF,0x572C,
/* Array index: 0x1FAC */ 0x61C1,0x5729,
/* Array index: 0x1FAC */ 0x61C3,0x5C6A,
/* Array index: 0x1FAC */ 0x61C5,0x5726,
/* Array index: 0x1FAC */ 0x61C6,0x5728,
/* Array index: 0x1FAC */ 0x61CC,0x572A,
/* Array index: 0x1FAC */ 0x61D6,0x615B,
/* Array index: 0x1FAC */ 0x61D8,0x6153,
/* Array index: 0x1FAC */ 0x61F9,0x6876,
/* Array index: 0x1FAC */ 0x61FB,0x654C,
/* Array index: 0x1FAC */ 0x61FD,0x6B5A,
/* Array index: 0x1FAC */ 0x6201,0x6F28,
/* Array index: 0x1FAC */ 0x6203,0x6F29,
/* Array index: 0x1FAC */ 0x6204,0x6F2A,
/* Array index: 0x1FAC */ 0x6207,0x722A,
/* Array index: 0x1FAC */ 0x6209,0x215D,
/* Array index: 0x1FAC */ 0x6214,0x2670,
/* Array index: 0x1FAC */ 0x6219,0x2F31,
/* Array index: 0x1FAC */ 0x6220,0x4278,
/* Array index: 0x1FAC */ 0x623A,0x2428,
/* Array index: 0x1FAC */ 0x623D,0x2671,
/* Array index: 0x1FAC */ 0x6242,0x2A53,
/* Array index: 0x1FAC */ 0x6243,0x2A54,
/* Array index: 0x1FAC */ 0x6246,0x2F32,
/* Array index: 0x1FAC */ 0x624A,0x3B74,
/* Array index: 0x1FAC */ 0x6250,0x215E,
/* Array index: 0x1FAC */ 0x6259,0x2249,
/* Array index: 0x1FAC */ 0x625A,0x224B,
/* Array index: 0x1FAC */ 0x625C,0x2243,
/* Array index: 0x1FAC */ 0x6277,0x2435,
/* Array index: 0x1FAC */ 0x627A,0x2431,
/* Array index: 0x1FAC */ 0x627B,0x2430,
/* Array index: 0x1FAC */ 0x627D,0x2436,
/* Array index: 0x1FAC */ 0x6281,0x2433,
/* Array index: 0x1FAC */ 0x6283,0x2429,
/* Array index: 0x1FAC */ 0x6287,0x242E,
/* Array index: 0x1FAC */ 0x6288,0x2434,
/* Array index: 0x1FAC */ 0x628C,0x242A,
/* Array index: 0x1FAC */ 0x628E,0x242B,
/* Array index: 0x1FAC */ 0x628F,0x242C,
/* Array index: 0x1FAC */ 0x6294,0x242D,
/* Array index: 0x1FAC */ 0x62BB,0x267C,
/* Array index: 0x1FAC */ 0x62BE,0x2675,
/* Array index: 0x1FAC */ 0x62CA,0x2678,
/* Array index: 0x1FAC */ 0x62CF,0x2A55,
/* Array index: 0x1FAC */ 0x62D1,0x2674,
/* Array index: 0x1FAC */ 0x62EB,0x2A5B,
/* Array index: 0x1FAC */ 0x62F0,0x2A67,
/* Array index: 0x1FAC */ 0x62F2,0x2F33,
/* Array index: 0x1FAC */ 0x6300,0x2A61,
/* Array index: 0x1FAC */ 0x6303,0x2A5A,
/* Array index: 0x1FAC */ 0x6329,0x2F40,
/* Array index: 0x1FAC */ 0x632C,0x2F36,
/* Array index: 0x1FAC */ 0x632D,0x2F46,
/* Array index: 0x1FAC */ 0x6351,0x2F4A,
/* Array index: 0x1FAC */ 0x6365,0x354B,
/* Array index: 0x1FAC */ 0x6375,0x355B,
/* Array index: 0x1FAC */ 0x6378,0x3563,
/* Array index: 0x1FAC */ 0x637C,0x355F,
/* Array index: 0x1FAC */ 0x637D,0x354E,
/* Array index: 0x1FAC */ 0x6381,0x3565,
/* Array index: 0x1FAC */ 0x6382,0x354D,
/* Array index: 0x1FAC */ 0x6385,0x3564,
/* Array index: 0x1FAC */ 0x6387,0x3557,
/* Array index: 0x1FAC */ 0x638A,0x354C,
/* Array index: 0x1FAC */ 0x6394,0x3B75,
/* Array index: 0x1FAC */ 0x6397,0x3553,
/* Array index: 0x1FAC */ 0x63A4,0x3560,
/* Array index: 0x1FAC */ 0x63BD,0x354F,
/* Array index: 0x1FAC */ 0x63BE,0x3C29,
/* Array index: 0x1FAC */ 0x63D3,0x3C2E,
/* Array index: 0x1FAC */ 0x63EB,0x4321,
/* Array index: 0x1FAC */ 0x6415,0x432A,
/* Array index: 0x1FAC */ 0x6418,0x432B,
/* Array index: 0x1FAC */ 0x641A,0x4338,
/* Array index: 0x1FAC */ 0x641B,0x433E,
/* Array index: 0x1FAC */ 0x642B,0x4A40,
/* Array index: 0x1FAC */ 0x6433,0x4327,
/* Array index: 0x1FAC */ 0x6435,0x4335,
/* Array index: 0x1FAC */ 0x6437,0x432D,
/* Array index: 0x1FAC */ 0x6439,0x432C,
/* Array index: 0x1FAC */ 0x644B,0x4A50,
/* Array index: 0x1FAC */ 0x644D,0x4A41,
/* Array index: 0x1FAC */ 0x644E,0x4A4C,
/* Array index: 0x1FAC */ 0x6450,0x4A53,
/* Array index: 0x1FAC */ 0x6453,0x4A51,
/* Array index: 0x1FAC */ 0x6465,0x4A59,
/* Array index: 0x1FAC */ 0x6466,0x4A4A,
/* Array index: 0x1FAC */ 0x6468,0x5061,
/* Array index: 0x1FAC */ 0x646B,0x4A57,
/* Array index: 0x1FAC */ 0x646C,0x4A56,
/* Array index: 0x1FAC */ 0x646E,0x5054,
/* Array index: 0x1FAC */ 0x647D,0x4A48,
/* Array index: 0x1FAC */ 0x647F,0x4A54,
/* Array index: 0x1FAC */ 0x6482,0x4A4D,
/* Array index: 0x1FAC */ 0x6485,0x5058,
/* Array index: 0x1FAC */ 0x648F,0x505B,
/* Array index: 0x1FAC */ 0x64A3,0x505F,
/* Array index: 0x1FAC */ 0x64A6,0x4A4B,
/* Array index: 0x1FAC */ 0x64B1,0x5062,
/* Array index: 0x1FAC */ 0x64BD,0x5734,
/* Array index: 0x1FAC */ 0x64C3,0x5736,
/* Array index: 0x1FAC */ 0x64C9,0x5733,
/* Array index: 0x1FAC */ 0x64CF,0x5732,
/* Array index: 0x1FAC */ 0x64D0,0x5731,
/* Array index: 0x1FAC */ 0x64D6,0x5730,
/* Array index: 0x1FAC */ 0x64D7,0x572F,
/* Array index: 0x1FAC */ 0x64D9,0x5739,
/* Array index: 0x1FAC */ 0x64DB,0x5737,
/* Array index: 0x1FAC */ 0x64E3,0x5C75,
/* Array index: 0x1FAC */ 0x64E4,0x5C77,
/* Array index: 0x1FAC */ 0x64E8,0x5C78,
/* Array index: 0x1FAC */ 0x64E9,0x5C74,
/* Array index: 0x1FAC */ 0x64EB,0x5C76,
/* Array index: 0x1FAC */ 0x64EF,0x5C73,
/* Array index: 0x1FAC */ 0x64F3,0x5738,
/* Array index: 0x1FAC */ 0x64F8,0x6160,
/* Array index: 0x1FAC */ 0x64FC,0x6163,
/* Array index: 0x1FAC */ 0x64FD,0x615F,
/* Array index: 0x1FAC */ 0x64FF,0x615D,
/* Array index: 0x1FAC */ 0x6501,0x6161,
/* Array index: 0x1FAC */ 0x6503,0x6162,
/* Array index: 0x1FAC */ 0x6504,0x615E,
/* Array index: 0x1FAC */ 0x6507,0x654D,
/* Array index: 0x1FAC */ 0x6509,0x6550,
/* Array index: 0x1FAC */ 0x651B,0x6B5B,
/* Array index: 0x1FAC */ 0x6529,0x6F2B,
/* Array index: 0x1FAC */ 0x652D,0x7037,
/* Array index: 0x1FAC */ 0x652E,0x707D,
/* Array index: 0x1FAC */ 0x6532,0x3C37,
/* Array index: 0x1FAC */ 0x6533,0x573A,
/* Array index: 0x1FAC */ 0x6537,0x224D,
/* Array index: 0x1FAC */ 0x653D,0x2722,
/* Array index: 0x1FAC */ 0x6541,0x2A68,
/* Array index: 0x1FAC */ 0x6543,0x2A69,
/* Array index: 0x1FAC */ 0x6546,0x2F50,
/* Array index: 0x1FAC */ 0x654A,0x2F4F,
/* Array index: 0x1FAC */ 0x6553,0x3569,
/* Array index: 0x1FAC */ 0x655C,0x3C3B,
/* Array index: 0x1FAC */ 0x656F,0x4342,
/* Array index: 0x1FAC */ 0x6573,0x4A5B,
/* Array index: 0x1FAC */ 0x6576,0x5064,
/* Array index: 0x1FAC */ 0x6584,0x6553,
/* Array index: 0x1FAC */ 0x658C,0x3C3E,
/* Array index: 0x1FAC */ 0x6592,0x4343,
/* Array index: 0x1FAC */ 0x6594,0x6164,
/* Array index: 0x1FAC */ 0x6596,0x6F2D,
/* Array index: 0x1FAC */ 0x659D,0x3C3F,
/* Array index: 0x1FAC */ 0x659E,0x3C40,
/* Array index: 0x1FAC */ 0x65A0,0x4A5C,
/* Array index: 0x1FAC */ 0x65A2,0x573D,
/* Array index: 0x1FAC */ 0x65A8,0x2723,
/* Array index: 0x1FAC */ 0x65AA,0x2A6A,
/* Array index: 0x1FAC */ 0x65AE,0x3C41,
/* Array index: 0x1FAC */ 0x65B2,0x5068,
/* Array index: 0x1FAC */ 0x65B3,0x5069,
/* Array index: 0x1FAC */ 0x65B6,0x5C7B,
/* Array index: 0x1FAC */ 0x65B8,0x707E,
/* Array index: 0x1FAC */ 0x65BB,0x2724,
/* Array index: 0x1FAC */ 0x65BF,0x2A6B,
/* Array index: 0x1FAC */ 0x65CD,0x356A,
/* Array index: 0x1FAC */ 0x65D0,0x3C42,
/* Array index: 0x1FAC */ 0x65D2,0x3C43,
/* Array index: 0x1FAC */ 0x65D3,0x4344,
/* Array index: 0x1FAC */ 0x661C,0x2A70,
/* Array index: 0x1FAC */ 0x661D,0x2A76,
/* Array index: 0x1FAC */ 0x6621,0x2A6D,
/* Array index: 0x1FAC */ 0x6622,0x2A72,
/* Array index: 0x1FAC */ 0x6626,0x2A71,
/* Array index: 0x1FAC */ 0x662B,0x2A74,
/* Array index: 0x1FAC */ 0x662E,0x2A79,
/* Array index: 0x1FAC */ 0x6647,0x2F57,
/* Array index: 0x1FAC */ 0x664A,0x2F55,
/* Array index: 0x1FAC */ 0x6651,0x2F58,
/* Array index: 0x1FAC */ 0x6659,0x356E,
/* Array index: 0x1FAC */ 0x665B,0x356D,
/* Array index: 0x1FAC */ 0x665C,0x356F,
/* Array index: 0x1FAC */ 0x665F,0x2F56,
/* Array index: 0x1FAC */ 0x6661,0x356C,
/* Array index: 0x1FAC */ 0x6662,0x3570,
/* Array index: 0x1FAC */ 0x6665,0x356B,
/* Array index: 0x1FAC */ 0x666A,0x3C4A,
/* Array index: 0x1FAC */ 0x666C,0x3C45,
/* Array index: 0x1FAC */ 0x6671,0x3C48,
/* Array index: 0x1FAC */ 0x6672,0x3C4B,
/* Array index: 0x1FAC */ 0x6680,0x3C47,
/* Array index: 0x1FAC */ 0x6686,0x4345,
/* Array index: 0x1FAC */ 0x6690,0x4348,
/* Array index: 0x1FAC */ 0x6694,0x434C,
/* Array index: 0x1FAC */ 0x6695,0x4347,
/* Array index: 0x1FAC */ 0x6699,0x434B,
/* Array index: 0x1FAC */ 0x66A9,0x506C,
/* Array index: 0x1FAC */ 0x66AA,0x506F,
/* Array index: 0x1FAC */ 0x66AF,0x5070,
/* Array index: 0x1FAC */ 0x66B0,0x506B,
/* Array index: 0x1FAC */ 0x66B2,0x506D,
/* Array index: 0x1FAC */ 0x66B5,0x506A,
/* Array index: 0x1FAC */ 0x66B7,0x506E,
/* Array index: 0x1FAC */ 0x66CF,0x5743,
/* Array index: 0x1FAC */ 0x66D2,0x5C7D,
/* Array index: 0x1FAC */ 0x66D8,0x6168,
/* Array index: 0x1FAC */ 0x66DA,0x6166,
/* Array index: 0x1FAC */ 0x66DB,0x6167,
/* Array index: 0x1FAC */ 0x66DE,0x6556,
/* Array index: 0x1FAC */ 0x66E3,0x687D,
/* Array index: 0x1FAC */ 0x66E4,0x687E,
/* Array index: 0x1FAC */ 0x66E8,0x687C,
/* Array index: 0x1FAC */ 0x66EB,0x6F2E,
/* Array index: 0x1FAC */ 0x66ED,0x7038,
/* Array index: 0x1FAC */ 0x66EE,0x7039,
/* Array index: 0x1FAC */ 0x66F6,0x2732,
/* Array index: 0x1FAC */ 0x6701,0x3C4C,
/* Array index: 0x1FAC */ 0x6704,0x4A61,
/* Array index: 0x1FAC */ 0x6705,0x4A60,
/* Array index: 0x1FAC */ 0x670A,0x2733,
/* Array index: 0x1FAC */ 0x6718,0x3571,
/* Array index: 0x1FAC */ 0x6733,0x2257,
/* Array index: 0x1FAC */ 0x6745,0x243E,
/* Array index: 0x1FAC */ 0x6755,0x2441,
/* Array index: 0x1FAC */ 0x6759,0x2440,
/* Array index: 0x1FAC */ 0x675A,0x2446,
/* Array index: 0x1FAC */ 0x675D,0x2444,
/* Array index: 0x1FAC */ 0x676C,0x2735,
/* Array index: 0x1FAC */ 0x6774,0x273D,
/* Array index: 0x1FAC */ 0x6798,0x273A,
/* Array index: 0x1FAC */ 0x6799,0x2743,
/* Array index: 0x1FAC */ 0x679F,0x2741,
/* Array index: 0x1FAC */ 0x67AE,0x2B3D,
/* Array index: 0x1FAC */ 0x67B2,0x2B38,
/* Array index: 0x1FAC */ 0x67B3,0x2B2E,
/* Array index: 0x1FAC */ 0x67B5,0x2B2C,
/* Array index: 0x1FAC */ 0x67D8,0x2B25,
/* Array index: 0x1FAC */ 0x67DB,0x2B3F,
/* Array index: 0x1FAC */ 0x67DC,0x2B22,
/* Array index: 0x1FAC */ 0x67DF,0x2B2B,
/* Array index: 0x1FAC */ 0x6812,0x2F6E,
/* Array index: 0x1FAC */ 0x6814,0x2F6F,
/* Array index: 0x1FAC */ 0x6816,0x2F63,
/* Array index: 0x1FAC */ 0x681A,0x2F5C,
/* Array index: 0x1FAC */ 0x6825,0x2F75,
/* Array index: 0x1FAC */ 0x6826,0x2F70,
/* Array index: 0x1FAC */ 0x6828,0x2F71,
/* Array index: 0x1FAC */ 0x683A,0x2F74,
/* Array index: 0x1FAC */ 0x683B,0x2F60,
/* Array index: 0x1FAC */ 0x6844,0x2F6B,
/* Array index: 0x1FAC */ 0x6849,0x2F5D,
/* Array index: 0x1FAC */ 0x6896,0x362F,
/* Array index: 0x1FAC */ 0x689B,0x362E,
/* Array index: 0x1FAC */ 0x689C,0x3575,
/* Array index: 0x1FAC */ 0x68A0,0x3631,
/* Array index: 0x1FAC */ 0x68A3,0x357C,
/* Array index: 0x1FAC */ 0x68A4,0x3633,
/* Array index: 0x1FAC */ 0x68B2,0x3623,
/* Array index: 0x1FAC */ 0x68B4,0x3C63,
/* Array index: 0x1FAC */ 0x68CC,0x3C60,
/* Array index: 0x1FAC */ 0x68CE,0x3C70,
/* Array index: 0x1FAC */ 0x68E1,0x3C5E,
/* Array index: 0x1FAC */ 0x68E4,0x3C59,
/* Array index: 0x1FAC */ 0x68FC,0x3C6B,
/* Array index: 0x1FAC */ 0x68FD,0x3C6A,
/* Array index: 0x1FAC */ 0x6925,0x3C7B,
/* Array index: 0x1FAC */ 0x692A,0x3C51,
/* Array index: 0x1FAC */ 0x692F,0x4378,
/* Array index: 0x1FAC */ 0x695C,0x4373,
/* Array index: 0x1FAC */ 0x695F,0x4350,
/* Array index: 0x1FAC */ 0x6962,0x4353,
/* Array index: 0x1FAC */ 0x6965,0x4363,
/* Array index: 0x1FAC */ 0x6966,0x434F,
/* Array index: 0x1FAC */ 0x6969,0x4367,
/* Array index: 0x1FAC */ 0x696A,0x4357,
/* Array index: 0x1FAC */ 0x696C,0x4360,
/* Array index: 0x1FAC */ 0x6974,0x436E,
/* Array index: 0x1FAC */ 0x6976,0x436B,
/* Array index: 0x1FAC */ 0x6978,0x4365,
/* Array index: 0x1FAC */ 0x697A,0x435C,
/* Array index: 0x1FAC */ 0x697B,0x4379,
/* Array index: 0x1FAC */ 0x6983,0x452C,
/* Array index: 0x1FAC */ 0x699E,0x4B23,
/* Array index: 0x1FAC */ 0x69A0,0x4A66,
/* Array index: 0x1FAC */ 0x69A1,0x4B22,
/* Array index: 0x1FAC */ 0x69A4,0x4A77,
/* Array index: 0x1FAC */ 0x69A5,0x4B29,
/* Array index: 0x1FAC */ 0x69A7,0x4A6F,
/* Array index: 0x1FAC */ 0x69A9,0x4A71,
/* Array index: 0x1FAC */ 0x69AA,0x4B21,
/* Array index: 0x1FAC */ 0x69AC,0x4A6A,
/* Array index: 0x1FAC */ 0x69B9,0x4A79,
/* Array index: 0x1FAC */ 0x69C2,0x4B27,
/* Array index: 0x1FAC */ 0x69C4,0x4A75,
/* Array index: 0x1FAC */ 0x69C6,0x4B2A,
/* Array index: 0x1FAC */ 0x69C9,0x4A65,
/* Array index: 0x1FAC */ 0x69CA,0x4A7A,
/* Array index: 0x1FAC */ 0x69CE,0x4A67,
/* Array index: 0x1FAC */ 0x69CF,0x4A7C,
/* Array index: 0x1FAC */ 0x69D4,0x4A78,
/* Array index: 0x1FAC */ 0x69D9,0x4B24,
/* Array index: 0x1FAC */ 0x69EB,0x512E,
/* Array index: 0x1FAC */ 0x69EC,0x507B,
/* Array index: 0x1FAC */ 0x69EE,0x5124,
/* Array index: 0x1FAC */ 0x69F1,0x5077,
/* Array index: 0x1FAC */ 0x69F2,0x5123,
/* Array index: 0x1FAC */ 0x6A0D,0x512C,
/* Array index: 0x1FAC */ 0x6A0F,0x5133,
/* Array index: 0x1FAC */ 0x6A1B,0x507D,
/* Array index: 0x1FAC */ 0x6A1D,0x507E,
/* Array index: 0x1FAC */ 0x6A20,0x5079,
/* Array index: 0x1FAC */ 0x6A32,0x574D,
/* Array index: 0x1FAC */ 0x6A34,0x5749,
/* Array index: 0x1FAC */ 0x6A46,0x5768,
/* Array index: 0x1FAC */ 0x6A49,0x574B,
/* Array index: 0x1FAC */ 0x6A6D,0x5751,
/* Array index: 0x1FAC */ 0x6A6F,0x575F,
/* Array index: 0x1FAC */ 0x6A76,0x5752,
/* Array index: 0x1FAC */ 0x6A7F,0x5D31,
/* Array index: 0x1FAC */ 0x6A81,0x5D22,
/* Array index: 0x1FAC */ 0x6A83,0x5D2D,
/* Array index: 0x1FAC */ 0x6A85,0x5D34,
/* Array index: 0x1FAC */ 0x6A87,0x5D29,
/* Array index: 0x1FAC */ 0x6A89,0x5D24,
/* Array index: 0x1FAC */ 0x6A9A,0x5D33,
/* Array index: 0x1FAC */ 0x6A9B,0x5D26,
/* Array index: 0x1FAC */ 0x6A9E,0x5D28,
/* Array index: 0x1FAC */ 0x6A9F,0x5D25,
/* Array index: 0x1FAC */ 0x6AA1,0x5D27,
/* Array index: 0x1FAC */ 0x6AAD,0x6173,
/* Array index: 0x1FAC */ 0x6AB4,0x6172,
/* Array index: 0x1FAC */ 0x6ABD,0x616B,
/* Array index: 0x1FAC */ 0x6AD9,0x655B,
/* Array index: 0x1FAC */ 0x6AF8,0x6B5F,
/* Array index: 0x1FAC */ 0x6AF9,0x6925,
/* Array index: 0x1FAC */ 0x6AFC,0x6B5D,
/* Array index: 0x1FAC */ 0x6B00,0x6B60,
/* Array index: 0x1FAC */ 0x6B02,0x6B5C,
/* Array index: 0x1FAC */ 0x6B03,0x6B5E,
/* Array index: 0x1FAC */ 0x6B08,0x6D53,
/* Array index: 0x1FAC */ 0x6B09,0x6D54,
/* Array index: 0x1FAC */ 0x6B0B,0x6D52,
/* Array index: 0x1FAC */ 0x6B1E,0x722B,
/* Array index: 0x1FAC */ 0x6B25,0x274A,
/* Array index: 0x1FAC */ 0x6B28,0x2B46,
/* Array index: 0x1FAC */ 0x6B2C,0x2F77,
/* Array index: 0x1FAC */ 0x6B2D,0x2F79,
/* Array index: 0x1FAC */ 0x6B2F,0x2F78,
/* Array index: 0x1FAC */ 0x6B31,0x2F7A,
/* Array index: 0x1FAC */ 0x6B51,0x5139,
/* Array index: 0x1FAC */ 0x6B5B,0x5D37,
/* Array index: 0x1FAC */ 0x6B5E,0x6174,
/* Array index: 0x1FAC */ 0x6B60,0x6564,
/* Array index: 0x1FAC */ 0x6B6D,0x2F7C,
/* Array index: 0x1FAC */ 0x6B76,0x5259,
/* Array index: 0x1FAC */ 0x6B7E,0x274C,
/* Array index: 0x1FAC */ 0x6B80,0x274B,
/* Array index: 0x1FAC */ 0x6B82,0x2B47,
/* Array index: 0x1FAC */ 0x6B84,0x2B48,
/* Array index: 0x1FAC */ 0x6B88,0x2F7E,
/* Array index: 0x1FAC */ 0x6BB0,0x6565,
/* Array index: 0x1FAC */ 0x6BB3,0x213F,
/* Array index: 0x1FAC */ 0x6BB6,0x2B49,
/* Array index: 0x1FAC */ 0x6BBD,0x3D27,
/* Array index: 0x1FAC */ 0x6BD0,0x2448,
/* Array index: 0x1FAC */ 0x6BD6,0x2B4A,
/* Array index: 0x1FAC */ 0x6BD8,0x2B4B,
/* Array index: 0x1FAC */ 0x6BDE,0x274D,
/* Array index: 0x1FAC */ 0x6BF0,0x3D28,
/* Array index: 0x1FAC */ 0x6BF2,0x3D29,
/* Array index: 0x1FAC */ 0x6BF3,0x3D2A,
/* Array index: 0x1FAC */ 0x6C1D,0x274E,
/* Array index: 0x1FAC */ 0x6C20,0x2B4D,
/* Array index: 0x1FAC */ 0x6C21,0x2B4E,
/* Array index: 0x1FAC */ 0x6C25,0x3027,
/* Array index: 0x1FAC */ 0x6C2A,0x3643,
/* Array index: 0x1FAC */ 0x6C30,0x3D2B,
/* Array index: 0x1FAC */ 0x6C36,0x2160,
/* Array index: 0x1FAC */ 0x6C3B,0x2163,
/* Array index: 0x1FAC */ 0x6C3F,0x2162,
/* Array index: 0x1FAC */ 0x6C43,0x2161,
/* Array index: 0x1FAC */ 0x6C46,0x2259,
/* Array index: 0x1FAC */ 0x6C4F,0x225C,
/* Array index: 0x1FAC */ 0x6C52,0x225A,
/* Array index: 0x1FAC */ 0x6C54,0x225E,
/* Array index: 0x1FAC */ 0x6C5C,0x225B,
/* Array index: 0x1FAC */ 0x6C78,0x244B,
/* Array index: 0x1FAC */ 0x6C7B,0x245C,
/* Array index: 0x1FAC */ 0x6C80,0x2765,
/* Array index: 0x1FAC */ 0x6C84,0x244E,
/* Array index: 0x1FAC */ 0x6C87,0x2456,
/* Array index: 0x1FAC */ 0x6C8A,0x2763,
/* Array index: 0x1FAC */ 0x6C8B,0x244F,
/* Array index: 0x1FAC */ 0x6C8E,0x245D,
/* Array index: 0x1FAC */ 0x6C8F,0x2450,
/* Array index: 0x1FAC */ 0x6C93,0x274F,
/* Array index: 0x1FAC */ 0x6C95,0x2457,
/* Array index: 0x1FAC */ 0x6C9A,0x2454,
/* Array index: 0x1FAC */ 0x6C9C,0x2458,
/* Array index: 0x1FAC */ 0x6C9D,0x2764,
/* Array index: 0x1FAC */ 0x6CAD,0x2756,
/* Array index: 0x1FAC */ 0x6CB0,0x276B,
/* Array index: 0x1FAC */ 0x6CB4,0x2762,
/* Array index: 0x1FAC */ 0x6CB6,0x2754,
/* Array index: 0x1FAC */ 0x6CB7,0x2758,
/* Array index: 0x1FAC */ 0x6CBA,0x275B,
/* Array index: 0x1FAC */ 0x6CC0,0x2767,
/* Array index: 0x1FAC */ 0x6CC2,0x275A,
/* Array index: 0x1FAC */ 0x6CC3,0x275C,
/* Array index: 0x1FAC */ 0x6CC6,0x275D,
/* Array index: 0x1FAC */ 0x6CC7,0x276A,
/* Array index: 0x1FAC */ 0x6CD9,0x2753,
/* Array index: 0x1FAC */ 0x6CDA,0x2B57,
/* Array index: 0x1FAC */ 0x6CDD,0x2761,
/* Array index: 0x1FAC */ 0x6CDE,0x2766,
/* Array index: 0x1FAC */ 0x6CE7,0x2757,
/* Array index: 0x1FAC */ 0x6CF2,0x275F,
/* Array index: 0x1FAC */ 0x6CF9,0x276C,
/* Array index: 0x1FAC */ 0x6D1D,0x2B5F,
/* Array index: 0x1FAC */ 0x6D1F,0x2B52,
/* Array index: 0x1FAC */ 0x6D20,0x2B68,
/* Array index: 0x1FAC */ 0x6D22,0x2B6B,
/* Array index: 0x1FAC */ 0x6D28,0x2B4F,
/* Array index: 0x1FAC */ 0x6D37,0x2B63,
/* Array index: 0x1FAC */ 0x6D3A,0x2B5B,
/* Array index: 0x1FAC */ 0x6D3C,0x2B53,
/* Array index: 0x1FAC */ 0x6D3F,0x2B54,
/* Array index: 0x1FAC */ 0x6D40,0x2B66,
/* Array index: 0x1FAC */ 0x6D42,0x2B60,
/* Array index: 0x1FAC */ 0x6D58,0x302F,
/* Array index: 0x1FAC */ 0x6D6D,0x3031,
/* Array index: 0x1FAC */ 0x6D6F,0x3032,
/* Array index: 0x1FAC */ 0x6D70,0x303C,
/* Array index: 0x1FAC */ 0x6D75,0x304B,
/* Array index: 0x1FAC */ 0x6D76,0x302B,
/* Array index: 0x1FAC */ 0x6D8B,0x3043,
/* Array index: 0x1FAC */ 0x6D8D,0x3034,
/* Array index: 0x1FAC */ 0x6D97,0x303B,
/* Array index: 0x1FAC */ 0x6D98,0x3040,
/* Array index: 0x1FAC */ 0x6DAB,0x3645,
/* Array index: 0x1FAC */ 0x6DAC,0x3649,
/* Array index: 0x1FAC */ 0x6DB3,0x3647,
/* Array index: 0x1FAC */ 0x6DB4,0x3646,
/* Array index: 0x1FAC */ 0x6DB7,0x364C,
/* Array index: 0x1FAC */ 0x6DCD,0x3668,
/* Array index: 0x1FAC */ 0x6DE9,0x364A,
/* Array index: 0x1FAC */ 0x6DED,0x365C,
/* Array index: 0x1FAC */ 0x6DEF,0x3035,
/* Array index: 0x1FAC */ 0x6DF0,0x365D,
/* Array index: 0x1FAC */ 0x6DF2,0x3664,
/* Array index: 0x1FAC */ 0x6DF4,0x3659,
/* Array index: 0x1FAC */ 0x6DF6,0x364D,
/* Array index: 0x1FAC */ 0x6DFC,0x3D2C,
/* Array index: 0x1FAC */ 0x6DFD,0x3666,
/* Array index: 0x1FAC */ 0x6E00,0x364F,
/* Array index: 0x1FAC */ 0x6E03,0x3D41,
/* Array index: 0x1FAC */ 0x6E1C,0x3D3B,
/* Array index: 0x1FAC */ 0x6E1F,0x3D2F,
/* Array index: 0x1FAC */ 0x6E22,0x3D4D,
/* Array index: 0x1FAC */ 0x6E27,0x3D51,
/* Array index: 0x1FAC */ 0x6E28,0x3D48,
/* Array index: 0x1FAC */ 0x6E2B,0x3D36,
/* Array index: 0x1FAC */ 0x6E2E,0x3D42,
/* Array index: 0x1FAC */ 0x6E30,0x3D4E,
/* Array index: 0x1FAC */ 0x6E31,0x3D47,
/* Array index: 0x1FAC */ 0x6E33,0x3D3C,
/* Array index: 0x1FAC */ 0x6E35,0x3D59,
/* Array index: 0x1FAC */ 0x6E36,0x3D5A,
/* Array index: 0x1FAC */ 0x6E6B,0x3D4B,
/* Array index: 0x1FAC */ 0x6E71,0x3D4A,
/* Array index: 0x1FAC */ 0x6E88,0x3D31,
/* Array index: 0x1FAC */ 0x6E97,0x444E,
/* Array index: 0x1FAC */ 0x6E99,0x4444,
/* Array index: 0x1FAC */ 0x6E9B,0x4429,
/* Array index: 0x1FAC */ 0x6EB7,0x443A,
/* Array index: 0x1FAC */ 0x6EB9,0x4433,
/* Array index: 0x1FAC */ 0x6ED6,0x442A,
/* Array index: 0x1FAC */ 0x6ED8,0x4443,
/* Array index: 0x1FAC */ 0x6EDC,0x4442,
/* Array index: 0x1FAC */ 0x6EEB,0x4B50,
/* Array index: 0x1FAC */ 0x6EED,0x4B45,
/* Array index: 0x1FAC */ 0x6EEE,0x4B4A,
/* Array index: 0x1FAC */ 0x6EF1,0x4B36,
/* Array index: 0x1FAC */ 0x6F00,0x515B,
/* Array index: 0x1FAC */ 0x6F03,0x4B37,
/* Array index: 0x1FAC */ 0x6F12,0x4B44,
/* Array index: 0x1FAC */ 0x6F2D,0x4B4B,
/* Array index: 0x1FAC */ 0x6F2E,0x4B3C,
/* Array index: 0x1FAC */ 0x6F30,0x4B4D,
/* Array index: 0x1FAC */ 0x6F40,0x4B4C,
/* Array index: 0x1FAC */ 0x6F41,0x5142,
/* Array index: 0x1FAC */ 0x6F43,0x4B53,
/* Array index: 0x1FAC */ 0x6F5A,0x514E,
/* Array index: 0x1FAC */ 0x6F72,0x5154,
/* Array index: 0x1FAC */ 0x6F73,0x4B48,
/* Array index: 0x1FAC */ 0x6F76,0x5150,
/* Array index: 0x1FAC */ 0x6F77,0x5167,
/* Array index: 0x1FAC */ 0x6F82,0x5152,
/* Array index: 0x1FAC */ 0x6F85,0x514D,
/* Array index: 0x1FAC */ 0x6F87,0x5145,
/* Array index: 0x1FAC */ 0x6F9E,0x577E,
/* Array index: 0x1FAC */ 0x6FA2,0x582C,
/* Array index: 0x1FAC */ 0x6FA3,0x5776,
/* Array index: 0x1FAC */ 0x6FA5,0x5824,
/* Array index: 0x1FAC */ 0x6FB8,0x582B,
/* Array index: 0x1FAC */ 0x6FBA,0x5826,
/* Array index: 0x1FAC */ 0x6FBC,0x5778,
/* Array index: 0x1FAC */ 0x6FBD,0x577D,
/* Array index: 0x1FAC */ 0x6FBF,0x582A,
/* Array index: 0x1FAC */ 0x6FD4,0x5D3D,
/* Array index: 0x1FAC */ 0x6FED,0x5D40,
/* Array index: 0x1FAC */ 0x6FF2,0x5D44,
/* Array index: 0x1FAC */ 0x6FF4,0x5D3C,
/* Array index: 0x1FAC */ 0x6FF7,0x6225,
/* Array index: 0x1FAC */ 0x7014,0x617C,
/* Array index: 0x1FAC */ 0x7016,0x656A,
/* Array index: 0x1FAC */ 0x7017,0x6570,
/* Array index: 0x1FAC */ 0x7019,0x6567,
/* Array index: 0x1FAC */ 0x701C,0x6572,
/* Array index: 0x1FAC */ 0x702F,0x692B,
/* Array index: 0x1FAC */ 0x7052,0x6D59,
/* Array index: 0x1FAC */ 0x7071,0x2261,
/* Array index: 0x1FAC */ 0x7074,0x245E,
/* Array index: 0x1FAC */ 0x707A,0x245F,
/* Array index: 0x1FAC */ 0x7091,0x2776,
/* Array index: 0x1FAC */ 0x7093,0x2773,
/* Array index: 0x1FAC */ 0x7094,0x2770,
/* Array index: 0x1FAC */ 0x7096,0x2777,
/* Array index: 0x1FAC */ 0x7098,0x2771,
/* Array index: 0x1FAC */ 0x709A,0x2779,
/* Array index: 0x1FAC */ 0x709F,0x2B6F,
/* Array index: 0x1FAC */ 0x70A1,0x2B73,
/* Array index: 0x1FAC */ 0x70A9,0x2B76,
/* Array index: 0x1FAC */ 0x70B0,0x2B72,
/* Array index: 0x1FAC */ 0x70B1,0x2B71,
/* Array index: 0x1FAC */ 0x70B4,0x2B74,
/* Array index: 0x1FAC */ 0x70B5,0x2B75,
/* Array index: 0x1FAC */ 0x70B7,0x2B6E,
/* Array index: 0x1FAC */ 0x70BE,0x2B70,
/* Array index: 0x1FAC */ 0x70CB,0x3051,
/* Array index: 0x1FAC */ 0x70D7,0x3054,
/* Array index: 0x1FAC */ 0x70F0,0x3671,
/* Array index: 0x1FAC */ 0x7113,0x3678,
/* Array index: 0x1FAC */ 0x7117,0x366E,
/* Array index: 0x1FAC */ 0x711B,0x3D69,
/* Array index: 0x1FAC */ 0x7128,0x3D67,
/* Array index: 0x1FAC */ 0x713A,0x3D68,
/* Array index: 0x1FAC */ 0x7147,0x4451,
/* Array index: 0x1FAC */ 0x714B,0x4460,
/* Array index: 0x1FAC */ 0x714D,0x4466,
/* Array index: 0x1FAC */ 0x7158,0x445E,
/* Array index: 0x1FAC */ 0x715A,0x4467,
/* Array index: 0x1FAC */ 0x716A,0x445B,
/* Array index: 0x1FAC */ 0x7170,0x4461,
/* Array index: 0x1FAC */ 0x7172,0x4459,
/* Array index: 0x1FAC */ 0x7178,0x445A,
/* Array index: 0x1FAC */ 0x717B,0x4B67,
/* Array index: 0x1FAC */ 0x718F,0x4B66,
/* Array index: 0x1FAC */ 0x7190,0x4B61,
/* Array index: 0x1FAC */ 0x7197,0x4B6A,
/* Array index: 0x1FAC */ 0x71B8,0x5836,
/* Array index: 0x1FAC */ 0x71CF,0x583E,
/* Array index: 0x1FAC */ 0x71D4,0x583B,
/* Array index: 0x1FAC */ 0x71D6,0x5837,
/* Array index: 0x1FAC */ 0x71D8,0x5840,
/* Array index: 0x1FAC */ 0x71DA,0x5843,
/* Array index: 0x1FAC */ 0x71DB,0x5844,
/* Array index: 0x1FAC */ 0x71E1,0x5D48,
/* Array index: 0x1FAC */ 0x71E2,0x5D4E,
/* Array index: 0x1FAC */ 0x71E4,0x5D4C,
/* Array index: 0x1FAC */ 0x71E8,0x5D4A,
/* Array index: 0x1FAC */ 0x71F9,0x6229,
/* Array index: 0x1FAC */ 0x71FD,0x622B,
/* Array index: 0x1FAC */ 0x720A,0x6574,
/* Array index: 0x1FAC */ 0x720C,0x6573,
/* Array index: 0x1FAC */ 0x7213,0x6939,
/* Array index: 0x1FAC */ 0x7214,0x693A,
/* Array index: 0x1FAC */ 0x723F,0x2142,
/* Array index: 0x1FAC */ 0x7241,0x2B77,
/* Array index: 0x1FAC */ 0x7242,0x3060,
/* Array index: 0x1FAC */ 0x7244,0x4B6B,
/* Array index: 0x1FAC */ 0x724F,0x4468,
/* Array index: 0x1FAC */ 0x7253,0x4B6C,
/* Array index: 0x1FAC */ 0x725A,0x3D6B,
/* Array index: 0x1FAC */ 0x725E,0x2262,
/* Array index: 0x1FAC */ 0x7263,0x2460,
/* Array index: 0x1FAC */ 0x726A,0x277B,
/* Array index: 0x1FAC */ 0x726C,0x2B7A,
/* Array index: 0x1FAC */ 0x726E,0x2B7D,
/* Array index: 0x1FAC */ 0x7270,0x2B7B,
/* Array index: 0x1FAC */ 0x7273,0x2B7C,
/* Array index: 0x1FAC */ 0x72AE,0x2164,
/* Array index: 0x1FAC */ 0x72B0,0x2165,
/* Array index: 0x1FAC */ 0x72B4,0x2263,
/* Array index: 0x1FAC */ 0x72B5,0x2264,
/* Array index: 0x1FAC */ 0x72BA,0x2466,
/* Array index: 0x1FAC */ 0x72BD,0x2462,
/* Array index: 0x1FAC */ 0x72BF,0x2461,
/* Array index: 0x1FAC */ 0x72C1,0x2465,
/* Array index: 0x1FAC */ 0x72C3,0x2463,
/* Array index: 0x1FAC */ 0x72D1,0x2827,
/* Array index: 0x1FAC */ 0x72D2,0x2823,
/* Array index: 0x1FAC */ 0x72D4,0x2824,
/* Array index: 0x1FAC */ 0x72D6,0x277C,
/* Array index: 0x1FAC */ 0x72D8,0x277E,
/* Array index: 0x1FAC */ 0x72DA,0x2825,
/* Array index: 0x1FAC */ 0x72DC,0x2822,
/* Array index: 0x1FAC */ 0x72DF,0x2C24,
/* Array index: 0x1FAC */ 0x72E3,0x2C27,
/* Array index: 0x1FAC */ 0x72E4,0x2C21,
/* Array index: 0x1FAC */ 0x72E6,0x2C26,
/* Array index: 0x1FAC */ 0x72E8,0x2C22,
/* Array index: 0x1FAC */ 0x72EA,0x2C25,
/* Array index: 0x1FAC */ 0x72EB,0x2C23,
/* Array index: 0x1FAC */ 0x72F3,0x3069,
/* Array index: 0x1FAC */ 0x72F4,0x3066,
/* Array index: 0x1FAC */ 0x72F6,0x3068,
/* Array index: 0x1FAC */ 0x730F,0x372D,
/* Array index: 0x1FAC */ 0x7311,0x3728,
/* Array index: 0x1FAC */ 0x7312,0x3D71,
/* Array index: 0x1FAC */ 0x7317,0x3726,
/* Array index: 0x1FAC */ 0x7318,0x3729,
/* Array index: 0x1FAC */ 0x731D,0x3725,
/* Array index: 0x1FAC */ 0x731E,0x372E,
/* Array index: 0x1FAC */ 0x7322,0x3D74,
/* Array index: 0x1FAC */ 0x7323,0x3D7B,
/* Array index: 0x1FAC */ 0x7326,0x3D7A,
/* Array index: 0x1FAC */ 0x7327,0x3D77,
/* Array index: 0x1FAC */ 0x732D,0x3D79,
/* Array index: 0x1FAC */ 0x7340,0x4472,
/* Array index: 0x1FAC */ 0x7342,0x446F,
/* Array index: 0x1FAC */ 0x7343,0x4B70,
/* Array index: 0x1FAC */ 0x7351,0x4B72,
/* Array index: 0x1FAC */ 0x7352,0x517E,
/* Array index: 0x1FAC */ 0x7373,0x5D4F,
/* Array index: 0x1FAC */ 0x7376,0x622C,
/* Array index: 0x1FAC */ 0x7388,0x372F,
/* Array index: 0x1FAC */ 0x738A,0x2166,
/* Array index: 0x1FAC */ 0x738E,0x2265,
/* Array index: 0x1FAC */ 0x739D,0x282F,
/* Array index: 0x1FAC */ 0x73AC,0x282E,
/* Array index: 0x1FAC */ 0x73AD,0x282A,
/* Array index: 0x1FAC */ 0x73BC,0x3070,
/* Array index: 0x1FAC */ 0x73BE,0x2C34,
/* Array index: 0x1FAC */ 0x73BF,0x2C32,
/* Array index: 0x1FAC */ 0x73E3,0x3072,
/* Array index: 0x1FAC */ 0x7404,0x3733,
/* Array index: 0x1FAC */ 0x7407,0x3736,
/* Array index: 0x1FAC */ 0x7408,0x373E,
/* Array index: 0x1FAC */ 0x740B,0x373C,
/* Array index: 0x1FAC */ 0x740C,0x373B,
/* Array index: 0x1FAC */ 0x7416,0x3E24,
/* Array index: 0x1FAC */ 0x741A,0x3E25,
/* Array index: 0x1FAC */ 0x741D,0x3E2B,
/* Array index: 0x1FAC */ 0x7440,0x447B,
/* Array index: 0x1FAC */ 0x7442,0x4521,
/* Array index: 0x1FAC */ 0x7444,0x4475,
/* Array index: 0x1FAC */ 0x7446,0x4522,
/* Array index: 0x1FAC */ 0x7457,0x447A,
/* Array index: 0x1FAC */ 0x7462,0x4B74,
/* Array index: 0x1FAC */ 0x7467,0x4B79,
/* Array index: 0x1FAC */ 0x746E,0x4B7A,
/* Array index: 0x1FAC */ 0x7479,0x5233,
/* Array index: 0x1FAC */ 0x747C,0x5232,
/* Array index: 0x1FAC */ 0x747D,0x522F,
/* Array index: 0x1FAC */ 0x747F,0x584E,
/* Array index: 0x1FAC */ 0x7481,0x522E,
/* Array index: 0x1FAC */ 0x7490,0x5D55,
/* Array index: 0x1FAC */ 0x7492,0x5852,
/* Array index: 0x1FAC */ 0x7494,0x5851,
/* Array index: 0x1FAC */ 0x7495,0x5853,
/* Array index: 0x1FAC */ 0x7497,0x5D52,
/* Array index: 0x1FAC */ 0x749A,0x584F,
/* Array index: 0x1FAC */ 0x74A0,0x5850,
/* Array index: 0x1FAC */ 0x74A1,0x5854,
/* Array index: 0x1FAC */ 0x74A5,0x5D59,
/* Array index: 0x1FAC */ 0x74AA,0x5D56,
/* Array index: 0x1FAC */ 0x74AB,0x5D54,
/* Array index: 0x1FAC */ 0x74AD,0x5D57,
/* Array index: 0x1FAC */ 0x74AF,0x5D5A,
/* Array index: 0x1FAC */ 0x74CB,0x657D,
/* Array index: 0x1FAC */ 0x74E5,0x7041,
/* Array index: 0x1FAC */ 0x74E8,0x2831,
/* Array index: 0x1FAC */ 0x74EC,0x2C39,
/* Array index: 0x1FAC */ 0x74EE,0x2C3A,
/* Array index: 0x1FAC */ 0x74F4,0x3121,
/* Array index: 0x1FAC */ 0x74F5,0x3122,
/* Array index: 0x1FAC */ 0x7507,0x5235,
/* Array index: 0x1FAC */ 0x7508,0x5234,
/* Array index: 0x1FAC */ 0x750B,0x5855,
/* Array index: 0x1FAC */ 0x751D,0x4529,
/* Array index: 0x1FAC */ 0x7521,0x3123,
/* Array index: 0x1FAC */ 0x752A,0x2266,
/* Array index: 0x1FAC */ 0x752E,0x2C3B,
/* Array index: 0x1FAC */ 0x752F,0x3E30,
/* Array index: 0x1FAC */ 0x7539,0x246E,
/* Array index: 0x1FAC */ 0x753A,0x246D,
/* Array index: 0x1FAC */ 0x7547,0x2C3C,
/* Array index: 0x1FAC */ 0x7548,0x2C3D,
/* Array index: 0x1FAC */ 0x755B,0x3124,
/* Array index: 0x1FAC */ 0x755F,0x3125,
/* Array index: 0x1FAC */ 0x7563,0x3740,
/* Array index: 0x1FAC */ 0x7564,0x373F,
/* Array index: 0x1FAC */ 0x756C,0x3E32,
/* Array index: 0x1FAC */ 0x756F,0x3E31,
/* Array index: 0x1FAC */ 0x7577,0x452B,
/* Array index: 0x1FAC */ 0x7579,0x452A,
/* Array index: 0x1FAC */ 0x757D,0x4B7E,
/* Array index: 0x1FAC */ 0x757E,0x5236,
/* Array index: 0x1FAC */ 0x7580,0x5856,
/* Array index: 0x1FAC */ 0x7584,0x5D5F,
/* Array index: 0x1FAC */ 0x758C,0x2835,
/* Array index: 0x1FAC */ 0x7590,0x4C21,
/* Array index: 0x1FAC */ 0x7594,0x246F,
/* Array index: 0x1FAC */ 0x7595,0x2470,
/* Array index: 0x1FAC */ 0x7598,0x2836,
/* Array index: 0x1FAC */ 0x75A7,0x2C3E,
/* Array index: 0x1FAC */ 0x75AA,0x2C3F,
/* Array index: 0x1FAC */ 0x75B0,0x3126,
/* Array index: 0x1FAC */ 0x75B6,0x312C,
/* Array index: 0x1FAC */ 0x75BA,0x312D,
/* Array index: 0x1FAC */ 0x75BB,0x3128,
/* Array index: 0x1FAC */ 0x75C4,0x3129,
/* Array index: 0x1FAC */ 0x75D7,0x3E3A,
/* Array index: 0x1FAC */ 0x75DA,0x3E34,
/* Array index: 0x1FAC */ 0x75DD,0x3E37,
/* Array index: 0x1FAC */ 0x75DF,0x3E38,
/* Array index: 0x1FAC */ 0x75E1,0x3E35,
/* Array index: 0x1FAC */ 0x75E4,0x3E39,
/* Array index: 0x1FAC */ 0x75E6,0x3E36,
/* Array index: 0x1FAC */ 0x75E7,0x3E33,
/* Array index: 0x1FAC */ 0x75ED,0x4538,
/* Array index: 0x1FAC */ 0x75EF,0x452D,
/* Array index: 0x1FAC */ 0x7603,0x452F,
/* Array index: 0x1FAC */ 0x7608,0x4C23,
/* Array index: 0x1FAC */ 0x760A,0x4C27,
/* Array index: 0x1FAC */ 0x760C,0x4C24,
/* Array index: 0x1FAC */ 0x7623,0x523C,
/* Array index: 0x1FAC */ 0x7625,0x5237,
/* Array index: 0x1FAC */ 0x7628,0x523E,
/* Array index: 0x1FAC */ 0x763C,0x585C,
/* Array index: 0x1FAC */ 0x763D,0x585A,
/* Array index: 0x1FAC */ 0x7643,0x5D60,
/* Array index: 0x1FAC */ 0x7650,0x623A,
/* Array index: 0x1FAC */ 0x7653,0x623B,
/* Array index: 0x1FAC */ 0x7657,0x623C,
/* Array index: 0x1FAC */ 0x7659,0x6239,
/* Array index: 0x1FAC */ 0x765A,0x623D,
/* Array index: 0x1FAC */ 0x765C,0x6237,
/* Array index: 0x1FAC */ 0x7660,0x6624,
/* Array index: 0x1FAC */ 0x7664,0x6238,
/* Array index: 0x1FAC */ 0x766A,0x6B6D,
/* Array index: 0x1FAC */ 0x766D,0x6D62,
/* Array index: 0x1FAC */ 0x7670,0x6F39,
/* Array index: 0x1FAC */ 0x7675,0x723A,
/* Array index: 0x1FAC */ 0x7679,0x2C40,
/* Array index: 0x1FAC */ 0x767F,0x2267,
/* Array index: 0x1FAC */ 0x7681,0x2471,
/* Array index: 0x1FAC */ 0x7689,0x3749,
/* Array index: 0x1FAC */ 0x768A,0x312E,
/* Array index: 0x1FAC */ 0x768F,0x3748,
/* Array index: 0x1FAC */ 0x7692,0x3E3C,
/* Array index: 0x1FAC */ 0x7695,0x3E3B,
/* Array index: 0x1FAC */ 0x76A4,0x5D64,
/* Array index: 0x1FAC */ 0x76A6,0x623E,
/* Array index: 0x1FAC */ 0x76AA,0x6940,
/* Array index: 0x1FAC */ 0x76AB,0x693F,
/* Array index: 0x1FAC */ 0x76AD,0x6D63,
/* Array index: 0x1FAC */ 0x76AF,0x2837,
/* Array index: 0x1FAC */ 0x76B5,0x453C,
/* Array index: 0x1FAC */ 0x76B8,0x4C29,
/* Array index: 0x1FAC */ 0x76BB,0x5860,
/* Array index: 0x1FAC */ 0x76BD,0x623F,
/* Array index: 0x1FAC */ 0x76BE,0x6941,
/* Array index: 0x1FAC */ 0x76C4,0x2C41,
/* Array index: 0x1FAC */ 0x76C9,0x312F,
/* Array index: 0x1FAC */ 0x76D3,0x374A,
/* Array index: 0x1FAC */ 0x76DA,0x3E3D,
/* Array index: 0x1FAC */ 0x76DD,0x453D,
/* Array index: 0x1FAC */ 0x76E6,0x5861,
/* Array index: 0x1FAC */ 0x76E9,0x5D65,
/* Array index: 0x1FAC */ 0x76EC,0x6240,
/* Array index: 0x1FAC */ 0x76ED,0x6942,
/* Array index: 0x1FAC */ 0x76F0,0x283A,
/* Array index: 0x1FAC */ 0x76F1,0x2839,
/* Array index: 0x1FAC */ 0x76F3,0x2838,
/* Array index: 0x1FAC */ 0x76F5,0x283B,
/* Array index: 0x1FAC */ 0x76F7,0x2C47,
/* Array index: 0x1FAC */ 0x76FA,0x2C49,
/* Array index: 0x1FAC */ 0x76FB,0x2C48,
/* Array index: 0x1FAC */ 0x7708,0x2C42,
/* Array index: 0x1FAC */ 0x770A,0x2C46,
/* Array index: 0x1FAC */ 0x7722,0x313A,
/* Array index: 0x1FAC */ 0x7723,0x3135,
/* Array index: 0x1FAC */ 0x7725,0x3753,
/* Array index: 0x1FAC */ 0x7727,0x313B,
/* Array index: 0x1FAC */ 0x772D,0x374D,
/* Array index: 0x1FAC */ 0x7739,0x374B,
/* Array index: 0x1FAC */ 0x773B,0x3754,
/* Array index: 0x1FAC */ 0x773D,0x3752,
/* Array index: 0x1FAC */ 0x775F,0x453F,
/* Array index: 0x1FAC */ 0x7760,0x4540,
/* Array index: 0x1FAC */ 0x7767,0x4545,
/* Array index: 0x1FAC */ 0x7769,0x4544,
/* Array index: 0x1FAC */ 0x777C,0x4C2B,
/* Array index: 0x1FAC */ 0x778D,0x5244,
/* Array index: 0x1FAC */ 0x778F,0x5245,
/* Array index: 0x1FAC */ 0x7795,0x5869,
/* Array index: 0x1FAC */ 0x77A8,0x5D6D,
/* Array index: 0x1FAC */ 0x77AB,0x5D67,
/* Array index: 0x1FAC */ 0x77BA,0x6242,
/* Array index: 0x1FAC */ 0x77C2,0x6241,
/* Array index: 0x1FAC */ 0x77C4,0x6627,
/* Array index: 0x1FAC */ 0x77D4,0x6F3A,
/* Array index: 0x1FAC */ 0x77D5,0x7042,
/* Array index: 0x1FAC */ 0x77D8,0x7128,
/* Array index: 0x1FAC */ 0x77D9,0x7129,
/* Array index: 0x1FAC */ 0x77DE,0x3E47,
/* Array index: 0x1FAC */ 0x77E0,0x4549,
/* Array index: 0x1FAC */ 0x77E7,0x2C4A,
/* Array index: 0x1FAC */ 0x77E8,0x2C4B,
/* Array index: 0x1FAC */ 0x77EC,0x3E48,
/* Array index: 0x1FAC */ 0x7803,0x2C54,
/* Array index: 0x1FAC */ 0x7805,0x2C4F,
/* Array index: 0x1FAC */ 0x7806,0x2C4C,
/* Array index: 0x1FAC */ 0x7809,0x2C53,
/* Array index: 0x1FAC */ 0x7845,0x375D,
/* Array index: 0x1FAC */ 0x7850,0x375E,
/* Array index: 0x1FAC */ 0x7852,0x3757,
/* Array index: 0x1FAC */ 0x785C,0x3E4C,
/* Array index: 0x1FAC */ 0x785E,0x3E54,
/* Array index: 0x1FAC */ 0x7860,0x3E49,
/* Array index: 0x1FAC */ 0x7862,0x3E55,
/* Array index: 0x1FAC */ 0x7879,0x4554,
/* Array index: 0x1FAC */ 0x787B,0x4558,
/* Array index: 0x1FAC */ 0x787E,0x4C38,
/* Array index: 0x1FAC */ 0x7880,0x4556,
/* Array index: 0x1FAC */ 0x788F,0x454D,
/* Array index: 0x1FAC */ 0x78B2,0x4C33,
/* Array index: 0x1FAC */ 0x78B4,0x4C35,
/* Array index: 0x1FAC */ 0x78BB,0x5249,
/* Array index: 0x1FAC */ 0x78C3,0x5250,
/* Array index: 0x1FAC */ 0x78C4,0x5251,
/* Array index: 0x1FAC */ 0x78D4,0x524E,
/* Array index: 0x1FAC */ 0x78E9,0x586D,
/* Array index: 0x1FAC */ 0x78EA,0x586F,
/* Array index: 0x1FAC */ 0x78ED,0x5875,
/* Array index: 0x1FAC */ 0x78F2,0x5D75,
/* Array index: 0x1FAC */ 0x78F3,0x5D6F,
/* Array index: 0x1FAC */ 0x7902,0x5D71,
/* Array index: 0x1FAC */ 0x7904,0x5D79,
/* Array index: 0x1FAC */ 0x7905,0x5D76,
/* Array index: 0x1FAC */ 0x7909,0x6246,
/* Array index: 0x1FAC */ 0x790C,0x6243,
/* Array index: 0x1FAC */ 0x7917,0x662D,
/* Array index: 0x1FAC */ 0x792D,0x6B6F,
/* Array index: 0x1FAC */ 0x792F,0x6B71,
/* Array index: 0x1FAC */ 0x7931,0x6B70,
/* Array index: 0x1FAC */ 0x7935,0x6D64,
/* Array index: 0x1FAC */ 0x7938,0x7043,
/* Array index: 0x1FAC */ 0x7939,0x712A,
/* Array index: 0x1FAC */ 0x793D,0x2472,
/* Array index: 0x1FAC */ 0x793F,0x2843,
/* Array index: 0x1FAC */ 0x7942,0x2842,
/* Array index: 0x1FAC */ 0x7944,0x2C5A,
/* Array index: 0x1FAC */ 0x7945,0x2C59,
/* Array index: 0x1FAC */ 0x795B,0x314A,
/* Array index: 0x1FAC */ 0x795C,0x314C,
/* Array index: 0x1FAC */ 0x7961,0x3765,
/* Array index: 0x1FAC */ 0x7963,0x3763,
/* Array index: 0x1FAC */ 0x7964,0x375F,
/* Array index: 0x1FAC */ 0x7979,0x455C,
/* Array index: 0x1FAC */ 0x797C,0x4559,
/* Array index: 0x1FAC */ 0x797D,0x455B,
/* Array index: 0x1FAC */ 0x7982,0x455A,
/* Array index: 0x1FAC */ 0x7988,0x4C48,
/* Array index: 0x1FAC */ 0x798A,0x4C41,
/* Array index: 0x1FAC */ 0x798B,0x4C42,
/* Array index: 0x1FAC */ 0x79A8,0x5D7B,
/* Array index: 0x1FAC */ 0x79B0,0x662F,
/* Array index: 0x1FAC */ 0x79B2,0x694E,
/* Array index: 0x1FAC */ 0x79BB,0x3766,
/* Array index: 0x1FAC */ 0x79C5,0x2844,
/* Array index: 0x1FAC */ 0x79D5,0x2C5B,
/* Array index: 0x1FAC */ 0x79D6,0x2C5E,
/* Array index: 0x1FAC */ 0x7A0A,0x3E5B,
/* Array index: 0x1FAC */ 0x7A0C,0x3E5D,
/* Array index: 0x1FAC */ 0x7A22,0x4563,
/* Array index: 0x1FAC */ 0x7A26,0x4C50,
/* Array index: 0x1FAC */ 0x7A28,0x4C4F,
/* Array index: 0x1FAC */ 0x7A2B,0x4C4B,
/* Array index: 0x1FAC */ 0x7A2F,0x4C4E,
/* Array index: 0x1FAC */ 0x7A30,0x4C4D,
/* Array index: 0x1FAC */ 0x7A39,0x525A,
/* Array index: 0x1FAC */ 0x7A44,0x5879,
/* Array index: 0x1FAC */ 0x7A47,0x587B,
/* Array index: 0x1FAC */ 0x7A48,0x587A,
/* Array index: 0x1FAC */ 0x7A4A,0x4C4C,
/* Array index: 0x1FAC */ 0x7A54,0x5E22,
/* Array index: 0x1FAC */ 0x7A56,0x5D7E,
/* Array index: 0x1FAC */ 0x7A5F,0x624C,
/* Array index: 0x1FAC */ 0x7A67,0x6630,
/* Array index: 0x1FAC */ 0x7A68,0x6631,
/* Array index: 0x1FAC */ 0x7A75,0x2268,
/* Array index: 0x1FAC */ 0x7A78,0x2845,
/* Array index: 0x1FAC */ 0x7A7B,0x2846,
/* Array index: 0x1FAC */ 0x7A7E,0x2C61,
/* Array index: 0x1FAC */ 0x7A80,0x2C60,
/* Array index: 0x1FAC */ 0x7A94,0x376C,
/* Array index: 0x1FAC */ 0x7A99,0x3E5F,
/* Array index: 0x1FAC */ 0x7A9E,0x4569,
/* Array index: 0x1FAC */ 0x7AA2,0x4568,
/* Array index: 0x1FAC */ 0x7AA3,0x4567,
/* Array index: 0x1FAC */ 0x7AA8,0x4C51,
/* Array index: 0x1FAC */ 0x7AAB,0x4C52,
/* Array index: 0x1FAC */ 0x7AAC,0x4C53,
/* Array index: 0x1FAC */ 0x7ABE,0x5E24,
/* Array index: 0x1FAC */ 0x7AC0,0x5E25,
/* Array index: 0x1FAC */ 0x7AC1,0x5E26,
/* Array index: 0x1FAC */ 0x7AD1,0x2C62,
/* Array index: 0x1FAC */ 0x7AD8,0x3160,
/* Array index: 0x1FAC */ 0x7AE4,0x3E61,
/* Array index: 0x1FAC */ 0x7AE6,0x3E60,
/* Array index: 0x1FAC */ 0x7AEB,0x456A,
/* Array index: 0x1FAC */ 0x7AEE,0x4C54,
/* Array index: 0x1FAC */ 0x7AF7,0x6952,
/* Array index: 0x1FAC */ 0x7AFB,0x2847,
/* Array index: 0x1FAC */ 0x7B00,0x2C63,
/* Array index: 0x1FAC */ 0x7B01,0x2C64,
/* Array index: 0x1FAC */ 0x7B18,0x3776,
/* Array index: 0x1FAC */ 0x7B1A,0x3821,
/* Array index: 0x1FAC */ 0x7B1D,0x3778,
/* Array index: 0x1FAC */ 0x7B2A,0x3777,
/* Array index: 0x1FAC */ 0x7B2B,0x377A,
/* Array index: 0x1FAC */ 0x7B38,0x377E,
/* Array index: 0x1FAC */ 0x7B3B,0x376F,
/* Array index: 0x1FAC */ 0x7B40,0x3E68,
/* Array index: 0x1FAC */ 0x7B58,0x3E69,
/* Array index: 0x1FAC */ 0x7B69,0x456F,
/* Array index: 0x1FAC */ 0x7B6D,0x456D,
/* Array index: 0x1FAC */ 0x7B82,0x4C64,
/* Array index: 0x1FAC */ 0x7B85,0x4C5F,
/* Array index: 0x1FAC */ 0x7B88,0x4C55,
/* Array index: 0x1FAC */ 0x7B96,0x4C5A,
/* Array index: 0x1FAC */ 0x7BA4,0x4C63,
/* Array index: 0x1FAC */ 0x7BAC,0x5261,
/* Array index: 0x1FAC */ 0x7BAF,0x5263,
/* Array index: 0x1FAC */ 0x7BB5,0x5266,
/* Array index: 0x1FAC */ 0x7BB7,0x525E,
/* Array index: 0x1FAC */ 0x7BB9,0x5264,
/* Array index: 0x1FAC */ 0x7BBE,0x5260,
/* Array index: 0x1FAC */ 0x7BCA,0x5265,
/* Array index: 0x1FAC */ 0x7BCB,0x525F,
/* Array index: 0x1FAC */ 0x7BCE,0x5262,
/* Array index: 0x1FAC */ 0x7BD4,0x592C,
/* Array index: 0x1FAC */ 0x7BD5,0x5927,
/* Array index: 0x1FAC */ 0x7BD8,0x5931,
/* Array index: 0x1FAC */ 0x7BF8,0x5E35,
/* Array index: 0x1FAC */ 0x7BF9,0x592B,
/* Array index: 0x1FAC */ 0x7BFB,0x5E2C,
/* Array index: 0x1FAC */ 0x7C19,0x624F,
/* Array index: 0x1FAC */ 0x7C30,0x6258,
/* Array index: 0x1FAC */ 0x7C33,0x6632,
/* Array index: 0x1FAC */ 0x7C39,0x6634,
/* Array index: 0x1FAC */ 0x7C3B,0x6636,
/* Array index: 0x1FAC */ 0x7C3C,0x6633,
/* Array index: 0x1FAC */ 0x7C53,0x6B73,
/* Array index: 0x1FAC */ 0x7C54,0x6B72,
/* Array index: 0x1FAC */ 0x7C6F,0x715C,
/* Array index: 0x1FAC */ 0x7C75,0x2848,
/* Array index: 0x1FAC */ 0x7C88,0x316F,
/* Array index: 0x1FAC */ 0x7C8A,0x316D,
/* Array index: 0x1FAC */ 0x7C8C,0x316E,
/* Array index: 0x1FAC */ 0x7C8D,0x3170,
/* Array index: 0x1FAC */ 0x7C91,0x316C,
/* Array index: 0x1FAC */ 0x7C94,0x3823,
/* Array index: 0x1FAC */ 0x7C96,0x3825,
/* Array index: 0x1FAC */ 0x7C98,0x3824,
/* Array index: 0x1FAC */ 0x7C9E,0x3E6C,
/* Array index: 0x1FAC */ 0x7CA8,0x3E6D,
/* Array index: 0x1FAC */ 0x7CAF,0x457B,
/* Array index: 0x1FAC */ 0x7CB2,0x4579,
/* Array index: 0x1FAC */ 0x7CB4,0x457A,
/* Array index: 0x1FAC */ 0x7CBF,0x4C66,
/* Array index: 0x1FAC */ 0x7CC5,0x5267,
/* Array index: 0x1FAC */ 0x7CC8,0x5268,
/* Array index: 0x1FAC */ 0x7CCB,0x526A,
/* Array index: 0x1FAC */ 0x7CCC,0x5269,
/* Array index: 0x1FAC */ 0x7CD7,0x5935,
/* Array index: 0x1FAC */ 0x7CE8,0x5E3C,
/* Array index: 0x1FAC */ 0x7CEA,0x6638,
/* Array index: 0x1FAC */ 0x7CEC,0x6637,
/* Array index: 0x1FAC */ 0x7CEE,0x6958,
/* Array index: 0x1FAC */ 0x7CF1,0x6D6E,
/* Array index: 0x1FAC */ 0x7CF2,0x6B74,
/* Array index: 0x1FAC */ 0x7CF4,0x6D6D,
/* Array index: 0x1FAC */ 0x7CF6,0x712D,
/* Array index: 0x1FAC */ 0x7CF7,0x7172,
/* Array index: 0x1FAC */ 0x7CFD,0x2849,
/* Array index: 0x1FAC */ 0x7D01,0x2C6D,
/* Array index: 0x1FAC */ 0x7D03,0x2C6B,
/* Array index: 0x1FAC */ 0x7D08,0x2C6C,
/* Array index: 0x1FAC */ 0x7D0C,0x317C,
/* Array index: 0x1FAC */ 0x7D16,0x3177,
/* Array index: 0x1FAC */ 0x7D18,0x3176,
/* Array index: 0x1FAC */ 0x7D28,0x3835,
/* Array index: 0x1FAC */ 0x7D29,0x382E,
/* Array index: 0x1FAC */ 0x7D2C,0x382D,
/* Array index: 0x1FAC */ 0x7D35,0x3827,
/* Array index: 0x1FAC */ 0x7D36,0x382A,
/* Array index: 0x1FAC */ 0x7D38,0x3829,
/* Array index: 0x1FAC */ 0x7D45,0x382C,
/* Array index: 0x1FAC */ 0x7D47,0x3830,
/* Array index: 0x1FAC */ 0x7D4A,0x3833,
/* Array index: 0x1FAC */ 0x7D5C,0x3E78,
/* Array index: 0x1FAC */ 0x7D5F,0x3E7E,
/* Array index: 0x1FAC */ 0x7D63,0x3E71,
/* Array index: 0x1FAC */ 0x7D92,0x462D,
/* Array index: 0x1FAC */ 0x7D94,0x462A,
/* Array index: 0x1FAC */ 0x7D96,0x4C79,
/* Array index: 0x1FAC */ 0x7D9D,0x4C71,
/* Array index: 0x1FAC */ 0x7D9F,0x4C7B,
/* Array index: 0x1FAC */ 0x7DA1,0x4D21,
/* Array index: 0x1FAC */ 0x7DA3,0x4C6C,
/* Array index: 0x1FAC */ 0x7DAE,0x4C7D,
/* Array index: 0x1FAC */ 0x7DAF,0x4C77,
/* Array index: 0x1FAC */ 0x7DB7,0x4C6A,
/* Array index: 0x1FAC */ 0x7DB9,0x4C78,
/* Array index: 0x1FAC */ 0x7DBC,0x4C7A,
/* Array index: 0x1FAC */ 0x7DC9,0x4D22,
/* Array index: 0x1FAC */ 0x7DCB,0x4C75,
/* Array index: 0x1FAC */ 0x7DCC,0x4C76,
/* Array index: 0x1FAC */ 0x7DCE,0x4C72,
/* Array index: 0x1FAC */ 0x7DD7,0x526F,
/* Array index: 0x1FAC */ 0x7DDB,0x526C,
/* Array index: 0x1FAC */ 0x7DDF,0x5278,
/* Array index: 0x1FAC */ 0x7DE1,0x5270,
/* Array index: 0x1FAC */ 0x7DE6,0x5273,
/* Array index: 0x1FAC */ 0x7DE7,0x526E,
/* Array index: 0x1FAC */ 0x7DEA,0x526D,
/* Array index: 0x1FAC */ 0x7DEE,0x5277,
/* Array index: 0x1FAC */ 0x7DF0,0x5276,
/* Array index: 0x1FAC */ 0x7DF1,0x5275,
/* Array index: 0x1FAC */ 0x7DF3,0x503B,
/* Array index: 0x1FAC */ 0x7DF6,0x5274,
/* Array index: 0x1FAC */ 0x7DF7,0x526B,
/* Array index: 0x1FAC */ 0x7DFA,0x5272,
/* Array index: 0x1FAC */ 0x7E03,0x5271,
/* Array index: 0x1FAC */ 0x7E1A,0x5942,
/* Array index: 0x1FAC */ 0x7E1C,0x5940,
/* Array index: 0x1FAC */ 0x7E29,0x5E47,
/* Array index: 0x1FAC */ 0x7E2A,0x5E43,
/* Array index: 0x1FAC */ 0x7E2D,0x5E3D,
/* Array index: 0x1FAC */ 0x7E30,0x5E49,
/* Array index: 0x1FAC */ 0x7E33,0x5E40,
/* Array index: 0x1FAC */ 0x7E36,0x5E4B,
/* Array index: 0x1FAC */ 0x7E40,0x5E45,
/* Array index: 0x1FAC */ 0x7E42,0x5E3F,
/* Array index: 0x1FAC */ 0x7E44,0x5E4C,
/* Array index: 0x1FAC */ 0x7E47,0x5E46,
/* Array index: 0x1FAC */ 0x7E49,0x5E44,
/* Array index: 0x1FAC */ 0x7E4C,0x5E48,
/* Array index: 0x1FAC */ 0x7E50,0x625A,
/* Array index: 0x1FAC */ 0x7E51,0x6260,
/* Array index: 0x1FAC */ 0x7E53,0x6263,
/* Array index: 0x1FAC */ 0x7E5C,0x6259,
/* Array index: 0x1FAC */ 0x7E68,0x6642,
/* Array index: 0x1FAC */ 0x7E6F,0x663E,
/* Array index: 0x1FAC */ 0x7E70,0x663C,
/* Array index: 0x1FAC */ 0x7E7E,0x695A,
/* Array index: 0x1FAC */ 0x7E80,0x695C,
/* Array index: 0x1FAC */ 0x7E81,0x695B,
/* Array index: 0x1FAC */ 0x7E91,0x6D6F,
/* Array index: 0x1FAC */ 0x7F39,0x3052,
/* Array index: 0x1FAC */ 0x7F3E,0x3F22,
/* Array index: 0x1FAC */ 0x7F3F,0x3F23,
/* Array index: 0x1FAC */ 0x7F43,0x594B,
/* Array index: 0x1FAC */ 0x7F45,0x5E4E,
/* Array index: 0x1FAC */ 0x7F4A,0x6644,
/* Array index: 0x1FAC */ 0x7F4B,0x6643,
/* Array index: 0x1FAC */ 0x7F4D,0x6B7B,
/* Array index: 0x1FAC */ 0x7F4F,0x6D70,
/* Array index: 0x1FAC */ 0x7F51,0x2269,
/* Array index: 0x1FAC */ 0x7F58,0x2C6E,
/* Array index: 0x1FAC */ 0x7F73,0x4D23,
/* Array index: 0x1FAC */ 0x7F76,0x5279,
/* Array index: 0x1FAC */ 0x7F83,0x6645,
/* Array index: 0x1FAC */ 0x7F86,0x6646,
/* Array index: 0x1FAC */ 0x7F87,0x6D71,
/* Array index: 0x1FAC */ 0x7F89,0x7048,
/* Array index: 0x1FAC */ 0x7F8D,0x2C70,
/* Array index: 0x1FAC */ 0x7F91,0x2C6F,
/* Array index: 0x1FAC */ 0x7F92,0x3226,
/* Array index: 0x1FAC */ 0x7F95,0x3837,
/* Array index: 0x1FAC */ 0x7F96,0x3225,
/* Array index: 0x1FAC */ 0x7FAC,0x527A,
/* Array index: 0x1FAC */ 0x7FAD,0x527C,
/* Array index: 0x1FAC */ 0x7FB0,0x527B,
/* Array index: 0x1FAC */ 0x7FB1,0x594F,
/* Array index: 0x1FAC */ 0x7FB3,0x6265,
/* Array index: 0x1FAC */ 0x7FB5,0x6264,
/* Array index: 0x1FAC */ 0x7FB7,0x6647,
/* Array index: 0x1FAC */ 0x7FBA,0x695D,
/* Array index: 0x1FAC */ 0x7FBB,0x6B7C,
/* Array index: 0x1FAC */ 0x7FBE,0x2C71,
/* Array index: 0x1FAC */ 0x7FC0,0x3229,
/* Array index: 0x1FAC */ 0x7FC2,0x3228,
/* Array index: 0x1FAC */ 0x7FC3,0x3227,
/* Array index: 0x1FAC */ 0x7FD7,0x3F29,
/* Array index: 0x1FAC */ 0x7FDB,0x4636,
/* Array index: 0x1FAC */ 0x7FDC,0x4637,
/* Array index: 0x1FAC */ 0x7FDE,0x4D27,
/* Array index: 0x1FAC */ 0x7FF2,0x5E53,
/* Array index: 0x1FAC */ 0x8007,0x2C72,
/* Array index: 0x1FAC */ 0x800E,0x2C73,
/* Array index: 0x1FAC */ 0x800F,0x2C74,
/* Array index: 0x1FAC */ 0x8014,0x2C75,
/* Array index: 0x1FAC */ 0x8016,0x322A,
/* Array index: 0x1FAC */ 0x801B,0x3845,
/* Array index: 0x1FAC */ 0x801E,0x3844,
/* Array index: 0x1FAC */ 0x801F,0x3843,
/* Array index: 0x1FAC */ 0x8021,0x4638,
/* Array index: 0x1FAC */ 0x8024,0x4D28,
/* Array index: 0x1FAC */ 0x8029,0x5952,
/* Array index: 0x1FAC */ 0x802A,0x5951,
/* Array index: 0x1FAC */ 0x802C,0x5E54,
/* Array index: 0x1FAC */ 0x8030,0x6B7D,
/* Array index: 0x1FAC */ 0x8034,0x2473,
/* Array index: 0x1FAC */ 0x8035,0x284A,
/* Array index: 0x1FAC */ 0x8037,0x2C76,
/* Array index: 0x1FAC */ 0x8039,0x322C,
/* Array index: 0x1FAC */ 0x803E,0x322B,
/* Array index: 0x1FAC */ 0x8043,0x3847,
/* Array index: 0x1FAC */ 0x8047,0x3846,
/* Array index: 0x1FAC */ 0x8048,0x3848,
/* Array index: 0x1FAC */ 0x805C,0x4D2A,
/* Array index: 0x1FAC */ 0x805D,0x4D29,
/* Array index: 0x1FAC */ 0x8064,0x5325,
/* Array index: 0x1FAC */ 0x8067,0x5326,
/* Array index: 0x1FAC */ 0x806C,0x5953,
/* Array index: 0x1FAC */ 0x8075,0x6268,
/* Array index: 0x1FAC */ 0x8078,0x664A,
/* Array index: 0x1FAC */ 0x8079,0x695F,
/* Array index: 0x1FAC */ 0x8082,0x2F7D,
/* Array index: 0x1FAC */ 0x808A,0x2168,
/* Array index: 0x1FAC */ 0x808F,0x284B,
/* Array index: 0x1FAC */ 0x8090,0x2476,
/* Array index: 0x1FAC */ 0x8092,0x2477,
/* Array index: 0x1FAC */ 0x8095,0x2474,
/* Array index: 0x1FAC */ 0x8099,0x2475,
/* Array index: 0x1FAC */ 0x809C,0x2478,
/* Array index: 0x1FAC */ 0x80A3,0x284D,
/* Array index: 0x1FAC */ 0x80AD,0x2850,
/* Array index: 0x1FAC */ 0x80AE,0x284C,
/* Array index: 0x1FAC */ 0x80B5,0x284F,
/* Array index: 0x1FAC */ 0x80B8,0x284E,
/* Array index: 0x1FAC */ 0x80C2,0x2C7C,
/* Array index: 0x1FAC */ 0x80DC,0x2D23,
/* Array index: 0x1FAC */ 0x80E0,0x2C79,
/* Array index: 0x1FAC */ 0x80E3,0x2D21,
/* Array index: 0x1FAC */ 0x80E6,0x2D29,
/* Array index: 0x1FAC */ 0x80F2,0x322E,
/* Array index: 0x1FAC */ 0x80F5,0x3230,
/* Array index: 0x1FAC */ 0x80FE,0x3F2D,
/* Array index: 0x1FAC */ 0x8100,0x3233,
/* Array index: 0x1FAC */ 0x8101,0x3231,
/* Array index: 0x1FAC */ 0x8115,0x3852,
/* Array index: 0x1FAC */ 0x8118,0x3849,
/* Array index: 0x1FAC */ 0x8119,0x384B,
/* Array index: 0x1FAC */ 0x8125,0x384A,
/* Array index: 0x1FAC */ 0x8127,0x3853,
/* Array index: 0x1FAC */ 0x812C,0x384F,
/* Array index: 0x1FAC */ 0x812D,0x384D,
/* Array index: 0x1FAC */ 0x813A,0x3F36,
/* Array index: 0x1FAC */ 0x813D,0x3F34,
/* Array index: 0x1FAC */ 0x8143,0x3F2F,
/* Array index: 0x1FAC */ 0x8144,0x4646,
/* Array index: 0x1FAC */ 0x8147,0x3F33,
/* Array index: 0x1FAC */ 0x814A,0x3F30,
/* Array index: 0x1FAC */ 0x814D,0x3F35,
/* Array index: 0x1FAC */ 0x814F,0x3F32,
/* Array index: 0x1FAC */ 0x8152,0x3F31,
/* Array index: 0x1FAC */ 0x815B,0x463E,
/* Array index: 0x1FAC */ 0x815C,0x463C,
/* Array index: 0x1FAC */ 0x8167,0x4644,
/* Array index: 0x1FAC */ 0x8169,0x463D,
/* Array index: 0x1FAC */ 0x816F,0x4645,
/* Array index: 0x1FAC */ 0x8172,0x4640,
/* Array index: 0x1FAC */ 0x8176,0x4643,
/* Array index: 0x1FAC */ 0x8177,0x463B,
/* Array index: 0x1FAC */ 0x8183,0x4D2D,
/* Array index: 0x1FAC */ 0x8186,0x4D2C,
/* Array index: 0x1FAC */ 0x8187,0x4D2E,
/* Array index: 0x1FAC */ 0x8195,0x532A,
/* Array index: 0x1FAC */ 0x8197,0x532D,
/* Array index: 0x1FAC */ 0x8199,0x532C,
/* Array index: 0x1FAC */ 0x819E,0x5329,
/* Array index: 0x1FAC */ 0x819F,0x5328,
/* Array index: 0x1FAC */ 0x81A2,0x532B,
/* Array index: 0x1FAC */ 0x81A3,0x5327,
/* Array index: 0x1FAC */ 0x81A6,0x5955,
/* Array index: 0x1FAC */ 0x81A7,0x595F,
/* Array index: 0x1FAC */ 0x81AB,0x5959,
/* Array index: 0x1FAC */ 0x81AC,0x595B,
/* Array index: 0x1FAC */ 0x81C4,0x5E56,
/* Array index: 0x1FAC */ 0x81C5,0x5E59,
/* Array index: 0x1FAC */ 0x81C7,0x5E5A,
/* Array index: 0x1FAC */ 0x81CA,0x5E58,
/* Array index: 0x1FAC */ 0x81CC,0x5E57,
/* Array index: 0x1FAC */ 0x81D5,0x664C,
/* Array index: 0x1FAC */ 0x81D7,0x664B,
/* Array index: 0x1FAC */ 0x81D9,0x6961,
/* Array index: 0x1FAC */ 0x81DB,0x6960,
/* Array index: 0x1FAC */ 0x81E6,0x3F37,
/* Array index: 0x1FAC */ 0x81E9,0x5E5C,
/* Array index: 0x1FAC */ 0x81EE,0x3F38,
/* Array index: 0x1FAC */ 0x81F2,0x5960,
/* Array index: 0x1FAC */ 0x81FF,0x2D2B,
/* Array index: 0x1FAC */ 0x8201,0x3234,
/* Array index: 0x1FAC */ 0x8204,0x3F3C,
/* Array index: 0x1FAC */ 0x820B,0x664D,
/* Array index: 0x1FAC */ 0x8211,0x3856,
/* Array index: 0x1FAC */ 0x8215,0x4D32,
/* Array index: 0x1FAC */ 0x8216,0x532E,
/* Array index: 0x1FAC */ 0x821D,0x4648,
/* Array index: 0x1FAC */ 0x8220,0x2851,
/* Array index: 0x1FAC */ 0x8221,0x2D2C,
/* Array index: 0x1FAC */ 0x8225,0x3236,
/* Array index: 0x1FAC */ 0x822F,0x3235,
/* Array index: 0x1FAC */ 0x8238,0x3857,
/* Array index: 0x1FAC */ 0x823A,0x3859,
/* Array index: 0x1FAC */ 0x8249,0x4649,
/* Array index: 0x1FAC */ 0x8274,0x385C,
/* Array index: 0x1FAC */ 0x8275,0x3F40,
/* Array index: 0x1FAC */ 0x8278,0x226A,
/* Array index: 0x1FAC */ 0x828A,0x2521,
/* Array index: 0x1FAC */ 0x8298,0x2856,
/* Array index: 0x1FAC */ 0x829A,0x2855,
/* Array index: 0x1FAC */ 0x829B,0x2857,
/* Array index: 0x1FAC */ 0x82AE,0x285A,
/* Array index: 0x1FAC */ 0x82BA,0x285D,
/* Array index: 0x1FAC */ 0x82BC,0x285B,
/* Array index: 0x1FAC */ 0x82C0,0x2853,
/* Array index: 0x1FAC */ 0x82C2,0x2862,
/* Array index: 0x1FAC */ 0x82C3,0x2864,
/* Array index: 0x1FAC */ 0x82D5,0x2D34,
/* Array index: 0x1FAC */ 0x82D6,0x2D37,
/* Array index: 0x1FAC */ 0x82D9,0x2D2E,
/* Array index: 0x1FAC */ 0x82E0,0x2D43,
/* Array index: 0x1FAC */ 0x82E1,0x2D3A,
/* Array index: 0x1FAC */ 0x82E4,0x2D42,
/* Array index: 0x1FAC */ 0x82FE,0x2D2F,
/* Array index: 0x1FAC */ 0x8300,0x2D33,
/* Array index: 0x1FAC */ 0x8307,0x2D31,
/* Array index: 0x1FAC */ 0x8308,0x3247,
/* Array index: 0x1FAC */ 0x830C,0x2D3D,
/* Array index: 0x1FAC */ 0x830D,0x2942,
/* Array index: 0x1FAC */ 0x8316,0x324A,
/* Array index: 0x1FAC */ 0x8319,0x323A,
/* Array index: 0x1FAC */ 0x831B,0x3245,
/* Array index: 0x1FAC */ 0x831C,0x3241,
/* Array index: 0x1FAC */ 0x831E,0x3254,
/* Array index: 0x1FAC */ 0x8320,0x324C,
/* Array index: 0x1FAC */ 0x8333,0x3237,
/* Array index: 0x1FAC */ 0x8337,0x324D,
/* Array index: 0x1FAC */ 0x833F,0x323E,
/* Array index: 0x1FAC */ 0x8351,0x323B,
/* Array index: 0x1FAC */ 0x8353,0x3253,
/* Array index: 0x1FAC */ 0x8356,0x323D,
/* Array index: 0x1FAC */ 0x837A,0x3861,
/* Array index: 0x1FAC */ 0x8394,0x386A,
/* Array index: 0x1FAC */ 0x8395,0x3867,
/* Array index: 0x1FAC */ 0x83F3,0x3F63,
/* Array index: 0x1FAC */ 0x8406,0x3F61,
/* Array index: 0x1FAC */ 0x8409,0x3F5D,
/* Array index: 0x1FAC */ 0x841B,0x3F72,
/* Array index: 0x1FAC */ 0x8423,0x3F44,
/* Array index: 0x1FAC */ 0x8429,0x466C,
/* Array index: 0x1FAC */ 0x842B,0x4724,
/* Array index: 0x1FAC */ 0x842D,0x4671,
/* Array index: 0x1FAC */ 0x8465,0x4655,
/* Array index: 0x1FAC */ 0x8467,0x4659,
/* Array index: 0x1FAC */ 0x8468,0x4721,
/* Array index: 0x1FAC */ 0x8486,0x4658,
/* Array index: 0x1FAC */ 0x8494,0x4D49,
/* Array index: 0x1FAC */ 0x84B4,0x4D3E,
/* Array index: 0x1FAC */ 0x84B6,0x4D52,
/* Array index: 0x1FAC */ 0x84C1,0x4D3F,
/* Array index: 0x1FAC */ 0x84C2,0x4D39,
/* Array index: 0x1FAC */ 0x84C5,0x4679,
/* Array index: 0x1FAC */ 0x84C7,0x4D4A,
/* Array index: 0x1FAC */ 0x84DB,0x4D58,
/* Array index: 0x1FAC */ 0x8512,0x534E,
/* Array index: 0x1FAC */ 0x853B,0x5336,
/* Array index: 0x1FAC */ 0x853E,0x5974,
/* Array index: 0x1FAC */ 0x854D,0x5967,
/* Array index: 0x1FAC */ 0x854E,0x5977,
/* Array index: 0x1FAC */ 0x855B,0x5975,
/* Array index: 0x1FAC */ 0x855D,0x5A21,
/* Array index: 0x1FAC */ 0x856B,0x5966,
/* Array index: 0x1FAC */ 0x856C,0x5A24,
/* Array index: 0x1FAC */ 0x856E,0x5978,
/* Array index: 0x1FAC */ 0x8571,0x5976,
/* Array index: 0x1FAC */ 0x85A7,0x5E63,
/* Array index: 0x1FAC */ 0x85CB,0x6279,
/* Array index: 0x1FAC */ 0x85CE,0x627A,
/* Array index: 0x1FAC */ 0x85D1,0x6660,
/* Array index: 0x1FAC */ 0x85D2,0x6321,
/* Array index: 0x1FAC */ 0x85E6,0x6662,
/* Array index: 0x1FAC */ 0x85E8,0x6656,
/* Array index: 0x1FAC */ 0x85F6,0x696A,
/* Array index: 0x1FAC */ 0x85F8,0x665B,
/* Array index: 0x1FAC */ 0x8609,0x696C,
/* Array index: 0x1FAC */ 0x860C,0x696E,
/* Array index: 0x1FAC */ 0x8643,0x704A,
/* Array index: 0x1FAC */ 0x8652,0x325A,
/* Array index: 0x1FAC */ 0x8653,0x3259,
/* Array index: 0x1FAC */ 0x8656,0x3921,
/* Array index: 0x1FAC */ 0x8659,0x387E,
/* Array index: 0x1FAC */ 0x8677,0x2D47,
/* Array index: 0x1FAC */ 0x867C,0x2D49,
/* Array index: 0x1FAC */ 0x868B,0x3264,
/* Array index: 0x1FAC */ 0x86A5,0x3267,
/* Array index: 0x1FAC */ 0x86A7,0x326A,
/* Array index: 0x1FAC */ 0x86A8,0x325C,
/* Array index: 0x1FAC */ 0x86B0,0x3928,
/* Array index: 0x1FAC */ 0x86C8,0x3929,
/* Array index: 0x1FAC */ 0x86CC,0x392D,
/* Array index: 0x1FAC */ 0x86D1,0x4025,
/* Array index: 0x1FAC */ 0x86D3,0x3F78,
/* Array index: 0x1FAC */ 0x86E2,0x3F76,
/* Array index: 0x1FAC */ 0x86E3,0x3F79,
/* Array index: 0x1FAC */ 0x8701,0x4734,
/* Array index: 0x1FAC */ 0x8704,0x472A,
/* Array index: 0x1FAC */ 0x8705,0x4737,
/* Array index: 0x1FAC */ 0x871E,0x4D62,
/* Array index: 0x1FAC */ 0x8738,0x4D77,
/* Array index: 0x1FAC */ 0x873A,0x4D71,
/* Array index: 0x1FAC */ 0x873C,0x4D6F,
/* Array index: 0x1FAC */ 0x8746,0x4D6A,
/* Array index: 0x1FAC */ 0x8773,0x536D,
/* Array index: 0x1FAC */ 0x8775,0x5426,
/* Array index: 0x1FAC */ 0x8781,0x5A2F,
/* Array index: 0x1FAC */ 0x87A3,0x5A34,
/* Array index: 0x1FAC */ 0x87A4,0x5A28,
/* Array index: 0x1FAC */ 0x87C9,0x5F30,
/* Array index: 0x1FAC */ 0x87CA,0x5F37,
/* Array index: 0x1FAC */ 0x87CC,0x5F33,
/* Array index: 0x1FAC */ 0x87FA,0x6667,
/* Array index: 0x1FAC */ 0x87FC,0x666F,
/* Array index: 0x1FAC */ 0x8810,0x6971,
/* Array index: 0x1FAC */ 0x8811,0x6972,
/* Array index: 0x1FAC */ 0x8813,0x6974,
/* Array index: 0x1FAC */ 0x8816,0x6975,
/* Array index: 0x1FAC */ 0x8817,0x6973,
/* Array index: 0x1FAC */ 0x8820,0x6C32,
/* Array index: 0x1FAC */ 0x8848,0x4026,
/* Array index: 0x1FAC */ 0x884A,0x6C36,
/* Array index: 0x1FAC */ 0x884B,0x704E,
/* Array index: 0x1FAC */ 0x884E,0x2D4C,
/* Array index: 0x1FAC */ 0x8852,0x3934,
/* Array index: 0x1FAC */ 0x8855,0x4028,
/* Array index: 0x1FAC */ 0x8856,0x4027,
/* Array index: 0x1FAC */ 0x885A,0x542A,
/* Array index: 0x1FAC */ 0x8867,0x2D4D,
/* Array index: 0x1FAC */ 0x8869,0x2D4F,
/* Array index: 0x1FAC */ 0x886A,0x2D4E,
/* Array index: 0x1FAC */ 0x886D,0x3273,
/* Array index: 0x1FAC */ 0x886F,0x327A,
/* Array index: 0x1FAC */ 0x8883,0x327B,
/* Array index: 0x1FAC */ 0x8889,0x3935,
/* Array index: 0x1FAC */ 0x888C,0x3945,
/* Array index: 0x1FAC */ 0x888E,0x3947,
/* Array index: 0x1FAC */ 0x8891,0x393B,
/* Array index: 0x1FAC */ 0x8893,0x3946,
/* Array index: 0x1FAC */ 0x889F,0x393D,
/* Array index: 0x1FAC */ 0x88A1,0x393C,
/* Array index: 0x1FAC */ 0x88A2,0x3938,
/* Array index: 0x1FAC */ 0x88A4,0x3943,
/* Array index: 0x1FAC */ 0x88A7,0x393F,
/* Array index: 0x1FAC */ 0x88A8,0x3937,
/* Array index: 0x1FAC */ 0x88AA,0x3939,
/* Array index: 0x1FAC */ 0x88AC,0x3944,
/* Array index: 0x1FAC */ 0x88B2,0x4033,
/* Array index: 0x1FAC */ 0x88D6,0x4738,
/* Array index: 0x1FAC */ 0x88D7,0x402A,
/* Array index: 0x1FAC */ 0x88DA,0x473E,
/* Array index: 0x1FAC */ 0x88DB,0x473D,
/* Array index: 0x1FAC */ 0x88DE,0x473C,
/* Array index: 0x1FAC */ 0x88E7,0x4D7D,
/* Array index: 0x1FAC */ 0x88EB,0x4E2A,
/* Array index: 0x1FAC */ 0x88EC,0x4E29,
/* Array index: 0x1FAC */ 0x8901,0x4034,
/* Array index: 0x1FAC */ 0x8905,0x542B,
/* Array index: 0x1FAC */ 0x8906,0x5432,
/* Array index: 0x1FAC */ 0x8909,0x5436,
/* Array index: 0x1FAC */ 0x890B,0x542E,
/* Array index: 0x1FAC */ 0x890C,0x542C,
/* Array index: 0x1FAC */ 0x890E,0x5435,
/* Array index: 0x1FAC */ 0x8911,0x5434,
/* Array index: 0x1FAC */ 0x891E,0x5A3E,
/* Array index: 0x1FAC */ 0x891F,0x5A4A,
/* Array index: 0x1FAC */ 0x8922,0x5A45,
/* Array index: 0x1FAC */ 0x8923,0x5A47,
/* Array index: 0x1FAC */ 0x8926,0x5A3F,
/* Array index: 0x1FAC */ 0x8927,0x5A43,
/* Array index: 0x1FAC */ 0x8929,0x5A46,
/* Array index: 0x1FAC */ 0x893C,0x5F41,
/* Array index: 0x1FAC */ 0x893E,0x5F42,
/* Array index: 0x1FAC */ 0x8941,0x5F43,
/* Array index: 0x1FAC */ 0x8942,0x5F46,
/* Array index: 0x1FAC */ 0x8946,0x6341,
/* Array index: 0x1FAC */ 0x8949,0x6344,
/* Array index: 0x1FAC */ 0x8966,0x6977,
/* Array index: 0x1FAC */ 0x8969,0x6C38,
/* Array index: 0x1FAC */ 0x896B,0x6C3A,
/* Array index: 0x1FAC */ 0x896D,0x6C37,
/* Array index: 0x1FAC */ 0x896E,0x6C39,
/* Array index: 0x1FAC */ 0x8971,0x6E21,
/* Array index: 0x1FAC */ 0x8973,0x6F4C,
/* Array index: 0x1FAC */ 0x8974,0x6F4B,
/* Array index: 0x1FAC */ 0x8976,0x6F4A,
/* Array index: 0x1FAC */ 0x8982,0x3948,
/* Array index: 0x1FAC */ 0x8985,0x4741,
/* Array index: 0x1FAC */ 0x8988,0x667D,
/* Array index: 0x1FAC */ 0x8995,0x4036,
/* Array index: 0x1FAC */ 0x8997,0x4038,
/* Array index: 0x1FAC */ 0x8998,0x4037,
/* Array index: 0x1FAC */ 0x89B6,0x6721,
/* Array index: 0x1FAC */ 0x89B7,0x667E,
/* Array index: 0x1FAC */ 0x89B9,0x6978,
/* Array index: 0x1FAC */ 0x89BE,0x6E23,
/* Array index: 0x1FAC */ 0x89BF,0x6E22,
/* Array index: 0x1FAC */ 0x89D3,0x2D50,
/* Array index: 0x1FAC */ 0x8A04,0x2D51,
/* Array index: 0x1FAC */ 0x8A07,0x2D52,
/* Array index: 0x1FAC */ 0x8A12,0x3321,
/* Array index: 0x1FAC */ 0x8A1E,0x394F,
/* Array index: 0x1FAC */ 0x8A27,0x394D,
/* Array index: 0x1FAC */ 0x8A2C,0x394E,
/* Array index: 0x1FAC */ 0x8A30,0x394C,
/* Array index: 0x1FAC */ 0x8A39,0x403E,
/* Array index: 0x1FAC */ 0x8A3F,0x474F,
/* Array index: 0x1FAC */ 0x8A40,0x4040,
/* Array index: 0x1FAC */ 0x8A44,0x4043,
/* Array index: 0x1FAC */ 0x8A45,0x4044,
/* Array index: 0x1FAC */ 0x8A48,0x4046,
/* Array index: 0x1FAC */ 0x8A61,0x474E,
/* Array index: 0x1FAC */ 0x8A7A,0x4757,
/* Array index: 0x1FAC */ 0x8A8B,0x4E34,
/* Array index: 0x1FAC */ 0x8A8F,0x4E36,
/* Array index: 0x1FAC */ 0x8A92,0x4E35,
/* Array index: 0x1FAC */ 0x8A96,0x4E37,
/* Array index: 0x1FAC */ 0x8A99,0x4E33,
/* Array index: 0x1FAC */ 0x8AAB,0x4E32,
/* Array index: 0x1FAC */ 0x8AB8,0x543F,
/* Array index: 0x1FAC */ 0x8AC3,0x544A,
/* Array index: 0x1FAC */ 0x8AC5,0x5448,
/* Array index: 0x1FAC */ 0x8AC6,0x543E,
/* Array index: 0x1FAC */ 0x8AC8,0x5A56,
/* Array index: 0x1FAC */ 0x8ACF,0x543D,
/* Array index: 0x1FAC */ 0x8AE8,0x5A59,
/* Array index: 0x1FAC */ 0x8AEF,0x5A5B,
/* Array index: 0x1FAC */ 0x8AF0,0x5A55,
/* Array index: 0x1FAC */ 0x8AF2,0x5A4E,
/* Array index: 0x1FAC */ 0x8AF4,0x5A4F,
/* Array index: 0x1FAC */ 0x8AF5,0x5A50,
/* Array index: 0x1FAC */ 0x8AFB,0x5A5C,
/* Array index: 0x1FAC */ 0x8AFF,0x5A5A,
/* Array index: 0x1FAC */ 0x8B0B,0x5F51,
/* Array index: 0x1FAC */ 0x8B0D,0x5F57,
/* Array index: 0x1FAC */ 0x8B2A,0x6345,
/* Array index: 0x1FAC */ 0x8B45,0x6C3E,
/* Array index: 0x1FAC */ 0x8B5D,0x697C,
/* Array index: 0x1FAC */ 0x8B60,0x697A,
/* Array index: 0x1FAC */ 0x8B63,0x697E,
/* Array index: 0x1FAC */ 0x8B65,0x6A21,
/* Array index: 0x1FAC */ 0x8B67,0x6A22,
/* Array index: 0x1FAC */ 0x8B68,0x697D,
/* Array index: 0x1FAC */ 0x8B6A,0x697B,
/* Array index: 0x1FAC */ 0x8B6D,0x6A23,
/* Array index: 0x1FAC */ 0x8B94,0x704F,
/* Array index: 0x1FAC */ 0x8B95,0x7050,
/* Array index: 0x1FAC */ 0x8B98,0x713C,
/* Array index: 0x1FAC */ 0x8B99,0x713D,
/* Array index: 0x1FAC */ 0x8B9E,0x7177,
/* Array index: 0x1FAC */ 0x8B9F,0x7236,
/* Array index: 0x1FAC */ 0x8C42,0x6359,
/* Array index: 0x1FAC */ 0x8C43,0x6730,
/* Array index: 0x1FAC */ 0x8C45,0x6F52,
/* Array index: 0x1FAC */ 0x8C47,0x3322,
/* Array index: 0x1FAC */ 0x8C4A,0x475A,
/* Array index: 0x1FAC */ 0x8C4B,0x4759,
/* Array index: 0x1FAC */ 0x8C4D,0x544F,
/* Array index: 0x1FAC */ 0x8C4F,0x5F5D,
/* Array index: 0x1FAC */ 0x8C56,0x286B,
/* Array index: 0x1FAC */ 0x8C57,0x3323,
/* Array index: 0x1FAC */ 0x8C5C,0x3952,
/* Array index: 0x1FAC */ 0x8C5D,0x3953,
/* Array index: 0x1FAC */ 0x8C5F,0x404B,
/* Array index: 0x1FAC */ 0x8C7B,0x3324,
/* Array index: 0x1FAC */ 0x8C7D,0x3954,
/* Array index: 0x1FAC */ 0x8CB0,0x4050,
/* Array index: 0x1FAC */ 0x8CB5,0x4052,
/* Array index: 0x1FAC */ 0x8CB9,0x4051,
/* Array index: 0x1FAC */ 0x8CBA,0x404E,
/* Array index: 0x1FAC */ 0x8CBE,0x404F,
/* Array index: 0x1FAC */ 0x8CCC,0x4761,
/* Array index: 0x1FAC */ 0x8CCF,0x4E3C,
/* Array index: 0x1FAC */ 0x8CD5,0x4E3B,
/* Array index: 0x1FAC */ 0x8CD7,0x4E3D,
/* Array index: 0x1FAC */ 0x8CD9,0x5453,
/* Array index: 0x1FAC */ 0x8CDA,0x5455,
/* Array index: 0x1FAC */ 0x8CDD,0x5456,
/* Array index: 0x1FAC */ 0x8CDF,0x5452,
/* Array index: 0x1FAC */ 0x8CE5,0x5451,
/* Array index: 0x1FAC */ 0x8CE7,0x5457,
/* Array index: 0x1FAC */ 0x8CE8,0x5454,
/* Array index: 0x1FAC */ 0x8CEE,0x5A61,
/* Array index: 0x1FAC */ 0x8CF0,0x5A63,
/* Array index: 0x1FAC */ 0x8CF1,0x5A62,
/* Array index: 0x1FAC */ 0x8CF3,0x5A64,
/* Array index: 0x1FAC */ 0x8CF5,0x5A60,
/* Array index: 0x1FAC */ 0x8CF9,0x5F64,
/* Array index: 0x1FAC */ 0x8CFE,0x635E,
/* Array index: 0x1FAC */ 0x8D00,0x6361,
/* Array index: 0x1FAC */ 0x8D02,0x6360,
/* Array index: 0x1FAC */ 0x8D04,0x635F,
/* Array index: 0x1FAC */ 0x8D06,0x6734,
/* Array index: 0x1FAC */ 0x8D07,0x6735,
/* Array index: 0x1FAC */ 0x8D09,0x6736,
/* Array index: 0x1FAC */ 0x8D10,0x6C41,
/* Array index: 0x1FAC */ 0x8D14,0x6C42,
/* Array index: 0x1FAC */ 0x8D15,0x6E2B,
/* Array index: 0x1FAC */ 0x8D19,0x6F53,
/* Array index: 0x1FAC */ 0x8D68,0x4762,
/* Array index: 0x1FAC */ 0x8D69,0x4763,
/* Array index: 0x1FAC */ 0x8D6C,0x5A65,
/* Array index: 0x1FAC */ 0x8D6E,0x5A66,
/* Array index: 0x1FAC */ 0x8D6F,0x5F65,
/* Array index: 0x1FAC */ 0x8D72,0x2D53,
/* Array index: 0x1FAC */ 0x8D76,0x3327,
/* Array index: 0x1FAC */ 0x8D78,0x3328,
/* Array index: 0x1FAC */ 0x8D79,0x3958,
/* Array index: 0x1FAC */ 0x8D7B,0x3957,
/* Array index: 0x1FAC */ 0x8D7D,0x3956,
/* Array index: 0x1FAC */ 0x8D80,0x4054,
/* Array index: 0x1FAC */ 0x8D84,0x4053,
/* Array index: 0x1FAC */ 0x8D89,0x4055,
/* Array index: 0x1FAC */ 0x8D9B,0x545B,
/* Array index: 0x1FAC */ 0x8D9C,0x5459,
/* Array index: 0x1FAC */ 0x8DA0,0x5458,
/* Array index: 0x1FAC */ 0x8DA1,0x545A,
/* Array index: 0x1FAC */ 0x8DA5,0x5A67,
/* Array index: 0x1FAC */ 0x8DA7,0x5A68,
/* Array index: 0x1FAC */ 0x8DB2,0x715E,
/* Array index: 0x1FAC */ 0x8DBC,0x3959,
/* Array index: 0x1FAC */ 0x8DBF,0x395C,
/* Array index: 0x1FAC */ 0x8DC1,0x395D,
/* Array index: 0x1FAC */ 0x8DC2,0x395A,
/* Array index: 0x1FAC */ 0x8DC5,0x4061,
/* Array index: 0x1FAC */ 0x8DC7,0x4059,
/* Array index: 0x1FAC */ 0x8DC8,0x405F,
/* Array index: 0x1FAC */ 0x8DCD,0x4058,
/* Array index: 0x1FAC */ 0x8DCF,0x405C,
/* Array index: 0x1FAC */ 0x8DD0,0x4772,
/* Array index: 0x1FAC */ 0x8DDC,0x405B,
/* Array index: 0x1FAC */ 0x8DE0,0x476E,
/* Array index: 0x1FAC */ 0x8DE2,0x4775,
/* Array index: 0x1FAC */ 0x8DE3,0x4774,
/* Array index: 0x1FAC */ 0x8DE7,0x4776,
/* Array index: 0x1FAC */ 0x8DE9,0x4773,
/* Array index: 0x1FAC */ 0x8DEB,0x4778,
/* Array index: 0x1FAC */ 0x8DEC,0x476F,
/* Array index: 0x1FAC */ 0x8E0D,0x4E42,
/* Array index: 0x1FAC */ 0x8E20,0x545C,
/* Array index: 0x1FAC */ 0x8E2E,0x5460,
/* Array index: 0x1FAC */ 0x8E30,0x5A72,
/* Array index: 0x1FAC */ 0x8E33,0x5A69,
/* Array index: 0x1FAC */ 0x8E36,0x5A6E,
/* Array index: 0x1FAC */ 0x8E38,0x5A6B,
/* Array index: 0x1FAC */ 0x8E45,0x5A6D,
/* Array index: 0x1FAC */ 0x8E47,0x5F6B,
/* Array index: 0x1FAC */ 0x8E65,0x6368,
/* Array index: 0x1FAC */ 0x8E67,0x6369,
/* Array index: 0x1FAC */ 0x8E69,0x636E,
/* Array index: 0x1FAC */ 0x8E6A,0x673E,
/* Array index: 0x1FAC */ 0x8E6D,0x673B,
/* Array index: 0x1FAC */ 0x8E6F,0x673F,
/* Array index: 0x1FAC */ 0x8E73,0x673D,
/* Array index: 0x1FAC */ 0x8E78,0x673C,
/* Array index: 0x1FAC */ 0x8E7B,0x6740,
/* Array index: 0x1FAC */ 0x8E84,0x6A27,
/* Array index: 0x1FAC */ 0x8E86,0x6A25,
/* Array index: 0x1FAC */ 0x8E88,0x6A26,
/* Array index: 0x1FAC */ 0x8E8C,0x6C45,
/* Array index: 0x1FAC */ 0x8E8E,0x6C44,
/* Array index: 0x1FAC */ 0x8E90,0x6E30,
/* Array index: 0x1FAC */ 0x8EBD,0x5A74,
/* Array index: 0x1FAC */ 0x8EC2,0x6741,
/* Array index: 0x1FAC */ 0x8EC9,0x717A,
/* Array index: 0x1FAC */ 0x8ED1,0x332C,
/* Array index: 0x1FAC */ 0x8ED3,0x332D,
/* Array index: 0x1FAC */ 0x8ED7,0x3962,
/* Array index: 0x1FAC */ 0x8ED8,0x395E,
/* Array index: 0x1FAC */ 0x8F0B,0x4824,
/* Array index: 0x1FAC */ 0x8F20,0x5473,
/* Array index: 0x1FAC */ 0x8F23,0x5474,
/* Array index: 0x1FAC */ 0x8F24,0x5470,
/* Array index: 0x1FAC */ 0x8F2C,0x546F,
/* Array index: 0x1FAC */ 0x8F2E,0x5A76,
/* Array index: 0x1FAC */ 0x8F40,0x5F6D,
/* Array index: 0x1FAC */ 0x8F43,0x5F6C,
/* Array index: 0x1FAC */ 0x8F4B,0x6373,
/* Array index: 0x1FAC */ 0x8FB4,0x6747,
/* Array index: 0x1FAC */ 0x8FBF,0x2526,
/* Array index: 0x1FAC */ 0x8FC9,0x2525,
/* Array index: 0x1FAC */ 0x8FCB,0x286D,
/* Array index: 0x1FAC */ 0x8FCD,0x286F,
/* Array index: 0x1FAC */ 0x8FE0,0x2D57,
/* Array index: 0x1FAC */ 0x8FE1,0x2D55,
/* Array index: 0x1FAC */ 0x8FE3,0x2D54,
/* Array index: 0x1FAC */ 0x8FEE,0x2D56,
/* Array index: 0x1FAC */ 0x8FF5,0x332F,
/* Array index: 0x1FAC */ 0x8FF6,0x3335,
/* Array index: 0x1FAC */ 0x9002,0x3330,
/* Array index: 0x1FAC */ 0x9004,0x3333,
/* Array index: 0x1FAC */ 0x900B,0x3966,
/* Array index: 0x1FAC */ 0x900C,0x3969,
/* Array index: 0x1FAC */ 0x9011,0x3967,
/* Array index: 0x1FAC */ 0x901C,0x3968,
/* Array index: 0x1FAC */ 0x9021,0x396A,
/* Array index: 0x1FAC */ 0x9024,0x3965,
/* Array index: 0x1FAC */ 0x902D,0x4072,
/* Array index: 0x1FAC */ 0x902F,0x4074,
/* Array index: 0x1FAC */ 0x9034,0x4073,
/* Array index: 0x1FAC */ 0x903D,0x4829,
/* Array index: 0x1FAC */ 0x903F,0x4826,
/* Array index: 0x1FAC */ 0x9044,0x4827,
/* Array index: 0x1FAC */ 0x9049,0x4828,
/* Array index: 0x1FAC */ 0x9052,0x4825,
/* Array index: 0x1FAC */ 0x9067,0x547A,
/* Array index: 0x1FAC */ 0x906B,0x547B,
/* Array index: 0x1FAC */ 0x906F,0x5479,
/* Array index: 0x1FAC */ 0x9070,0x5478,
/* Array index: 0x1FAC */ 0x9073,0x5477,
/* Array index: 0x1FAC */ 0x9076,0x5A7C,
/* Array index: 0x1FAC */ 0x9079,0x5A7D,
/* Array index: 0x1FAC */ 0x907B,0x5A7E,
/* Array index: 0x1FAC */ 0x907E,0x5F6F,
/* Array index: 0x1FAC */ 0x9085,0x5F6E,
/* Array index: 0x1FAC */ 0x9086,0x5B21,
/* Array index: 0x1FAC */ 0x908D,0x6A2E,
/* Array index: 0x1FAC */ 0x9094,0x2275,
/* Array index: 0x1FAC */ 0x90A5,0x2529,
/* Array index: 0x1FAC */ 0x90A7,0x252B,
/* Array index: 0x1FAC */ 0x90C5,0x2D5C,
/* Array index: 0x1FAC */ 0x90C7,0x2D5E,
/* Array index: 0x1FAC */ 0x90C8,0x2D60,
/* Array index: 0x1FAC */ 0x90CB,0x2D5F,
/* Array index: 0x1FAC */ 0x9114,0x482F,
/* Array index: 0x1FAC */ 0x9116,0x482E,
/* Array index: 0x1FAC */ 0x9153,0x3978,
/* Array index: 0x1FAC */ 0x9155,0x3979,
/* Array index: 0x1FAC */ 0x9156,0x3975,
/* Array index: 0x1FAC */ 0x9158,0x3976,
/* Array index: 0x1FAC */ 0x915A,0x3977,
/* Array index: 0x1FAC */ 0x9168,0x4279,
/* Array index: 0x1FAC */ 0x916E,0x4832,
/* Array index: 0x1FAC */ 0x916F,0x4833,
/* Array index: 0x1FAC */ 0x9172,0x4E5B,
/* Array index: 0x1FAC */ 0x9173,0x4E5D,
/* Array index: 0x1FAC */ 0x9179,0x4E5C,
/* Array index: 0x1FAC */ 0x917A,0x4E5A,
/* Array index: 0x1FAC */ 0x918A,0x5527,
/* Array index: 0x1FAC */ 0x91A5,0x6379,
/* Array index: 0x1FAC */ 0x91A7,0x637A,
/* Array index: 0x1FAC */ 0x91A8,0x6378,
/* Array index: 0x1FAC */ 0x91AA,0x637C,
/* Array index: 0x1FAC */ 0x91AD,0x674B,
/* Array index: 0x1FAC */ 0x91C2,0x7057,
/* Array index: 0x1FAC */ 0x91C3,0x7160,
/* Array index: 0x1FAC */ 0x91DA,0x3347,
/* Array index: 0x1FAC */ 0x91E2,0x3346,
/* Array index: 0x1FAC */ 0x91E4,0x3A21,
/* Array index: 0x1FAC */ 0x91F1,0x397C,
/* Array index: 0x1FAC */ 0x920A,0x412A,
/* Array index: 0x1FAC */ 0x920C,0x4130,
/* Array index: 0x1FAC */ 0x920F,0x412F,
/* Array index: 0x1FAC */ 0x9212,0x4132,
/* Array index: 0x1FAC */ 0x9236,0x4846,
/* Array index: 0x1FAC */ 0x923A,0x4837,
/* Array index: 0x1FAC */ 0x9246,0x483F,
/* Array index: 0x1FAC */ 0x9248,0x4834,
/* Array index: 0x1FAC */ 0x924A,0x483E,
/* Array index: 0x1FAC */ 0x925E,0x483B,
/* Array index: 0x1FAC */ 0x9260,0x4843,
/* Array index: 0x1FAC */ 0x9261,0x4847,
/* Array index: 0x1FAC */ 0x9276,0x4E60,
/* Array index: 0x1FAC */ 0x9294,0x4E64,
/* Array index: 0x1FAC */ 0x9295,0x4E71,
/* Array index: 0x1FAC */ 0x92EE,0x4E6E,
/* Array index: 0x1FAC */ 0x92EF,0x553A,
/* Array index: 0x1FAC */ 0x92F1,0x5533,
/* Array index: 0x1FAC */ 0x9306,0x5B2F,
/* Array index: 0x1FAC */ 0x932D,0x5B39,
/* Array index: 0x1FAC */ 0x9334,0x5B42,
/* Array index: 0x1FAC */ 0x9335,0x5B48,
/* Array index: 0x1FAC */ 0x9338,0x5B32,
/* Array index: 0x1FAC */ 0x9339,0x5B47,
/* Array index: 0x1FAC */ 0x933C,0x5B33,
/* Array index: 0x1FAC */ 0x9346,0x5B38,
/* Array index: 0x1FAC */ 0x9347,0x5F7E,
/* Array index: 0x1FAC */ 0x9349,0x6025,
/* Array index: 0x1FAC */ 0x935C,0x6023,
/* Array index: 0x1FAC */ 0x935E,0x6036,
/* Array index: 0x1FAC */ 0x9367,0x6038,
/* Array index: 0x1FAC */ 0x936A,0x602C,
/* Array index: 0x1FAC */ 0x936D,0x6029,
/* Array index: 0x1FAC */ 0x9371,0x6032,
/* Array index: 0x1FAC */ 0x9380,0x642F,
/* Array index: 0x1FAC */ 0x9383,0x5F7A,
/* Array index: 0x1FAC */ 0x9395,0x642B,
/* Array index: 0x1FAC */ 0x9399,0x642D,
/* Array index: 0x1FAC */ 0x93AF,0x5F7B,
/* Array index: 0x1FAC */ 0x93C0,0x675F,
/* Array index: 0x1FAC */ 0x93C2,0x674F,
/* Array index: 0x1FAC */ 0x93C4,0x675D,
/* Array index: 0x1FAC */ 0x93C7,0x674D,
/* Array index: 0x1FAC */ 0x93CA,0x6758,
/* Array index: 0x1FAC */ 0x93D9,0x6755,
/* Array index: 0x1FAC */ 0x93DA,0x6750,
/* Array index: 0x1FAC */ 0x93DE,0x674C,
/* Array index: 0x1FAC */ 0x93E3,0x675B,
/* Array index: 0x1FAC */ 0x93E6,0x6757,
/* Array index: 0x1FAC */ 0x93E7,0x6762,
/* Array index: 0x1FAC */ 0x93EC,0x6753,
/* Array index: 0x1FAC */ 0x93EE,0x675A,
/* Array index: 0x1FAC */ 0x9419,0x6A3F,
/* Array index: 0x1FAC */ 0x9420,0x6A38,
/* Array index: 0x1FAC */ 0x9430,0x6C52,
/* Array index: 0x1FAC */ 0x9431,0x6C58,
/* Array index: 0x1FAC */ 0x9436,0x6C4F,
/* Array index: 0x1FAC */ 0x9437,0x6C55,
/* Array index: 0x1FAC */ 0x9455,0x6F59,
/* Array index: 0x1FAC */ 0x9457,0x6F5B,
/* Array index: 0x1FAC */ 0x945D,0x6F5A,
/* Array index: 0x1FAC */ 0x945E,0x6F5C,
/* Array index: 0x1FAC */ 0x9462,0x6F58,
/* Array index: 0x1FAC */ 0x9468,0x7059,
/* Array index: 0x1FAC */ 0x9469,0x705A,
/* Array index: 0x1FAC */ 0x9586,0x3A29,
/* Array index: 0x1FAC */ 0x9588,0x3A2A,
/* Array index: 0x1FAC */ 0x958C,0x4141,
/* Array index: 0x1FAC */ 0x958D,0x4140,
/* Array index: 0x1FAC */ 0x9590,0x4142,
/* Array index: 0x1FAC */ 0x95AB,0x5550,
/* Array index: 0x1FAC */ 0x95AC,0x554F,
/* Array index: 0x1FAC */ 0x95AE,0x5551,
/* Array index: 0x1FAC */ 0x95B0,0x5552,
/* Array index: 0x1FAC */ 0x95C3,0x603E,
/* Array index: 0x1FAC */ 0x95C5,0x603F,
/* Array index: 0x1FAC */ 0x95C7,0x603B,
/* Array index: 0x1FAC */ 0x95C9,0x603D,
/* Array index: 0x1FAC */ 0x95CD,0x5B53,
/* Array index: 0x1FAC */ 0x961E,0x2169,
/* Array index: 0x1FAC */ 0x9628,0x252E,
/* Array index: 0x1FAC */ 0x962D,0x2530,
/* Array index: 0x1FAC */ 0x962F,0x252F,
/* Array index: 0x1FAC */ 0x9630,0x252D,
/* Array index: 0x1FAC */ 0x9643,0x287C,
/* Array index: 0x1FAC */ 0x964A,0x2D67,
/* Array index: 0x1FAC */ 0x964E,0x2D68,
/* Array index: 0x1FAC */ 0x964F,0x2D64,
/* Array index: 0x1FAC */ 0x9651,0x2D65,
/* Array index: 0x1FAC */ 0x9653,0x2D66,
/* Array index: 0x1FAC */ 0x9654,0x2D63,
/* Array index: 0x1FAC */ 0x965C,0x3348,
/* Array index: 0x1FAC */ 0x965F,0x3349,
/* Array index: 0x1FAC */ 0x966B,0x3A2D,
/* Array index: 0x1FAC */ 0x966D,0x3A2C,
/* Array index: 0x1FAC */ 0x966F,0x3A2F,
/* Array index: 0x1FAC */ 0x9671,0x3A2E,
/* Array index: 0x1FAC */ 0x967C,0x3A2B,
/* Array index: 0x1FAC */ 0x967E,0x4144,
/* Array index: 0x1FAC */ 0x9680,0x4148,
/* Array index: 0x1FAC */ 0x9683,0x4147,
/* Array index: 0x1FAC */ 0x9697,0x485A,
/* Array index: 0x1FAC */ 0x969E,0x4F23,
/* Array index: 0x1FAC */ 0x96A1,0x4F24,
/* Array index: 0x1FAC */ 0x96A2,0x5554,
/* Array index: 0x1FAC */ 0x96A4,0x5553,
/* Array index: 0x1FAC */ 0x96A9,0x5B5B,
/* Array index: 0x1FAC */ 0x96AC,0x6043,
/* Array index: 0x1FAC */ 0x96AE,0x6041,
/* Array index: 0x1FAC */ 0x96B0,0x6042,
/* Array index: 0x1FAC */ 0x96B3,0x643B,
/* Array index: 0x1FAC */ 0x96BC,0x334A,
/* Array index: 0x1FAC */ 0x96BF,0x3A30,
/* Array index: 0x1FAC */ 0x96C2,0x4149,
/* Array index: 0x1FAC */ 0x96C3,0x414B,
/* Array index: 0x1FAC */ 0x96C8,0x414A,
/* Array index: 0x1FAC */ 0x96CE,0x485B,
/* Array index: 0x1FAC */ 0x96D3,0x5555,
/* Array index: 0x1FAC */ 0x96D4,0x5B5C,
/* Array index: 0x1FAC */ 0x96D7,0x643C,
/* Array index: 0x1FAC */ 0x96D8,0x6440,
/* Array index: 0x1FAC */ 0x96DA,0x643D,
/* Array index: 0x1FAC */ 0x96DD,0x6441,
/* Array index: 0x1FAC */ 0x96DF,0x643F,
/* Array index: 0x1FAC */ 0x96E1,0x6766,
/* Array index: 0x1FAC */ 0x96E5,0x705B,
/* Array index: 0x1FAC */ 0x96F0,0x414D,
/* Array index: 0x1FAC */ 0x96F1,0x414C,
/* Array index: 0x1FAC */ 0x96F5,0x485F,
/* Array index: 0x1FAC */ 0x96F8,0x485E,
/* Array index: 0x1FAC */ 0x96FA,0x485C,
/* Array index: 0x1FAC */ 0x96FD,0x485D,
/* Array index: 0x1FAC */ 0x96FF,0x4F25,
/* Array index: 0x1FAC */ 0x9702,0x5558,
/* Array index: 0x1FAC */ 0x9705,0x5556,
/* Array index: 0x1FAC */ 0x9708,0x5557,
/* Array index: 0x1FAC */ 0x970B,0x5B5D,
/* Array index: 0x1FAC */ 0x9710,0x5B5F,
/* Array index: 0x1FAC */ 0x9712,0x5B5E,
/* Array index: 0x1FAC */ 0x9718,0x6046,
/* Array index: 0x1FAC */ 0x9719,0x6048,
/* Array index: 0x1FAC */ 0x971D,0x6047,
/* Array index: 0x1FAC */ 0x9735,0x6C5C,
/* Array index: 0x1FAC */ 0x973A,0x6C5D,
/* Array index: 0x1FAC */ 0x973F,0x6E40,
/* Array index: 0x1FAC */ 0x9743,0x705D,
/* Array index: 0x1FAC */ 0x9746,0x705C,
/* Array index: 0x1FAC */ 0x9747,0x705E,
/* Array index: 0x1FAC */ 0x9749,0x7146,
/* Array index: 0x1FAC */ 0x974B,0x717B,
/* Array index: 0x1FAC */ 0x9758,0x4F26,
/* Array index: 0x1FAC */ 0x975A,0x5559,
/* Array index: 0x1FAC */ 0x976A,0x3A31,
/* Array index: 0x1FAC */ 0x976C,0x414E,
/* Array index: 0x1FAC */ 0x976E,0x4150,
/* Array index: 0x1FAC */ 0x9770,0x414F,
/* Array index: 0x1FAC */ 0x9772,0x4863,
/* Array index: 0x1FAC */ 0x9773,0x4860,
/* Array index: 0x1FAC */ 0x9788,0x555C,
/* Array index: 0x1FAC */ 0x978A,0x555A,
/* Array index: 0x1FAC */ 0x978E,0x555B,
/* Array index: 0x1FAC */ 0x9794,0x5B62,
/* Array index: 0x1FAC */ 0x9797,0x5B61,
/* Array index: 0x1FAC */ 0x97B3,0x676C,
/* Array index: 0x1FAC */ 0x97B6,0x676E,
/* Array index: 0x1FAC */ 0x97B7,0x676D,
/* Array index: 0x1FAC */ 0x97B9,0x6A58,
/* Array index: 0x1FAC */ 0x97BB,0x6A59,
/* Array index: 0x1FAC */ 0x97BF,0x6C5E,
/* Array index: 0x1FAC */ 0x97C4,0x6F5D,
/* Array index: 0x1FAC */ 0x97C5,0x6F5E,
/* Array index: 0x1FAC */ 0x97C7,0x705F,
/* Array index: 0x1FAC */ 0x97F0,0x5B63,
/* Array index: 0x1FAC */ 0x97F1,0x6050,
/* Array index: 0x1FAC */ 0x97F8,0x5B64,
/* Array index: 0x1FAC */ 0x97FA,0x6451,
/* Array index: 0x1FAC */ 0x97FD,0x6A5A,
/* Array index: 0x1FAC */ 0x97FE,0x6A5B,
/* Array index: 0x1FAC */ 0x9800,0x6F5F,
/* Array index: 0x1FAC */ 0x9804,0x3A32,
/* Array index: 0x1FAC */ 0x9807,0x4151,
/* Array index: 0x1FAC */ 0x9816,0x4F33,
/* Array index: 0x1FAC */ 0x981B,0x5565,
/* Array index: 0x1FAC */ 0x981D,0x5560,
/* Array index: 0x1FAC */ 0x981E,0x555F,
/* Array index: 0x1FAC */ 0x9820,0x5564,
/* Array index: 0x1FAC */ 0x982F,0x5B66,
/* Array index: 0x1FAC */ 0x9832,0x5B67,
/* Array index: 0x1FAC */ 0x9835,0x5B65,
/* Array index: 0x1FAC */ 0x9857,0x6775,
/* Array index: 0x1FAC */ 0x9859,0x6773,
/* Array index: 0x1FAC */ 0x9869,0x6E43,
/* Array index: 0x1FAC */ 0x986A,0x6E42,
/* Array index: 0x1FAC */ 0x98A9,0x4152,
/* Array index: 0x1FAC */ 0x98B2,0x5567,
/* Array index: 0x1FAC */ 0x98B8,0x6455,
/* Array index: 0x1FAC */ 0x98C6,0x6C62,
/* Array index: 0x1FAC */ 0x98C9,0x6C61,
/* Array index: 0x1FAC */ 0x98CB,0x6E44,
/* Array index: 0x1FAC */ 0x98CC,0x717E,
/* Array index: 0x1FAC */ 0x98E3,0x334B,
/* Array index: 0x1FAC */ 0x98E5,0x3A33,
/* Array index: 0x1FAC */ 0x98EB,0x4153,
/* Array index: 0x1FAC */ 0x98F6,0x4868,
/* Array index: 0x1FAC */ 0x98F9,0x4869,
/* Array index: 0x1FAC */ 0x98FA,0x5569,
/* Array index: 0x1FAC */ 0x9900,0x4F37,
/* Array index: 0x1FAC */ 0x9902,0x4F36,
/* Array index: 0x1FAC */ 0x9907,0x4F38,
/* Array index: 0x1FAC */ 0x9908,0x5568,
/* Array index: 0x1FAC */ 0x9911,0x556A,
/* Array index: 0x1FAC */ 0x991F,0x5B69,
/* Array index: 0x1FAC */ 0x9924,0x5B68,
/* Array index: 0x1FAC */ 0x9925,0x6057,
/* Array index: 0x1FAC */ 0x993A,0x6458,
/* Array index: 0x1FAC */ 0x993C,0x6457,
/* Array index: 0x1FAC */ 0x9941,0x6456,
/* Array index: 0x1FAC */ 0x9943,0x677C,
/* Array index: 0x1FAC */ 0x9947,0x677B,
/* Array index: 0x1FAC */ 0x9948,0x677A,
/* Array index: 0x1FAC */ 0x994B,0x6A66,
/* Array index: 0x1FAC */ 0x994C,0x6A65,
/* Array index: 0x1FAC */ 0x994E,0x6A63,
/* Array index: 0x1FAC */ 0x9950,0x6A62,
/* Array index: 0x1FAC */ 0x9953,0x6A67,
/* Array index: 0x1FAC */ 0x9954,0x6E45,
/* Array index: 0x1FAC */ 0x9956,0x6C65,
/* Array index: 0x1FAC */ 0x9958,0x6C64,
/* Array index: 0x1FAC */ 0x9959,0x6A64,
/* Array index: 0x1FAC */ 0x995B,0x6E46,
/* Array index: 0x1FAC */ 0x995F,0x7148,
/* Array index: 0x1FAC */ 0x9961,0x7221,
/* Array index: 0x1FAC */ 0x9997,0x3A34,
/* Array index: 0x1FAC */ 0x9998,0x6061,
/* Array index: 0x1FAC */ 0x99A1,0x6063,
/* Array index: 0x1FAC */ 0x99A3,0x6062,
/* Array index: 0x1FAC */ 0x99A6,0x677D,
/* Array index: 0x1FAC */ 0x99A7,0x677E,
/* Array index: 0x1FAC */ 0x99AB,0x7222,
/* Array index: 0x1FAC */ 0x99AF,0x486A,
/* Array index: 0x1FAC */ 0x99B0,0x486C,
/* Array index: 0x1FAC */ 0x99B2,0x486B,
/* Array index: 0x1FAC */ 0x99B5,0x486D,
/* Array index: 0x1FAC */ 0x99C2,0x4F3F,
/* Array index: 0x1FAC */ 0x99C3,0x4F3B,
/* Array index: 0x1FAC */ 0x99C7,0x4F41,
/* Array index: 0x1FAC */ 0x99DC,0x556F,
/* Array index: 0x1FAC */ 0x9A3D,0x6C67,
/* Array index: 0x1FAC */ 0x9A3F,0x6C6D,
/* Array index: 0x1FAC */ 0x9A41,0x6C6B,
/* Array index: 0x1FAC */ 0x9A42,0x6C6A,
/* Array index: 0x1FAC */ 0x9A44,0x6C69,
/* Array index: 0x1FAC */ 0x9A59,0x6F61,
/* Array index: 0x1FAC */ 0x9A5E,0x7061,
/* Array index: 0x1FAC */ 0x9A60,0x7165,
/* Array index: 0x1FAC */ 0x9AAB,0x486F,
/* Array index: 0x1FAC */ 0x9AAD,0x486E,
/* Array index: 0x1FAC */ 0x9AB1,0x4F42,
/* Array index: 0x1FAC */ 0x9AB3,0x557B,
/* Array index: 0x1FAC */ 0x9AB4,0x5B78,
/* Array index: 0x1FAC */ 0x9AB9,0x5B76,
/* Array index: 0x1FAC */ 0x9ABB,0x5B79,
/* Array index: 0x1FAC */ 0x9AC6,0x6A74,
/* Array index: 0x1FAC */ 0x9AC7,0x6A72,
/* Array index: 0x1FAC */ 0x9ACA,0x6A73,
/* Array index: 0x1FAC */ 0x9ACD,0x6C6E,
/* Array index: 0x1FAC */ 0x9AD0,0x6E51,
/* Array index: 0x1FAC */ 0x9AD5,0x7062,
/* Array index: 0x1FAC */ 0x9ADC,0x6464,
/* Array index: 0x1FAC */ 0x9ADF,0x334C,
/* Array index: 0x1FAC */ 0x9AE3,0x4F43,
/* Array index: 0x1FAC */ 0x9AE7,0x4F44,
/* Array index: 0x1FAC */ 0x9AEB,0x557D,
/* Array index: 0x1FAC */ 0x9AEC,0x557C,
/* Array index: 0x1FAC */ 0x9B01,0x6073,
/* Array index: 0x1FAC */ 0x9B04,0x6466,
/* Array index: 0x1FAC */ 0x9B05,0x6467,
/* Array index: 0x1FAC */ 0x9B24,0x7226,
/* Array index: 0x1FAC */ 0x9B29,0x6468,
/* Array index: 0x1FAC */ 0x9B2B,0x6E53,
/* Array index: 0x1FAC */ 0x9B2E,0x7166,
/* Array index: 0x1FAC */ 0x9B2F,0x334D,
/* Array index: 0x1FAC */ 0x9B33,0x5B7E,
/* Array index: 0x1FAC */ 0x9B35,0x6469,
/* Array index: 0x1FAC */ 0x9B37,0x6833,
/* Array index: 0x1FAC */ 0x9B3A,0x6C73,
/* Array index: 0x1FAC */ 0x9B3B,0x6E54,
/* Array index: 0x1FAC */ 0x9B3E,0x4F45,
/* Array index: 0x1FAC */ 0x9B3F,0x4F46,
/* Array index: 0x1FAC */ 0x9B43,0x5624,
/* Array index: 0x1FAC */ 0x9B46,0x5623,
/* Array index: 0x1FAC */ 0x9B52,0x6C74,
/* Array index: 0x1FAC */ 0x9B55,0x6E56,
/* Array index: 0x1FAC */ 0x9B56,0x6E55,
/* Array index: 0x1FAC */ 0x9B59,0x7063,
/* Array index: 0x1FAC */ 0x9B5B,0x4870,
/* Array index: 0x1FAC */ 0x9B6C,0x562E,
/* Array index: 0x1FAC */ 0x9B90,0x5C2A,
/* Array index: 0x1FAC */ 0x9B92,0x5C29,
/* Array index: 0x1FAC */ 0x9B93,0x5C28,
/* Array index: 0x1FAC */ 0x9B95,0x5C2C,
/* Array index: 0x1FAC */ 0x9B9A,0x6076,
/* Array index: 0x1FAC */ 0x9B9B,0x6079,
/* Array index: 0x1FAC */ 0x9BAF,0x6123,
/* Array index: 0x1FAC */ 0x9BBD,0x6478,
/* Array index: 0x1FAC */ 0x9BBF,0x6470,
/* Array index: 0x1FAC */ 0x9BC1,0x6471,
/* Array index: 0x1FAC */ 0x9BF0,0x683B,
/* Array index: 0x1FAC */ 0x9BF7,0x6A7A,
/* Array index: 0x1FAC */ 0x9BF8,0x6A7D,
/* Array index: 0x1FAC */ 0x9C0E,0x6B22,
/* Array index: 0x1FAC */ 0x9C12,0x6A7C,
/* Array index: 0x1FAC */ 0x9C14,0x6B25,
/* Array index: 0x1FAC */ 0x9C17,0x6B24,
/* Array index: 0x1FAC */ 0x9C1C,0x6C77,
/* Array index: 0x1FAC */ 0x9C1D,0x6C76,
/* Array index: 0x1FAC */ 0x9C21,0x6C7D,
/* Array index: 0x1FAC */ 0x9C23,0x6C79,
/* Array index: 0x1FAC */ 0x9C24,0x6C7C,
/* Array index: 0x1FAC */ 0x9C44,0x6E5A,
/* Array index: 0x1FAC */ 0x9C46,0x6E57,
/* Array index: 0x1FAC */ 0x9C55,0x6F6B,
/* Array index: 0x1FAC */ 0x9C58,0x6F66,
/* Array index: 0x1FAC */ 0x9C59,0x6F6C,
/* Array index: 0x1FAC */ 0x9C5E,0x7068,
/* Array index: 0x1FAC */ 0x9C60,0x7069,
/* Array index: 0x1FAC */ 0x9C6D,0x714B,
/* Array index: 0x1FAC */ 0x9C6E,0x714A,
/* Array index: 0x1FAC */ 0x9C79,0x7238,
/* Array index: 0x1FAC */ 0x9C7A,0x723C,
/* Array index: 0x1FAC */ 0x9CE6,0x4154,
/* Array index: 0x1FAC */ 0x9CE7,0x4873,
/* Array index: 0x1FAC */ 0x9CEA,0x4871,
/* Array index: 0x1FAC */ 0x9CED,0x4872,
/* Array index: 0x1FAC */ 0x9CF1,0x4F4A,
/* Array index: 0x1FAC */ 0x9CF2,0x4F4B,
/* Array index: 0x1FAC */ 0x9CF5,0x4F4C,
/* Array index: 0x1FAC */ 0x9D10,0x5C38,
/* Array index: 0x1FAC */ 0x9D14,0x5C33,
/* Array index: 0x1FAC */ 0x9D25,0x5C2F,
/* Array index: 0x1FAC */ 0x9D29,0x5C34,
/* Array index: 0x1FAC */ 0x9D4F,0x647B,
/* Array index: 0x1FAC */ 0x9D5F,0x6527,
/* Array index: 0x1FAC */ 0x9D90,0x6B2D,
/* Array index: 0x1FAC */ 0x9D92,0x6B2B,
/* Array index: 0x1FAC */ 0x9E1D,0x723D,
/* Array index: 0x1FAC */ 0x9E7A,0x6D37,
/* Array index: 0x1FAC */ 0x9E80,0x4874,
/* Array index: 0x1FAC */ 0x9E83,0x563B,
/* Array index: 0x1FAC */ 0x9E91,0x6860,
/* Array index: 0x1FAC */ 0x9E94,0x685F,
/* Array index: 0x1FAC */ 0x9EA0,0x7076,
/* Array index: 0x1FAC */ 0x9EA1,0x7152,
/* Array index: 0x1FAC */ 0x9EA4,0x7241,
/* Array index: 0x1FAC */ 0x9EA7,0x4F4D,
/* Array index: 0x1FAC */ 0x9EAD,0x5C3F,
/* Array index: 0x1FAC */ 0x9EAE,0x5C3E,
/* Array index: 0x1FAC */ 0x9EB0,0x6139,
/* Array index: 0x1FAC */ 0x9EB6,0x6E74,
/* Array index: 0x1FAC */ 0x9EB7,0x7239,
/* Array index: 0x1FAC */ 0x9EC0,0x6861,
/* Array index: 0x1FAC */ 0x9EC2,0x7024,
/* Array index: 0x1FAC */ 0x9EC8,0x613A,
/* Array index: 0x1FAC */ 0x9ED0,0x7025,
/* Array index: 0x1FAC */ 0x9ED3,0x563C,
/* Array index: 0x1FAC */ 0x9ED5,0x5C40,
/* Array index: 0x1FAC */ 0x9ED6,0x5C41,
/* Array index: 0x1FAC */ 0x9EDA,0x613B,
/* Array index: 0x1FAC */ 0x9EDF,0x652C,
/* Array index: 0x1FAC */ 0x9EEB,0x6D39,
/* Array index: 0x1FAC */ 0x9EED,0x6D3B,
/* Array index: 0x1FAC */ 0x9EEE,0x6D3A,
/* Array index: 0x1FAC */ 0x9EF0,0x6E75,
/* Array index: 0x1FAC */ 0x9F06,0x7028,
/* Array index: 0x1FAC */ 0x9F09,0x7154,
/* Array index: 0x1FAC */ 0x9F0A,0x716E,
/* Array index: 0x1FAC */ 0x9F0F,0x563D,
/* Array index: 0x1FAC */ 0x9F10,0x563E,
/* Array index: 0x1FAC */ 0x9F12,0x5C43,
/* Array index: 0x1FAC */ 0x9F16,0x652F,
/* Array index: 0x1FAC */ 0x9F3D,0x5C44,
/* Array index: 0x1FAC */ 0x9F64,0x6D42,
/* Array index: 0x1FAC */ 0x9F65,0x6D41,
/* Array index: 0x1FAC */ 0x9F6B,0x6E7A,
/* Array index: 0x1FAC */ 0x9F7E,0x7242,
/* Array index: 0x1FAC */ 0x9F91,0x6B4D,
/* Array index: 0x1FAC */ 0x9F92,0x6D43,
/* Array index: 0x1FAC */ 0x9F95,0x6E7B,
/* Array index: 0x1FAC */ 0x9F98,0x7244,
/* Array index: 0x1FAC */ 0x9FA0,0x6142,
/* Array index: 0x1FAC */ 0x9FA2,0x6E7C,
/* Array index: 0x1FAC */ 0x9FA4,0x716F,
};
#endif /* ICONV_FROM_UCS_CCS_CNS11643_PLANE2 && defined (TABLE_USE_SIZE_OPTIMIZATION) */
/*
* cns11643_plane2 CCS description table.
* ======================================================================
*/
_CONST iconv_ccs_t
_iconv_ccs_cns11643_plane2 =
{
TABLE_VERSION_1, /* Table version */
ICONV_CCS_CNS11643_PLANE2, /* CCS name */
TABLE_16BIT, /* Table bits */
#if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) \
&& (defined (TABLE_USE_SIZE_OPTIMIZATION))
TABLE_SIZE_OPTIMIZED,
(__uint16_t *)&from_ucs_size_cns11643_plane2, /* UCS -> cns11643_plane2 table size-optimized table */
#elif defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) \
&& !(defined (TABLE_USE_SIZE_OPTIMIZATION))
TABLE_SPEED_OPTIMIZED,
(__uint16_t *)&from_ucs_speed_cns11643_plane2, /* UCS -> cns11643_plane2 table speed-optimized table */
#else
TABLE_SPEED_OPTIMIZED,
(__uint16_t *)NULL,
#endif
#if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \
&& (defined (TABLE_USE_SIZE_OPTIMIZATION))
TABLE_SIZE_OPTIMIZED,
(__uint16_t *)&to_ucs_size_cns11643_plane2 /* cns11643_plane2 -> UCS table speed-optimized table */
#elif defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \
&& !(defined (TABLE_USE_SIZE_OPTIMIZATION))
TABLE_SPEED_OPTIMIZED,
(__uint16_t *)&to_ucs_speed_cns11643_plane2 /* cns11643_plane2 -> UCS table speed-optimized table */
#else
TABLE_SPEED_OPTIMIZED,
(__uint16_t *)NULL,
#endif
};
#endif /* ICONV_TO_UCS_CCS_CNS11643_PLANE2) || ... */
| bsd-3-clause |
eugene1g/phantomjs | src/qt/qtwebkit/Source/WebKit2/Shared/API/c/cg/WKGraphicsContextCG.cpp | 144 | 1644 | /*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WKGraphicsContextCG.h"
#include "WKSharedAPICast.h"
#include "WebGraphicsContext.h"
using namespace WebKit;
CGContextRef WKGraphicsContextGetCGContext(WKGraphicsContextRef graphicsContextRef)
{
return toImpl(graphicsContextRef)->platformContext();
}
| bsd-3-clause |
mostsun1987/codis | extern/redis-2.8.13/deps/hiredis/async.c | 151 | 22288 | /*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2010-2011, Pieter Noordhuis <pcnoordhuis at gmail dot com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "fmacros.h"
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include "async.h"
#include "net.h"
#include "dict.c"
#include "sds.h"
#define _EL_ADD_READ(ctx) do { \
if ((ctx)->ev.addRead) (ctx)->ev.addRead((ctx)->ev.data); \
} while(0)
#define _EL_DEL_READ(ctx) do { \
if ((ctx)->ev.delRead) (ctx)->ev.delRead((ctx)->ev.data); \
} while(0)
#define _EL_ADD_WRITE(ctx) do { \
if ((ctx)->ev.addWrite) (ctx)->ev.addWrite((ctx)->ev.data); \
} while(0)
#define _EL_DEL_WRITE(ctx) do { \
if ((ctx)->ev.delWrite) (ctx)->ev.delWrite((ctx)->ev.data); \
} while(0)
#define _EL_CLEANUP(ctx) do { \
if ((ctx)->ev.cleanup) (ctx)->ev.cleanup((ctx)->ev.data); \
} while(0);
/* Forward declaration of function in hiredis.c */
void __redisAppendCommand(redisContext *c, char *cmd, size_t len);
/* Functions managing dictionary of callbacks for pub/sub. */
static unsigned int callbackHash(const void *key) {
return dictGenHashFunction((const unsigned char *)key,
sdslen((const sds)key));
}
static void *callbackValDup(void *privdata, const void *src) {
((void) privdata);
redisCallback *dup = malloc(sizeof(*dup));
memcpy(dup,src,sizeof(*dup));
return dup;
}
static int callbackKeyCompare(void *privdata, const void *key1, const void *key2) {
int l1, l2;
((void) privdata);
l1 = sdslen((const sds)key1);
l2 = sdslen((const sds)key2);
if (l1 != l2) return 0;
return memcmp(key1,key2,l1) == 0;
}
static void callbackKeyDestructor(void *privdata, void *key) {
((void) privdata);
sdsfree((sds)key);
}
static void callbackValDestructor(void *privdata, void *val) {
((void) privdata);
free(val);
}
static dictType callbackDict = {
callbackHash,
NULL,
callbackValDup,
callbackKeyCompare,
callbackKeyDestructor,
callbackValDestructor
};
static redisAsyncContext *redisAsyncInitialize(redisContext *c) {
redisAsyncContext *ac;
ac = realloc(c,sizeof(redisAsyncContext));
if (ac == NULL)
return NULL;
c = &(ac->c);
/* The regular connect functions will always set the flag REDIS_CONNECTED.
* For the async API, we want to wait until the first write event is
* received up before setting this flag, so reset it here. */
c->flags &= ~REDIS_CONNECTED;
ac->err = 0;
ac->errstr = NULL;
ac->data = NULL;
ac->ev.data = NULL;
ac->ev.addRead = NULL;
ac->ev.delRead = NULL;
ac->ev.addWrite = NULL;
ac->ev.delWrite = NULL;
ac->ev.cleanup = NULL;
ac->onConnect = NULL;
ac->onDisconnect = NULL;
ac->replies.head = NULL;
ac->replies.tail = NULL;
ac->sub.invalid.head = NULL;
ac->sub.invalid.tail = NULL;
ac->sub.channels = dictCreate(&callbackDict,NULL);
ac->sub.patterns = dictCreate(&callbackDict,NULL);
return ac;
}
/* We want the error field to be accessible directly instead of requiring
* an indirection to the redisContext struct. */
static void __redisAsyncCopyError(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
ac->err = c->err;
ac->errstr = c->errstr;
}
redisAsyncContext *redisAsyncConnect(const char *ip, int port) {
redisContext *c;
redisAsyncContext *ac;
c = redisConnectNonBlock(ip,port);
if (c == NULL)
return NULL;
ac = redisAsyncInitialize(c);
if (ac == NULL) {
redisFree(c);
return NULL;
}
__redisAsyncCopyError(ac);
return ac;
}
redisAsyncContext *redisAsyncConnectBind(const char *ip, int port,
const char *source_addr) {
redisContext *c = redisConnectBindNonBlock(ip,port,source_addr);
redisAsyncContext *ac = redisAsyncInitialize(c);
__redisAsyncCopyError(ac);
return ac;
}
redisAsyncContext *redisAsyncConnectUnix(const char *path) {
redisContext *c;
redisAsyncContext *ac;
c = redisConnectUnixNonBlock(path);
if (c == NULL)
return NULL;
ac = redisAsyncInitialize(c);
if (ac == NULL) {
redisFree(c);
return NULL;
}
__redisAsyncCopyError(ac);
return ac;
}
int redisAsyncSetConnectCallback(redisAsyncContext *ac, redisConnectCallback *fn) {
if (ac->onConnect == NULL) {
ac->onConnect = fn;
/* The common way to detect an established connection is to wait for
* the first write event to be fired. This assumes the related event
* library functions are already set. */
_EL_ADD_WRITE(ac);
return REDIS_OK;
}
return REDIS_ERR;
}
int redisAsyncSetDisconnectCallback(redisAsyncContext *ac, redisDisconnectCallback *fn) {
if (ac->onDisconnect == NULL) {
ac->onDisconnect = fn;
return REDIS_OK;
}
return REDIS_ERR;
}
/* Helper functions to push/shift callbacks */
static int __redisPushCallback(redisCallbackList *list, redisCallback *source) {
redisCallback *cb;
/* Copy callback from stack to heap */
cb = malloc(sizeof(*cb));
if (cb == NULL)
return REDIS_ERR_OOM;
if (source != NULL) {
memcpy(cb,source,sizeof(*cb));
cb->next = NULL;
}
/* Store callback in list */
if (list->head == NULL)
list->head = cb;
if (list->tail != NULL)
list->tail->next = cb;
list->tail = cb;
return REDIS_OK;
}
static int __redisShiftCallback(redisCallbackList *list, redisCallback *target) {
redisCallback *cb = list->head;
if (cb != NULL) {
list->head = cb->next;
if (cb == list->tail)
list->tail = NULL;
/* Copy callback from heap to stack */
if (target != NULL)
memcpy(target,cb,sizeof(*cb));
free(cb);
return REDIS_OK;
}
return REDIS_ERR;
}
static void __redisRunCallback(redisAsyncContext *ac, redisCallback *cb, redisReply *reply) {
redisContext *c = &(ac->c);
if (cb->fn != NULL) {
c->flags |= REDIS_IN_CALLBACK;
cb->fn(ac,reply,cb->privdata);
c->flags &= ~REDIS_IN_CALLBACK;
}
}
/* Helper function to free the context. */
static void __redisAsyncFree(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
redisCallback cb;
dictIterator *it;
dictEntry *de;
/* Execute pending callbacks with NULL reply. */
while (__redisShiftCallback(&ac->replies,&cb) == REDIS_OK)
__redisRunCallback(ac,&cb,NULL);
/* Execute callbacks for invalid commands */
while (__redisShiftCallback(&ac->sub.invalid,&cb) == REDIS_OK)
__redisRunCallback(ac,&cb,NULL);
/* Run subscription callbacks callbacks with NULL reply */
it = dictGetIterator(ac->sub.channels);
while ((de = dictNext(it)) != NULL)
__redisRunCallback(ac,dictGetEntryVal(de),NULL);
dictReleaseIterator(it);
dictRelease(ac->sub.channels);
it = dictGetIterator(ac->sub.patterns);
while ((de = dictNext(it)) != NULL)
__redisRunCallback(ac,dictGetEntryVal(de),NULL);
dictReleaseIterator(it);
dictRelease(ac->sub.patterns);
/* Signal event lib to clean up */
_EL_CLEANUP(ac);
/* Execute disconnect callback. When redisAsyncFree() initiated destroying
* this context, the status will always be REDIS_OK. */
if (ac->onDisconnect && (c->flags & REDIS_CONNECTED)) {
if (c->flags & REDIS_FREEING) {
ac->onDisconnect(ac,REDIS_OK);
} else {
ac->onDisconnect(ac,(ac->err == 0) ? REDIS_OK : REDIS_ERR);
}
}
/* Cleanup self */
redisFree(c);
}
/* Free the async context. When this function is called from a callback,
* control needs to be returned to redisProcessCallbacks() before actual
* free'ing. To do so, a flag is set on the context which is picked up by
* redisProcessCallbacks(). Otherwise, the context is immediately free'd. */
void redisAsyncFree(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
c->flags |= REDIS_FREEING;
if (!(c->flags & REDIS_IN_CALLBACK))
__redisAsyncFree(ac);
}
/* Helper function to make the disconnect happen and clean up. */
static void __redisAsyncDisconnect(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
/* Make sure error is accessible if there is any */
__redisAsyncCopyError(ac);
if (ac->err == 0) {
/* For clean disconnects, there should be no pending callbacks. */
assert(__redisShiftCallback(&ac->replies,NULL) == REDIS_ERR);
} else {
/* Disconnection is caused by an error, make sure that pending
* callbacks cannot call new commands. */
c->flags |= REDIS_DISCONNECTING;
}
/* For non-clean disconnects, __redisAsyncFree() will execute pending
* callbacks with a NULL-reply. */
__redisAsyncFree(ac);
}
/* Tries to do a clean disconnect from Redis, meaning it stops new commands
* from being issued, but tries to flush the output buffer and execute
* callbacks for all remaining replies. When this function is called from a
* callback, there might be more replies and we can safely defer disconnecting
* to redisProcessCallbacks(). Otherwise, we can only disconnect immediately
* when there are no pending callbacks. */
void redisAsyncDisconnect(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
c->flags |= REDIS_DISCONNECTING;
if (!(c->flags & REDIS_IN_CALLBACK) && ac->replies.head == NULL)
__redisAsyncDisconnect(ac);
}
static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply, redisCallback *dstcb) {
redisContext *c = &(ac->c);
dict *callbacks;
dictEntry *de;
int pvariant;
char *stype;
sds sname;
/* Custom reply functions are not supported for pub/sub. This will fail
* very hard when they are used... */
if (reply->type == REDIS_REPLY_ARRAY) {
assert(reply->elements >= 2);
assert(reply->element[0]->type == REDIS_REPLY_STRING);
stype = reply->element[0]->str;
pvariant = (tolower(stype[0]) == 'p') ? 1 : 0;
if (pvariant)
callbacks = ac->sub.patterns;
else
callbacks = ac->sub.channels;
/* Locate the right callback */
assert(reply->element[1]->type == REDIS_REPLY_STRING);
sname = sdsnewlen(reply->element[1]->str,reply->element[1]->len);
de = dictFind(callbacks,sname);
if (de != NULL) {
memcpy(dstcb,dictGetEntryVal(de),sizeof(*dstcb));
/* If this is an unsubscribe message, remove it. */
if (strcasecmp(stype+pvariant,"unsubscribe") == 0) {
dictDelete(callbacks,sname);
/* If this was the last unsubscribe message, revert to
* non-subscribe mode. */
assert(reply->element[2]->type == REDIS_REPLY_INTEGER);
if (reply->element[2]->integer == 0)
c->flags &= ~REDIS_SUBSCRIBED;
}
}
sdsfree(sname);
} else {
/* Shift callback for invalid commands. */
__redisShiftCallback(&ac->sub.invalid,dstcb);
}
return REDIS_OK;
}
void redisProcessCallbacks(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
redisCallback cb = {NULL, NULL, NULL};
void *reply = NULL;
int status;
while((status = redisGetReply(c,&reply)) == REDIS_OK) {
if (reply == NULL) {
/* When the connection is being disconnected and there are
* no more replies, this is the cue to really disconnect. */
if (c->flags & REDIS_DISCONNECTING && sdslen(c->obuf) == 0) {
__redisAsyncDisconnect(ac);
return;
}
/* If monitor mode, repush callback */
if(c->flags & REDIS_MONITORING) {
__redisPushCallback(&ac->replies,&cb);
}
/* When the connection is not being disconnected, simply stop
* trying to get replies and wait for the next loop tick. */
break;
}
/* Even if the context is subscribed, pending regular callbacks will
* get a reply before pub/sub messages arrive. */
if (__redisShiftCallback(&ac->replies,&cb) != REDIS_OK) {
/*
* A spontaneous reply in a not-subscribed context can be the error
* reply that is sent when a new connection exceeds the maximum
* number of allowed connections on the server side.
*
* This is seen as an error instead of a regular reply because the
* server closes the connection after sending it.
*
* To prevent the error from being overwritten by an EOF error the
* connection is closed here. See issue #43.
*
* Another possibility is that the server is loading its dataset.
* In this case we also want to close the connection, and have the
* user wait until the server is ready to take our request.
*/
if (((redisReply*)reply)->type == REDIS_REPLY_ERROR) {
c->err = REDIS_ERR_OTHER;
snprintf(c->errstr,sizeof(c->errstr),"%s",((redisReply*)reply)->str);
__redisAsyncDisconnect(ac);
return;
}
/* No more regular callbacks and no errors, the context *must* be subscribed or monitoring. */
assert((c->flags & REDIS_SUBSCRIBED || c->flags & REDIS_MONITORING));
if(c->flags & REDIS_SUBSCRIBED)
__redisGetSubscribeCallback(ac,reply,&cb);
}
if (cb.fn != NULL) {
__redisRunCallback(ac,&cb,reply);
c->reader->fn->freeObject(reply);
/* Proceed with free'ing when redisAsyncFree() was called. */
if (c->flags & REDIS_FREEING) {
__redisAsyncFree(ac);
return;
}
} else {
/* No callback for this reply. This can either be a NULL callback,
* or there were no callbacks to begin with. Either way, don't
* abort with an error, but simply ignore it because the client
* doesn't know what the server will spit out over the wire. */
c->reader->fn->freeObject(reply);
}
}
/* Disconnect when there was an error reading the reply */
if (status != REDIS_OK)
__redisAsyncDisconnect(ac);
}
/* Internal helper function to detect socket status the first time a read or
* write event fires. When connecting was not succesful, the connect callback
* is called with a REDIS_ERR status and the context is free'd. */
static int __redisAsyncHandleConnect(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
if (redisCheckSocketError(c) == REDIS_ERR) {
/* Try again later when connect(2) is still in progress. */
if (errno == EINPROGRESS)
return REDIS_OK;
if (ac->onConnect) ac->onConnect(ac,REDIS_ERR);
__redisAsyncDisconnect(ac);
return REDIS_ERR;
}
/* Mark context as connected. */
c->flags |= REDIS_CONNECTED;
if (ac->onConnect) ac->onConnect(ac,REDIS_OK);
return REDIS_OK;
}
/* This function should be called when the socket is readable.
* It processes all replies that can be read and executes their callbacks.
*/
void redisAsyncHandleRead(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
if (!(c->flags & REDIS_CONNECTED)) {
/* Abort connect was not successful. */
if (__redisAsyncHandleConnect(ac) != REDIS_OK)
return;
/* Try again later when the context is still not connected. */
if (!(c->flags & REDIS_CONNECTED))
return;
}
if (redisBufferRead(c) == REDIS_ERR) {
__redisAsyncDisconnect(ac);
} else {
/* Always re-schedule reads */
_EL_ADD_READ(ac);
redisProcessCallbacks(ac);
}
}
void redisAsyncHandleWrite(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
int done = 0;
if (!(c->flags & REDIS_CONNECTED)) {
/* Abort connect was not successful. */
if (__redisAsyncHandleConnect(ac) != REDIS_OK)
return;
/* Try again later when the context is still not connected. */
if (!(c->flags & REDIS_CONNECTED))
return;
}
if (redisBufferWrite(c,&done) == REDIS_ERR) {
__redisAsyncDisconnect(ac);
} else {
/* Continue writing when not done, stop writing otherwise */
if (!done)
_EL_ADD_WRITE(ac);
else
_EL_DEL_WRITE(ac);
/* Always schedule reads after writes */
_EL_ADD_READ(ac);
}
}
/* Sets a pointer to the first argument and its length starting at p. Returns
* the number of bytes to skip to get to the following argument. */
static char *nextArgument(char *start, char **str, size_t *len) {
char *p = start;
if (p[0] != '$') {
p = strchr(p,'$');
if (p == NULL) return NULL;
}
*len = (int)strtol(p+1,NULL,10);
p = strchr(p,'\r');
assert(p);
*str = p+2;
return p+2+(*len)+2;
}
/* Helper function for the redisAsyncCommand* family of functions. Writes a
* formatted command to the output buffer and registers the provided callback
* function with the context. */
static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, char *cmd, size_t len) {
redisContext *c = &(ac->c);
redisCallback cb;
int pvariant, hasnext;
char *cstr, *astr;
size_t clen, alen;
char *p;
sds sname;
/* Don't accept new commands when the connection is about to be closed. */
if (c->flags & (REDIS_DISCONNECTING | REDIS_FREEING)) return REDIS_ERR;
/* Setup callback */
cb.fn = fn;
cb.privdata = privdata;
/* Find out which command will be appended. */
p = nextArgument(cmd,&cstr,&clen);
assert(p != NULL);
hasnext = (p[0] == '$');
pvariant = (tolower(cstr[0]) == 'p') ? 1 : 0;
cstr += pvariant;
clen -= pvariant;
if (hasnext && strncasecmp(cstr,"subscribe\r\n",11) == 0) {
c->flags |= REDIS_SUBSCRIBED;
/* Add every channel/pattern to the list of subscription callbacks. */
while ((p = nextArgument(p,&astr,&alen)) != NULL) {
sname = sdsnewlen(astr,alen);
if (pvariant)
dictReplace(ac->sub.patterns,sname,&cb);
else
dictReplace(ac->sub.channels,sname,&cb);
}
} else if (strncasecmp(cstr,"unsubscribe\r\n",13) == 0) {
/* It is only useful to call (P)UNSUBSCRIBE when the context is
* subscribed to one or more channels or patterns. */
if (!(c->flags & REDIS_SUBSCRIBED)) return REDIS_ERR;
/* (P)UNSUBSCRIBE does not have its own response: every channel or
* pattern that is unsubscribed will receive a message. This means we
* should not append a callback function for this command. */
} else if(strncasecmp(cstr,"monitor\r\n",9) == 0) {
/* Set monitor flag and push callback */
c->flags |= REDIS_MONITORING;
__redisPushCallback(&ac->replies,&cb);
} else {
if (c->flags & REDIS_SUBSCRIBED)
/* This will likely result in an error reply, but it needs to be
* received and passed to the callback. */
__redisPushCallback(&ac->sub.invalid,&cb);
else
__redisPushCallback(&ac->replies,&cb);
}
__redisAppendCommand(c,cmd,len);
/* Always schedule a write when the write buffer is non-empty */
_EL_ADD_WRITE(ac);
return REDIS_OK;
}
int redisvAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *format, va_list ap) {
char *cmd;
int len;
int status;
len = redisvFormatCommand(&cmd,format,ap);
status = __redisAsyncCommand(ac,fn,privdata,cmd,len);
free(cmd);
return status;
}
int redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *format, ...) {
va_list ap;
int status;
va_start(ap,format);
status = redisvAsyncCommand(ac,fn,privdata,format,ap);
va_end(ap);
return status;
}
int redisAsyncCommandArgv(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, int argc, const char **argv, const size_t *argvlen) {
char *cmd;
int len;
int status;
len = redisFormatCommandArgv(&cmd,argc,argv,argvlen);
status = __redisAsyncCommand(ac,fn,privdata,cmd,len);
free(cmd);
return status;
}
| bsd-3-clause |
nfxosp/platform_external_skia | experimental/DrawingBoard/SampleDrawingServer.cpp | 164 | 7313 | #include "SampleCode.h"
#include "SkView.h"
#include "SkCanvas.h"
#include "SkGPipe.h"
#include "SkSockets.h"
#include "SkNetPipeController.h"
#include "SkCornerPathEffect.h"
#include "SkOSMenu.h"
#include <map>
/**
* Drawing Server
*
* This simple drawing server can accept connections from multiple drawing
* clients simultaneously. It accumulates drawing data from each client each
* frame, stores it in the appropriate place, and then broadcasts incremental
* changes back to all the clients. Each logical packet, meaning one brush
* stoke in this case can be of two types, append and replace. Append types are
* completed strokes ready to be stored in the fData queue and will no longer be
* modified. Replace types are drawing operations that are still in progress on
* the client side, so they are appended to fBuffer. The location and size of
* the buffered data for each client is stored in a map and updated properly.
* Each time a new replace drawing call is received from a client, its previous
* buffered data is discarded.
* Since the Server keeps all the complete drawing data and the latest buffered
* data, it's able to switch between vector and bitmap drawing
*/
class DrawingServerView : public SampleView {
public:
DrawingServerView(){
fServer = new SkTCPServer(40000);
fServer->suspendWrite();
fTotalBytesRead = fTotalBytesWritten = 0;
fVector = true;
}
~DrawingServerView() {
delete fServer;
fData.reset();
fBuffer.reset();
fClientMap.clear();
}
virtual void requestMenu(SkOSMenu* menu) {
menu->setTitle("Drawing Server");
menu->appendAction("Clear", this->getSinkID());
menu->appendSwitch("Vector", "Vector", this->getSinkID(), fVector);
}
protected:
static void readData(int cid, const void* data, size_t size,
SkSocket::DataType type, void* context) {
DrawingServerView* view = (DrawingServerView*)context;
view->onRead(cid, data, size, type);
}
void onRead(int cid, const void* data, size_t size, SkSocket::DataType type) {
if (NULL == data && size <= 0)
return;
ClientState* cs;
std::map<int, ClientState*>::iterator it = fClientMap.find(cid);
if (it == fClientMap.end()) { //New client
cs = new ClientState;
cs->bufferBase = 0;
cs->bufferSize = 0;
fClientMap[cid] = cs;
}
else {
cs = it->second;
}
if (type == SkSocket::kPipeReplace_type) {
fBuffer.remove(cs->bufferBase, cs->bufferSize);
for (it = fClientMap.begin(); it != fClientMap.end(); ++it) {
if (cid == it->first)
continue;
else {
if (it->second->bufferBase > cs->bufferBase) {
it->second->bufferBase -= cs->bufferSize;
SkASSERT(it->second->bufferBase >= 0);
}
}
}
cs->bufferBase = fBuffer.count();
cs->bufferSize = size;
fBuffer.append(size, (const char*)data);
}
else if (type == SkSocket::kPipeAppend_type) {
fData.append(size, (const char*)data);
fServer->resumeWrite();
fServer->writePacket(fData.begin() + fTotalBytesWritten,
fData.count() - fTotalBytesWritten,
SkSocket::kPipeAppend_type);
fTotalBytesWritten = fData.count();
fServer->suspendWrite();
}
else {
//other types of data
}
}
bool onQuery(SkEvent* evt) {
if (SampleCode::TitleQ(*evt)) {
SampleCode::TitleR(evt, "Drawing Server");
return true;
}
return this->INHERITED::onQuery(evt);
}
bool onEvent(const SkEvent& evt) {
if (SkOSMenu::FindAction(evt, "Clear")) {
this->clear();
return true;
}
if (SkOSMenu::FindSwitchState(evt, "Vector", &fVector)) {
this->clearBitmap();
return true;
}
return this->INHERITED::onEvent(evt);
}
virtual void onDrawContent(SkCanvas* canvas) {
if (fCurrMatrix != canvas->getTotalMatrix()) {
fTotalBytesRead = 0;
fCurrMatrix = canvas->getTotalMatrix();
}
fServer->acceptConnections();
if (fServer->readPacket(readData, this) > 0) {
fServer->resumeWrite();
}
else {
fServer->suspendWrite();
}
size_t bytesRead;
SkGPipeReader::Status stat;
SkCanvas bufferCanvas(fBase);
SkCanvas* tempCanvas;
while (fTotalBytesRead < fData.count()) {
if (fVector) {
tempCanvas = canvas;
} else {
tempCanvas = &bufferCanvas;
}
SkGPipeReader reader(tempCanvas);
stat = reader.playback(fData.begin() + fTotalBytesRead,
fData.count() - fTotalBytesRead,
&bytesRead);
SkASSERT(SkGPipeReader::kError_Status != stat);
fTotalBytesRead += bytesRead;
}
if (fVector) {
fTotalBytesRead = 0;
} else {
canvas->drawBitmap(fBase, 0, 0, NULL);
}
size_t totalBytesRead = 0;
while (totalBytesRead < fBuffer.count()) {
SkGPipeReader reader(canvas);
stat = reader.playback(fBuffer.begin() + totalBytesRead,
fBuffer.count() - totalBytesRead,
&bytesRead);
SkASSERT(SkGPipeReader::kError_Status != stat);
totalBytesRead += bytesRead;
}
fServer->writePacket(fBuffer.begin(), fBuffer.count(),
SkSocket::kPipeReplace_type);
this->inval(NULL);
}
virtual void onSizeChange() {
this->INHERITED::onSizeChange();
fBase.setConfig(SkBitmap::kARGB_8888_Config,
this->width(),
this->height());
fBase.allocPixels(NULL);
this->clearBitmap();
}
private:
void clear() {
fData.reset();
fBuffer.reset();
fTotalBytesRead = fTotalBytesWritten = 0;
fClientMap.clear();
this->clearBitmap();
}
void clearBitmap() {
fTotalBytesRead = 0;
fBase.eraseColor(fBGColor);
}
struct ClientState {
int bufferBase;
int bufferSize;
};
std::map<int, ClientState*> fClientMap;
SkTDArray<char> fData;
SkTDArray<char> fBuffer;
size_t fTotalBytesRead;
size_t fTotalBytesWritten;
SkMatrix fCurrMatrix;
SkBitmap fBase;
bool fVector;
SkTCPServer* fServer;
typedef SampleView INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
static SkView* MyFactory() { return new DrawingServerView; }
static SkViewRegister reg(MyFactory);
| bsd-3-clause |
Nu3001/external_chromium_org | native_client_sdk/src/libraries/third_party/pthreads-win32/pthread_mutexattr_setkind_np.c | 420 | 1708 | /*
* pthread_mutexattr_setkind_np.c
*
* Description:
* This translation unit implements non-portable thread functions.
*
* --------------------------------------------------------------------------
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
*
* Contact Email: rpj@callisto.canberra.edu.au
*
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "pthread.h"
#include "implement.h"
int
pthread_mutexattr_setkind_np (pthread_mutexattr_t * attr, int kind)
{
return pthread_mutexattr_settype (attr, kind);
}
| bsd-3-clause |
lokeshjindal15/pd-gem5 | kernel_dvfs/linux-linaro-tracking-gem5/arch/powerpc/mm/init_64.c | 429 | 10324 | /*
* PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
*
* Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
* and Cort Dougan (PReP) (cort@cs.nmt.edu)
* Copyright (C) 1996 Paul Mackerras
*
* Derived from "arch/i386/mm/init.c"
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
*
* Dave Engebretsen <engebret@us.ibm.com>
* Rework for PPC64 port.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
*/
#undef DEBUG
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/stddef.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/idr.h>
#include <linux/nodemask.h>
#include <linux/module.h>
#include <linux/poison.h>
#include <linux/memblock.h>
#include <linux/hugetlb.h>
#include <linux/slab.h>
#include <asm/pgalloc.h>
#include <asm/page.h>
#include <asm/prom.h>
#include <asm/rtas.h>
#include <asm/io.h>
#include <asm/mmu_context.h>
#include <asm/pgtable.h>
#include <asm/mmu.h>
#include <asm/uaccess.h>
#include <asm/smp.h>
#include <asm/machdep.h>
#include <asm/tlb.h>
#include <asm/eeh.h>
#include <asm/processor.h>
#include <asm/mmzone.h>
#include <asm/cputable.h>
#include <asm/sections.h>
#include <asm/iommu.h>
#include <asm/vdso.h>
#include "mmu_decl.h"
#ifdef CONFIG_PPC_STD_MMU_64
#if PGTABLE_RANGE > USER_VSID_RANGE
#warning Limited user VSID range means pagetable space is wasted
#endif
#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE)
#warning TASK_SIZE is smaller than it needs to be.
#endif
#endif /* CONFIG_PPC_STD_MMU_64 */
phys_addr_t memstart_addr = ~0;
EXPORT_SYMBOL_GPL(memstart_addr);
phys_addr_t kernstart_addr;
EXPORT_SYMBOL_GPL(kernstart_addr);
static void pgd_ctor(void *addr)
{
memset(addr, 0, PGD_TABLE_SIZE);
}
static void pmd_ctor(void *addr)
{
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
memset(addr, 0, PMD_TABLE_SIZE * 2);
#else
memset(addr, 0, PMD_TABLE_SIZE);
#endif
}
struct kmem_cache *pgtable_cache[MAX_PGTABLE_INDEX_SIZE];
/*
* Create a kmem_cache() for pagetables. This is not used for PTE
* pages - they're linked to struct page, come from the normal free
* pages pool and have a different entry size (see real_pte_t) to
* everything else. Caches created by this function are used for all
* the higher level pagetables, and for hugepage pagetables.
*/
void pgtable_cache_add(unsigned shift, void (*ctor)(void *))
{
char *name;
unsigned long table_size = sizeof(void *) << shift;
unsigned long align = table_size;
/* When batching pgtable pointers for RCU freeing, we store
* the index size in the low bits. Table alignment must be
* big enough to fit it.
*
* Likewise, hugeapge pagetable pointers contain a (different)
* shift value in the low bits. All tables must be aligned so
* as to leave enough 0 bits in the address to contain it. */
unsigned long minalign = max(MAX_PGTABLE_INDEX_SIZE + 1,
HUGEPD_SHIFT_MASK + 1);
struct kmem_cache *new;
/* It would be nice if this was a BUILD_BUG_ON(), but at the
* moment, gcc doesn't seem to recognize is_power_of_2 as a
* constant expression, so so much for that. */
BUG_ON(!is_power_of_2(minalign));
BUG_ON((shift < 1) || (shift > MAX_PGTABLE_INDEX_SIZE));
if (PGT_CACHE(shift))
return; /* Already have a cache of this size */
align = max_t(unsigned long, align, minalign);
name = kasprintf(GFP_KERNEL, "pgtable-2^%d", shift);
new = kmem_cache_create(name, table_size, align, 0, ctor);
pgtable_cache[shift - 1] = new;
pr_debug("Allocated pgtable cache for order %d\n", shift);
}
void pgtable_cache_init(void)
{
pgtable_cache_add(PGD_INDEX_SIZE, pgd_ctor);
pgtable_cache_add(PMD_CACHE_INDEX, pmd_ctor);
if (!PGT_CACHE(PGD_INDEX_SIZE) || !PGT_CACHE(PMD_CACHE_INDEX))
panic("Couldn't allocate pgtable caches");
/* In all current configs, when the PUD index exists it's the
* same size as either the pgd or pmd index. Verify that the
* initialization above has also created a PUD cache. This
* will need re-examiniation if we add new possibilities for
* the pagetable layout. */
BUG_ON(PUD_INDEX_SIZE && !PGT_CACHE(PUD_INDEX_SIZE));
}
#ifdef CONFIG_SPARSEMEM_VMEMMAP
/*
* Given an address within the vmemmap, determine the pfn of the page that
* represents the start of the section it is within. Note that we have to
* do this by hand as the proffered address may not be correctly aligned.
* Subtraction of non-aligned pointers produces undefined results.
*/
static unsigned long __meminit vmemmap_section_start(unsigned long page)
{
unsigned long offset = page - ((unsigned long)(vmemmap));
/* Return the pfn of the start of the section. */
return (offset / sizeof(struct page)) & PAGE_SECTION_MASK;
}
/*
* Check if this vmemmap page is already initialised. If any section
* which overlaps this vmemmap page is initialised then this page is
* initialised already.
*/
static int __meminit vmemmap_populated(unsigned long start, int page_size)
{
unsigned long end = start + page_size;
for (; start < end; start += (PAGES_PER_SECTION * sizeof(struct page)))
if (pfn_valid(vmemmap_section_start(start)))
return 1;
return 0;
}
/* On hash-based CPUs, the vmemmap is bolted in the hash table.
*
* On Book3E CPUs, the vmemmap is currently mapped in the top half of
* the vmalloc space using normal page tables, though the size of
* pages encoded in the PTEs can be different
*/
#ifdef CONFIG_PPC_BOOK3E
static void __meminit vmemmap_create_mapping(unsigned long start,
unsigned long page_size,
unsigned long phys)
{
/* Create a PTE encoding without page size */
unsigned long i, flags = _PAGE_PRESENT | _PAGE_ACCESSED |
_PAGE_KERNEL_RW;
/* PTEs only contain page size encodings up to 32M */
BUG_ON(mmu_psize_defs[mmu_vmemmap_psize].enc > 0xf);
/* Encode the size in the PTE */
flags |= mmu_psize_defs[mmu_vmemmap_psize].enc << 8;
/* For each PTE for that area, map things. Note that we don't
* increment phys because all PTEs are of the large size and
* thus must have the low bits clear
*/
for (i = 0; i < page_size; i += PAGE_SIZE)
BUG_ON(map_kernel_page(start + i, phys, flags));
}
#else /* CONFIG_PPC_BOOK3E */
static void __meminit vmemmap_create_mapping(unsigned long start,
unsigned long page_size,
unsigned long phys)
{
int mapped = htab_bolt_mapping(start, start + page_size, phys,
pgprot_val(PAGE_KERNEL),
mmu_vmemmap_psize,
mmu_kernel_ssize);
BUG_ON(mapped < 0);
}
#endif /* CONFIG_PPC_BOOK3E */
struct vmemmap_backing *vmemmap_list;
static __meminit struct vmemmap_backing * vmemmap_list_alloc(int node)
{
static struct vmemmap_backing *next;
static int num_left;
/* allocate a page when required and hand out chunks */
if (!next || !num_left) {
next = vmemmap_alloc_block(PAGE_SIZE, node);
if (unlikely(!next)) {
WARN_ON(1);
return NULL;
}
num_left = PAGE_SIZE / sizeof(struct vmemmap_backing);
}
num_left--;
return next++;
}
static __meminit void vmemmap_list_populate(unsigned long phys,
unsigned long start,
int node)
{
struct vmemmap_backing *vmem_back;
vmem_back = vmemmap_list_alloc(node);
if (unlikely(!vmem_back)) {
WARN_ON(1);
return;
}
vmem_back->phys = phys;
vmem_back->virt_addr = start;
vmem_back->list = vmemmap_list;
vmemmap_list = vmem_back;
}
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
{
unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
/* Align to the page size of the linear mapping. */
start = _ALIGN_DOWN(start, page_size);
pr_debug("vmemmap_populate %lx..%lx, node %d\n", start, end, node);
for (; start < end; start += page_size) {
void *p;
if (vmemmap_populated(start, page_size))
continue;
p = vmemmap_alloc_block(page_size, node);
if (!p)
return -ENOMEM;
vmemmap_list_populate(__pa(p), start, node);
pr_debug(" * %016lx..%016lx allocated at %p\n",
start, start + page_size, p);
vmemmap_create_mapping(start, page_size, __pa(p));
}
return 0;
}
void vmemmap_free(unsigned long start, unsigned long end)
{
}
void register_page_bootmem_memmap(unsigned long section_nr,
struct page *start_page, unsigned long size)
{
}
/*
* We do not have access to the sparsemem vmemmap, so we fallback to
* walking the list of sparsemem blocks which we already maintain for
* the sake of crashdump. In the long run, we might want to maintain
* a tree if performance of that linear walk becomes a problem.
*
* realmode_pfn_to_page functions can fail due to:
* 1) As real sparsemem blocks do not lay in RAM continously (they
* are in virtual address space which is not available in the real mode),
* the requested page struct can be split between blocks so get_page/put_page
* may fail.
* 2) When huge pages are used, the get_page/put_page API will fail
* in real mode as the linked addresses in the page struct are virtual
* too.
*/
struct page *realmode_pfn_to_page(unsigned long pfn)
{
struct vmemmap_backing *vmem_back;
struct page *page;
unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
unsigned long pg_va = (unsigned long) pfn_to_page(pfn);
for (vmem_back = vmemmap_list; vmem_back; vmem_back = vmem_back->list) {
if (pg_va < vmem_back->virt_addr)
continue;
/* Check that page struct is not split between real pages */
if ((pg_va + sizeof(struct page)) >
(vmem_back->virt_addr + page_size))
return NULL;
page = (struct page *) (vmem_back->phys + pg_va -
vmem_back->virt_addr);
return page;
}
return NULL;
}
EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
#elif defined(CONFIG_FLATMEM)
struct page *realmode_pfn_to_page(unsigned long pfn)
{
struct page *page = pfn_to_page(pfn);
return page;
}
EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
#endif /* CONFIG_SPARSEMEM_VMEMMAP/CONFIG_FLATMEM */
| bsd-3-clause |
daoluan/decode-redis-2.8 | deps/lua/src/lcode.c | 967 | 21170 | /*
** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
#include <stdlib.h>
#define lcode_c
#define LUA_CORE
#include "lua.h"
#include "lcode.h"
#include "ldebug.h"
#include "ldo.h"
#include "lgc.h"
#include "llex.h"
#include "lmem.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
#include "ltable.h"
#define hasjumps(e) ((e)->t != (e)->f)
static int isnumeral(expdesc *e) {
return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP);
}
void luaK_nil (FuncState *fs, int from, int n) {
Instruction *previous;
if (fs->pc > fs->lasttarget) { /* no jumps to current position? */
if (fs->pc == 0) { /* function start? */
if (from >= fs->nactvar)
return; /* positions are already clean */
}
else {
previous = &fs->f->code[fs->pc-1];
if (GET_OPCODE(*previous) == OP_LOADNIL) {
int pfrom = GETARG_A(*previous);
int pto = GETARG_B(*previous);
if (pfrom <= from && from <= pto+1) { /* can connect both? */
if (from+n-1 > pto)
SETARG_B(*previous, from+n-1);
return;
}
}
}
}
luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */
}
int luaK_jump (FuncState *fs) {
int jpc = fs->jpc; /* save list of jumps to here */
int j;
fs->jpc = NO_JUMP;
j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP);
luaK_concat(fs, &j, jpc); /* keep them on hold */
return j;
}
void luaK_ret (FuncState *fs, int first, int nret) {
luaK_codeABC(fs, OP_RETURN, first, nret+1, 0);
}
static int condjump (FuncState *fs, OpCode op, int A, int B, int C) {
luaK_codeABC(fs, op, A, B, C);
return luaK_jump(fs);
}
static void fixjump (FuncState *fs, int pc, int dest) {
Instruction *jmp = &fs->f->code[pc];
int offset = dest-(pc+1);
lua_assert(dest != NO_JUMP);
if (abs(offset) > MAXARG_sBx)
luaX_syntaxerror(fs->ls, "control structure too long");
SETARG_sBx(*jmp, offset);
}
/*
** returns current `pc' and marks it as a jump target (to avoid wrong
** optimizations with consecutive instructions not in the same basic block).
*/
int luaK_getlabel (FuncState *fs) {
fs->lasttarget = fs->pc;
return fs->pc;
}
static int getjump (FuncState *fs, int pc) {
int offset = GETARG_sBx(fs->f->code[pc]);
if (offset == NO_JUMP) /* point to itself represents end of list */
return NO_JUMP; /* end of list */
else
return (pc+1)+offset; /* turn offset into absolute position */
}
static Instruction *getjumpcontrol (FuncState *fs, int pc) {
Instruction *pi = &fs->f->code[pc];
if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))
return pi-1;
else
return pi;
}
/*
** check whether list has any jump that do not produce a value
** (or produce an inverted value)
*/
static int need_value (FuncState *fs, int list) {
for (; list != NO_JUMP; list = getjump(fs, list)) {
Instruction i = *getjumpcontrol(fs, list);
if (GET_OPCODE(i) != OP_TESTSET) return 1;
}
return 0; /* not found */
}
static int patchtestreg (FuncState *fs, int node, int reg) {
Instruction *i = getjumpcontrol(fs, node);
if (GET_OPCODE(*i) != OP_TESTSET)
return 0; /* cannot patch other instructions */
if (reg != NO_REG && reg != GETARG_B(*i))
SETARG_A(*i, reg);
else /* no register to put value or register already has the value */
*i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));
return 1;
}
static void removevalues (FuncState *fs, int list) {
for (; list != NO_JUMP; list = getjump(fs, list))
patchtestreg(fs, list, NO_REG);
}
static void patchlistaux (FuncState *fs, int list, int vtarget, int reg,
int dtarget) {
while (list != NO_JUMP) {
int next = getjump(fs, list);
if (patchtestreg(fs, list, reg))
fixjump(fs, list, vtarget);
else
fixjump(fs, list, dtarget); /* jump to default target */
list = next;
}
}
static void dischargejpc (FuncState *fs) {
patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc);
fs->jpc = NO_JUMP;
}
void luaK_patchlist (FuncState *fs, int list, int target) {
if (target == fs->pc)
luaK_patchtohere(fs, list);
else {
lua_assert(target < fs->pc);
patchlistaux(fs, list, target, NO_REG, target);
}
}
void luaK_patchtohere (FuncState *fs, int list) {
luaK_getlabel(fs);
luaK_concat(fs, &fs->jpc, list);
}
void luaK_concat (FuncState *fs, int *l1, int l2) {
if (l2 == NO_JUMP) return;
else if (*l1 == NO_JUMP)
*l1 = l2;
else {
int list = *l1;
int next;
while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */
list = next;
fixjump(fs, list, l2);
}
}
void luaK_checkstack (FuncState *fs, int n) {
int newstack = fs->freereg + n;
if (newstack > fs->f->maxstacksize) {
if (newstack >= MAXSTACK)
luaX_syntaxerror(fs->ls, "function or expression too complex");
fs->f->maxstacksize = cast_byte(newstack);
}
}
void luaK_reserveregs (FuncState *fs, int n) {
luaK_checkstack(fs, n);
fs->freereg += n;
}
static void freereg (FuncState *fs, int reg) {
if (!ISK(reg) && reg >= fs->nactvar) {
fs->freereg--;
lua_assert(reg == fs->freereg);
}
}
static void freeexp (FuncState *fs, expdesc *e) {
if (e->k == VNONRELOC)
freereg(fs, e->u.s.info);
}
static int addk (FuncState *fs, TValue *k, TValue *v) {
lua_State *L = fs->L;
TValue *idx = luaH_set(L, fs->h, k);
Proto *f = fs->f;
int oldsize = f->sizek;
if (ttisnumber(idx)) {
lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v));
return cast_int(nvalue(idx));
}
else { /* constant not found; create a new entry */
setnvalue(idx, cast_num(fs->nk));
luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,
MAXARG_Bx, "constant table overflow");
while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
setobj(L, &f->k[fs->nk], v);
luaC_barrier(L, f, v);
return fs->nk++;
}
}
int luaK_stringK (FuncState *fs, TString *s) {
TValue o;
setsvalue(fs->L, &o, s);
return addk(fs, &o, &o);
}
int luaK_numberK (FuncState *fs, lua_Number r) {
TValue o;
setnvalue(&o, r);
return addk(fs, &o, &o);
}
static int boolK (FuncState *fs, int b) {
TValue o;
setbvalue(&o, b);
return addk(fs, &o, &o);
}
static int nilK (FuncState *fs) {
TValue k, v;
setnilvalue(&v);
/* cannot use nil as key; instead use table itself to represent nil */
sethvalue(fs->L, &k, fs->h);
return addk(fs, &k, &v);
}
void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
if (e->k == VCALL) { /* expression is an open function call? */
SETARG_C(getcode(fs, e), nresults+1);
}
else if (e->k == VVARARG) {
SETARG_B(getcode(fs, e), nresults+1);
SETARG_A(getcode(fs, e), fs->freereg);
luaK_reserveregs(fs, 1);
}
}
void luaK_setoneret (FuncState *fs, expdesc *e) {
if (e->k == VCALL) { /* expression is an open function call? */
e->k = VNONRELOC;
e->u.s.info = GETARG_A(getcode(fs, e));
}
else if (e->k == VVARARG) {
SETARG_B(getcode(fs, e), 2);
e->k = VRELOCABLE; /* can relocate its simple result */
}
}
void luaK_dischargevars (FuncState *fs, expdesc *e) {
switch (e->k) {
case VLOCAL: {
e->k = VNONRELOC;
break;
}
case VUPVAL: {
e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0);
e->k = VRELOCABLE;
break;
}
case VGLOBAL: {
e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info);
e->k = VRELOCABLE;
break;
}
case VINDEXED: {
freereg(fs, e->u.s.aux);
freereg(fs, e->u.s.info);
e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux);
e->k = VRELOCABLE;
break;
}
case VVARARG:
case VCALL: {
luaK_setoneret(fs, e);
break;
}
default: break; /* there is one value available (somewhere) */
}
}
static int code_label (FuncState *fs, int A, int b, int jump) {
luaK_getlabel(fs); /* those instructions may be jump targets */
return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump);
}
static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
luaK_dischargevars(fs, e);
switch (e->k) {
case VNIL: {
luaK_nil(fs, reg, 1);
break;
}
case VFALSE: case VTRUE: {
luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0);
break;
}
case VK: {
luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info);
break;
}
case VKNUM: {
luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval));
break;
}
case VRELOCABLE: {
Instruction *pc = &getcode(fs, e);
SETARG_A(*pc, reg);
break;
}
case VNONRELOC: {
if (reg != e->u.s.info)
luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0);
break;
}
default: {
lua_assert(e->k == VVOID || e->k == VJMP);
return; /* nothing to do... */
}
}
e->u.s.info = reg;
e->k = VNONRELOC;
}
static void discharge2anyreg (FuncState *fs, expdesc *e) {
if (e->k != VNONRELOC) {
luaK_reserveregs(fs, 1);
discharge2reg(fs, e, fs->freereg-1);
}
}
static void exp2reg (FuncState *fs, expdesc *e, int reg) {
discharge2reg(fs, e, reg);
if (e->k == VJMP)
luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */
if (hasjumps(e)) {
int final; /* position after whole expression */
int p_f = NO_JUMP; /* position of an eventual LOAD false */
int p_t = NO_JUMP; /* position of an eventual LOAD true */
if (need_value(fs, e->t) || need_value(fs, e->f)) {
int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
p_f = code_label(fs, reg, 0, 1);
p_t = code_label(fs, reg, 1, 0);
luaK_patchtohere(fs, fj);
}
final = luaK_getlabel(fs);
patchlistaux(fs, e->f, final, reg, p_f);
patchlistaux(fs, e->t, final, reg, p_t);
}
e->f = e->t = NO_JUMP;
e->u.s.info = reg;
e->k = VNONRELOC;
}
void luaK_exp2nextreg (FuncState *fs, expdesc *e) {
luaK_dischargevars(fs, e);
freeexp(fs, e);
luaK_reserveregs(fs, 1);
exp2reg(fs, e, fs->freereg - 1);
}
int luaK_exp2anyreg (FuncState *fs, expdesc *e) {
luaK_dischargevars(fs, e);
if (e->k == VNONRELOC) {
if (!hasjumps(e)) return e->u.s.info; /* exp is already in a register */
if (e->u.s.info >= fs->nactvar) { /* reg. is not a local? */
exp2reg(fs, e, e->u.s.info); /* put value on it */
return e->u.s.info;
}
}
luaK_exp2nextreg(fs, e); /* default */
return e->u.s.info;
}
void luaK_exp2val (FuncState *fs, expdesc *e) {
if (hasjumps(e))
luaK_exp2anyreg(fs, e);
else
luaK_dischargevars(fs, e);
}
int luaK_exp2RK (FuncState *fs, expdesc *e) {
luaK_exp2val(fs, e);
switch (e->k) {
case VKNUM:
case VTRUE:
case VFALSE:
case VNIL: {
if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */
e->u.s.info = (e->k == VNIL) ? nilK(fs) :
(e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
boolK(fs, (e->k == VTRUE));
e->k = VK;
return RKASK(e->u.s.info);
}
else break;
}
case VK: {
if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */
return RKASK(e->u.s.info);
else break;
}
default: break;
}
/* not a constant in the right range: put it in a register */
return luaK_exp2anyreg(fs, e);
}
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {
switch (var->k) {
case VLOCAL: {
freeexp(fs, ex);
exp2reg(fs, ex, var->u.s.info);
return;
}
case VUPVAL: {
int e = luaK_exp2anyreg(fs, ex);
luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0);
break;
}
case VGLOBAL: {
int e = luaK_exp2anyreg(fs, ex);
luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info);
break;
}
case VINDEXED: {
int e = luaK_exp2RK(fs, ex);
luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e);
break;
}
default: {
lua_assert(0); /* invalid var kind to store */
break;
}
}
freeexp(fs, ex);
}
void luaK_self (FuncState *fs, expdesc *e, expdesc *key) {
int func;
luaK_exp2anyreg(fs, e);
freeexp(fs, e);
func = fs->freereg;
luaK_reserveregs(fs, 2);
luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key));
freeexp(fs, key);
e->u.s.info = func;
e->k = VNONRELOC;
}
static void invertjump (FuncState *fs, expdesc *e) {
Instruction *pc = getjumpcontrol(fs, e->u.s.info);
lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET &&
GET_OPCODE(*pc) != OP_TEST);
SETARG_A(*pc, !(GETARG_A(*pc)));
}
static int jumponcond (FuncState *fs, expdesc *e, int cond) {
if (e->k == VRELOCABLE) {
Instruction ie = getcode(fs, e);
if (GET_OPCODE(ie) == OP_NOT) {
fs->pc--; /* remove previous OP_NOT */
return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond);
}
/* else go through */
}
discharge2anyreg(fs, e);
freeexp(fs, e);
return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond);
}
void luaK_goiftrue (FuncState *fs, expdesc *e) {
int pc; /* pc of last jump */
luaK_dischargevars(fs, e);
switch (e->k) {
case VK: case VKNUM: case VTRUE: {
pc = NO_JUMP; /* always true; do nothing */
break;
}
case VJMP: {
invertjump(fs, e);
pc = e->u.s.info;
break;
}
default: {
pc = jumponcond(fs, e, 0);
break;
}
}
luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */
luaK_patchtohere(fs, e->t);
e->t = NO_JUMP;
}
static void luaK_goiffalse (FuncState *fs, expdesc *e) {
int pc; /* pc of last jump */
luaK_dischargevars(fs, e);
switch (e->k) {
case VNIL: case VFALSE: {
pc = NO_JUMP; /* always false; do nothing */
break;
}
case VJMP: {
pc = e->u.s.info;
break;
}
default: {
pc = jumponcond(fs, e, 1);
break;
}
}
luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */
luaK_patchtohere(fs, e->f);
e->f = NO_JUMP;
}
static void codenot (FuncState *fs, expdesc *e) {
luaK_dischargevars(fs, e);
switch (e->k) {
case VNIL: case VFALSE: {
e->k = VTRUE;
break;
}
case VK: case VKNUM: case VTRUE: {
e->k = VFALSE;
break;
}
case VJMP: {
invertjump(fs, e);
break;
}
case VRELOCABLE:
case VNONRELOC: {
discharge2anyreg(fs, e);
freeexp(fs, e);
e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0);
e->k = VRELOCABLE;
break;
}
default: {
lua_assert(0); /* cannot happen */
break;
}
}
/* interchange true and false lists */
{ int temp = e->f; e->f = e->t; e->t = temp; }
removevalues(fs, e->f);
removevalues(fs, e->t);
}
void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
t->u.s.aux = luaK_exp2RK(fs, k);
t->k = VINDEXED;
}
static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
lua_Number v1, v2, r;
if (!isnumeral(e1) || !isnumeral(e2)) return 0;
v1 = e1->u.nval;
v2 = e2->u.nval;
switch (op) {
case OP_ADD: r = luai_numadd(v1, v2); break;
case OP_SUB: r = luai_numsub(v1, v2); break;
case OP_MUL: r = luai_nummul(v1, v2); break;
case OP_DIV:
if (v2 == 0) return 0; /* do not attempt to divide by 0 */
r = luai_numdiv(v1, v2); break;
case OP_MOD:
if (v2 == 0) return 0; /* do not attempt to divide by 0 */
r = luai_nummod(v1, v2); break;
case OP_POW: r = luai_numpow(v1, v2); break;
case OP_UNM: r = luai_numunm(v1); break;
case OP_LEN: return 0; /* no constant folding for 'len' */
default: lua_assert(0); r = 0; break;
}
if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */
e1->u.nval = r;
return 1;
}
static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) {
if (constfolding(op, e1, e2))
return;
else {
int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0;
int o1 = luaK_exp2RK(fs, e1);
if (o1 > o2) {
freeexp(fs, e1);
freeexp(fs, e2);
}
else {
freeexp(fs, e2);
freeexp(fs, e1);
}
e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2);
e1->k = VRELOCABLE;
}
}
static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1,
expdesc *e2) {
int o1 = luaK_exp2RK(fs, e1);
int o2 = luaK_exp2RK(fs, e2);
freeexp(fs, e2);
freeexp(fs, e1);
if (cond == 0 && op != OP_EQ) {
int temp; /* exchange args to replace by `<' or `<=' */
temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */
cond = 1;
}
e1->u.s.info = condjump(fs, op, cond, o1, o2);
e1->k = VJMP;
}
void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
expdesc e2;
e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
switch (op) {
case OPR_MINUS: {
if (!isnumeral(e))
luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */
codearith(fs, OP_UNM, e, &e2);
break;
}
case OPR_NOT: codenot(fs, e); break;
case OPR_LEN: {
luaK_exp2anyreg(fs, e); /* cannot operate on constants */
codearith(fs, OP_LEN, e, &e2);
break;
}
default: lua_assert(0);
}
}
void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {
switch (op) {
case OPR_AND: {
luaK_goiftrue(fs, v);
break;
}
case OPR_OR: {
luaK_goiffalse(fs, v);
break;
}
case OPR_CONCAT: {
luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */
break;
}
case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV:
case OPR_MOD: case OPR_POW: {
if (!isnumeral(v)) luaK_exp2RK(fs, v);
break;
}
default: {
luaK_exp2RK(fs, v);
break;
}
}
}
void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
switch (op) {
case OPR_AND: {
lua_assert(e1->t == NO_JUMP); /* list must be closed */
luaK_dischargevars(fs, e2);
luaK_concat(fs, &e2->f, e1->f);
*e1 = *e2;
break;
}
case OPR_OR: {
lua_assert(e1->f == NO_JUMP); /* list must be closed */
luaK_dischargevars(fs, e2);
luaK_concat(fs, &e2->t, e1->t);
*e1 = *e2;
break;
}
case OPR_CONCAT: {
luaK_exp2val(fs, e2);
if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) {
lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1);
freeexp(fs, e1);
SETARG_B(getcode(fs, e2), e1->u.s.info);
e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info;
}
else {
luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */
codearith(fs, OP_CONCAT, e1, e2);
}
break;
}
case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break;
case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break;
case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break;
case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break;
case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break;
case OPR_POW: codearith(fs, OP_POW, e1, e2); break;
case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break;
case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break;
case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break;
case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break;
case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break;
case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break;
default: lua_assert(0);
}
}
void luaK_fixline (FuncState *fs, int line) {
fs->f->lineinfo[fs->pc - 1] = line;
}
static int luaK_code (FuncState *fs, Instruction i, int line) {
Proto *f = fs->f;
dischargejpc(fs); /* `pc' will change */
/* put new instruction in code array */
luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction,
MAX_INT, "code size overflow");
f->code[fs->pc] = i;
/* save corresponding line information */
luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int,
MAX_INT, "code size overflow");
f->lineinfo[fs->pc] = line;
return fs->pc++;
}
int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) {
lua_assert(getOpMode(o) == iABC);
lua_assert(getBMode(o) != OpArgN || b == 0);
lua_assert(getCMode(o) != OpArgN || c == 0);
return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline);
}
int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) {
lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx);
lua_assert(getCMode(o) == OpArgN);
return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline);
}
void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) {
int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1;
int b = (tostore == LUA_MULTRET) ? 0 : tostore;
lua_assert(tostore != 0);
if (c <= MAXARG_C)
luaK_codeABC(fs, OP_SETLIST, base, b, c);
else {
luaK_codeABC(fs, OP_SETLIST, base, b, 0);
luaK_code(fs, cast(Instruction, c), fs->ls->lastline);
}
fs->freereg = base + 1; /* free registers with list values */
}
| bsd-3-clause |
eriknstr/ThinkPad-FreeBSD-setup | FreeBSD/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp | 2 | 15074 | //===-- SystemInitializerFull.cpp -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#if !defined(LLDB_DISABLE_PYTHON)
#include "Plugins/ScriptInterpreter/Python/lldb-python.h"
#endif
#include "lldb/API/SystemInitializerFull.h"
#include "lldb/API/SBCommandInterpreter.h"
#if !defined(LLDB_DISABLE_PYTHON)
#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
#endif
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Timer.h"
#include "lldb/Host/Host.h"
#include "lldb/Initialization/SystemInitializerCommon.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/GoASTContext.h"
#include "Plugins/ABI/SysV-arm/ABISysV_arm.h"
#include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h"
#include "Plugins/ABI/SysV-i386/ABISysV_i386.h"
#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
#include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h"
#include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h"
#include "Plugins/ABI/SysV-mips/ABISysV_mips.h"
#include "Plugins/ABI/SysV-mips64/ABISysV_mips64.h"
#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
#include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h"
#include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h"
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h"
#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
#include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h"
#include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h"
#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
#if defined(__APPLE__)
#include "Plugins/Process/mach-core/ProcessMachCore.h"
#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h"
#include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h"
#include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h"
#include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h"
#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h"
#endif
#if defined(__FreeBSD__)
#include "Plugins/Process/FreeBSD/ProcessFreeBSD.h"
#endif
#if defined(_MSC_VER)
#include "lldb/Host/windows/windows.h"
#include "Plugins/Process/Windows/Live/ProcessWindowsLive.h"
#include "Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h"
#endif
#include "llvm/Support/TargetSelect.h"
#include <string>
using namespace lldb_private;
#ifndef LLDB_DISABLE_PYTHON
// Defined in the SWIG source file
#if PY_MAJOR_VERSION >= 3
extern "C" PyObject*
PyInit__lldb(void);
#define LLDBSwigPyInit PyInit__lldb
#else
extern "C" void
init_lldb(void);
#define LLDBSwigPyInit init_lldb
#endif
// these are the Pythonic implementations of the required callbacks
// these are scripting-language specific, which is why they belong here
// we still need to use function pointers to them instead of relying
// on linkage-time resolution because the SWIG stuff and this file
// get built at different times
extern "C" bool
LLDBSwigPythonBreakpointCallbackFunction (const char *python_function_name,
const char *session_dictionary_name,
const lldb::StackFrameSP& sb_frame,
const lldb::BreakpointLocationSP& sb_bp_loc);
extern "C" bool
LLDBSwigPythonWatchpointCallbackFunction (const char *python_function_name,
const char *session_dictionary_name,
const lldb::StackFrameSP& sb_frame,
const lldb::WatchpointSP& sb_wp);
extern "C" bool
LLDBSwigPythonCallTypeScript (const char *python_function_name,
void *session_dictionary,
const lldb::ValueObjectSP& valobj_sp,
void** pyfunct_wrapper,
const lldb::TypeSummaryOptionsSP& options_sp,
std::string& retval);
extern "C" void*
LLDBSwigPythonCreateSyntheticProvider (const char *python_class_name,
const char *session_dictionary_name,
const lldb::ValueObjectSP& valobj_sp);
extern "C" void*
LLDBSwigPythonCreateCommandObject (const char *python_class_name,
const char *session_dictionary_name,
const lldb::DebuggerSP debugger_sp);
extern "C" void*
LLDBSwigPythonCreateScriptedThreadPlan (const char *python_class_name,
const char *session_dictionary_name,
const lldb::ThreadPlanSP& thread_plan_sp);
extern "C" bool
LLDBSWIGPythonCallThreadPlan (void *implementor,
const char *method_name,
Event *event_sp,
bool &got_error);
extern "C" size_t
LLDBSwigPython_CalculateNumChildren (void *implementor, uint32_t max);
extern "C" void *
LLDBSwigPython_GetChildAtIndex (void *implementor, uint32_t idx);
extern "C" int
LLDBSwigPython_GetIndexOfChildWithName (void *implementor, const char* child_name);
extern "C" void *
LLDBSWIGPython_CastPyObjectToSBValue (void* data);
extern lldb::ValueObjectSP
LLDBSWIGPython_GetValueObjectSPFromSBValue (void* data);
extern "C" bool
LLDBSwigPython_UpdateSynthProviderInstance (void* implementor);
extern "C" bool
LLDBSwigPython_MightHaveChildrenSynthProviderInstance (void* implementor);
extern "C" void *
LLDBSwigPython_GetValueSynthProviderInstance (void* implementor);
extern "C" bool
LLDBSwigPythonCallCommand (const char *python_function_name,
const char *session_dictionary_name,
lldb::DebuggerSP& debugger,
const char* args,
lldb_private::CommandReturnObject &cmd_retobj,
lldb::ExecutionContextRefSP exe_ctx_ref_sp);
extern "C" bool
LLDBSwigPythonCallCommandObject (void *implementor,
lldb::DebuggerSP& debugger,
const char* args,
lldb_private::CommandReturnObject& cmd_retobj,
lldb::ExecutionContextRefSP exe_ctx_ref_sp);
extern "C" bool
LLDBSwigPythonCallModuleInit (const char *python_module_name,
const char *session_dictionary_name,
lldb::DebuggerSP& debugger);
extern "C" void*
LLDBSWIGPythonCreateOSPlugin (const char *python_class_name,
const char *session_dictionary_name,
const lldb::ProcessSP& process_sp);
extern "C" bool
LLDBSWIGPythonRunScriptKeywordProcess (const char* python_function_name,
const char* session_dictionary_name,
lldb::ProcessSP& process,
std::string& output);
extern "C" bool
LLDBSWIGPythonRunScriptKeywordThread (const char* python_function_name,
const char* session_dictionary_name,
lldb::ThreadSP& thread,
std::string& output);
extern "C" bool
LLDBSWIGPythonRunScriptKeywordTarget (const char* python_function_name,
const char* session_dictionary_name,
lldb::TargetSP& target,
std::string& output);
extern "C" bool
LLDBSWIGPythonRunScriptKeywordFrame (const char* python_function_name,
const char* session_dictionary_name,
lldb::StackFrameSP& frame,
std::string& output);
extern "C" bool
LLDBSWIGPythonRunScriptKeywordValue (const char* python_function_name,
const char* session_dictionary_name,
lldb::ValueObjectSP& value,
std::string& output);
extern "C" void*
LLDBSWIGPython_GetDynamicSetting (void* module,
const char* setting,
const lldb::TargetSP& target_sp);
#endif
SystemInitializerFull::SystemInitializerFull()
{
}
SystemInitializerFull::~SystemInitializerFull()
{
}
void
SystemInitializerFull::Initialize()
{
SystemInitializerCommon::Initialize();
ScriptInterpreterNone::Initialize();
#if !defined(LLDB_DISABLE_PYTHON)
InitializeSWIG();
// ScriptInterpreterPython::Initialize() depends on things like HostInfo being initialized
// so it can compute the python directory etc, so we need to do this after
// SystemInitializerCommon::Initialize().
ScriptInterpreterPython::Initialize();
#endif
// Initialize LLVM and Clang
llvm::InitializeAllTargets();
llvm::InitializeAllAsmPrinters();
llvm::InitializeAllTargetMCs();
llvm::InitializeAllDisassemblers();
ClangASTContext::Initialize();
GoASTContext::Initialize();
ABISysV_arm::Initialize();
ABISysV_arm64::Initialize();
ABISysV_i386::Initialize();
ABISysV_x86_64::Initialize();
ABISysV_ppc::Initialize();
ABISysV_ppc64::Initialize();
ABISysV_mips::Initialize();
ABISysV_mips64::Initialize();
DisassemblerLLVMC::Initialize();
JITLoaderGDB::Initialize();
ProcessElfCore::Initialize();
#if defined(_MSC_VER)
ProcessWinMiniDump::Initialize();
#endif
MemoryHistoryASan::Initialize();
AddressSanitizerRuntime::Initialize();
SymbolVendorELF::Initialize();
SymbolFileDWARF::Initialize();
SymbolFileSymtab::Initialize();
UnwindAssemblyInstEmulation::Initialize();
UnwindAssembly_x86::Initialize();
EmulateInstructionARM64::Initialize();
SymbolFileDWARFDebugMap::Initialize();
ItaniumABILanguageRuntime::Initialize();
CPlusPlusLanguage::Initialize();
#if defined(_MSC_VER)
ProcessWindowsLive::Initialize();
#endif
#if defined(__FreeBSD__)
ProcessFreeBSD::Initialize();
#endif
#if defined(__APPLE__)
SymbolVendorMacOSX::Initialize();
ProcessKDP::Initialize();
ProcessMachCore::Initialize();
PlatformAppleTVSimulator::Initialize();
PlatformAppleWatchSimulator::Initialize();
PlatformRemoteAppleTV::Initialize();
PlatformRemoteAppleWatch::Initialize();
#endif
//----------------------------------------------------------------------
// Platform agnostic plugins
//----------------------------------------------------------------------
platform_gdb_server::PlatformRemoteGDBServer::Initialize();
process_gdb_remote::ProcessGDBRemote::Initialize();
DynamicLoaderStatic::Initialize();
// Scan for any system or user LLDB plug-ins
PluginManager::Initialize();
// The process settings need to know about installed plug-ins, so the Settings must be initialized
// AFTER PluginManager::Initialize is called.
Debugger::SettingsInitialize();
}
void SystemInitializerFull::InitializeSWIG()
{
#if !defined(LLDB_DISABLE_PYTHON)
ScriptInterpreterPython::InitializeInterpreter(
LLDBSwigPyInit,
LLDBSwigPythonBreakpointCallbackFunction,
LLDBSwigPythonWatchpointCallbackFunction,
LLDBSwigPythonCallTypeScript,
LLDBSwigPythonCreateSyntheticProvider,
LLDBSwigPythonCreateCommandObject,
LLDBSwigPython_CalculateNumChildren,
LLDBSwigPython_GetChildAtIndex,
LLDBSwigPython_GetIndexOfChildWithName,
LLDBSWIGPython_CastPyObjectToSBValue,
LLDBSWIGPython_GetValueObjectSPFromSBValue,
LLDBSwigPython_UpdateSynthProviderInstance,
LLDBSwigPython_MightHaveChildrenSynthProviderInstance,
LLDBSwigPython_GetValueSynthProviderInstance,
LLDBSwigPythonCallCommand,
LLDBSwigPythonCallCommandObject,
LLDBSwigPythonCallModuleInit,
LLDBSWIGPythonCreateOSPlugin,
LLDBSWIGPythonRunScriptKeywordProcess,
LLDBSWIGPythonRunScriptKeywordThread,
LLDBSWIGPythonRunScriptKeywordTarget,
LLDBSWIGPythonRunScriptKeywordFrame,
LLDBSWIGPythonRunScriptKeywordValue,
LLDBSWIGPython_GetDynamicSetting,
LLDBSwigPythonCreateScriptedThreadPlan,
LLDBSWIGPythonCallThreadPlan);
#endif
}
void
SystemInitializerFull::Terminate()
{
Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
Debugger::SettingsTerminate();
// Terminate and unload and loaded system or user LLDB plug-ins
PluginManager::Terminate();
ClangASTContext::Terminate();
GoASTContext::Terminate();
ABISysV_arm::Terminate();
ABISysV_arm64::Terminate();
ABISysV_i386::Terminate();
ABISysV_x86_64::Terminate();
ABISysV_ppc::Terminate();
ABISysV_ppc64::Terminate();
ABISysV_mips::Terminate();
ABISysV_mips64::Terminate();
DisassemblerLLVMC::Terminate();
JITLoaderGDB::Terminate();
ProcessElfCore::Terminate();
#if defined(_MSC_VER)
ProcessWinMiniDump::Terminate();
#endif
MemoryHistoryASan::Terminate();
AddressSanitizerRuntime::Terminate();
SymbolVendorELF::Terminate();
SymbolFileDWARF::Terminate();
SymbolFileSymtab::Terminate();
UnwindAssembly_x86::Terminate();
UnwindAssemblyInstEmulation::Terminate();
EmulateInstructionARM64::Terminate();
SymbolFileDWARFDebugMap::Terminate();
ItaniumABILanguageRuntime::Terminate();
CPlusPlusLanguage::Terminate();
#if defined(__APPLE__)
ProcessMachCore::Terminate();
ProcessKDP::Terminate();
SymbolVendorMacOSX::Terminate();
PlatformAppleTVSimulator::Terminate();
PlatformAppleWatchSimulator::Terminate();
PlatformRemoteAppleTV::Terminate();
PlatformRemoteAppleWatch::Terminate();
#endif
#if defined(__FreeBSD__)
ProcessFreeBSD::Terminate();
#endif
Debugger::SettingsTerminate();
platform_gdb_server::PlatformRemoteGDBServer::Terminate();
process_gdb_remote::ProcessGDBRemote::Terminate();
DynamicLoaderStatic::Terminate();
// Now shutdown the common parts, in reverse order.
SystemInitializerCommon::Terminate();
}
| isc |
Webern/MusicXML-Class-Library | Sourcecode/private/mxtest/api/TranspositionTest.cpp | 1 | 38385 | // MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License
#include "mxtest/control/CompileControl.h"
#ifdef MX_COMPILE_API_TESTS
#include "cpul/cpulTestHarness.h"
#include "mx/api/DocumentManager.h"
#include "mx/core/Document.h"
#include "mx/core/elements/Chromatic.h"
#include "mx/core/elements/Diatonic.h"
#include "mx/core/elements/MusicDataChoice.h"
#include "mx/core/elements/Properties.h"
#include "mx/core/elements/Transpose.h"
#include "mx/impl/Converter.h"
#include "mxtest/file/MxFileRepository.h"
#include <sstream>
namespace mxtest
{
// There seems to be an existing notion of an API 'round trip' test which requires specifying the
// music data by hand. In this version of an API round trip test, we will load the file into API,
// save the file back to disk, load it back up into the API and assert equality.
inline mx::api::ScoreData roundtrip( const mx::api::ScoreData& inOriginal )
{
auto& docMgr = mx::api::DocumentManager::getInstance();
const auto id = docMgr.createFromScore( inOriginal );
std::ostringstream oss;
docMgr.writeToStream( id, oss );
std::istringstream iss{ oss.str() };
const auto id2 = docMgr.createFromStream( iss );
auto result = docMgr.getData( id2 );
docMgr.destroyDocument( id );
docMgr.destroyDocument( id2 );
return result;
}
// create a score with one part an any number of measures
inline mx::api::ScoreData makeScore( int measures )
{
auto score = mx::api::ScoreData{};
score.parts.emplace_back( mx::api::PartData{} );
auto& part = score.parts.back();
for( int i = 0; i < measures; ++ i )
{
part.measures.emplace_back( mx::api::MeasureData{} );
}
return score;
}
inline void checkCoreTransposeElement(
const mx::api::ScoreData& inScore,
int inExpectedChromatic,
std::optional<int> inExpectedDiatonic,
std::optional<int> inExpectedOctave )
{
auto& docMgr = mx::api::DocumentManager::getInstance();
const auto id = docMgr.createFromScore( inScore );
const auto core = docMgr.getDocument( id );
docMgr.destroyDocument( id );
CHECK( core->getChoice() == mx::core::DocumentChoice::partwise );
const auto& score = core->getScorePartwise();
REQUIRE( !score->getPartwisePartSet().empty() );
const auto& part = score->getPartwisePartSet().front();
REQUIRE( !part->getPartwiseMeasureSet().empty() );
const auto& measure = part->getPartwiseMeasureSet().front();
const auto& choices = measure->getMusicDataGroup()->getMusicDataChoiceSet();
REQUIRE( !choices.empty() );
mx::core::PropertiesPtr properties;
for( const auto& choice : choices )
{
if( choice->getChoice() == mx::core::MusicDataChoice::Choice::properties )
{
// there should be only 1 properties element
CHECK( properties == nullptr );
properties = choice->getProperties();
// continue looping to make sure we don't hit another properties element
}
}
// we should have found exactly one properties element
CHECK( properties != nullptr );
// assert that the transpose element matches
REQUIRE( properties->getTransposeSet().size() == 1 );
const auto& transpose = properties->getTransposeSet().front();
CHECK_EQUAL( inExpectedChromatic, static_cast<int>( transpose->getChromatic()->getValue().getValue() ) );
if( inExpectedDiatonic.has_value() )
{
CHECK( transpose->getHasDiatonic() );
CHECK_EQUAL( inExpectedDiatonic.value(), static_cast<int>( transpose->getDiatonic()->getValue().getValue() ) );
}
if( inExpectedOctave.has_value() )
{
CHECK( transpose->getHasOctaveChange() );
CHECK_EQUAL( inExpectedOctave.value(), static_cast<int>( transpose->getOctaveChange()->getValue().getValue() ) );
}
}
inline mx::core::TransposePtr makeTranspose( int inChromatic, std::optional<int> inDiatonic, std::optional<int> inOctave )
{
auto transpose = mx::core::makeTranspose();
transpose->getChromatic()->setValue( mx::core::Semitones{ static_cast<mx::core::DecimalType>( inChromatic ) } );
if( inDiatonic.has_value() )
{
transpose->setHasDiatonic( true );
transpose->getDiatonic()->setValue( mx::core::Integer{ inDiatonic.value() } );
}
if( inOctave.has_value() )
{
transpose->setHasOctaveChange( true );
transpose->getOctaveChange()->setValue( mx::core::Integer{ inOctave.value() } );
}
return transpose;
}
}
TEST( convertToTransposeData01, Transposition )
{
// in Db (up) with no diatonic
const int expectedChromatic = 1;
const int expectedDiatonic = 1;
const auto transpose = mxtest::makeTranspose( 1, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData02, Transposition )
{
// in B (down) with no diatonic
const int expectedChromatic = -1;
const int expectedDiatonic = -1;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData03, Transposition )
{
// in D with no diatonic
const int expectedChromatic = 2;
const int expectedDiatonic = 1;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData04, Transposition )
{
// in Bb with no diatonic
const int expectedChromatic = -2;
const int expectedDiatonic = -1;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData05, Transposition )
{
// in Eb (up) with no diatonic
const int expectedChromatic = 3;
const int expectedDiatonic = 2;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData06, Transposition )
{
// in A with no diatonic
const int expectedChromatic = -3;
const int expectedDiatonic = -2;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData07, Transposition )
{
// in E with no diatonic
const int expectedChromatic = 4;
const int expectedDiatonic = 2;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData08, Transposition )
{
// in Ab with no diatonic
const int expectedChromatic = -4;
const int expectedDiatonic = -2;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData09, Transposition )
{
// in F with no diatonic
const int expectedChromatic = 5;
const int expectedDiatonic = 3;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData10, Transposition )
{
// in G with no diatonic
const int expectedChromatic = -5;
const int expectedDiatonic = -3;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData11, Transposition )
{
// in F# with no diatonic
const int expectedChromatic = 6;
const int expectedDiatonic = 3;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData12, Transposition )
{
// in Gb with no diatonic
const int expectedChromatic = -6;
const int expectedDiatonic = -3;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData13, Transposition )
{
// in G (up) with no diatonic
const int expectedChromatic = 7;
const int expectedDiatonic = 4;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData14, Transposition )
{
// in F (down) with no diatonic
const int expectedChromatic = -7;
const int expectedDiatonic = -4;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData15, Transposition )
{
// in Ab (up) with no diatonic
const int expectedChromatic = 8;
const int expectedDiatonic = 5;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData16, Transposition )
{
// in E (down) with no diatonic
const int expectedChromatic = -8;
const int expectedDiatonic = -5;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData17, Transposition )
{
// in A (up) with no diatonic
const int expectedChromatic = 9;
const int expectedDiatonic = 5;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData18, Transposition )
{
// in Eb (down) with no diatonic
const int expectedChromatic = -9;
const int expectedDiatonic = -5;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData19, Transposition )
{
// in Bb (up) with no diatonic
const int expectedChromatic = 10;
const int expectedDiatonic = 6;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData20, Transposition )
{
// in D (down) with no diatonic
const int expectedChromatic = -10;
const int expectedDiatonic = -6;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData21, Transposition )
{
// in B (up) with no diatonic
const int expectedChromatic = 11;
const int expectedDiatonic = 6;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData22, Transposition )
{
// in Db (down) with no diatonic
const int expectedChromatic = -11;
const int expectedDiatonic = -6;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData23, Transposition )
{
// in C (up) with no diatonic and no octave (technically incorrect musicxml)
const int expectedChromatic = 12;
const int expectedDiatonic = 7;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData24, Transposition )
{
// in C (down) with no diatonic and no octave (technically incorrect musicxml)
const int expectedChromatic = -12;
const int expectedDiatonic = -7;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData25, Transposition )
{
// in Db+1 (up) with no diatonic and no octave (technically incorrect musicxml)
const int expectedChromatic = 13;
const int expectedDiatonic = 8;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData26, Transposition )
{
// in B-1 (down) with no diatonic and no octave (technically incorrect musicxml)
const int expectedChromatic = -13;
const int expectedDiatonic = -8;
const auto transpose = mxtest::makeTranspose( expectedChromatic, std::nullopt, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData27, Transposition )
{
// crazy numbers, both chromatic and diatonic specified (and technically invalid), octave not specified
const int expectedChromatic = -130;
const int expectedDiatonic = 147;
const auto transpose = mxtest::makeTranspose( expectedChromatic, expectedDiatonic, std::nullopt );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData28, Transposition )
{
// crazy numbers, both chromatic and diatonic specified (and technically invalid), octave is specified
const int expectedChromatic = -138;
const int expectedDiatonic = 147;
const int octave = 2;
const auto transpose = mxtest::makeTranspose( -162, 133, octave );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData29, Transposition )
{
// normal, correct usage with octave offset, e.g. Tenor Saxophone in Bb
const int expectedChromatic = -14;
const int expectedDiatonic = -8;
const int octave = -1;
const auto transpose = mxtest::makeTranspose( -2, -1, octave );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData30, Transposition )
{
// normal, correct usage with octave offset, e.g. Piccolo Clarinet in Bb
const int expectedChromatic = 10;
const int expectedDiatonic = 6;
const int octave = 1;
const auto transpose = mxtest::makeTranspose( -2, -1, octave );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( convertToTransposeData31, Transposition )
{
// complete nonsense input, chromatic is out of range, diatonic is not specified, octave is specified.
// the behaviour is undefined, but this test locks down the behaviour as we have it now.
const int expectedChromatic = -1306;
const int expectedDiatonic = -762;
const int octave = -6;
const auto transpose = mxtest::makeTranspose( -1234, std::nullopt, octave );
const auto actual = mx::impl::Converter::convertToTransposeData( *transpose );
CHECK_EQUAL( expectedChromatic, actual.chromatic );
CHECK_EQUAL( expectedDiatonic, actual.diatonic );
}
TEST( Conversion01, Transposition )
{
const auto expectedChromatic = 2;
const auto expectedDiatonic = 1;
const auto expectedOctave = 0;
const auto transposeDataChromatic = 2;
const auto transposeDataDiatonic = 1;
const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic };
const auto converted = mx::impl::Converter::convertToTranspose( original );
REQUIRE( converted != nullptr );
CHECK_EQUAL( expectedChromatic, static_cast<int>( converted->getChromatic()->getValue().getValue() ) );
CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) );
CHECK_EQUAL( expectedDiatonic, static_cast<int>( converted->getDiatonic()->getValue().getValue() ) );
CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) );
CHECK_EQUAL( expectedOctave, static_cast<int>( converted->getOctaveChange()->getValue().getValue() ) );
const auto final = mx::impl::Converter::convertToTransposeData( *converted );
CHECK_EQUAL( transposeDataChromatic, final.chromatic );
CHECK_EQUAL( transposeDataDiatonic, final.diatonic );
CHECK_EQUAL( original, final );
}
TEST( Conversion02, Transposition )
{
const auto expectedChromatic = 0;
const auto expectedDiatonic = 0;
const auto expectedOctave = 1;
const auto transposeDataChromatic = 12;
const auto transposeDataDiatonic = 7;
const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic };
const auto converted = mx::impl::Converter::convertToTranspose( original );
REQUIRE( converted != nullptr );
CHECK_EQUAL( expectedChromatic, static_cast<int>( converted->getChromatic()->getValue().getValue() ) );
CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) );
CHECK_EQUAL( expectedDiatonic, static_cast<int>( converted->getDiatonic()->getValue().getValue() ) );
CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) );
CHECK_EQUAL( expectedOctave, static_cast<int>( converted->getOctaveChange()->getValue().getValue() ) );
const auto final = mx::impl::Converter::convertToTransposeData( *converted );
CHECK_EQUAL( transposeDataChromatic, final.chromatic );
CHECK_EQUAL( transposeDataDiatonic, final.diatonic );
CHECK_EQUAL( original, final );
}
TEST( Conversion03, Transposition )
{
const auto expectedChromatic = 4;
const auto expectedDiatonic = 2;
const auto expectedOctave = 1;
const auto transposeDataChromatic = 16;
const auto transposeDataDiatonic = 9;
const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic };
const auto converted = mx::impl::Converter::convertToTranspose( original );
REQUIRE( converted != nullptr );
CHECK_EQUAL( expectedChromatic, static_cast<int>( converted->getChromatic()->getValue().getValue() ) );
CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) );
CHECK_EQUAL( expectedDiatonic, static_cast<int>( converted->getDiatonic()->getValue().getValue() ) );
CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) );
CHECK_EQUAL( expectedOctave, static_cast<int>( converted->getOctaveChange()->getValue().getValue() ) );
const auto final = mx::impl::Converter::convertToTransposeData( *converted );
CHECK_EQUAL( transposeDataChromatic, final.chromatic );
CHECK_EQUAL( transposeDataDiatonic, final.diatonic );
CHECK_EQUAL( original, final );
}
TEST( Conversion04, Transposition )
{
const auto expectedChromatic = -4;
const auto expectedDiatonic = -2;
const auto expectedOctave = -1;
const auto transposeDataChromatic = -16;
const auto transposeDataDiatonic = -9;
const auto original = mx::api::TransposeData{ transposeDataChromatic, transposeDataDiatonic };
const auto converted = mx::impl::Converter::convertToTranspose( original );
REQUIRE( converted != nullptr );
CHECK_EQUAL( expectedChromatic, static_cast<int>( converted->getChromatic()->getValue().getValue() ) );
CHECK( converted->getHasDiatonic() == ( expectedDiatonic != 0 ) );
CHECK_EQUAL( expectedDiatonic, static_cast<int>( converted->getDiatonic()->getValue().getValue() ) );
CHECK( converted->getHasOctaveChange() == ( expectedOctave != 0 ) );
CHECK_EQUAL( expectedOctave, static_cast<int>( converted->getOctaveChange()->getValue().getValue() ) );
const auto final = mx::impl::Converter::convertToTransposeData( *converted );
CHECK_EQUAL( transposeDataChromatic, final.chromatic );
CHECK_EQUAL( transposeDataDiatonic, final.diatonic );
CHECK_EQUAL( original, final );
}
TEST( Tests01, Transposition )
{
const int chromatic = 2;
const int diatonic = 1;
const int expectedXmlChromatic = 2;
const int expectedXmlDiatonic = 1;
const std::optional<int> expectedXmlOctave = std::nullopt;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests02, Transposition )
{
const int chromatic = 11;
const int diatonic = 6;
const int expectedXmlChromatic = 11;
const int expectedXmlDiatonic = 6;
const std::optional<int> expectedXmlOctave = std::nullopt;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests03, Transposition )
{
const int chromatic = 12;
const int diatonic = 7;
const int expectedXmlChromatic = 0;
const std::optional<int> expectedXmlDiatonic = std::nullopt;
const std::optional<int> expectedXmlOctave = std::nullopt;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests04, Transposition )
{
const int chromatic = 13;
const int diatonic = 8;
const int expectedXmlChromatic = 1;
const int expectedXmlDiatonic = 1;
const std::optional<int> expectedXmlOctave = 1;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests05, Transposition )
{
const int chromatic = 14;
const int diatonic = 8;
const int expectedXmlChromatic = 2;
const int expectedXmlDiatonic = 1;
const std::optional<int> expectedXmlOctave = 1;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests06, Transposition )
{
// super wonky test case, maybe it doesn't matter if it fails
const int chromatic = 14;
const int diatonic = -8;
const int expectedXmlChromatic = 2;
const int expectedXmlDiatonic = -15;
const std::optional<int> expectedXmlOctave = 1;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests07, Transposition )
{
const int chromatic = -1;
const int diatonic = -1;
const int expectedXmlChromatic = -1;
const int expectedXmlDiatonic = -1;
const std::optional<int> expectedXmlOctave = std::nullopt;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests08, Transposition )
{
const int chromatic = -11;
const int diatonic = -6;
const int expectedXmlChromatic = -11;
const int expectedXmlDiatonic = -6;
const std::optional<int> expectedXmlOctave = std::nullopt;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests09, Transposition )
{
const int chromatic = -12;
const int diatonic = -7;
const int expectedXmlChromatic = 0;
const std::optional<int> expectedXmlDiatonic = std::nullopt;
const std::optional<int> expectedXmlOctave = -1;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( noMeasures, Transposition )
{
const int chromatic = 2;
const int diatonic = 1;
const int expectedXmlChromatic = 2;
const std::optional<int> expectedXmlDiatonic = 1;
const std::optional<int> expectedXmlOctave = std::nullopt;
auto score = mxtest::makeScore( 0 ); // NO MEASURES!
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( noTransposition, Transposition )
{
const int chromatic = 0;
const int diatonic = 0;
auto score = mxtest::makeScore( 0 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( !part.transposition->isUsed() );
const auto result = mxtest::roundtrip( score );
CHECK( !result.parts.back().transposition );
}
TEST( Tests10, Transposition )
{
const int chromatic = -13;
const int diatonic = -8;
const int expectedXmlChromatic = -1;
const std::optional<int> expectedXmlDiatonic = -1;
const std::optional<int> expectedXmlOctave = -1;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( Tests11, Transposition )
{
// this is a funky test case. these values are actually nonsense.
const int chromatic = -14;
const int diatonic = 8;
const int expectedXmlChromatic = -2;
const std::optional<int> expectedXmlDiatonic = 15;
const std::optional<int> expectedXmlOctave = -1;
auto score = mxtest::makeScore( 1 );
auto& part = score.parts.back();
part.transposition = mx::api::TransposeData{ chromatic, diatonic };
CHECK( part.transposition->isUsed() );
mxtest::checkCoreTransposeElement( score, expectedXmlChromatic, expectedXmlDiatonic, expectedXmlOctave );
const auto result = mxtest::roundtrip( score );
REQUIRE( result.parts.back().transposition.has_value() );
CHECK( result.parts.back().transposition );
CHECK( result.parts.back().transposition->isUsed() );
CHECK_EQUAL( chromatic, result.parts.back().transposition->chromatic );
CHECK_EQUAL( diatonic, result.parts.back().transposition->diatonic );
}
TEST( ApiRoundTrip, Transposition )
{
const auto original = mxtest::MxFileRepository::loadFile( "transposition.musicxml" );
const auto result = mxtest::roundtrip( original );
REQUIRE( result.parts.size() == 31 );
// manually check some of the part transpositions
size_t partIndex = 0;
std::string partId = "P" + std::to_string( partIndex + 1 );
auto part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" );
CHECK( part.transposition->isUsed() );
CHECK_EQUAL( 12, part.transposition->chromatic );
CHECK_EQUAL( 7, part.transposition->diatonic );
partIndex = 6;
partId = "P" + std::to_string( partIndex + 1 );
part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( !part.transposition.has_value(), partId + " should have no transposition" );
partIndex = 13;
partId = "P" + std::to_string( partIndex + 1 );
part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" );
CHECK( part.transposition->isUsed() );
CHECK_EQUAL( -9, part.transposition->chromatic );
CHECK_EQUAL( -5, part.transposition->diatonic );
partIndex = 14;
partId = "P" + std::to_string( partIndex + 1 );
part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" );
CHECK( part.transposition->isUsed() );
CHECK_EQUAL( -14, part.transposition->chromatic );
CHECK_EQUAL( -8, part.transposition->diatonic );
partIndex = 15;
partId = "P" + std::to_string( partIndex + 1 );
part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( part.transposition.has_value(), partId + " is missing transposition" );
CHECK( part.transposition->isUsed() );
CHECK_EQUAL( -21, part.transposition->chromatic );
CHECK_EQUAL( -12, part.transposition->diatonic );
partIndex = 27;
partId = "P" + std::to_string( partIndex + 1 );
part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( !part.transposition.has_value(), partId + " should have no transposition" );
partIndex = 30;
partId = "P" + std::to_string( partIndex + 1 );
part = result.parts.at( partIndex );
CHECK_EQUAL( partId, part.uniqueId );
CHECK_WITH_MESSAGE( !part.transposition.has_value(), partId + " should have no transposition" );
CHECK_EQUAL( original, result );
}
#endif | mit |
quitejonny/tangram-es | core/src/style/style.cpp | 1 | 18362 | #include "style/style.h"
#include "data/tileSource.h"
#include "gl/renderState.h"
#include "gl/shaderProgram.h"
#include "gl/mesh.h"
#include "log.h"
#include "map.h"
#include "marker/marker.h"
#include "scene/light.h"
#include "scene/scene.h"
#include "scene/spriteAtlas.h"
#include "scene/styleParam.h"
#include "style/material.h"
#include "tile/tile.h"
#include "view/view.h"
#include "rasters_glsl.h"
namespace Tangram {
Style::Style(std::string _name, Blending _blendMode, GLenum _drawMode, bool _selection) :
m_name(_name),
m_shaderSource(std::make_unique<ShaderSource>()),
m_blend(_blendMode),
m_drawMode(_drawMode),
m_selection(_selection) {
m_material.material = std::make_shared<Material>();
}
Style::~Style() {}
Style::LightHandle::LightHandle(Light* _light, std::unique_ptr<LightUniforms> _uniforms)
: light(_light), uniforms(std::move(_uniforms)){}
const std::vector<std::string>& Style::builtInStyleNames() {
static std::vector<std::string> builtInStyleNames{ "points", "lines", "polygons", "text", "debug", "debugtext" };
return builtInStyleNames;
}
void Style::build(const Scene& _scene) {
constructVertexLayout();
constructShaderProgram();
if (m_blend == Blending::inlay) {
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_BLEND_INLAY\n", false);
} else if (m_blend == Blending::overlay) {
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_BLEND_OVERLAY\n", false);
}
if (m_material.material) {
m_material.uniforms = m_material.material->injectOnProgram(*m_shaderSource);
}
if (m_lightingType != LightingType::none) {
switch (m_lightingType) {
case LightingType::vertex:
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_LIGHTING_VERTEX\n", false);
break;
case LightingType::fragment:
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_LIGHTING_FRAGMENT\n", false);
break;
default:
break;
}
for (auto& light : _scene.lights()) {
auto uniforms = light->getUniforms();
if (uniforms) {
m_lights.emplace_back(light.get(), std::move(uniforms));
}
}
for (auto& block : _scene.lightBlocks()) {
m_shaderSource->addSourceBlock(block.first, block.second);
}
}
setupRasters(_scene.tileSources());
const auto& blocks = m_shaderSource->getSourceBlocks();
if (blocks.find("color") != blocks.end() ||
blocks.find("filter") != blocks.end() ||
blocks.find("raster") != blocks.end()) {
m_hasColorShaderBlock = true;
}
std::string vertSrc = m_shaderSource->buildVertexSource();
std::string fragSrc = m_shaderSource->buildFragmentSource();
for (auto& s : _scene.styles()) {
auto& prg = s->m_shaderProgram;
if (!prg) { break; }
if (prg->vertexShaderSource() == vertSrc &&
prg->fragmentShaderSource() == fragSrc) {
m_shaderProgram = prg;
break;
}
}
if (!m_shaderProgram) {
m_shaderProgram = std::make_shared<ShaderProgram>();
m_shaderProgram->setDescription("{style:" + m_name + "}");
m_shaderProgram->setShaderSource(vertSrc, fragSrc);
}
if (m_selection) {
std::string vertSrc = m_shaderSource->buildSelectionVertexSource();
std::string fragSrc = m_shaderSource->buildSelectionFragmentSource();
for (auto& s : _scene.styles()) {
if (!s->m_selection) { continue; }
auto& prg = s->m_selectionProgram;
if (!prg) { break; }
if (prg->vertexShaderSource() == vertSrc &&
prg->fragmentShaderSource() == fragSrc) {
m_selectionProgram = prg;
break;
}
}
if (!m_selectionProgram) {
m_selectionProgram = std::make_shared<ShaderProgram>();
m_selectionProgram->setDescription("selection_program {style:" + m_name + "}");
m_selectionProgram->setShaderSource(vertSrc, fragSrc);
}
}
// Clear ShaderSource builder
m_shaderSource.reset();
}
void Style::setLightingType(LightingType _type) {
m_lightingType = _type;
}
void Style::setupSceneShaderUniforms(RenderState& rs, Scene& _scene, UniformBlock& _uniformBlock) {
for (auto& uniformPair : _uniformBlock.styleUniforms) {
const auto& name = uniformPair.first;
auto& value = uniformPair.second;
if (value.is<std::string>()) {
std::string textureName = value.get<std::string>();
std::shared_ptr<Texture> texture = _scene.getTexture(textureName);
if (!texture) {
LOGN("Texture with texture name %s is not available to be sent as uniform",
textureName.c_str());
continue;
}
texture->update(rs, rs.nextAvailableTextureUnit());
texture->bind(rs, rs.currentTextureUnit());
m_shaderProgram->setUniformi(rs, name, rs.currentTextureUnit());
} else if (value.is<bool>()) {
m_shaderProgram->setUniformi(rs, name, value.get<bool>());
} else if(value.is<float>()) {
m_shaderProgram->setUniformf(rs, name, value.get<float>());
} else if(value.is<glm::vec2>()) {
m_shaderProgram->setUniformf(rs, name, value.get<glm::vec2>());
} else if(value.is<glm::vec3>()) {
m_shaderProgram->setUniformf(rs, name, value.get<glm::vec3>());
} else if(value.is<glm::vec4>()) {
m_shaderProgram->setUniformf(rs, name, value.get<glm::vec4>());
} else if (value.is<UniformArray1f>()) {
m_shaderProgram->setUniformf(rs, name, value.get<UniformArray1f>());
} else if (value.is<UniformTextureArray>()) {
UniformTextureArray& textureUniformArray = value.get<UniformTextureArray>();
textureUniformArray.slots.clear();
for (const auto& textureName : textureUniformArray.names) {
std::shared_ptr<Texture> texture = _scene.getTexture(textureName);
if (!texture) {
LOGN("Texture with texture name %s is not available to be sent as uniform",
textureName.c_str());
continue;
}
texture->update(rs, rs.nextAvailableTextureUnit());
texture->bind(rs, rs.currentTextureUnit());
textureUniformArray.slots.push_back(rs.currentTextureUnit());
}
m_shaderProgram->setUniformi(rs, name, textureUniformArray);
}
}
}
void Style::setupRasters(const std::vector<std::shared_ptr<TileSource>>& _sources) {
if (!hasRasters()) {
return;
}
int numRasterSource = 0;
for (const auto& source : _sources) {
if (source->isRaster()) {
numRasterSource++;
}
}
if (numRasterSource == 0) {
return;
}
// Inject shader defines for raster sampling and uniforms
if (m_rasterType == RasterType::normal) {
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_RASTER_TEXTURE_NORMAL\n", false);
} else if (m_rasterType == RasterType::color) {
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_RASTER_TEXTURE_COLOR\n", false);
}
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_NUM_RASTER_SOURCES "
+ std::to_string(numRasterSource) + "\n", false);
m_shaderSource->addSourceBlock("defines", "#define TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING\n", false);
m_shaderSource->addSourceBlock("raster", SHADER_SOURCE(rasters_glsl));
}
void Style::setupShaderUniforms(RenderState& rs, ShaderProgram& _program, const View& _view,
Scene& _scene, UniformBlock& _uniforms) {
// Reset the currently used texture unit to 0
rs.resetTextureUnit();
// Set time uniforms style's shader programs
_program.setUniformf(rs, _uniforms.uTime, _scene.time());
_program.setUniformf(rs, _uniforms.uDevicePixelRatio, m_pixelScale);
if (m_material.uniforms) {
m_material.material->setupProgram(rs, *m_shaderProgram, *m_material.uniforms);
}
// Set up lights
for (const auto& light : m_lights) {
light.light->setupProgram(rs, _view, *m_shaderProgram, *light.uniforms);
}
// Set Map Position
_program.setUniformf(rs, _uniforms.uResolution, _view.getWidth(), _view.getHeight());
const auto& mapPos = _view.getPosition();
_program.setUniformf(rs, _uniforms.uMapPosition, mapPos.x, mapPos.y, _view.getZoom());
_program.setUniformMatrix3f(rs, _uniforms.uNormalMatrix, _view.getNormalMatrix());
_program.setUniformMatrix3f(rs, _uniforms.uInverseNormalMatrix, _view.getInverseNormalMatrix());
_program.setUniformf(rs, _uniforms.uMetersPerPixel, 1.0 / _view.pixelsPerMeter());
_program.setUniformMatrix4f(rs, _uniforms.uView, _view.getViewMatrix());
_program.setUniformMatrix4f(rs, _uniforms.uProj, _view.getProjectionMatrix());
setupSceneShaderUniforms(rs, _scene, _uniforms);
}
void Style::onBeginDrawFrame(RenderState& rs, const View& _view, Scene& _scene) {
setupShaderUniforms(rs, *m_shaderProgram, _view, _scene, m_mainUniforms);
// Configure render state
switch (m_blend) {
case Blending::opaque:
rs.blending(GL_FALSE);
rs.blendingFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
rs.depthTest(GL_TRUE);
rs.depthMask(GL_TRUE);
break;
case Blending::add:
rs.blending(GL_TRUE);
rs.blendingFunc(GL_ONE, GL_ONE);
rs.depthTest(GL_TRUE);
rs.depthMask(GL_TRUE);
break;
case Blending::multiply:
rs.blending(GL_TRUE);
rs.blendingFunc(GL_ZERO, GL_SRC_COLOR);
rs.depthTest(GL_TRUE);
rs.depthMask(GL_TRUE);
break;
case Blending::overlay:
rs.blending(GL_TRUE);
rs.blendingFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
rs.depthTest(GL_FALSE);
rs.depthMask(GL_FALSE);
break;
case Blending::inlay:
// TODO: inlay does not behave correctly for labels because they don't have a z position
rs.blending(GL_TRUE);
rs.blendingFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
rs.depthTest(GL_TRUE);
rs.depthMask(GL_FALSE);
break;
default:
break;
}
}
void Style::onBeginDrawSelectionFrame(RenderState& rs, const View& _view, Scene& _scene) {
if (!m_selection) {
return;
}
setupShaderUniforms(rs, *m_selectionProgram, _view, _scene, m_selectionUniforms);
// Configure render state
rs.blending(GL_FALSE);
switch (m_blend) {
case Blending::opaque:
case Blending::add:
case Blending::multiply:
rs.depthTest(GL_TRUE);
rs.depthMask(GL_TRUE);
break;
case Blending::overlay:
rs.depthTest(GL_FALSE);
rs.depthMask(GL_FALSE);
break;
case Blending::inlay:
rs.depthTest(GL_TRUE);
rs.depthMask(GL_FALSE);
break;
default:
break;
}
}
void Style::drawSelectionFrame(RenderState& _rs, const Marker& _marker) {
if (!m_selection || _marker.styleId() != m_id || !_marker.isVisible()) {
return;
}
auto* mesh = _marker.mesh();
if (!mesh) { return; }
m_selectionProgram->setUniformMatrix4f(_rs, m_selectionUniforms.uModel, _marker.modelMatrix());
m_selectionProgram->setUniformf(_rs, m_selectionUniforms.uTileOrigin,
_marker.origin().x, _marker.origin().y,
_marker.builtZoomLevel(), _marker.builtZoomLevel());
if (!mesh->draw(_rs, *m_selectionProgram, false)) {
LOGN("Mesh built by style %s cannot be drawn", m_name.c_str());
}
}
void Style::drawSelectionFrame(Tangram::RenderState& rs, const Tangram::Tile &_tile) {
if (!m_selection) {
return;
}
auto& styleMesh = _tile.getMesh(*this);
if (!styleMesh) { return; }
TileID tileID = _tile.getID();
m_selectionProgram->setUniformMatrix4f(rs, m_selectionUniforms.uModel, _tile.getModelMatrix());
m_selectionProgram->setUniformf(rs, m_selectionUniforms.uProxyDepth, _tile.isProxy() ? 1.f : 0.f);
m_selectionProgram->setUniformf(rs, m_selectionUniforms.uTileOrigin,
_tile.getOrigin().x,
_tile.getOrigin().y,
tileID.s,
tileID.z);
if (!styleMesh->draw(rs, *m_selectionProgram, false)) {
LOGN("Mesh built by style %s cannot be drawn", m_name.c_str());
}
}
void Style::draw(RenderState& rs, const Tile& _tile) {
auto& styleMesh = _tile.getMesh(*this);
if (!styleMesh) { return; }
TileID tileID = _tile.getID();
if (hasRasters() && !_tile.rasters().empty()) {
UniformTextureArray textureIndexUniform;
UniformArray2f rasterSizeUniform;
UniformArray3f rasterOffsetsUniform;
for (auto& raster : _tile.rasters()) {
if (raster.isValid()) {
auto& texture = raster.texture;
auto texUnit = rs.nextAvailableTextureUnit();
texture->update(rs, texUnit);
texture->bind(rs, texUnit);
textureIndexUniform.slots.push_back(texUnit);
rasterSizeUniform.push_back({texture->getWidth(), texture->getHeight()});
if (tileID.z > raster.tileID.z) {
float dz = tileID.z - raster.tileID.z;
float dz2 = powf(2.f, dz);
rasterOffsetsUniform.push_back({
fmodf(tileID.x, dz2) / dz2,
(dz2 - 1.f - fmodf(tileID.y, dz2)) / dz2,
1.f / dz2
});
} else {
rasterOffsetsUniform.push_back({0, 0, 1});
}
}
}
m_shaderProgram->setUniformi(rs, m_mainUniforms.uRasters, textureIndexUniform);
m_shaderProgram->setUniformf(rs, m_mainUniforms.uRasterSizes, rasterSizeUniform);
m_shaderProgram->setUniformf(rs, m_mainUniforms.uRasterOffsets, rasterOffsetsUniform);
}
m_shaderProgram->setUniformMatrix4f(rs, m_mainUniforms.uModel, _tile.getModelMatrix());
m_shaderProgram->setUniformf(rs, m_mainUniforms.uProxyDepth, _tile.isProxy() ? 1.f : 0.f);
m_shaderProgram->setUniformf(rs, m_mainUniforms.uTileOrigin,
_tile.getOrigin().x,
_tile.getOrigin().y,
tileID.s,
tileID.z);
if (!styleMesh->draw(rs, *m_shaderProgram)) {
LOGN("Mesh built by style %s cannot be drawn", m_name.c_str());
}
if (hasRasters()) {
for (auto& raster : _tile.rasters()) {
if (raster.isValid()) {
rs.releaseTextureUnit();
}
}
}
}
void Style::draw(RenderState& rs, const Marker& marker) {
if (marker.styleId() != m_id || !marker.isVisible()) { return; }
auto* mesh = marker.mesh();
if (!mesh) { return; }
m_shaderProgram->setUniformMatrix4f(rs, m_mainUniforms.uModel, marker.modelMatrix());
m_shaderProgram->setUniformf(rs, m_mainUniforms.uTileOrigin,
marker.origin().x, marker.origin().y,
marker.builtZoomLevel(), marker.builtZoomLevel());
if (!mesh->draw(rs, *m_shaderProgram)) {
LOGN("Mesh built by style %s cannot be drawn", m_name.c_str());
}
}
void Style::setDefaultDrawRule(std::unique_ptr<DrawRuleData>&& _rule) {
m_defaultDrawRule = std::move(_rule);
}
void Style::applyDefaultDrawRules(DrawRule& _rule) const {
if (m_defaultDrawRule) {
for (auto& param : m_defaultDrawRule->parameters) {
auto key = static_cast<uint8_t>(param.key);
if (!_rule.active[key]) {
_rule.active[key] = true;
// NOTE: layername and layer depth are actually immaterial here, since these are
// only used during layer draw rules merging. Adding a default string for
// debugging purposes.
_rule.params[key] = { ¶m, "default_style_draw_rule", 0 };
}
}
}
}
bool StyleBuilder::checkRule(const DrawRule& _rule) const {
uint32_t checkColor;
uint32_t checkOrder;
if (!_rule.get(StyleParamKey::color, checkColor)) {
if (!style().hasColorShaderBlock()) {
return false;
}
}
if (!_rule.get(StyleParamKey::order, checkOrder)) {
return false;
}
return true;
}
bool StyleBuilder::addFeature(const Feature& _feat, const DrawRule& _rule) {
if (!checkRule(_rule)) { return false; }
bool added = false;
switch (_feat.geometryType) {
case GeometryType::points:
for (auto& point : _feat.points) {
added |= addPoint(point, _feat.props, _rule);
}
break;
case GeometryType::lines:
for (auto& line : _feat.lines) {
added |= addLine(line, _feat.props, _rule);
}
break;
case GeometryType::polygons:
for (auto& polygon : _feat.polygons) {
added |= addPolygon(polygon, _feat.props, _rule);
}
break;
default:
break;
}
return added;
}
bool StyleBuilder::addPoint(const Point& _point, const Properties& _props, const DrawRule& _rule) {
// No-op by default
return false;
}
bool StyleBuilder::addLine(const Line& _line, const Properties& _props, const DrawRule& _rule) {
// No-op by default
return false;
}
bool StyleBuilder::addPolygon(const Polygon& _polygon, const Properties& _props, const DrawRule& _rule) {
// No-op by default
return false;
}
}
| mit |
yahiahisham14/bde_verify | groups/csa/csatr/csatr_friendship.cpp | 1 | 8481 | // csatr_friendship.cpp -*-C++-*-
#include <clang/AST/Decl.h>
#include <clang/AST/DeclBase.h>
#include <clang/AST/DeclCXX.h>
#include <clang/AST/DeclFriend.h>
#include <clang/AST/DeclTemplate.h>
#include <clang/AST/TemplateName.h>
#include <clang/AST/Type.h>
#include <clang/AST/TypeLoc.h>
#include <clang/ASTMatchers/ASTMatchFinder.h>
#include <clang/ASTMatchers/ASTMatchers.h>
#include <clang/ASTMatchers/ASTMatchersInternal.h>
#include <clang/Basic/SourceLocation.h>
#include <csabase_analyser.h>
#include <csabase_debug.h>
#include <csabase_diagnostic_builder.h>
#include <csabase_filenames.h>
#include <csabase_format.h>
#include <csabase_location.h>
#include <csabase_registercheck.h>
#include <csabase_report.h>
#include <csabase_util.h>
#include <llvm/Support/Casting.h>
#include <string>
using namespace clang;
using namespace clang::ast_matchers;
using namespace csabase;
// ----------------------------------------------------------------------------
static std::string const check_name("local-friendship-only");
// ----------------------------------------------------------------------------
namespace
{
struct data
{
};
struct report : Report<data>
{
INHERIT_REPORT_CTOR(report, Report, data);
std::string context(const Decl *decl);
bool is_extern_type(Type const* type);
const Decl *get_definition(const Decl *decl);
const Decl *other(const Decl *frend, const Decl *decl);
bool is_good_friend(const FriendDecl *frend, const NamedDecl *def);
void local_friendship_only(FriendDecl const* decl);
void operator()();
};
std::string report::context(const Decl *decl)
{
return "";
}
bool report::is_extern_type(Type const* type)
{
CXXRecordDecl const* record(type->getAsCXXRecordDecl());
Location cloc(a.get_location(record));
return (type->isIncompleteType()
&& record->getLexicalDeclContext()->isFileContext())
|| !a.is_component(cloc.file());
}
const Decl *report::get_definition(const Decl *decl)
{
if (auto d = llvm::dyn_cast<RecordDecl>(decl)) {
return d->getDefinition();
}
if (auto d = llvm::dyn_cast<VarDecl>(decl)) {
return d->getDefinition();
}
if (auto d = llvm::dyn_cast<TagDecl>(decl)) {
return d->getDefinition();
}
if (auto d = llvm::dyn_cast<ClassTemplateDecl>(decl)) {
if (d->isThisDeclarationADefinition()) {
return d;
}
}
if (auto d = llvm::dyn_cast<FunctionTemplateDecl>(decl)) {
if (d->isThisDeclarationADefinition()) {
return d;
}
}
if (auto d = llvm::dyn_cast<VarTemplateDecl>(decl)) {
if (d->isThisDeclarationADefinition()) {
return d;
}
}
return 0;
}
const Decl *report::other(const Decl *frend, const Decl *decl)
{
for (auto d = decl->redecls_begin(); d != decl->redecls_end(); ++d) {
auto def = get_definition(*d);
if (def) {
return def;
}
}
FileID fid = m.getFileID(frend->getLocation());
for (auto d = decl->redecls_begin(); d != decl->redecls_end(); ++d) {
if (*d != decl && m.getFileID((*d)->getLocation()) == fid) {
return *d;
}
}
for (auto d = decl->redecls_begin(); d != decl->redecls_end(); ++d) {
if (*d != decl) {
return *d;
}
}
return 0;
}
bool report::is_good_friend(const FriendDecl *frend, const NamedDecl *def)
{
std::string fn = llvm::dyn_cast<NamedDecl>(frend->getDeclContext())
->getQualifiedNameAsString();
std::string dn = def->getQualifiedNameAsString();
FileName ff(m.getFilename(frend->getLocation()));
FileName df(m.getFilename(def->getLocation()));
if (llvm::StringRef(dn).startswith_lower(fn)) {
return true;
}
if (auto rd = llvm::dyn_cast<RecordDecl>(def)) {
if (rd != rd->getDefinition()) {
if (rd->getLexicalDeclContext()->isFileContext()) {
return false;
}
}
}
if (ff.component() == df.component()) {
return true;
}
if (a.is_standard_namespace(fn) || a.is_standard_namespace(dn)) {
return true;
}
return false;
}
void report::local_friendship_only(FriendDecl const* frend)
{
const Decl *def = frend->getFriendDecl();
const TypeSourceInfo *tsi = frend->getFriendType();
const Type *type = tsi ? tsi->getTypeLoc().getTypePtr() : 0;
if (type && type->isElaboratedTypeSpecifier()) {
type = type->getAs<ElaboratedType>()->getNamedType().getTypePtr();
if (auto spec = type->getAs<TemplateSpecializationType>()) {
def = spec->getTemplateName().getAsTemplateDecl();
}
}
const char *tag;
if (def) {
if (auto method = llvm::dyn_cast<CXXMethodDecl>(def)) {
tag = "Friendship to a method";
def = method->getParent();
}
else if (llvm::dyn_cast<FunctionDecl>(def)) {
tag = "Friendship to a function";
}
else if (llvm::dyn_cast<FunctionTemplateDecl>(def)) {
tag = "Friendship to a function template";
}
else if (llvm::dyn_cast<ClassTemplateDecl>(def)) {
tag = "Friendship to a class template";
}
else {
tag = "Friendship";
}
if (auto d = other(frend, def)) {
def = d;
}
}
else {
tag = "Friendship to a class";
auto rd = type->getAsCXXRecordDecl();
while (rd && !(def = other(frend, rd))) {
rd = llvm::dyn_cast<CXXRecordDecl>(rd->getParent());
}
}
if (!def) {
def = frend->getFriendDecl();
if (!def && type) {
def = type->getAsCXXRecordDecl();
}
}
if (!def || !is_good_friend(frend, llvm::dyn_cast<NamedDecl>(def))) {
a.report(frend->getFriendLoc(), check_name, "TR19",
"%0 can only be granted within a component")
<< frend->getSourceRange()
<< tag;
}
}
void report::operator()()
{
MatchFinder mf;
OnMatch<> m1([&](const BoundNodes &nodes) {
local_friendship_only(nodes.getNodeAs<FriendDecl>("friend"));
});
mf.addDynamicMatcher(
decl(forEachDescendant(recordDecl(
unless(classTemplateSpecializationDecl(anything())),
forEach(friendDecl(anything()).bind("friend"))
))), &m1);
mf.addDynamicMatcher(
decl(forEachDescendant(recordDecl(
isExplicitTemplateSpecialization(),
forEach(friendDecl(anything()).bind("friend"))
))), &m1);
mf.addDynamicMatcher(
decl(forEachDescendant(classTemplateDecl(
forEach(friendDecl(anything()).bind("friend"))
))), &m1);
mf.match(*a.context()->getTranslationUnitDecl(), *a.context());
}
void subscribe(Analyser& analyser, Visitor& visitor, PPObserver& observer)
// Hook up the callback functions.
{
analyser.onTranslationUnitDone += report(analyser);
}
}
// ----------------------------------------------------------------------------
static RegisterCheck c1(check_name, &subscribe);
// ----------------------------------------------------------------------------
// Copyright (C) 2014 Bloomberg Finance L.P.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
// ----------------------------- ENDOF-FILE -----------------------------------
| mit |
matsumoto-r/mruby-uname | src/mrb_uname.c | 1 | 2694 | /*
** mrb_uname.c - Uname class
**
** Copyright (c) MATSUMOTO Ryosuke 2014
**
** See Copyright Notice in LICENSE
*/
#include "mruby.h"
#include "mruby/variable.h"
#include "mruby/class.h"
#include "mruby/data.h"
#include "mrb_uname.h"
#include <sys/utsname.h>
#define DONE mrb_gc_arena_restore(mrb, 0);
typedef struct {
struct utsname uname_b;
} mrb_uname_data;
static const struct mrb_data_type mrb_uname_data_type = {
"mrb_uname_data", mrb_free,
};
static mrb_value mrb_uname_wrap(mrb_state *mrb, struct RClass *uname,
mrb_uname_data *data)
{
return mrb_obj_value(Data_Wrap_Struct(mrb, uname, &mrb_uname_data_type,
data));
}
static mrb_uname_data *mrb_uname_get_uname_data(mrb_state *mrb, mrb_value self)
{
struct utsname uname_b;
mrb_uname_data *data = NULL;
mrb_sym uname_sym = mrb_intern_lit(mrb, "@@uname");
if (mrb_cv_defined(mrb, self, uname_sym)) {
Data_Get_Struct(mrb, mrb_cv_get(mrb, self, uname_sym),
&mrb_uname_data_type, data);
} else {
data = (mrb_uname_data *)mrb_malloc(mrb, sizeof(mrb_uname_data));
if (uname(&uname_b) != 0) {
mrb_raise(mrb, E_RUNTIME_ERROR, "uname failed");
}
data->uname_b = uname_b;
mrb_cv_set(mrb, self, uname_sym,
mrb_uname_wrap(mrb, mrb_class_ptr(self), data));
}
return data;
}
#define MRB_UNAME_GET_VALUE(mrb, self, name) \
mrb_str_new_cstr(mrb, (mrb_uname_get_uname_data(mrb, self))->uname_b.name)
static mrb_value mrb_uname_sysname(mrb_state *mrb, mrb_value self)
{
return MRB_UNAME_GET_VALUE(mrb, self, sysname);
}
static mrb_value mrb_uname_machine(mrb_state *mrb, mrb_value self)
{
return MRB_UNAME_GET_VALUE(mrb, self, machine);
}
static mrb_value mrb_uname_nodename(mrb_state *mrb, mrb_value self)
{
return MRB_UNAME_GET_VALUE(mrb, self, nodename);
}
static mrb_value mrb_uname_release(mrb_state *mrb, mrb_value self)
{
return MRB_UNAME_GET_VALUE(mrb, self, release);
}
static mrb_value mrb_uname_version(mrb_state *mrb, mrb_value self)
{
return MRB_UNAME_GET_VALUE(mrb, self, version);
}
void mrb_mruby_uname_gem_init(mrb_state *mrb)
{
struct RClass *uname;
uname = mrb_define_class(mrb, "Uname", mrb->object_class);
mrb_define_class_method(mrb, uname, "sysname", mrb_uname_sysname, MRB_ARGS_NONE());
mrb_define_class_method(mrb, uname, "machine", mrb_uname_machine, MRB_ARGS_NONE());
mrb_define_class_method(mrb, uname, "nodename", mrb_uname_nodename, MRB_ARGS_NONE());
mrb_define_class_method(mrb, uname, "release", mrb_uname_release, MRB_ARGS_NONE());
mrb_define_class_method(mrb, uname, "version", mrb_uname_version, MRB_ARGS_NONE());
DONE;
}
void mrb_mruby_uname_gem_final(mrb_state *mrb)
{
}
| mit |
Zhang-RQ/OI_DataBase | BZOJ/3262.cpp | 1 | 1733 | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int MAXN=1E5+5;
const int MAXK=2E5+5;
struct node{
int a,b,c,id;
bool operator < (const node &rhs) const
{
if(a!=rhs.a) return a<rhs.a;
if(b!=rhs.b) return b<rhs.b;
return c<rhs.c;
}
bool operator == (const node &rhs) const
{
return a==rhs.a&&b==rhs.b&&c==rhs.c;
}
}f[MAXN],tmp[MAXN];
int ans[MAXN],n,t[MAXK],k,cnt[MAXN];
void add(int pos,int val)
{
for(int i=pos;i<=k;i+=(-i)&i)
t[i]+=val;
}
int query(int pos)
{
int ret=0;
for(int i=pos;i>=1;i-=(-i)&i)
ret+=t[i];
return ret;
}
void CDQ(int l,int r)
{
if(l==r) return;
int mid=(l+r)>>1;
CDQ(l,mid);CDQ(mid+1,r);
int L=l,R=mid+1,cntt=0;
while(L<=mid&&R<=r)
{
if(f[L].b<=f[R].b) add(f[L].c,1),tmp[++cntt]=f[L],L++;
else ans[f[R].id]+=query(f[R].c),tmp[++cntt]=f[R],R++;
}
while(L<=mid) add(f[L].c,1),tmp[++cntt]=f[L++];
while(R<=r) ans[f[R].id]+=query(f[R].c),tmp[++cntt]=f[R++];
for(int i=l;i<=mid;i++) add(f[i].c,-1);
for(int i=1;i<=cntt;i++) f[i+l-1]=tmp[i];
}
int main()
{
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++) scanf("%d%d%d",&f[i].a,&f[i].b,&f[i].c),f[i].id=i;
sort(f+1,f+1+n);
node tp=f[n];int tt=1;
for(int i=n-1;i>=1;i--)
if(f[i]==tp) ans[f[i].id]+=tt,tt++;
else tt=1,tp=f[i];
CDQ(1,n);
for(int i=1;i<=n;i++)
cnt[ans[i]]++;
for(int i=0;i<n;i++)
printf("%d\n",cnt[i]);
}
| mit |
gbelwariar/Self-Made-Projects | Number-Of-Factors-Of-Factorial/Legendre's_Method.cpp | 1 | 1279 | #include <bits/stdc++.h>
using namespace std;
// A recursive funtion to find the exponent of the highest
// power of 'p' which is divisible by n!
int findHighestPower(int n, int p)
{
// Base Case
if(n==0)
return 0;
// Do floor operation and recurse
return (n/p + findHighestPower(n/p, p));
}
int countDivisorsFactorial(int n)
{
// We are going to perform a Sieve of Eratosthenes
// Create a boolean array "prime[0..n]" and initialize
// all entries it as true. A value in prime[i] will
// finally be false if i is Not a prime, else true.
bool prime[n+1];
memset(prime, true, sizeof(prime));
int count = 1;
for (int p=2; p*p<=n; p++)
{
// If prime[p] is not changed, then it is a prime
if (prime[p] == true)
{
// Update all multiples of p
for (int i=p*2; i<=n; i += p)
prime[i] = false;
}
}
// Print all prime numbers
for (int p=2; p<=n; p++)
if (prime[p])
count = count * (findHighestPower(n, p) + 1);
return (count);
}
// Driver Program to test above functions
int main()
{
int count = countDivisorsFactorial(10);
printf ("%d", count);
return (0);
}
| mit |
redagito/CG2015 | source/resource/core/LoadShader.cpp | 1 | 3729 | #include "LoadShader.h"
#include "CResourceManager.h"
#include "debug/Log.h"
#include "io/JsonUtil.h"
#include "io/JsonDeserialize.h"
#include "io/CIniFile.h"
bool load(const std::string& file, CResourceManager& manager, SShader& shader)
{
std::string vertex;
std::string tessControl;
std::string tessEval;
std::string geometry;
std::string fragment;
if (file.find(".ini") != std::string::npos)
{
if (!loadShaderFromIni(file, vertex, tessControl, tessEval, geometry, fragment))
{
return false;
}
}
else if (file.find(".json") != std::string::npos)
{
if (!loadShaderFromJson(file, vertex, tessControl, tessEval, geometry, fragment))
{
return false;
}
}
else
{
LOG_ERROR("Unknown or invalid shader file format.");
return false;
}
// Requires vertex and fragment shader files
if (vertex.empty())
{
LOG_ERROR("The shader program file %s is missing a vertex shader source file specifier.", file.c_str());
return false;
}
if (fragment.empty())
{
LOG_ERROR("The shader program file %s is missing a vertex shader source file specifier.", file.c_str());
return false;
}
ResourceId vertexId = manager.loadString(vertex, true);
if (vertexId == invalidResource)
{
LOG_ERROR(
"The vertex shader source file %s, specified in the shader program file %s could not "
"be loaded.", vertex.c_str(), file.c_str());
return false;
}
ResourceId fragmentId = manager.loadString(fragment, true);
if (fragmentId == invalidResource)
{
LOG_ERROR(
"The fragment shader source file %s, specified in the shader program file %s could not "
"be loaded.", fragment.c_str(), file.c_str());
return false;
}
ResourceId tessCtrlId = invalidResource;
if (!tessControl.empty())
{
tessCtrlId = manager.loadString(tessControl, true);
if (tessCtrlId == invalidResource)
{
LOG_ERROR(
"The tessellation control shader source file %s, specified in the shader program "
"file %s could not be loaded.", tessControl.c_str(), file.c_str());
return false;
}
}
ResourceId tessEvalId = invalidResource;
if (!tessEval.empty())
{
tessEvalId = manager.loadString(tessEval, true);
if (tessEvalId == invalidResource)
{
LOG_ERROR(
"The tessellation evaluation shader source file %s, specified in the shader "
"program file %s could not be loaded.", tessEval.c_str(), file.c_str());
return false;
}
}
ResourceId geometryId = invalidResource;
if (!geometry.empty())
{
geometryId = manager.loadString(geometry, true);
if (geometryId == invalidResource)
{
LOG_ERROR(
"The geometry shader source file %s, specified in the shader program file %s could "
"not be loaded.", geometry.c_str(), file.c_str());
return false;
}
}
shader.m_vertex = vertexId;
shader.m_tessCtrl = tessCtrlId;
shader.m_tessEval = tessEvalId;
shader.m_geometry = geometryId;
shader.m_fragment = fragmentId;
return true;
}
bool loadShaderFromIni(const std::string& file, std::string& vertex, std::string& tessControl,
std::string& tessEval, std::string& geometry, std::string& fragment)
{
// Load shader ini
CIniFile ini;
if (!ini.load(file))
{
LOG_ERROR("Failed to load shader program file %s", file.c_str());
return false;
}
// Load from ini
vertex = ini.getValue("vertex", "file", "");
tessControl = ini.getValue("tess_control", "file", "");
tessEval = ini.getValue("tess_evaluation", "file", "");
geometry = ini.getValue("geometry", "file", "");
fragment = ini.getValue("fragment", "file", "");
return true;
}
bool loadShaderFromJson(const std::string& file, std::string& vertex, std::string& tessControl,
std::string& tessEval, std::string& geometry, std::string& fragment)
{
LOG_DEBUG("Not implemented");
return false;
} | mit |
obono/ArduboyWorks | evasion/title.cpp | 1 | 15026 | #include "common.h"
/* Defines */
#define SPEED_MAX 9
#define ACCEL_MAX 3
#define DENSITY_MAX 5
#define THICKNESS_MAX 5
enum STATE_T : uint8_t {
STATE_INIT = 0,
STATE_TOP,
STATE_SETTINGS,
STATE_CREDIT,
STATE_NOTICE,
STATE_STARTED,
};
#define IMG_TITLE_W 88
#define IMG_TITLE_H 24
#define IMG_GUYPART_H 16
#define IMG_BUTTON_W 7
#define IMG_BUTTON_H 7
/* Typedefs */
typedef struct {
const uint8_t *bitmap;
uint8_t offsetX, width;
} GUYPART_T;
/* Local Functions */
static void handleInit(void);
static void handleTop(void);
static void handleSettings(void);
static void handleNotice(void);
static void handleAnyButton(void);
static void onTop(void);
static void onStart(void);
static void onSettings(void);
static void onCredit(void);
static void onMenuSpeed(void);
static void onMenuAccel(void);
static void onMenuDensity(void);
static void onMenuThickness(void);
static void onMenuSimpleMode(void);
static void drawInit(void);
static void drawTop(void);
static void drawSettings(void);
static void drawCredit(void);
static void drawNotice(void);
static void drawGuy(int16_t x);
static void drawText(const char *p, int lines);
/* Local Functions (macros) */
#define callHandlerFunc(n) ((void (*)(void)) pgm_read_ptr(handlerFuncTable + n))()
#define callDrawerFunc(n) ((void (*)(void)) pgm_read_ptr(drawerFuncTable + n))()
#define getGameSettings() (*((uint16_t *)&record) & 0xFFF) // trick!
/* Local Variables */
PROGMEM static const uint8_t imgTitle[264] = { // 88x24
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0xFF, 0xFF, 0xFF, 0xC1, 0x61, 0x61,
0x61, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x20, 0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xC0, 0xE0, 0xE0, 0x60, 0x00, 0x00, 0x80, 0xE0, 0xF0, 0x70, 0x30, 0x10, 0x10, 0xF0, 0xF0, 0xE0,
0x80, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0x70, 0x70, 0x30, 0x30, 0x30, 0x70, 0x60, 0x00, 0x00,
0xC6, 0xCE, 0xCE, 0x08, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF0, 0x70, 0x30, 0x30, 0xF0, 0xE0, 0x80,
0x00, 0x00, 0x00, 0xE0, 0xE0, 0xE0, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x20, 0x30, 0x30, 0x10, 0x10, 0x00, 0x00,
0x00, 0x01, 0x1F, 0x3F, 0x7C, 0x70, 0x3C, 0x3E, 0x0F, 0x07, 0x01, 0x00, 0x00, 0x3E, 0x7F, 0x7F,
0x61, 0x70, 0x38, 0x1C, 0x0E, 0x0F, 0x7F, 0xFF, 0xE0, 0x80, 0x00, 0x00, 0xC0, 0xC1, 0x83, 0x87,
0xCE, 0xDC, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x1F, 0x3F, 0x7F,
0x61, 0x40, 0x60, 0x60, 0x60, 0x30, 0x1F, 0x1F, 0x0E, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F, 0x03,
0x01, 0x00, 0x07, 0x3F, 0x7F, 0x78, 0x40, 0x40
};
PROGMEM static const uint8_t imgGuyPart0[] = { // 36x16 +2
0x00, 0x00, 0x60, 0xA0, 0x2C, 0x14, 0x08, 0x0F, 0x01, 0x02, 0x1C, 0x08, 0x08, 0x34, 0x4C, 0x20,
0x10, 0xF0, 0xC0, 0x60, 0x30, 0xF8, 0xF8, 0xF8, 0xFC, 0x7C, 0xBC, 0x78, 0xB0, 0x70, 0xB0, 0xD0,
0xE0, 0xE0, 0xC0, 0x00, 0x02, 0x46, 0xA9, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00,
0x00, 0x00, 0xC0, 0xE0, 0xE0, 0x00, 0x00, 0xA4, 0xF7, 0xFB, 0x7F, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE,
0xFC, 0xF8, 0xF9, 0xF3, 0xE7, 0xE7, 0xC3, 0x80
};
PROGMEM static const uint8_t imgGuyPart1[] = { // 46x16 +0
0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE1, 0xC1, 0x02, 0x87, 0x07, 0x07, 0x0F, 0x1F, 0x19, 0x1F, 0x1F,
0x1F, 0x0F, 0x07, 0x02, 0x03, 0x02, 0x85, 0xCA, 0xF5, 0xEE, 0xF7, 0xFF, 0xFF, 0xFF, 0x7F, 0xBF,
0x5F, 0xAF, 0x5F, 0xBF, 0xDF, 0xFF, 0x7F, 0x7E, 0x3C, 0x38, 0xB0, 0x80, 0x00, 0x00, 0x01, 0x01,
0x03, 0x03, 0x03, 0x05, 0x06, 0x0F, 0x0F, 0x1F, 0x1F, 0x3E, 0x3E, 0x7E, 0x7E, 0xFE, 0xFC, 0xFC,
0xF8, 0xF8, 0xFE, 0xFF, 0xFF, 0x7F, 0x3F, 0x9F, 0xCF, 0xC7, 0xE3, 0xE1, 0xE5, 0xF2, 0x75, 0xF2,
0xF9, 0xF9, 0x7C, 0xFC, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x80
};
PROGMEM static const uint8_t imgGuyPart2[] = { // 47x16 +16
0x00, 0x00, 0x01, 0x81, 0xE1, 0xF1, 0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F,
0x3F, 0x9E, 0x4D, 0x82, 0x45, 0x8B, 0x9F, 0x3F, 0x5F, 0xBF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0xFC, 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
0x7C, 0xFF, 0xFF, 0x7F, 0x7F, 0x7F, 0x3F, 0x3F, 0x1F, 0x1F, 0x1F, 0x0F, 0x0D, 0x06, 0x06, 0x07,
0x06, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x0E, 0x0C, 0x09, 0x02, 0x05, 0x0B, 0x05, 0x0B, 0x17,
0x2F, 0x5F, 0x3F, 0x7F, 0xFE, 0x7E, 0xFC, 0xFC, 0xFC, 0xF8, 0xF8, 0xF0, 0xC0, 0x80
};
PROGMEM static const uint8_t imgGuyPart3[] = { // 15x16 +56
0x01, 0x02, 0x05, 0x03, 0x07, 0x0F, 0x17, 0x2F, 0xD0, 0xFE, 0xFE, 0xFE, 0xFC, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x3D, 0x3F, 0x3F, 0x1F, 0x0F
};
PROGMEM static const GUYPART_T guyPartTable[] = {
{ imgGuyPart0, 2, 36 }, { imgGuyPart1, 0, 46 }, { imgGuyPart2, 16, 47 }, { imgGuyPart3, 56, 15 }
};
PROGMEM static const uint8_t imgButton[2][7] = { // 7x7 x2
{ 0x3E, 0x47, 0x6B, 0x6D, 0x6D, 0x41, 0x3E }, { 0x3E, 0x41, 0x55, 0x55, 0x51, 0x65, 0x3E }
};
PROGMEM static const char creditText[] = \
"- " APP_TITLE " -\0\0\0" APP_RELEASED "\0PROGRAMMED BY OBONO\0\0" \
"THIS PROGRAM IS\0RELEASED UNDER\0THE MIT LICENSE.\0\e";
PROGMEM static const char accelText[] = "OFF \0SLOW\0FAST";
PROGMEM static const char noticeText[] = \
"[SIMPLE MODE]\0\0\0IN THIS MODE,\0YOU CAN ACCESS\0THE SETTINGS BY\0" \
"HOLDING D-PAD DOWN.\0\0 OK CANCEL\0\e";
PROGMEM static void(*const handlerFuncTable[])(void) = {
handleInit, handleTop, handleSettings, handleAnyButton, handleNotice
};
PROGMEM static void(*const drawerFuncTable[])(void) = {
drawInit, drawTop, drawSettings, drawCredit, drawNotice
};
static STATE_T state = STATE_INIT;
static uint16_t lastSettings;
static bool lastSimpleMode, isSettingChenged;
/*---------------------------------------------------------------------------*/
/* Main Functions */
/*---------------------------------------------------------------------------*/
void initTitle(void)
{
if (state == STATE_INIT) {
counter = 0;
} else if (record.simpleMode && state == STATE_STARTED) {
onSettings();
} else {
onTop();
}
}
MODE_T updateTitle(void)
{
callHandlerFunc(state);
randomSeed(rand() ^ micros()); // Shuffle random
return (state == STATE_STARTED) ? MODE_GAME : MODE_TITLE;
}
void drawTitle(void)
{
if (state == STATE_STARTED) return;
if (isInvalid) arduboy.clear();
callDrawerFunc(state);
isInvalid = false;
}
/*---------------------------------------------------------------------------*/
/* Control Functions */
/*---------------------------------------------------------------------------*/
static void handleInit(void)
{
if (++counter >= FPS) onTop();
isInvalid = true;
}
static void handleTop(void)
{
if (record.simpleMode) {
SIMPLE_OP_T op = handleSimpleMode();
if (op == SIMPLE_OP_START) onStart();
if (op == SIMPLE_OP_SETTINGS) onSettings();
} else {
handleMenu();
}
}
static void handleSettings(void)
{
handleDPad();
uint8_t pos = getMenuItemPos();
if (pos <= 3) {
if (padX != 0) {
playSoundTick();
switch (pos) {
case 0: record.speed = circulateOne(record.speed, padX, SPEED_MAX); break;
case 1: record.acceleration = circulate(record.acceleration, padX, ACCEL_MAX); break;
case 2: record.density = circulateOne(record.density, padX, DENSITY_MAX); break;
case 3: record.thickness = circulateOne(record.thickness, padX, THICKNESS_MAX); break;
}
isSettingChenged = true;
}
} else if (pos == 4 && arduboy.buttonDown(LEFT_BUTTON | RIGHT_BUTTON)) {
onMenuSimpleMode();
}
handleMenu();
if (arduboy.buttonDown(UP_BUTTON | DOWN_BUTTON)) isSettingChenged = true;
}
static void handleNotice(void)
{
if (arduboy.buttonDown(A_BUTTON)) {
onTop();
} else if (arduboy.buttonDown(B_BUTTON)) {
record.simpleMode = false;
onSettings();
}
}
static void handleAnyButton(void)
{
if (arduboy.buttonDown(A_BUTTON | B_BUTTON)) {
playSoundClick();
state = STATE_TOP;
isInvalid = true;
}
}
/*---------------------------------------------------------------------------*/
/* Menu Handlers */
/*---------------------------------------------------------------------------*/
static void onTop(void)
{
if (state == STATE_SETTINGS || state == STATE_NOTICE) {
playSoundClick();
if (state == STATE_SETTINGS && record.simpleMode && !lastSimpleMode) {
state = STATE_NOTICE;
isInvalid = true;
return;
}
if (getGameSettings() != lastSettings) {
record.hiscore = 0;
isRecordDirty = true;
}
if (record.simpleMode != lastSimpleMode) isRecordDirty = true;
writeRecord();
}
clearMenuItems();
addMenuItem(F("GAME START"), onStart);
addMenuItem(F("SETTINGS"), onSettings);
addMenuItem(F("CREDIT"), onCredit);
setMenuItemPos((state == STATE_SETTINGS) ? 1 : 0);
setMenuCoords(56, 2, 72, 17, false, true);
counter = 0;
state = STATE_TOP;
isInvalid = true;
dprintln(F("Title screen"));
}
static void onStart(void)
{
state = STATE_STARTED;
dprintln(F("Game start"));
}
static void onSettings(void)
{
playSoundClick();
clearMenuItems();
addMenuItem(F("SPEED"), onMenuSpeed);
addMenuItem(F("ACCELERATION"), onMenuAccel);
addMenuItem(F("DENSITY"), onMenuDensity);
addMenuItem(F("THICKNESS"), onMenuThickness);
addMenuItem(F("SIMPLE MODE"), onMenuSimpleMode);
addMenuItem(F("EXIT"), onTop);
setMenuItemPos((state == STATE_NOTICE) ? 4 : 0);
setMenuCoords(10, 8, 112, 35, false, false);
if (state != STATE_NOTICE) {
lastSettings = getGameSettings();
lastSimpleMode = record.simpleMode;
}
state = STATE_SETTINGS;
isInvalid = true;
isSettingChenged = true;
dprintln(F("Show settings"));
}
static void onCredit(void)
{
playSoundClick();
state = STATE_CREDIT;
isInvalid = true;
dprintln(F("Show credit"));
}
static void onMenuSpeed(void)
{
playSoundClick();
record.speed = circulateOne(record.speed, 1, SPEED_MAX);
isSettingChenged = true;
}
static void onMenuAccel(void)
{
playSoundClick();
record.acceleration = circulate(record.acceleration, 1, ACCEL_MAX);
isSettingChenged = true;
}
static void onMenuDensity(void)
{
playSoundClick();
record.density = circulateOne(record.density, 1, DENSITY_MAX);
isSettingChenged = true;
}
static void onMenuThickness(void)
{
playSoundClick();
record.thickness = circulateOne(record.thickness, 1, THICKNESS_MAX);
isSettingChenged = true;
}
static void onMenuSimpleMode(void)
{
playSoundClick();
record.simpleMode = !record.simpleMode;
isSettingChenged = true;
}
/*---------------------------------------------------------------------------*/
/* Draw Functions */
/*---------------------------------------------------------------------------*/
static void drawInit(void)
{
int16_t guyX = 0;
if (counter < FPS / 2) {
int16_t tmp = FPS / 2 - counter;
guyX = tmp * tmp / 7;
}
drawGuy(guyX);
if (counter >= FPS / 2) {
int16_t tmp = FPS - counter;
int16_t x = WIDTH - IMG_TITLE_W - tmp * tmp / 7;
drawBitmapBordered(x, 16, imgTitle, IMG_TITLE_W, IMG_TITLE_H);
}
}
static void drawTop(void)
{
if (isInvalid) {
drawGuy(0);
drawBitmapBordered(WIDTH - IMG_TITLE_W, 16, imgTitle, IMG_TITLE_W, IMG_TITLE_H);
if (record.hiscore > 0) {
arduboy.printEx(0, 50, F("HI:"));
arduboy.print(record.hiscore / 6);
}
#ifdef DEBUG
arduboy.printEx(98, 40, F("DEBUG"));
#endif
}
(record.simpleMode) ? drawSimpleModeInstruction() : drawMenuItems(isInvalid);
}
static void drawSettings(void)
{
if (isInvalid) {
arduboy.printEx(34, 0, F("[SETTINGS]"));
arduboy.drawFastHLine(0, 44, 128, WHITE);
arduboy.printEx(10, 48, F("PLAY COUNT "));
arduboy.print(record.playCount);
arduboy.printEx(10, 54, F("PLAY TIME"));
drawTime(76, 54, record.playFrames);
}
drawMenuItems(isInvalid);
if (isSettingChenged) {
for (int i = 0; i < 5; i++) {
int16_t dx = 100 - (getMenuItemPos() == i) * 4, dy = i * 6 + 8;
const char *p;
switch (i) {
case 0:
arduboy.printEx(dx, dy, record.speed);
break;
case 1:
p = accelText + record.acceleration * 5;
arduboy.printEx(dx, dy, (const __FlashStringHelper *)p);
break;
case 2:
arduboy.printEx(dx, dy, record.density);
break;
case 3:
arduboy.printEx(dx, dy, record.thickness);
break;
case 4:
arduboy.printEx(dx, dy, record.simpleMode ? F("ON ") : F("OFF"));
break;
}
}
isSettingChenged = false;
}
}
static void drawCredit(void)
{
if (isInvalid) drawText(creditText, 11);
}
static void drawNotice(void)
{
if (isInvalid) {
arduboy.drawRect(2, 7, 123, 49, WHITE);
drawText(noticeText, 11);
for (int i = 0; i < 2; i++) {
arduboy.drawBitmap(21 + i * 36, 46, imgButton[i], IMG_BUTTON_W, IMG_BUTTON_H);
}
}
}
/*---------------------------------------------------------------------------*/
static void drawGuy(int16_t x)
{
GUYPART_T guyPart;
for (int i = 0; i < 4; i++) {
memcpy_P(&guyPart, guyPartTable + i, sizeof(GUYPART_T));
arduboy.drawBitmap(x + guyPart.offsetX, IMG_GUYPART_H * i, guyPart.bitmap,
guyPart.width, IMG_GUYPART_H);
}
}
static void drawText(const char *p, int16_t y)
{
while (pgm_read_byte(p) != '\e') {
uint8_t len = strnlen_P(p, 21);
arduboy.printEx(64 - len * 3, y, (const __FlashStringHelper *) p);
p += len + 1;
y += (len == 0) ? 2 : 6;
}
}
| mit |
AntonBogomolov/LightSpeedLimit | LSL/AppManager.cpp | 1 | 2680 | #include "AppManager.h"
#include "global.h"
#include "VideoManeger.h"
#include "ResourceManager.h"
#include "GLUtils.h"
#include "EventsManager.h"
#include "InputManager.h"
#include "GameEvent.h"
#include "InputEvent.h"
#include "AppDefines.h"
#include "Log.h"
#include "Scene.h"
#include "MainMenu.h"
#include "StarSystemScene.h"
CAppManager::CAppManager(void) : CAppBase()
{
CInputManager::getInstance()->addEventHandler(this, CInputEvent::IEVENT_KEY_DOWN | CInputEvent::IEVENT_WINDOW);
}
CAppManager::~CAppManager(void)
{
}
void CAppManager::Init()
{
__super::Init();
}
void CAppManager::appEvents(const float dt)
{
CGameEvent* currEvent;
int newScrWidth;
int newScrHeight;
while ((currEvent = CEventsManager::getEvent()) != NULL)
{
switch (currEvent->getEventId())
{
case Defines::EV_WINDOW_RESIZED:
newScrWidth = (int)currEvent->getParam(0);
newScrHeight = (int)currEvent->getParam(1);
CVideoManeger::scrWidth = newScrWidth;
CVideoManeger::scrHeight = newScrHeight;
CVideoManeger::GetInstance()->uiPlatform->getRenderManagerPtr()->setViewSize(newScrWidth, newScrHeight);
CLog::getInstance()->addInfo("Resize screen : " + std::to_string(newScrWidth) + "x" + std::to_string(newScrHeight));
CGLUtils::resizeWindow();
currScene->resizeScene();
break;
case Defines::EV_UI_NEWGAME:
changeScene(new CStarSystemScene());
break;
case Defines::EV_UI_MENU:
changeScene(new CMainMenu());
break;
case Defines::EV_APP_START:
changeScene(new CMainMenu());
break;
case Defines::EV_APP_EXIT:
CLog::getInstance()->addInfo("Normal app exit");
quit = true;
break;
default:
currScene->appEventHandler(currEvent);
break;
}
if (currEvent) delete currEvent;
}
}
void CAppManager::inputEventHandler(const CInputEvent event)
{
CGameEvent* gEvent;
switch (event.eventId)
{
case SDL_WINDOWEVENT:
switch (event.window.windowEvent)
{
case SDL_QUIT:
CEventsManager::addEvent(new CGameEvent(Defines::EV_APP_EXIT));
break;
case SDL_WINDOWEVENT_RESIZED:
gEvent = new CGameEvent(Defines::EV_WINDOW_RESIZED);
gEvent->addParam(event.window.data1);
gEvent->addParam(event.window.data2);
CEventsManager::addEvent(gEvent);
break;
default:
break;
}
break;
case SDL_KEYDOWN:
switch (event.keyboard.keyboardEvent)
{
case SDLK_ESCAPE:
CEventsManager::addEvent(new CGameEvent(Defines::EV_APP_EXIT));
break;
case SDLK_n:
CEventsManager::addEvent(new CGameEvent(Defines::EV_UI_NEWGAME));
break;
case SDLK_m:
CEventsManager::addEvent(new CGameEvent(Defines::EV_UI_MENU));
break;
default:
break;
}
break;
default:
break;
}
} | mit |
niello/deusexmachina | Deps/vorbis/lib/info.c | 1 | 19788 | /********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: maintain the info structure, info <-> header packets
********************************************************************/
/* general handling of the header and the vorbis_info structure (and
substructures) */
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "codec_internal.h"
#include "codebook.h"
#include "registry.h"
#include "window.h"
#include "psy.h"
#include "misc.h"
#include "os.h"
#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.6"
#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20180316 (Now 100% fewer shells)"
/* helpers */
static void _v_writestring(oggpack_buffer *o,const char *s, int bytes){
while(bytes--){
oggpack_write(o,*s++,8);
}
}
static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
while(bytes--){
*buf++=oggpack_read(o,8);
}
}
void vorbis_comment_init(vorbis_comment *vc){
memset(vc,0,sizeof(*vc));
}
void vorbis_comment_add(vorbis_comment *vc,const char *comment){
vc->user_comments=_ogg_realloc(vc->user_comments,
(vc->comments+2)*sizeof(*vc->user_comments));
vc->comment_lengths=_ogg_realloc(vc->comment_lengths,
(vc->comments+2)*sizeof(*vc->comment_lengths));
vc->comment_lengths[vc->comments]=strlen(comment);
vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1);
strcpy(vc->user_comments[vc->comments], comment);
vc->comments++;
vc->user_comments[vc->comments]=NULL;
}
void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){
/* Length for key and value +2 for = and \0 */
char *comment=_ogg_malloc(strlen(tag)+strlen(contents)+2);
strcpy(comment, tag);
strcat(comment, "=");
strcat(comment, contents);
vorbis_comment_add(vc, comment);
_ogg_free(comment);
}
/* This is more or less the same as strncasecmp - but that doesn't exist
* everywhere, and this is a fairly trivial function, so we include it */
static int tagcompare(const char *s1, const char *s2, int n){
int c=0;
while(c < n){
if(toupper(s1[c]) != toupper(s2[c]))
return !0;
c++;
}
return 0;
}
char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){
long i;
int found = 0;
int taglen = strlen(tag)+1; /* +1 for the = we append */
char *fulltag = _ogg_malloc(taglen+1);
strcpy(fulltag, tag);
strcat(fulltag, "=");
for(i=0;i<vc->comments;i++){
if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
if(count == found) {
/* We return a pointer to the data, not a copy */
_ogg_free(fulltag);
return vc->user_comments[i] + taglen;
} else {
found++;
}
}
}
_ogg_free(fulltag);
return NULL; /* didn't find anything */
}
int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){
int i,count=0;
int taglen = strlen(tag)+1; /* +1 for the = we append */
char *fulltag = _ogg_malloc(taglen+1);
strcpy(fulltag,tag);
strcat(fulltag, "=");
for(i=0;i<vc->comments;i++){
if(!tagcompare(vc->user_comments[i], fulltag, taglen))
count++;
}
_ogg_free(fulltag);
return count;
}
void vorbis_comment_clear(vorbis_comment *vc){
if(vc){
long i;
if(vc->user_comments){
for(i=0;i<vc->comments;i++)
if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
_ogg_free(vc->user_comments);
}
if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
if(vc->vendor)_ogg_free(vc->vendor);
memset(vc,0,sizeof(*vc));
}
}
/* blocksize 0 is guaranteed to be short, 1 is guaranteed to be long.
They may be equal, but short will never ge greater than long */
int vorbis_info_blocksize(vorbis_info *vi,int zo){
codec_setup_info *ci = vi->codec_setup;
return ci ? ci->blocksizes[zo] : -1;
}
/* used by synthesis, which has a full, alloced vi */
void vorbis_info_init(vorbis_info *vi){
memset(vi,0,sizeof(*vi));
vi->codec_setup=_ogg_calloc(1,sizeof(codec_setup_info));
}
void vorbis_info_clear(vorbis_info *vi){
codec_setup_info *ci=vi->codec_setup;
int i;
if(ci){
for(i=0;i<ci->modes;i++)
if(ci->mode_param[i])_ogg_free(ci->mode_param[i]);
for(i=0;i<ci->maps;i++) /* unpack does the range checking */
if(ci->map_param[i]) /* this may be cleaning up an aborted
unpack, in which case the below type
cannot be trusted */
_mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]);
for(i=0;i<ci->floors;i++) /* unpack does the range checking */
if(ci->floor_param[i]) /* this may be cleaning up an aborted
unpack, in which case the below type
cannot be trusted */
_floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]);
for(i=0;i<ci->residues;i++) /* unpack does the range checking */
if(ci->residue_param[i]) /* this may be cleaning up an aborted
unpack, in which case the below type
cannot be trusted */
_residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]);
for(i=0;i<ci->books;i++){
if(ci->book_param[i]){
/* knows if the book was not alloced */
vorbis_staticbook_destroy(ci->book_param[i]);
}
if(ci->fullbooks)
vorbis_book_clear(ci->fullbooks+i);
}
if(ci->fullbooks)
_ogg_free(ci->fullbooks);
for(i=0;i<ci->psys;i++)
_vi_psy_free(ci->psy_param[i]);
_ogg_free(ci);
}
memset(vi,0,sizeof(*vi));
}
/* Header packing/unpacking ********************************************/
static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
codec_setup_info *ci=vi->codec_setup;
int bs;
if(!ci)return(OV_EFAULT);
vi->version=oggpack_read(opb,32);
if(vi->version!=0)return(OV_EVERSION);
vi->channels=oggpack_read(opb,8);
vi->rate=oggpack_read(opb,32);
vi->bitrate_upper=(ogg_int32_t)oggpack_read(opb,32);
vi->bitrate_nominal=(ogg_int32_t)oggpack_read(opb,32);
vi->bitrate_lower=(ogg_int32_t)oggpack_read(opb,32);
bs = oggpack_read(opb,4);
if(bs<0)goto err_out;
ci->blocksizes[0]=1<<bs;
bs = oggpack_read(opb,4);
if(bs<0)goto err_out;
ci->blocksizes[1]=1<<bs;
if(vi->rate<1)goto err_out;
if(vi->channels<1)goto err_out;
if(ci->blocksizes[0]<64)goto err_out;
if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
if(ci->blocksizes[1]>8192)goto err_out;
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
return(0);
err_out:
vorbis_info_clear(vi);
return(OV_EBADHEADER);
}
static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
int i;
int vendorlen=oggpack_read(opb,32);
if(vendorlen<0)goto err_out;
if(vendorlen>opb->storage-8)goto err_out;
vc->vendor=_ogg_calloc(vendorlen+1,1);
_v_readstring(opb,vc->vendor,vendorlen);
i=oggpack_read(opb,32);
if(i<0)goto err_out;
if(i>((opb->storage-oggpack_bytes(opb))>>2))goto err_out;
vc->comments=i;
vc->user_comments=_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments));
vc->comment_lengths=_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths));
for(i=0;i<vc->comments;i++){
int len=oggpack_read(opb,32);
if(len<0)goto err_out;
if(len>opb->storage-oggpack_bytes(opb))goto err_out;
vc->comment_lengths[i]=len;
vc->user_comments[i]=_ogg_calloc(len+1,1);
_v_readstring(opb,vc->user_comments[i],len);
}
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
return(0);
err_out:
vorbis_comment_clear(vc);
return(OV_EBADHEADER);
}
/* all of the real encoding details are here. The modes, books,
everything */
static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
codec_setup_info *ci=vi->codec_setup;
int i;
/* codebooks */
ci->books=oggpack_read(opb,8)+1;
if(ci->books<=0)goto err_out;
for(i=0;i<ci->books;i++){
ci->book_param[i]=vorbis_staticbook_unpack(opb);
if(!ci->book_param[i])goto err_out;
}
/* time backend settings; hooks are unused */
{
int times=oggpack_read(opb,6)+1;
if(times<=0)goto err_out;
for(i=0;i<times;i++){
int test=oggpack_read(opb,16);
if(test<0 || test>=VI_TIMEB)goto err_out;
}
}
/* floor backend settings */
ci->floors=oggpack_read(opb,6)+1;
if(ci->floors<=0)goto err_out;
for(i=0;i<ci->floors;i++){
ci->floor_type[i]=oggpack_read(opb,16);
if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb);
if(!ci->floor_param[i])goto err_out;
}
/* residue backend settings */
ci->residues=oggpack_read(opb,6)+1;
if(ci->residues<=0)goto err_out;
for(i=0;i<ci->residues;i++){
ci->residue_type[i]=oggpack_read(opb,16);
if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out;
ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb);
if(!ci->residue_param[i])goto err_out;
}
/* map backend settings */
ci->maps=oggpack_read(opb,6)+1;
if(ci->maps<=0)goto err_out;
for(i=0;i<ci->maps;i++){
ci->map_type[i]=oggpack_read(opb,16);
if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out;
ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb);
if(!ci->map_param[i])goto err_out;
}
/* mode settings */
ci->modes=oggpack_read(opb,6)+1;
if(ci->modes<=0)goto err_out;
for(i=0;i<ci->modes;i++){
ci->mode_param[i]=_ogg_calloc(1,sizeof(*ci->mode_param[i]));
ci->mode_param[i]->blockflag=oggpack_read(opb,1);
ci->mode_param[i]->windowtype=oggpack_read(opb,16);
ci->mode_param[i]->transformtype=oggpack_read(opb,16);
ci->mode_param[i]->mapping=oggpack_read(opb,8);
if(ci->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out;
if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out;
if(ci->mode_param[i]->mapping>=ci->maps)goto err_out;
if(ci->mode_param[i]->mapping<0)goto err_out;
}
if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
return(0);
err_out:
vorbis_info_clear(vi);
return(OV_EBADHEADER);
}
/* Is this packet a vorbis ID header? */
int vorbis_synthesis_idheader(ogg_packet *op){
oggpack_buffer opb;
char buffer[6];
if(op){
oggpack_readinit(&opb,op->packet,op->bytes);
if(!op->b_o_s)
return(0); /* Not the initial packet */
if(oggpack_read(&opb,8) != 1)
return 0; /* not an ID header */
memset(buffer,0,6);
_v_readstring(&opb,buffer,6);
if(memcmp(buffer,"vorbis",6))
return 0; /* not vorbis */
return 1;
}
return 0;
}
/* The Vorbis header is in three packets; the initial small packet in
the first page that identifies basic parameters, a second packet
with bitstream comments and a third packet that holds the
codebook. */
int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){
oggpack_buffer opb;
if(op){
oggpack_readinit(&opb,op->packet,op->bytes);
/* Which of the three types of header is this? */
/* Also verify header-ness, vorbis */
{
char buffer[6];
int packtype=oggpack_read(&opb,8);
memset(buffer,0,6);
_v_readstring(&opb,buffer,6);
if(memcmp(buffer,"vorbis",6)){
/* not a vorbis header */
return(OV_ENOTVORBIS);
}
switch(packtype){
case 0x01: /* least significant *bit* is read first */
if(!op->b_o_s){
/* Not the initial packet */
return(OV_EBADHEADER);
}
if(vi->rate!=0){
/* previously initialized info header */
return(OV_EBADHEADER);
}
return(_vorbis_unpack_info(vi,&opb));
case 0x03: /* least significant *bit* is read first */
if(vi->rate==0){
/* um... we didn't get the initial header */
return(OV_EBADHEADER);
}
if(vc->vendor!=NULL){
/* previously initialized comment header */
return(OV_EBADHEADER);
}
return(_vorbis_unpack_comment(vc,&opb));
case 0x05: /* least significant *bit* is read first */
if(vi->rate==0 || vc->vendor==NULL){
/* um... we didn;t get the initial header or comments yet */
return(OV_EBADHEADER);
}
if(vi->codec_setup==NULL){
/* improperly initialized vorbis_info */
return(OV_EFAULT);
}
if(((codec_setup_info *)vi->codec_setup)->books>0){
/* previously initialized setup header */
return(OV_EBADHEADER);
}
return(_vorbis_unpack_books(vi,&opb));
default:
/* Not a valid vorbis header type */
return(OV_EBADHEADER);
break;
}
}
}
return(OV_EBADHEADER);
}
/* pack side **********************************************************/
static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){
codec_setup_info *ci=vi->codec_setup;
if(!ci||
ci->blocksizes[0]<64||
ci->blocksizes[1]<ci->blocksizes[0]){
return(OV_EFAULT);
}
/* preamble */
oggpack_write(opb,0x01,8);
_v_writestring(opb,"vorbis", 6);
/* basic information about the stream */
oggpack_write(opb,0x00,32);
oggpack_write(opb,vi->channels,8);
oggpack_write(opb,vi->rate,32);
oggpack_write(opb,vi->bitrate_upper,32);
oggpack_write(opb,vi->bitrate_nominal,32);
oggpack_write(opb,vi->bitrate_lower,32);
oggpack_write(opb,ov_ilog(ci->blocksizes[0]-1),4);
oggpack_write(opb,ov_ilog(ci->blocksizes[1]-1),4);
oggpack_write(opb,1,1);
return(0);
}
static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
int bytes = strlen(ENCODE_VENDOR_STRING);
/* preamble */
oggpack_write(opb,0x03,8);
_v_writestring(opb,"vorbis", 6);
/* vendor */
oggpack_write(opb,bytes,32);
_v_writestring(opb,ENCODE_VENDOR_STRING, bytes);
/* comments */
oggpack_write(opb,vc->comments,32);
if(vc->comments){
int i;
for(i=0;i<vc->comments;i++){
if(vc->user_comments[i]){
oggpack_write(opb,vc->comment_lengths[i],32);
_v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]);
}else{
oggpack_write(opb,0,32);
}
}
}
oggpack_write(opb,1,1);
return(0);
}
static int _vorbis_pack_books(oggpack_buffer *opb,vorbis_info *vi){
codec_setup_info *ci=vi->codec_setup;
int i;
if(!ci)return(OV_EFAULT);
oggpack_write(opb,0x05,8);
_v_writestring(opb,"vorbis", 6);
/* books */
oggpack_write(opb,ci->books-1,8);
for(i=0;i<ci->books;i++)
if(vorbis_staticbook_pack(ci->book_param[i],opb))goto err_out;
/* times; hook placeholders */
oggpack_write(opb,0,6);
oggpack_write(opb,0,16);
/* floors */
oggpack_write(opb,ci->floors-1,6);
for(i=0;i<ci->floors;i++){
oggpack_write(opb,ci->floor_type[i],16);
if(_floor_P[ci->floor_type[i]]->pack)
_floor_P[ci->floor_type[i]]->pack(ci->floor_param[i],opb);
else
goto err_out;
}
/* residues */
oggpack_write(opb,ci->residues-1,6);
for(i=0;i<ci->residues;i++){
oggpack_write(opb,ci->residue_type[i],16);
_residue_P[ci->residue_type[i]]->pack(ci->residue_param[i],opb);
}
/* maps */
oggpack_write(opb,ci->maps-1,6);
for(i=0;i<ci->maps;i++){
oggpack_write(opb,ci->map_type[i],16);
_mapping_P[ci->map_type[i]]->pack(vi,ci->map_param[i],opb);
}
/* modes */
oggpack_write(opb,ci->modes-1,6);
for(i=0;i<ci->modes;i++){
oggpack_write(opb,ci->mode_param[i]->blockflag,1);
oggpack_write(opb,ci->mode_param[i]->windowtype,16);
oggpack_write(opb,ci->mode_param[i]->transformtype,16);
oggpack_write(opb,ci->mode_param[i]->mapping,8);
}
oggpack_write(opb,1,1);
return(0);
err_out:
return(-1);
}
int vorbis_commentheader_out(vorbis_comment *vc,
ogg_packet *op){
oggpack_buffer opb;
oggpack_writeinit(&opb);
if(_vorbis_pack_comment(&opb,vc)){
oggpack_writeclear(&opb);
return OV_EIMPL;
}
op->packet = _ogg_malloc(oggpack_bytes(&opb));
memcpy(op->packet, opb.buffer, oggpack_bytes(&opb));
op->bytes=oggpack_bytes(&opb);
op->b_o_s=0;
op->e_o_s=0;
op->granulepos=0;
op->packetno=1;
oggpack_writeclear(&opb);
return 0;
}
int vorbis_analysis_headerout(vorbis_dsp_state *v,
vorbis_comment *vc,
ogg_packet *op,
ogg_packet *op_comm,
ogg_packet *op_code){
int ret=OV_EIMPL;
vorbis_info *vi=v->vi;
oggpack_buffer opb;
private_state *b=v->backend_state;
if(!b||vi->channels<=0||vi->channels>256){
b = NULL;
ret=OV_EFAULT;
goto err_out;
}
/* first header packet **********************************************/
oggpack_writeinit(&opb);
if(_vorbis_pack_info(&opb,vi))goto err_out;
/* build the packet */
if(b->header)_ogg_free(b->header);
b->header=_ogg_malloc(oggpack_bytes(&opb));
memcpy(b->header,opb.buffer,oggpack_bytes(&opb));
op->packet=b->header;
op->bytes=oggpack_bytes(&opb);
op->b_o_s=1;
op->e_o_s=0;
op->granulepos=0;
op->packetno=0;
/* second header packet (comments) **********************************/
oggpack_reset(&opb);
if(_vorbis_pack_comment(&opb,vc))goto err_out;
if(b->header1)_ogg_free(b->header1);
b->header1=_ogg_malloc(oggpack_bytes(&opb));
memcpy(b->header1,opb.buffer,oggpack_bytes(&opb));
op_comm->packet=b->header1;
op_comm->bytes=oggpack_bytes(&opb);
op_comm->b_o_s=0;
op_comm->e_o_s=0;
op_comm->granulepos=0;
op_comm->packetno=1;
/* third header packet (modes/codebooks) ****************************/
oggpack_reset(&opb);
if(_vorbis_pack_books(&opb,vi))goto err_out;
if(b->header2)_ogg_free(b->header2);
b->header2=_ogg_malloc(oggpack_bytes(&opb));
memcpy(b->header2,opb.buffer,oggpack_bytes(&opb));
op_code->packet=b->header2;
op_code->bytes=oggpack_bytes(&opb);
op_code->b_o_s=0;
op_code->e_o_s=0;
op_code->granulepos=0;
op_code->packetno=2;
oggpack_writeclear(&opb);
return(0);
err_out:
memset(op,0,sizeof(*op));
memset(op_comm,0,sizeof(*op_comm));
memset(op_code,0,sizeof(*op_code));
if(b){
if(vi->channels>0)oggpack_writeclear(&opb);
if(b->header)_ogg_free(b->header);
if(b->header1)_ogg_free(b->header1);
if(b->header2)_ogg_free(b->header2);
b->header=NULL;
b->header1=NULL;
b->header2=NULL;
}
return(ret);
}
double vorbis_granule_time(vorbis_dsp_state *v,ogg_int64_t granulepos){
if(granulepos == -1) return -1;
/* We're not guaranteed a 64 bit unsigned type everywhere, so we
have to put the unsigned granpo in a signed type. */
if(granulepos>=0){
return((double)granulepos/v->vi->rate);
}else{
ogg_int64_t granuleoff=0xffffffff;
granuleoff<<=31;
granuleoff|=0x7ffffffff;
return(((double)granulepos+2+granuleoff+granuleoff)/v->vi->rate);
}
}
const char *vorbis_version_string(void){
return GENERAL_VENDOR_STRING;
}
| mit |
paintdream/PaintsNow | Source/Shell/LostDream/main.cpp | 1 | 1215 | // LostDream Test Entry
#include "../../Core/PaintsNow.h"
#include "../../Utility/LeavesFlute/LeavesFlute.h"
#include "LostDream.h"
#include "Spatial/Spatial.h"
#include "Reflection/Reflection.h"
#include "Parallel/Parallel.h"
#include "Network/Network.h"
#include "../../Utility/LeavesFlute/Platform.h"
#ifdef _WIN32
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")
#endif
using namespace PaintsNow;
#if defined(_MSC_VER) && _MSC_VER <= 1200 && _DEBUG
extern "C" int _CrtDbgReport() {
return 0;
}
#endif
int main(void) {
#ifdef _WIN32
WSADATA wsa;
::WSAStartup(0x201, &wsa);
#endif
LostDream lostDream;
lostDream.RegisterQualifier(WrapFactory(UniqueType<NewRPC>()), 1);
lostDream.RegisterQualifier(WrapFactory(UniqueType<ServerClient>()), 1);
lostDream.RegisterQualifier(WrapFactory(UniqueType<Serialization>()), 1);
lostDream.RegisterQualifier(WrapFactory(UniqueType<TaskAllocator>()), 1);
lostDream.RegisterQualifier(WrapFactory(UniqueType<Memory>()), 1);
lostDream.RegisterQualifier(WrapFactory(UniqueType<RandomQuery>()), 12);
lostDream.RegisterQualifier(WrapFactory(UniqueType<Annotation>()), 1);
lostDream.RunQualifiers(true, 0, 4);
#ifdef _WIN32
::WSACleanup();
#endif
return 0;
}
| mit |
murataka9/iOSinOF-NativeGUISample | of_v0.9.3_ios_release/libs/openFrameworks/sound/ofSoundBuffer.cpp | 1 | 18814 | /*
* ofSoundBuffer.cpp
*
* Created on: 25/07/2012
* Author: arturo
*/
#include "ofSoundBuffer.h"
#include "ofSoundUtils.h"
#include "ofLog.h"
#include <limits>
#if !defined(TARGET_ANDROID) && !defined(TARGET_IPHONE) && !defined(TARGET_LINUX_ARM)
ofSoundBuffer::InterpolationAlgorithm ofSoundBuffer::defaultAlgorithm = ofSoundBuffer::Hermite;
#else
ofSoundBuffer::InterpolationAlgorithm ofSoundBuffer::defaultAlgorithm = ofSoundBuffer::Linear;
#endif
ofSoundBuffer::ofSoundBuffer()
:channels(1)
,samplerate(44100)
,tickCount(0)
,soundStreamDeviceID(0){
}
ofSoundBuffer::ofSoundBuffer(short * shortBuffer, std::size_t numFrames, std::size_t numChannels, unsigned int sampleRate)
:tickCount(0)
,soundStreamDeviceID(0) {
copyFrom(shortBuffer, numFrames, numChannels, sampleRate);
checkSizeAndChannelsConsistency("constructor");
}
void ofSoundBuffer::copyFrom(const short * shortBuffer, std::size_t numFrames, std::size_t numChannels, unsigned int sampleRate) {
this->channels = numChannels;
this->samplerate = sampleRate;
buffer.resize(numFrames * numChannels);
for(std::size_t i = 0; i < size(); i++){
buffer[i] = shortBuffer[i]/float(numeric_limits<short>::max());
}
checkSizeAndChannelsConsistency("copyFrom");
}
void ofSoundBuffer::copyFrom(const float * floatBuffer, std::size_t numFrames, std::size_t numChannels, unsigned int sampleRate) {
this->channels = numChannels;
this->samplerate = sampleRate;
buffer.assign(floatBuffer, floatBuffer + (numFrames * numChannels));
checkSizeAndChannelsConsistency("copyFrom");
}
void ofSoundBuffer::copyFrom(const vector<short> & shortBuffer, std::size_t numChannels, unsigned int sampleRate){
copyFrom(&shortBuffer[0],shortBuffer.size()/numChannels,numChannels,sampleRate);
}
void ofSoundBuffer::copyFrom(const vector<float> & floatBuffer, std::size_t numChannels, unsigned int sampleRate){
copyFrom(&floatBuffer[0],floatBuffer.size()/numChannels,numChannels,sampleRate);
}
void ofSoundBuffer::toShortPCM(vector<short> & dst) const{
dst.resize(size());
for(std::size_t i = 0; i < size(); i++){
dst[i] = buffer[i]*float(numeric_limits<short>::max());
}
}
void ofSoundBuffer::toShortPCM(short * dst) const{
for(std::size_t i = 0; i < size(); i++){
dst[i] = buffer[i]*float(numeric_limits<short>::max());
}
}
vector<float> & ofSoundBuffer::getBuffer(){
return buffer;
}
const vector<float> & ofSoundBuffer::getBuffer() const{
return buffer;
}
uint64_t ofSoundBuffer::getDurationMS() const{
return uint64_t(getNumFrames()) * uint64_t(1000) / uint64_t(samplerate);
}
uint64_t ofSoundBuffer::getDurationMicros() const{
return uint64_t(getNumFrames()) * uint64_t(1000000) / uint64_t(samplerate);
}
uint64_t ofSoundBuffer::getDurationNanos() const{
return uint64_t(getNumFrames()) * uint64_t(1000000000) / uint64_t(samplerate);
}
void ofSoundBuffer::setNumChannels(int channels){
this->channels = channels;
checkSizeAndChannelsConsistency("setNumChannels");
}
void ofSoundBuffer::setSampleRate(unsigned int rate){
samplerate = rate;
}
void ofSoundBuffer::allocate(size_t numSamples, size_t numChannels){
resize(numSamples*numChannels);
channels = numChannels;
}
void ofSoundBuffer::resize(std::size_t samples, float val){
buffer.resize(samples, val);
checkSizeAndChannelsConsistency("resize(samples,val)");
}
void ofSoundBuffer::clear(){
buffer.clear();
}
void ofSoundBuffer::set(float value){
buffer.assign(buffer.size(), value);
checkSizeAndChannelsConsistency("set");
}
bool ofSoundBuffer::checkSizeAndChannelsConsistency(const std::string& _function ) {
std::string function = _function;
if ( function.size()!= 0 ){
function += ": ";
}
if ( (size()%channels) != 0 ){
ofLogWarning("ofSoundBuffer") << function << "channel count " << channels << " is not consistent with sample count " << size() << " (non-zero remainder)";
return false;
}
return true;
}
float & ofSoundBuffer::operator[](std::size_t pos){
return buffer[pos];
}
const float & ofSoundBuffer::operator[](std::size_t pos) const{
return buffer[pos];
}
float & ofSoundBuffer::getSample(std::size_t frameIndex, std::size_t channel){
return buffer[(frameIndex * channels) + channel];
}
const float & ofSoundBuffer::getSample(std::size_t frameIndex, std::size_t channel) const {
return buffer[(frameIndex * channels) + channel];
}
void ofSoundBuffer::swap(ofSoundBuffer & buffer){
std::swap(this->channels, buffer.channels);
std::swap(this->samplerate, buffer.samplerate);
std::swap(this->tickCount, buffer.tickCount);
std::swap(this->soundStreamDeviceID, buffer.soundStreamDeviceID);
std::swap(this->buffer, buffer.buffer);
}
ofSoundBuffer ofSoundBuffer::operator*(float value){
ofSoundBuffer ret = *this;
ret *= value;
return ret;
}
ofSoundBuffer & ofSoundBuffer::operator*=(float value){
for(std::size_t i=0;i<buffer.size();i++){
buffer[i] *= value;
}
return *this;
}
void ofSoundBuffer::stereoPan(float left, float right){
if(channels!=2){
ofLogWarning("ofSoundBuffer") << "stereoPan called on a buffer with " << channels << " channels, only works with 2 channels";
return;
}
float * bufferPtr = &buffer[0];
for(std::size_t i=0;i<getNumFrames();i++){
*bufferPtr++ *= left;
*bufferPtr++ *= right;
}
}
void ofSoundBuffer::copyTo(ofSoundBuffer & soundBuffer, std::size_t nFrames, std::size_t outChannels,std::size_t fromFrame,bool loop) const{
soundBuffer.resize(nFrames*outChannels);
soundBuffer.setNumChannels(outChannels);
soundBuffer.setSampleRate(samplerate);
copyTo(&soundBuffer[0], nFrames, outChannels, fromFrame, loop);
}
void ofSoundBuffer::copyTo(ofSoundBuffer & outBuffer, std::size_t fromFrame, bool loop) const{
copyTo(&outBuffer[0], outBuffer.getNumFrames(), outBuffer.getNumChannels(), fromFrame, loop);
}
void ofSoundBuffer::addTo(ofSoundBuffer & soundBuffer, std::size_t nFrames, std::size_t outChannels,std::size_t fromFrame, bool loop) const {
soundBuffer.resize(nFrames*outChannels);
soundBuffer.setNumChannels(outChannels);
soundBuffer.setSampleRate(samplerate);
addTo(&soundBuffer.getBuffer()[0], nFrames, outChannels, fromFrame, loop);
}
void ofSoundBuffer::addTo(ofSoundBuffer & outBuffer, std::size_t fromFrame, bool loop) const{
addTo(&outBuffer[0], outBuffer.getNumFrames(), outBuffer.getNumChannels(), fromFrame, loop);
}
void ofSoundBuffer::copyTo(float * outBuffer, std::size_t nFrames, std::size_t outChannels, std::size_t fromFrame, bool loop) const{
// figure out how many frames we can copy before we need to stop or loop
std::size_t nFramesToCopy = nFrames;
if ((fromFrame + nFrames) >= this->getNumFrames()){
nFramesToCopy = this->getNumFrames() - fromFrame;
}
const float * buffPtr = &buffer[fromFrame * channels];
// if channels count matches we can just memcpy
if(channels == outChannels){
memcpy(outBuffer, buffPtr, nFramesToCopy * channels * sizeof(float));
outBuffer += nFramesToCopy * outChannels;
} else if(channels > outChannels){
// otherwise, if we have more channels than the output is requesting,
// we copy the first outChannels channels
for(std::size_t i = 0; i < nFramesToCopy; i++){
for(std::size_t j = 0; j < outChannels; j++){
*outBuffer++ = *buffPtr++;
}
// and skip the rest
buffPtr += channels - outChannels;
}
} else {
// we have fewer channels than output is requesting. so replicate as many channels as possible then loop.
// if we have 2 channels and output wants 5, data is copied from our channels in the following in order:
// 1 2 1 2 1
for(std::size_t i = 0; i < nFramesToCopy; i++){
for(std::size_t j = 0; j < outChannels; j++){
*outBuffer++ = buffPtr[(j%channels)];
}
buffPtr += channels;
}
}
// do we have anything left?
int framesRemaining = nFrames - (int)nFramesToCopy;
if (framesRemaining > 0){
if(!loop || size() == 0){
// fill with 0s
for(std::size_t i = 0; i < framesRemaining * outChannels; i++){
outBuffer[i] = 0;
}
}else{
// loop
copyTo(outBuffer, framesRemaining, outChannels, 0, loop);
}
}
}
void ofSoundBuffer::addTo(float * outBuffer, std::size_t nFrames, std::size_t outChannels, std::size_t fromFrame, bool loop) const{
// figure out how many frames we can copy before we need to stop or loop
std::size_t nFramesToCopy = nFrames;
if ((fromFrame + nFrames) >= this->getNumFrames()){
nFramesToCopy = this->getNumFrames() - fromFrame;
}
const float * buffPtr = &buffer[fromFrame * channels];
// if channels count matches it is easy
if(channels == outChannels){
for(std::size_t i = 0; i < (nFramesToCopy * outChannels); i++){
outBuffer[i] += buffPtr[i];
}
outBuffer += nFramesToCopy * outChannels;
} else if(channels > outChannels){
// otherwise, if we have more channels than the output is requesting,
// we copy the first outChannels channels
for(std::size_t i = 0; i < nFramesToCopy; i++){
for(std::size_t j = 0; j < outChannels; j++){
*outBuffer++ += *buffPtr++;
}
// and skip the rest
buffPtr += channels - outChannels;
}
} else {
// we have fewer channels than output is requesting. so replicate as many channels as possible then loop.
// if we have 2 channels and output wants 5, data is copied from our channels in the following in order:
// 1 2 1 2 1
for(std::size_t i = 0; i < nFramesToCopy; i++){
for(std::size_t j = 0; j < outChannels; j++){
*outBuffer++ += buffPtr[(j%channels)];
}
buffPtr += channels;
}
}
// do we have anything left?
int framesRemaining = nFrames - (int)nFramesToCopy;
if (framesRemaining > 0 && loop){
// loop
addTo(outBuffer, framesRemaining, outChannels, 0, loop);
}
}
void ofSoundBuffer::append(ofSoundBuffer & other){
if(other.getNumChannels() != getNumChannels()){
ofLogError() << "can't append sound buffers with different num channels";
return;
}
buffer.insert(buffer.end(),other.buffer.begin(),other.buffer.end());
}
static bool prepareBufferForResampling(const ofSoundBuffer &in, ofSoundBuffer &out, std::size_t numFrames) {
std::size_t totalOutBufferSize = numFrames * in.getNumChannels();
if(totalOutBufferSize < out.getBuffer().max_size()) {
out.resize(totalOutBufferSize,0);
} else {
ofLogError("ofSoundUtils") << "resampling would create a buffer size of " << totalOutBufferSize << " (too large for std::vector)";
return false;
}
out.setNumChannels(in.getNumChannels());
out.setSampleRate(in.getSampleRate());
return true;
}
// based on maximilian optimized for performance.
// might lose 1 or 2 samples when it reaches the end of the buffer
void ofSoundBuffer::linearResampleTo(ofSoundBuffer &outBuffer, std::size_t fromFrame, std::size_t numFrames, float speed, bool loop) const {
std::size_t inChannels = getNumChannels();
std::size_t inFrames = getNumFrames();
bool bufferReady = prepareBufferForResampling(*this, outBuffer, numFrames);
if(!bufferReady) {
outBuffer = *this;
return;
}
std::size_t start = fromFrame;
std::size_t end = start*inChannels + double(numFrames*inChannels)*speed;
double position = start;
std::size_t intPosition = position;
float increment = speed;
std::size_t copySize = inChannels*sizeof(float);
std::size_t to;
if(end<size()-2*inChannels){
to = numFrames;
}else if(fromFrame+2>inFrames){
to = 0;
}else{
to = ceil(float(inFrames-2-fromFrame)/speed);
}
float remainder = position - intPosition;
float * resBufferPtr = &outBuffer[0];
float a, b;
for(std::size_t i=0;i<to;i++){
intPosition *= inChannels;
for(std::size_t j=0;j<inChannels;j++){
a = buffer[intPosition];
b = buffer[intPosition+inChannels];
*resBufferPtr++ = ofLerp(a,b,remainder);
}
position += increment;
intPosition = position;
remainder = position - intPosition;
}
if(end>=size()-2*inChannels){
to = numFrames-to;
if(loop){
intPosition %= inFrames;
for(std::size_t i=0;i<to;i++){
intPosition *= inChannels;
for(std::size_t j=0;j<inChannels;j++){
a = buffer[intPosition];
b = buffer[intPosition+inChannels];
*resBufferPtr++ = (b-a)*remainder+a;
}
resBufferPtr+=inChannels;
position += increment;
intPosition = position;
}
}else{
memset(resBufferPtr,0,to*copySize);
}
}
}
// based on maximilian optimized for performance.
// might lose 1 to 3 samples when it reaches the end of the buffer
void ofSoundBuffer::hermiteResampleTo(ofSoundBuffer &outBuffer, std::size_t fromFrame, std::size_t numFrames, float speed, bool loop) const {
std::size_t inChannels = getNumChannels();
std::size_t inFrames = getNumFrames();
bool bufferReady = prepareBufferForResampling(*this, outBuffer, numFrames);
if(!bufferReady) {
outBuffer = *this;
return;
}
std::size_t start = fromFrame;
std::size_t end = start*inChannels + double(numFrames*inChannels)*speed;
double position = start;
std::size_t intPosition = position;
float remainder = position - intPosition;
float increment = speed;
std::size_t copySize = inChannels*sizeof(float);
std::size_t to;
if(end<size()-3*inChannels){
to = numFrames;
}else if(fromFrame+3>inFrames){
to = 0;
}else{
to = double(inFrames-3-fromFrame)/speed;
}
float * resBufferPtr = &outBuffer[0];
float a,b,c,d;
std::size_t from = 0;
while(intPosition==0){
intPosition *= inChannels;
for(std::size_t j=0;j<inChannels;++j){
a=loop?buffer[j]:0;
b=buffer[intPosition+j];
c=buffer[intPosition+j+inChannels];
d=buffer[intPosition+j+inChannels*2];
*resBufferPtr++ = ofInterpolateHermite(a, b, c, d, remainder);
}
position += increment;
intPosition = position;
remainder = position - intPosition;
from++;
}
for(std::size_t i=from;i<to;++i){
intPosition *= inChannels;
for(std::size_t j=0;j<inChannels;++j){
a=buffer[intPosition+j-inChannels];
b=buffer[intPosition+j];
c=buffer[intPosition+j+inChannels];
d=buffer[intPosition+j+inChannels*2];
*resBufferPtr++ = ofInterpolateHermite(a, b, c, d, remainder);
}
position += increment;
intPosition = position;
remainder = position - intPosition;
}
if(end>=size()-3*inChannels){
to = numFrames-to;
if(loop){
intPosition %= size();
for(std::size_t i=0;i<to;++i){
for(std::size_t j=0;j<inChannels;++j){
a=buffer[intPosition+j-inChannels];
b=buffer[intPosition+j];
c=buffer[intPosition+j+inChannels];
d=buffer[intPosition+j+inChannels*2];
*resBufferPtr++ = ofInterpolateHermite(a, b, c, d, remainder);
}
position += increment;
intPosition = position;
remainder = position - intPosition;
intPosition *= inChannels;
}
}else{
memset(resBufferPtr,0,to*copySize);
}
}
}
void ofSoundBuffer::resampleTo(ofSoundBuffer & buffer, std::size_t fromFrame, std::size_t numFrames, float speed, bool loop, InterpolationAlgorithm algorithm) const {
switch(algorithm){
case Linear:
linearResampleTo(buffer, fromFrame, numFrames, speed, loop);
break;
case Hermite:
hermiteResampleTo(buffer, fromFrame, numFrames, speed, loop);
break;
}
}
void ofSoundBuffer::resample(float speed, InterpolationAlgorithm algorithm){
ofSoundBuffer resampled;
resampleTo(resampled, 0, ceilf(getNumFrames() / speed), speed, false, algorithm);
*this = resampled;
}
void ofSoundBuffer::getChannel(ofSoundBuffer & targetBuffer, std::size_t sourceChannel) const {
if(channels == 0) {
ofLogWarning("ofSoundBuffer") << "getChannel requested on empty buffer";
return;
}
if (sourceChannel >= channels){
ofLogWarning("ofSoundBuffer") << "getChannel requested channel " << sourceChannel << " but we only have " << channels << " channels. clamping channel to " << channels-1;
sourceChannel = channels-1;
}
targetBuffer.setNumChannels(1);
targetBuffer.setSampleRate(samplerate);
if(channels == 1){
copyTo(targetBuffer, getNumFrames(), 1, 0);
}else{
// fetch samples from only one channel
targetBuffer.resize(getNumFrames());
const float * bufferPtr = &this->buffer[sourceChannel];
for(std::size_t i = 0; i < targetBuffer.getNumFrames(); i++){
targetBuffer[i] = *bufferPtr;
bufferPtr += channels;
}
}
}
void ofSoundBuffer::setChannel(const ofSoundBuffer & inBuffer, std::size_t targetChannel){
// resize ourself to match inBuffer
resize(inBuffer.getNumFrames() * channels);
// copy from inBuffer to targetChannel
float * bufferPtr = &this->buffer[targetChannel];
const float * inBufferPtr = &(inBuffer[targetChannel]);
for(std::size_t i = 0; i < getNumFrames(); i++){
*bufferPtr = *inBufferPtr;
bufferPtr += channels;
// inBuffer.getNumChannels() is probably 1 but let's be safe
inBufferPtr += inBuffer.getNumChannels();
}
}
float ofSoundBuffer::getRMSAmplitude() const {
double acc = 0;
for(size_t i = 0; i < buffer.size(); i++){
acc += buffer[i] * buffer[i];
}
return sqrt(acc / (double)buffer.size());
}
float ofSoundBuffer::getRMSAmplitudeChannel(std::size_t channel) const {
if(channel > channels - 1) {
return 0;
}
double acc = 0;
for(size_t i = 0; i < getNumFrames(); i++) {
float sample = getSample(i, channel);
acc += sample * sample;
}
return sqrt(acc / (double)getNumFrames());
}
void ofSoundBuffer::normalize(float level){
float maxAmplitude = 0;
for(std::size_t i = 0; i < size(); i++) {
maxAmplitude = max(maxAmplitude, abs(buffer[i]));
}
float normalizationFactor = level/maxAmplitude;
for(std::size_t i = 0; i < size(); i++) {
buffer[i] *= normalizationFactor;
}
}
bool ofSoundBuffer::trimSilence(float threshold, bool trimStart, bool trimEnd) {
if(buffer.empty()) {
ofLogVerbose("ofSoundBuffer") << "attempted to trim empty buffer";
return true;
}
std::size_t firstNonSilence = 0;
std::size_t lastNonSilence = buffer.size() - 1;
if(trimStart) {
for(std::size_t i = 0; i < buffer.size(); ++i) {
if(abs(buffer[i]) > threshold) {
firstNonSilence = i;
break;
}
}
}
if(trimEnd) {
for(std::size_t i = lastNonSilence; i > firstNonSilence; --i) {
if(abs(buffer[i]) > threshold) {
lastNonSilence = i;
break;
}
}
}
firstNonSilence -= firstNonSilence % getNumChannels();
lastNonSilence -= lastNonSilence % getNumChannels();
if(trimEnd) {
buffer.erase(buffer.begin() + lastNonSilence, buffer.end());
}
if(trimStart) {
buffer.erase(buffer.begin(), buffer.begin() + firstNonSilence);
}
return checkSizeAndChannelsConsistency("trimSilence");
}
void ofSoundBuffer::fillWithNoise(float amplitude){
for (std::size_t i=0; i<size(); i++ ) {
buffer[i] = ofRandom(-amplitude, amplitude);
}
}
float ofSoundBuffer::fillWithTone( float pitchHz, float phase ){
float step = TWO_PI*(pitchHz/samplerate);
for (std::size_t i=0; i<size()/channels; i++ ) {
std::size_t base = i*channels;
for (std::size_t j=0; j<channels; j++)
buffer[base+j] = sinf(phase);
phase += step;
}
return phase;
}
namespace std{
void swap(ofSoundBuffer & src, ofSoundBuffer & dst){
src.swap(dst);
}
}
| mit |
relminator/SpaceImpakto-DS | src/source/bezier_loop.cpp | 1 | 1051 | /*======================================================================
loop Bezier Coordinates
Generated By Bezier Designer
Relminator 2010
======================================================================*/
#include "bezier_loop.h"
// Point Format:
// x,y
// Table Format:
// d,t
Bezier::Coord bezier_loop_coord[] =
{
{-146,52},{300,160},{-30,188},{517,-80}
};
Bezier::Coord bezier_loop_coord_mirrored[] =
{
{-146,140},{300,32},{-30,4},{517,272}
};
Bezier::Table bezier_loop_table[] =
{
{0,0},{168521,132},{311711,264},{431715,396},{530763,529},{611219,661},{675664,793},{727014,925},
{768650,1057},{804366,1189},{837794,1321},{871508,1453},{906625,1586},{943092,1718},{980137,1850},{1016587,1982},
{1051078,2114},{1082206,2246},{1108716,2378},{1129934,2510},{1147044,2643},{1165343,2775},{1191864,2907},{1231212,3039},
{1286364,3171},{1359706,3303},{1453397,3435},{1569496,3567},{1710013,3700},{1876933,3832},{2072226,3964},{2297854,4096}
};
| mit |
nisc-code/dpkg | dpkg-1.17.5ubuntu5.3/dpkg-split/join.c | 1 | 4442 | /*
* dpkg-split - splitting and joining of multipart *.deb archives
* join.c - joining
*
* Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <compat.h>
#include <assert.h>
#include <limits.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <dpkg/i18n.h>
#include <dpkg/dpkg.h>
#include <dpkg/dpkg-db.h>
#include <dpkg/buffer.h>
#include <dpkg/options.h>
#include "dpkg-split.h"
void reassemble(struct partinfo **partlist, const char *outputfile) {
struct dpkg_error err;
int fd_out, fd_in;
unsigned int i;
printf(P_("Putting package %s together from %d part: ",
"Putting package %s together from %d parts: ",
partlist[0]->maxpartn),
partlist[0]->package,partlist[0]->maxpartn);
fd_out = creat(outputfile, 0644);
if (fd_out < 0)
ohshite(_("unable to open output file `%.250s'"), outputfile);
for (i=0; i<partlist[0]->maxpartn; i++) {
struct partinfo *pi = partlist[i];
fd_in = open(pi->filename, O_RDONLY);
if (fd_in < 0)
ohshite(_("unable to (re)open input part file `%.250s'"), pi->filename);
if (fd_skip(fd_in, pi->headerlen, &err) < 0)
ohshit(_("cannot skip split package header for '%s': %s"), pi->filename,
err.str);
if (fd_fd_copy(fd_in, fd_out, pi->thispartlen, &err) < 0)
ohshit(_("cannot append split package part '%s' to '%s': %s"),
pi->filename, outputfile, err.str);
close(fd_in);
printf("%d ",i+1);
}
if (fsync(fd_out))
ohshite(_("unable to sync file '%s'"), outputfile);
if (close(fd_out))
ohshite(_("unable to close file '%s'"), outputfile);
printf(_("done\n"));
}
void addtopartlist(struct partinfo **partlist,
struct partinfo *pi, struct partinfo *refi) {
int i;
if (strcmp(pi->package,refi->package) ||
strcmp(pi->version,refi->version) ||
strcmp(pi->md5sum,refi->md5sum) ||
pi->orglength != refi->orglength ||
pi->maxpartn != refi->maxpartn ||
pi->maxpartlen != refi->maxpartlen) {
print_info(pi);
print_info(refi);
ohshit(_("files `%.250s' and `%.250s' are not parts of the same file"),
pi->filename,refi->filename);
}
i= pi->thispartn-1;
if (partlist[i])
ohshit(_("there are several versions of part %d - at least `%.250s' and `%.250s'"),
pi->thispartn, pi->filename, partlist[i]->filename);
partlist[i]= pi;
}
int
do_join(const char *const *argv)
{
const char *thisarg;
struct partqueue *queue = NULL;
struct partqueue *pq;
struct partinfo *refi, **partlist;
unsigned int i;
if (!*argv)
badusage(_("--%s requires one or more part file arguments"),
cipaction->olong);
while ((thisarg= *argv++)) {
pq= nfmalloc(sizeof(struct partqueue));
mustgetpartinfo(thisarg,&pq->info);
pq->nextinqueue= queue;
queue= pq;
}
refi= NULL;
for (pq= queue; pq; pq= pq->nextinqueue)
if (!refi || pq->info.thispartn < refi->thispartn) refi= &pq->info;
assert(refi);
partlist= nfmalloc(sizeof(struct partinfo*)*refi->maxpartn);
for (i = 0; i < refi->maxpartn; i++)
partlist[i] = NULL;
for (pq= queue; pq; pq= pq->nextinqueue) {
struct partinfo *pi = &pq->info;
addtopartlist(partlist,pi,refi);
}
for (i=0; i<refi->maxpartn; i++) {
if (!partlist[i]) ohshit(_("part %d is missing"),i+1);
}
if (!opt_outputfile) {
char *p;
p= nfmalloc(strlen(refi->package)+1+strlen(refi->version)+sizeof(DEBEXT));
strcpy(p,refi->package);
strcat(p, "_");
strcat(p,refi->version);
strcat(p, "_");
strcat(p, refi->arch ? refi->arch : "unknown");
strcat(p,DEBEXT);
opt_outputfile = p;
}
reassemble(partlist, opt_outputfile);
return 0;
}
| mit |
UANDES-OSN-201720/tarea-1-1-arpaci-lovers | main.c | 1 | 5900 | #include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <time.h>
int random_time(){
srand(time(NULL));
int t = (rand() % (500001 - 100000)) + 100000;
return t;
}
typedef struct
{
unsigned int banco;
unsigned int sucursal;
unsigned int numero;
unsigned int saldo;
} cuenta;
typedef struct
{
unsigned int id;
cuenta origen;
cuenta destino;
unsigned int monto;
unsigned int erex; //0 para error, 1 para exito
} movimiento;
// Cuenten con este codigo monolitico en una funcion
// main como punto de partida.
// Idealmente, el codigo del programa deberia estar
// adecuadamente modularizado en distintas funciones,
// e incluso en archivos separados, con dependencias
// distribuidas en headers. Pueden modificar el Makefile
// libremente para lograr esto.
int main(int argc, char** argv) {
size_t bufsize = 512;
char* commandBuf = malloc(sizeof(char)*bufsize);
char** cuentas;
int* sucursales;
// Para guardar descriptores de pipe
// el elemento 0 es para lectura
// y el elemento 1 es para escritura.
int bankPipe[2];
char readbuffer[80]; // buffer para lectura desde pipe
// Se crea un pipe...
pipe(bankPipe);
const int bankId = getpid() % 1000;
printf("Bienvenido a Banco '%d'\n", bankId);
while (true) {
printf(">>");
getline(&commandBuf, &bufsize, stdin);
// Manera de eliminar el \n leido por getline
commandBuf[strlen(commandBuf)-1] = '\0';
printf("Comando ingresado: '%s'\n", commandBuf);
if (!strncmp("quit", commandBuf, strlen("quit"))) {
break;
}
else if (!strncmp("init", commandBuf, strlen("init"))) {
// OJO: Llamar a fork dentro de un ciclo
// es potencialmente peligroso, dado que accidentalmente
// pueden iniciarse procesos sin control.
// Buscar en Google "fork bomb"
char strnum[512]; //Cantidad de cuentas ingresadas por el usuario, si es que lo hizo.
strcpy(strnum, "None");
if (strlen(commandBuf)> strlen("init")){
strcpy(strnum, "");
int j = 0;
for (int i=strlen("init")+1;i<strlen(commandBuf);i++){
if (commandBuf[i]!=0){
strnum[j] = commandBuf[i];
j++;
}
}
}
pid_t sucid = fork();
if (sucid > 0) {
printf("Sucursal creada con ID '%d'\n", sucid);
// Enviando cantidad de cuentas a la sucursal a la sucursal
write(bankPipe[1], strnum, (strlen(strnum)+1));
continue;
}
// Proceso de sucursal-----------------------------------------------
else if (!sucid) {
int total_cuentas;
cuenta* cuentas;
int accNumber = 1000;
int sucId = getpid() % 1000;
printf("\nHola, soy la sucursal '%d'\n", sucId);
int bytes = read(bankPipe[0], readbuffer, sizeof(readbuffer));
if (strncmp("None", readbuffer, strlen("None"))!=0){
accNumber = atoi(readbuffer);
}
printf("Tengo '%d' cuentas\n", accNumber);
//ACA SE TIENEN QUE CREAR LAS CUENTAS
while (true) {
// 100 milisegundos...
bytes = read(bankPipe[0], readbuffer, sizeof(readbuffer));
printf("Soy la sucursal '%d' y leí el mensaje: '%s'\n", sucId, readbuffer);
//Ejecuta lo que le dice el mensaje
if (!strncmp("kill", readbuffer, strlen("kill"))){
// Cerrar lado de lectura del pipe
close(bankPipe[0]);
// Para terminar, el proceso hijo debe llamar a _exit,
// debido a razones documentadas aqui:
// https://goo.gl/Yxyuxb
_exit(EXIT_SUCCESS);
}
// Usar usleep para dormir una cantidad de microsegundos
usleep(random_time());
}
}
// error
else {
fprintf(stderr, "Error al crear proceso de sucursal!\n");
return (EXIT_FAILURE);
}
}
else if (!strncmp("kill", commandBuf, strlen("kill"))) {
//Se elimina sucursal especificada.
printf("Matar proceso\n");
}
else if (!strncmp("list", commandBuf, strlen("list"))) {
if (sucursales[0]!='\0' && cuentas[0][0]!='\0'){
//Se imprime lista de movimientos en la sucursal
printf("Lista:\n");
printf("Sucursal\t|n° inicial\t|n° final\t|cuentas totales\n");
for (int s=0;s<sizeof(sucursales);s++){
char id[3];
sprintf(id, "%d", sucursales[s]);
for (int j=0; j<sizeof(cuentas); j++){
if (!strncmp(id, cuentas[j], strlen(id))){
//Armar string
printf("hi\n");
}
}
}
}
}
else if (!strncmp("dump_errs", commandBuf, strlen("dump_errs"))) {
printf("In dump_errs\n");
if (strlen(commandBuf)> strlen("dump_errs")){
char strnum[4];
strcpy(strnum, "");
printf("strnum: %s\n", strnum);
int j = 0;
for (int i=strlen("dump_errs")+1;i<strlen(commandBuf);i++){
if (commandBuf[i]!=0){
strnum[j] = commandBuf[i];
j++;
}
}
int num = atoi(strnum);
printf("%d\n",num);
}
//Creación archivo csv de movimientos fallidos en una sucursal
printf("Archivo creado\n");
}
else if (!strncmp("dump_accs", commandBuf, strlen("dump_accs"))) {
//Creación archivo csv de cuentas en una sucursal
printf("Archivo creado\n");
}
else if (!strncmp("dump", commandBuf, strlen("dump"))) {
//Creación archivo csv de movimientos en una sucursal
printf("Archivo creado\n");
}
else {
fprintf(stderr, "Comando no reconocido.\n");
}
}
printf("Terminando ejecucion limpiamente...\n");
// Cerrar lado de escritura del pipe
close(bankPipe[1]);
return(EXIT_SUCCESS);
}
| mit |
Moonhint/Smart-Lock-Prototype | Embed2014/Keil/Library/NUC1xx/Source/SPI.c | 1 | 99845 | /*---------------------------------------------------------------------------------------------------------*/
/* */
/* Copyright(c) 2009 Nuvoton Technology Corp. All rights reserved. */
/* */
/*---------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------*/
/* Include related headers */
/*---------------------------------------------------------------------------------------------------------*/
#include "NUC1xx.h"
#include "core_cm0.h"
#include "SPI.h"
#include "SYS.h"
/*---------------------------------------------------------------------------------------------------------*/
/* Global file scope (static) variables */
/*---------------------------------------------------------------------------------------------------------*/
typedef struct
{
uint8_t bInUse;
PFN_DRVSPI_CALLBACK pfnOneTransDoneCallBack; /* Function pointer of the one transaction done interrupt */
uint32_t u32OneTransDoneUserData;
PFN_DRVSPI_CALLBACK pfn3WireStartCallBack; /* Function pointer of the 3-wire SPI start interrupt */
uint32_t u32ThreeWireStartUserData;
} S_DRVSPI_HANDLE;
static S_DRVSPI_HANDLE g_sSpiHandler[4];
static SPI_T * SPI_PORT[4]={SPI0, SPI1, SPI2, SPI3};
/*---------------------------------------------------------------------------------------------------------*/
/* Interrupt Handler */
/*---------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------*/
/* Function: SPI0_IRQHandler */
/* */
/* Parameters: */
/* None. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* SPI0 interrupt handler. Clear the SPI interrupt flag and execute the callback function. */
/*---------------------------------------------------------------------------------------------------------*/
void SPI0_IRQHandler(void)
{
if( SPI0->CNTRL.IF == 1 ) /* One transaction done interrupt */
{
SPI0->CNTRL.IF = 1; /* write '1' to clear SPI0 interrupt flag */
if(g_sSpiHandler[0].pfnOneTransDoneCallBack != NULL)
{
g_sSpiHandler[0].pfnOneTransDoneCallBack(g_sSpiHandler[0].u32OneTransDoneUserData);
}
}
if( SPI0->CNTRL2.SLV_START_INTSTS == 1 ) /* 3-wire SPI start interrupt */
{
SPI0->CNTRL2.SLV_START_INTSTS = 1; /* write '1' to clear SPI0 3-wire start interrupt flag */
if(g_sSpiHandler[0].pfn3WireStartCallBack != NULL)
{
g_sSpiHandler[0].pfn3WireStartCallBack(g_sSpiHandler[0].u32ThreeWireStartUserData);
}
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: SPI1_IRQHandler */
/* */
/* Parameters: */
/* None. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* SPI1 interrupt handler. Clear the SPI interrupt flag and execute the callback function. */
/*---------------------------------------------------------------------------------------------------------*/
void SPI1_IRQHandler(void)
{
if( SPI1->CNTRL.IF == 1 ) /* One transaction done interrupt */
{
SPI1->CNTRL.IF = 1; /* write '1' to clear SPI1 interrupt flag */
if(g_sSpiHandler[1].pfnOneTransDoneCallBack != NULL)
{
g_sSpiHandler[1].pfnOneTransDoneCallBack(g_sSpiHandler[1].u32OneTransDoneUserData);
}
}
if( SPI1->CNTRL2.SLV_START_INTSTS == 1 ) /* 3-wire SPI start interrupt */
{
SPI1->CNTRL2.SLV_START_INTSTS = 1; /* write '1' to clear SPI1 3-wire start interrupt flag */
if(g_sSpiHandler[1].pfn3WireStartCallBack != NULL)
{
g_sSpiHandler[1].pfn3WireStartCallBack(g_sSpiHandler[1].u32ThreeWireStartUserData);
}
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: SPI2_IRQHandler */
/* */
/* Parameters: */
/* None. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* SPI2 interrupt handler. Clear the SPI interrupt flag and execute the callback function. */
/*---------------------------------------------------------------------------------------------------------*/
void SPI2_IRQHandler(void)
{
if( SPI2->CNTRL.IF == 1 ) /* One transaction done interrupt */
{
SPI2->CNTRL.IF = 1; /* write '1' to clear SPI2 interrupt flag */
if(g_sSpiHandler[2].pfnOneTransDoneCallBack != NULL)
{
g_sSpiHandler[2].pfnOneTransDoneCallBack(g_sSpiHandler[2].u32OneTransDoneUserData);
}
}
if( SPI2->CNTRL2.SLV_START_INTSTS == 1 ) /* 3-wire SPI start interrupt */
{
SPI2->CNTRL2.SLV_START_INTSTS = 1; /* write '1' to clear SPI2 3-wire start interrupt flag */
if(g_sSpiHandler[2].pfn3WireStartCallBack != NULL)
{
g_sSpiHandler[2].pfn3WireStartCallBack(g_sSpiHandler[2].u32ThreeWireStartUserData);
}
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: SPI3_IRQHandler */
/* */
/* Parameters: */
/* None. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* SPI3 interrupt handler. Clear the SPI interrupt flag and execute the callback function. */
/*---------------------------------------------------------------------------------------------------------*/
void SPI3_IRQHandler(void)
{
if( SPI3->CNTRL.IF == 1 ) /* One transaction done interrupt */
{
SPI3->CNTRL.IF = 1; /* write '1' to clear SPI3 interrupt flag */
if(g_sSpiHandler[3].pfnOneTransDoneCallBack != NULL)
{
g_sSpiHandler[3].pfnOneTransDoneCallBack(g_sSpiHandler[3].u32OneTransDoneUserData);
}
}
if( SPI3->CNTRL2.SLV_START_INTSTS == 1 ) /* 3-wire SPI start interrupt */
{
SPI3->CNTRL2.SLV_START_INTSTS = 1; /* write '1' to clear SPI3 3-wire start interrupt flag */
if(g_sSpiHandler[3].pfn3WireStartCallBack != NULL)
{
g_sSpiHandler[3].pfn3WireStartCallBack(g_sSpiHandler[3].u32ThreeWireStartUserData);
}
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Open */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eMode [in]: Specify the operation mode (eDRVSPI_MASTER/eDRVSPI_SLAVE) */
/* eType [in]: Specify the transfer type (eDRVSPI_TYPE0 ~ eDRVSPI_TYPE7) */
/* i32BitLength [in]: Specify the bit length in a transaction (1~32) */
/* */
/* Returns: */
/* E_DRVSPI_ERR_INIT: The specified SPI port has been opened before. */
/* E_DRVSPI_ERR_BUSY: The specified SPI port is in busy status. */
/* E_DRVSPI_ERR_BIT_LENGTH: The specified bit length is out of range. */
/* E_SUCCESS: Success. */
/* */
/* Description: */
/* Configure the operation mode, transfer type and bit length of a transaction of the specified SPI */
/* port. */
/* The timing waveform types: */
/*
DRVSPI_TYPE0:
CS --| Active state |---
_ _ _ _ _ _ _ _
CLK ____| |_| |_| |_| |_| |_| |_| |_| |_____
Tx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |---
Rx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |-----
DRVSPI_TYPE1:
CS --| Active state |---
_ _ _ _ _ _ _ _
CLK ____| |_| |_| |_| |_| |_| |_| |_| |_____
Tx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |-----
Rx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |-----
DRVSPI_TYPE2:
CS --| Active state |---
_ _ _ _ _ _ _ _
CLK ____| |_| |_| |_| |_| |_| |_| |_| |_____
Tx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |---
Rx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |---
DRVSPI_TYPE3:
CS --| Active state |---
_ _ _ _ _ _ _ _
CLK ____| |_| |_| |_| |_| |_| |_| |_| |_____
Tx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |-----
Rx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |---
DRVSPI_TYPE4:
CS --| Active state |---
___ _ _ _ _ _ _ _ ______
CLK |_| |_| |_| |_| |_| |_| |_| |_|
Tx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |------
Rx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |----
DRVSPI_TYPE5:
CS --| Active state |---
___ _ _ _ _ _ _ _ ______
CLK |_| |_| |_| |_| |_| |_| |_| |_|
Tx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |----
Rx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |----
DRVSPI_TYPE6:
CS --| Active state |---
___ _ _ _ _ _ _ _ ______
CLK |_| |_| |_| |_| |_| |_| |_| |_|
Tx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |------
Rx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |------
DRVSPI_TYPE7:
CS --| Active state |---
___ _ _ _ _ _ _ _ ______
CLK |_| |_| |_| |_| |_| |_| |_| |_|
Tx ----| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |----
Rx --| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |----
Master / Slave Transfer Type Matching Table
DRVSPI_TYPE0 <==> DRVSPI_TYPE3
DRVSPI_TYPE1 <==> DRVSPI_TYPE1
DRVSPI_TYPE2 <==> DRVSPI_TYPE2
DRVSPI_TYPE3 <==> DRVSPI_TYPE0
DRVSPI_TYPE4 <==> DRVSPI_TYPE7
DRVSPI_TYPE5 <==> DRVSPI_TYPE5
DRVSPI_TYPE6 <==> DRVSPI_TYPE6
DRVSPI_TYPE7 <==> DRVSPI_TYPE4
*/
/*---------------------------------------------------------------------------------------------------------*/
int32_t DrvSPI_Open(E_DRVSPI_PORT eSpiPort, E_DRVSPI_MODE eMode, E_DRVSPI_TRANS_TYPE eType, int32_t i32BitLength)
{
int32_t i32TimeOut;
if(g_sSpiHandler[eSpiPort].bInUse)
{
return E_DRVSPI_ERR_INIT;
}
/* Bit length 1 ~ 32 */
if((i32BitLength <= 0) || (i32BitLength > 32))
{
return E_DRVSPI_ERR_BIT_LENGTH;
}
if(eSpiPort == eDRVSPI_PORT0)
{
SYSCLK->APBCLK.SPI0_EN =1;
SYS->IPRSTC2.SPI0_RST =1;
SYS->IPRSTC2.SPI0_RST =0;
}
else if(eSpiPort == eDRVSPI_PORT1)
{
SYSCLK->APBCLK.SPI1_EN =1;
SYS->IPRSTC2.SPI1_RST =1;
SYS->IPRSTC2.SPI1_RST =0;
}
else if(eSpiPort == eDRVSPI_PORT2)
{
SYSCLK->APBCLK.SPI2_EN =1;
SYS->IPRSTC2.SPI2_RST =1;
SYS->IPRSTC2.SPI2_RST =0;
}
else
{
SYSCLK->APBCLK.SPI3_EN =1;
SYS->IPRSTC2.SPI3_RST =1;
SYS->IPRSTC2.SPI3_RST =0;
}
/* Check busy*/
i32TimeOut = 0x10000;
while(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY == 1)
{
if(i32TimeOut-- <= 0)
return E_DRVSPI_ERR_BUSY;
}
g_sSpiHandler[eSpiPort].bInUse = TRUE;
g_sSpiHandler[eSpiPort].pfnOneTransDoneCallBack = NULL;
g_sSpiHandler[eSpiPort].u32OneTransDoneUserData = 0;
g_sSpiHandler[eSpiPort].pfn3WireStartCallBack = NULL;
g_sSpiHandler[eSpiPort].u32ThreeWireStartUserData = 0;
/* "i32BitLength = 0" means 32 bits */
if(i32BitLength == 32)
{
i32BitLength = 0;
}
SPI_PORT[eSpiPort]->CNTRL.TX_BIT_LEN = i32BitLength;
if(eMode == eDRVSPI_SLAVE)
SPI_PORT[eSpiPort]->CNTRL.SLAVE = 1;
else
SPI_PORT[eSpiPort]->CNTRL.SLAVE = 0;
/* Automatic slave select */
SPI_PORT[eSpiPort]->SSR.AUTOSS = 1;
/* Timing waveform types */
if(eType==eDRVSPI_TYPE0)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 0;
/* Drive data and latch data at the same edge. Not recommend to use this transfer type. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 0;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 0;
}
else if(eType==eDRVSPI_TYPE1)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 0;
/* Drive data at falling-edge of serial clock; latch data at rising-edge of serial clock. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 1;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 0;
}
else if(eType==eDRVSPI_TYPE2)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 0;
/* Drive data at rising-edge of serial clock; latch data at falling-edge of serial clock. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 0;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 1;
}
else if(eType==eDRVSPI_TYPE3)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 0;
/* Drive data and latch data at the same edge. Not recommend to use this transfer type. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 1;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 1;
}
else if(eType==eDRVSPI_TYPE4)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 1;
/* Drive data and latch data at the same edge. Not recommend to use this transfer type. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 0;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 0;
}
else if(eType==eDRVSPI_TYPE5)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 1;
/* Drive data at falling-edge of serial clock; latch data at rising-edge of serial clock. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 1;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 0;
}
else if(eType==eDRVSPI_TYPE6)
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 1;
/* Drive data at rising-edge of serial clock; latch data at falling-edge of serial clock. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 0;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 1;
}
else
{
SPI_PORT[eSpiPort]->CNTRL.CLKP = 1;
/* Drive data and latch data at the same edge. Not recommend to use this transfer type. */
SPI_PORT[eSpiPort]->CNTRL.TX_NEG = 1;
SPI_PORT[eSpiPort]->CNTRL.RX_NEG = 1;
}
return E_SUCCESS;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Close */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Close the specified SPI module and disable the SPI interrupt. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Close(E_DRVSPI_PORT eSpiPort)
{
int32_t i32TimeOut;
g_sSpiHandler[eSpiPort].bInUse = FALSE;
g_sSpiHandler[eSpiPort].pfnOneTransDoneCallBack = NULL;
g_sSpiHandler[eSpiPort].u32OneTransDoneUserData = 0;
g_sSpiHandler[eSpiPort].pfn3WireStartCallBack = NULL;
g_sSpiHandler[eSpiPort].u32ThreeWireStartUserData = 0;
/* Check SPI state */
i32TimeOut = 0x10000;
while(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY == 1)
{
if(i32TimeOut-- <= 0)
break;
}
if(eSpiPort == eDRVSPI_PORT0)
{
NVIC_DisableIRQ(SPI0_IRQn);
SYS->IPRSTC2.SPI0_RST=1;
SYS->IPRSTC2.SPI0_RST=0;
SYSCLK->APBCLK.SPI0_EN=0;
}
else if(eSpiPort == eDRVSPI_PORT1)
{
NVIC_DisableIRQ(SPI1_IRQn);
SYS->IPRSTC2.SPI1_RST=1;
SYS->IPRSTC2.SPI1_RST=0;
SYSCLK->APBCLK.SPI1_EN=0;
}
else if(eSpiPort == eDRVSPI_PORT2)
{
NVIC_DisableIRQ(SPI2_IRQn);
SYS->IPRSTC2.SPI2_RST=1;
SYS->IPRSTC2.SPI2_RST=0;
SYSCLK->APBCLK.SPI2_EN=0;
}
else
{
NVIC_DisableIRQ(SPI3_IRQn);
SYS->IPRSTC2.SPI3_RST=1;
SYS->IPRSTC2.SPI3_RST=0;
SYSCLK->APBCLK.SPI3_EN=0;
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Set2BitTransferMode */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* bEnable [in]: Enable (TRUE) / Disable (FALSE) */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set 2-bit transfer mode. */
/* When enable 2-bit transfer mode, the Tx_NUM must be configure as 0x00 (one transaction in one */
/* transfer.) */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Set2BitTransferMode(E_DRVSPI_PORT eSpiPort, uint8_t bEnable)
{
if(bEnable)
{
SPI_PORT[eSpiPort]->CNTRL.TWOB = 1;
SPI_PORT[eSpiPort]->CNTRL.TX_NUM = 0;
}
else
SPI_PORT[eSpiPort]->CNTRL.TWOB = 0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetEndian */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eEndian [in]: Specify LSB first or MSB first (eDRVSPI_LSB_FIRST / eDRVSPI_MSB_FIRST) */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Dertermine to transfer data with LSB first or MSB first */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetEndian(E_DRVSPI_PORT eSpiPort, E_DRVSPI_ENDIAN eEndian)
{
if(eEndian == eDRVSPI_LSB_FIRST)
SPI_PORT[eSpiPort]->CNTRL.LSB = 1;
else
SPI_PORT[eSpiPort]->CNTRL.LSB = 0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetBitLength */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* i32BitLength [in]: Specify the bit length (1~32 bits) */
/* */
/* Returns: */
/* E_SUCCESS: Success. */
/* E_DRVSPI_ERR_BIT_LENGTH: The bit length is out of range. */
/* */
/* Description: */
/* Set the bit length of SPI transfer. */
/*---------------------------------------------------------------------------------------------------------*/
int32_t DrvSPI_SetBitLength(E_DRVSPI_PORT eSpiPort, int32_t i32BitLength)
{
if((i32BitLength < 1) || (i32BitLength > 32))
{
return E_DRVSPI_ERR_BIT_LENGTH;
}
if(i32BitLength == 32)
i32BitLength = 0;
SPI_PORT[eSpiPort]->CNTRL.TX_BIT_LEN = i32BitLength;
return E_SUCCESS;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetByteReorder */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eOption [in]: the options of Byte Reorder function and Byte Suspend function. */
/* eDRVSPI_BYTE_REORDER_SUSPEND_DISABLE: both Byte Reorder function and Byte Suspend */
/* function are disabled. */
/* eDRVSPI_BYTE_REORDER_SUSPEND : both Byte Reorder function and Byte Suspend */
/* function are enabled. */
/* eDRVSPI_BYTE_REORDER : only enable the Byte Reorder function. */
/* eDRVSPI_BYTE_SUSPEND : only enable the Byte Suspend function. */
/* The Byte Suspend function is only available in 32-bit transaction. */
/* */
/* Returns: */
/* E_SUCCESS : Success. */
/* E_DRVSPI_ERR_BIT_LENGTH: The bit length is not 16-, 24- or 32-bit. */
/* */
/* Description: */
/* Enable/disable Byte Reorder function. */
/* The Byte Reorder function is supported only in 16-, 24- and 32-bit transaction mode. */
/*---------------------------------------------------------------------------------------------------------*/
int32_t DrvSPI_SetByteReorder(E_DRVSPI_PORT eSpiPort, E_DRVSPI_BYTE_REORDER eOption)
{
/* The Byte Suspend function is only available in 32-bit transaction. */
if( (eOption==eDRVSPI_BYTE_REORDER_SUSPEND)||(eOption==eDRVSPI_BYTE_SUSPEND) )
if( (SPI_PORT[eSpiPort]->CNTRL.TX_BIT_LEN) != 0 )
return E_DRVSPI_ERR_BIT_LENGTH;
/* The Byte Reorder function is supported only in 16-, 24- and 32-bit transaction mode. */
else if( eOption==eDRVSPI_BYTE_REORDER )
if( (SPI_PORT[eSpiPort]->CNTRL.TX_BIT_LEN) % 8 )
return E_DRVSPI_ERR_BIT_LENGTH;
SPI_PORT[eSpiPort]->CNTRL.REORDER = eOption;
return E_SUCCESS;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetSuspendCycle */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port. */
/* i32Interval [in]: In burst transfer mode, this value specified the delay clocks between successive */
/* transactions. If the Byte Suspend function is enabled, it specified the delay */
/* clocks among each byte. It could be 2~17 which indicate 2~17 SPI clock cycles. */
/* */
/* Returns: */
/* E_DRVSPI_ERR_SUSPEND_INTERVAL: The suspend interval setting is out of range. */
/* E_SUCCESS: Success. */
/* */
/* Description: */
/* Set the number of clock cycle of the suspend interval. Only for master mode. */
/* The suspend cycle setting is shared with burst mode and byte suspend function. */
/*---------------------------------------------------------------------------------------------------------*/
int32_t DrvSPI_SetSuspendCycle(E_DRVSPI_PORT eSpiPort, int32_t i32Interval)
{
/* In burst mode and byte suspend function, it could be 2~17. */
if((i32Interval < 2) || (i32Interval > 17))
{
/* If out of range, specify the maximum suspend cycle and return error code. */
SPI_PORT[eSpiPort]->CNTRL.SP_CYCLE = 15;
return E_DRVSPI_ERR_SUSPEND_INTERVAL;
}
SPI_PORT[eSpiPort]->CNTRL.SP_CYCLE = i32Interval-2;
return E_SUCCESS;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetTriggerMode */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eSSTriggerMode [in]: Specify the trigger mode. (eDRVSPI_EDGE_TRIGGER or eDRVSPI_LEVEL_TRIGGER) */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set the trigger mode of slave select pin. Only for slave mode. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetTriggerMode(E_DRVSPI_PORT eSpiPort, E_DRVSPI_SSLTRIG eSSTriggerMode)
{
SPI_PORT[eSpiPort]->SSR.SS_LTRIG = eSSTriggerMode;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetSlaveSelectActiveLevel */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eSSActType [in]: Select the active type of slave select pin. */
/* eDRVSPI_ACTIVE_LOW_FALLING: Slave select pin is active low in level-trigger mode; */
/* or falling-edge trigger in edge-trigger mode. */
/* eDRVSPI_ACTIVE_HIGH_RISING: Slave select pin is active high in level-trigger mode; */
/* or rising-edge trigger in edge-trigger mode. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set the active level of slave select. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetSlaveSelectActiveLevel(E_DRVSPI_PORT eSpiPort, E_DRVSPI_SS_ACT_TYPE eSSActType)
{
SPI_PORT[eSpiPort]->SSR.SS_LVL = eSSActType;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_GetLevelTriggerStatus */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* TRUE : The transaction number and the transferred bit length met the requirements which defines in */
/* TX_NUM and TX_BIT_LEN among one transfer. */
/* FALSE: The transaction number or the transferred bit length of one transaction doesn't meet the */
/* requirements. */
/* */
/* Description: */
/* Get the level-trigger transmission status. Only for slave mode. */
/*---------------------------------------------------------------------------------------------------------*/
uint8_t DrvSPI_GetLevelTriggerStatus(E_DRVSPI_PORT eSpiPort)
{
if(SPI_PORT[eSpiPort]->SSR.LTRIG_FLAG==1)
return TRUE;
else
return FALSE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_EnableAutoSS */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eSlaveSel [in]: Select the slave select pins which will be used. */
/* It could be eDRVSPI_NONE, eDRVSPI_SS0, eDRVSPI_SS1 and eDRVSPI_SS0_SS1. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Enable the automatic slave select function and set the specified slave select pin. Only for master */
/* mode. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_EnableAutoSS(E_DRVSPI_PORT eSpiPort, E_DRVSPI_SLAVE_SEL eSlaveSel)
{
SPI_PORT[eSpiPort]->SSR.AUTOSS = 1;
SPI_PORT[eSpiPort]->SSR.SSR = eSlaveSel;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_DisableAutoSS */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Disable the Automatic Slave Select function and deselect slave select pins. Only for master mode. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_DisableAutoSS(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->SSR.AUTOSS = 0;
SPI_PORT[eSpiPort]->SSR.SSR = eDRVSPI_NONE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetSS */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eSlaveSel [in]: In automatic slave select operation, to use this parameter to select the slave */
/* select pins which will be used. The specified slave select pins will be controlled */
/* by hardware. In manual slave select operation, the specified slave select pins will */
/* be set to active state. It could be eDRVSPI_NONE, eDRVSPI_SS0, eDRVSPI_SS1 or */
/* eDRVSPI_SS0_SS1. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set the slave select pins. Only for master mode. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetSS(E_DRVSPI_PORT eSpiPort, E_DRVSPI_SLAVE_SEL eSlaveSel)
{
SPI_PORT[eSpiPort]->SSR.SSR = eSlaveSel;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_ClrSS */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eSlaveSel [in]: Specify slave select pins */
/* It could be eDRVSPI_NONE, eDRVSPI_SS0, eDRVSPI_SS1 or eDRVSPI_SS0_SS1. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set the specified slave select pins to inactive state. Only for master mode. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_ClrSS(E_DRVSPI_PORT eSpiPort, E_DRVSPI_SLAVE_SEL eSlaveSel)
{
uint32_t u32Reg;
u32Reg = SPI_PORT[eSpiPort]->SSR.SSR;
u32Reg = u32Reg & (~eSlaveSel);
SPI_PORT[eSpiPort]->SSR.SSR = u32Reg;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_IsBusy */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* TRUE: The SPI port is in busy. */
/* FALSE: The SPI port is not in busy. */
/* */
/* Description: */
/* Check the busy status of the specified SPI port. */
/*---------------------------------------------------------------------------------------------------------*/
uint8_t DrvSPI_IsBusy(E_DRVSPI_PORT eSpiPort)
{
return ((SPI_PORT[eSpiPort]->CNTRL.GO_BUSY)?TRUE:FALSE);
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_BurstTransfer */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* i32BurstCnt [in]: Specify the transaction number in one transfer. It could be 1 or 2. */
/* i32Interval [in]: Specify the delay clocks between successive transactions. It could be 2~17. */
/* */
/* Returns: */
/* E_DRVSPI_ERR_BURST_CNT: The transaction number is out of range. */
/* E_DRVSPI_ERR_SUSPEND_INTERVAL: The suspend interval setting is out of range. */
/* E_SUCCESS: Success. */
/* */
/* Description: */
/* Configure the burst transfer settings. */
/*---------------------------------------------------------------------------------------------------------*/
int32_t DrvSPI_BurstTransfer(E_DRVSPI_PORT eSpiPort, int32_t i32BurstCnt, int32_t i32Interval)
{
if((i32BurstCnt < 1) || (i32BurstCnt > 2))
{
return E_DRVSPI_ERR_BURST_CNT;
}
if((i32Interval < 2) || (i32Interval > 17))
{
return E_DRVSPI_ERR_SUSPEND_INTERVAL;
}
SPI_PORT[eSpiPort]->CNTRL.TX_NUM = i32BurstCnt-1;
SPI_PORT[eSpiPort]->CNTRL.SP_CYCLE = i32Interval-2;
return E_SUCCESS;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetClockFreq */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* u32Clock1 [in]: Specify the SPI clock rate in Hz. It's the target clock rate of SPI base clock and */
/* variable clock 1. */
/* u32Clock2 [in]: Specify the SPI clock rate in Hz. It's the target clock rate of variable clock 2. */
/* */
/* Returns: */
/* The actual clock rate of SPI engine clock is returned. */
/* SPI engine clock rate = APB clock rate / ((DIVIDER + 1) * 2) */
/* The actual clock rate may be different from the target SPI clock rate. */
/* For example, if the system clock rate is 12MHz and the target SPI base clock rate is 7MHz, the */
/* actual SPI clock rate will be 6MHz. */
/* */
/* Description: */
/* Configure the SPI clock. Only for master mode. */
/* If the DIV_ONE bit is set to 1, executing this function is unmeaningful. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_SetClockFreq(E_DRVSPI_PORT eSpiPort, uint32_t u32Clock1, uint32_t u32Clock2)
{
uint32_t u32Div;
uint32_t u32Pclk;
u32Pclk = DrvSYS_GetHCLKFreq();
u32Div = 0xFFFF; /* Initial value */
if(u32Clock2!=0)
{
if(u32Clock2>u32Pclk)
u32Div = 0;
else
{
u32Div = (((u32Pclk / u32Clock2) + 1) >> 1) - 1;
if(u32Div > 65535)
u32Div = 65535;
}
SPI_PORT[eSpiPort]->DIVIDER.DIVIDER2 = u32Div;
}
else
SPI_PORT[eSpiPort]->DIVIDER.DIVIDER2 = 0xFFFF;
if(u32Clock1!=0)
{
if(u32Clock1>u32Pclk)
u32Div = 0;
else
{
u32Div = (((u32Pclk / u32Clock1) + 1) >> 1) - 1;
if(u32Div > 0xFFFF)
u32Div = 0xFFFF;
}
SPI_PORT[eSpiPort]->DIVIDER.DIVIDER = u32Div;
}
else
SPI_PORT[eSpiPort]->DIVIDER.DIVIDER = 0xFFFF;
return ( u32Pclk / ((u32Div+1)*2) );
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_GetClock1Freq */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* The current SPI bus clock frequency in Hz. */
/* */
/* Description: */
/* Get the SPI engine clock rate in Hz. Only for master mode. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_GetClock1Freq(E_DRVSPI_PORT eSpiPort)
{
uint32_t u32Div;
uint32_t u32ApbClock;
u32ApbClock = DrvSYS_GetHCLKFreq();
u32Div = SPI_PORT[eSpiPort]->DIVIDER.DIVIDER;
return ((u32ApbClock >> 1) / (u32Div + 1)); /* SPI_CLK = APB_CLK / ((Divider + 1) * 2) */
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_GetClock2Freq */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* The frequency of variable clock 2 in Hz. */
/* */
/* Description: */
/* Get the clock rate of variable clock 2 in Hz. Only for master mode. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_GetClock2Freq(E_DRVSPI_PORT eSpiPort)
{
uint32_t u32Div;
uint32_t u32ApbClock;
u32ApbClock = DrvSYS_GetHCLKFreq();
u32Div = SPI_PORT[eSpiPort]->DIVIDER.DIVIDER2;
return ((u32ApbClock >> 1) / (u32Div + 1)); /* SPI_CLK = APB_CLK / ((Divider + 1) * 2) */
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetVariableClockFunction */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* bEnable [in]: TRUE -- Enable variable clock function */
/* FALSE -- Disable variable clock function */
/* u32Pattern [in]: Specify the variable clock pattern */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set the variable clock function. Only for master mode. */
/* If the bit pattern of VARCLK is '0', the output frequency of SPICLK is according to the value of */
/* DIVIDER. */
/* If the bit pattern of VARCLK is '1', the output frequency of SPICLK is according to the value of */
/* DIVIDER2. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetVariableClockFunction(E_DRVSPI_PORT eSpiPort, uint8_t bEnable, uint32_t u32Pattern)
{
if(bEnable)
{
SPI_PORT[eSpiPort]->CNTRL.VARCLK_EN = 1;
SPI_PORT[eSpiPort]->VARCLK = u32Pattern;
}
else
SPI_PORT[eSpiPort]->CNTRL.VARCLK_EN = 0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_EnableInt */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pfnCallback [in]: The callback function of SPI interrupt. */
/* u32UserData [in]: The parameter which will be passed to the callback function. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Enable the SPI interrupt of the specified SPI port and install the callback function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_EnableInt(E_DRVSPI_PORT eSpiPort, PFN_DRVSPI_CALLBACK pfnCallback, uint32_t u32UserData)
{
if(pfnCallback != NULL)
{
g_sSpiHandler[eSpiPort].pfnOneTransDoneCallBack = pfnCallback;
g_sSpiHandler[eSpiPort].u32OneTransDoneUserData = u32UserData;
}
SPI_PORT[eSpiPort]->CNTRL.IE = 1;
if(eSpiPort == eDRVSPI_PORT0)
{
NVIC_SetPriority(SPI0_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI0_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT1)
{
NVIC_SetPriority(SPI1_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI1_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT2)
{
NVIC_SetPriority(SPI2_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI2_IRQn);
}
else
{
NVIC_SetPriority(SPI3_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI3_IRQn);
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_DisableInt */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Disable the SPI interrupt. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_DisableInt(E_DRVSPI_PORT eSpiPort)
{
g_sSpiHandler[eSpiPort].pfnOneTransDoneCallBack = NULL;
g_sSpiHandler[eSpiPort].u32OneTransDoneUserData = 0;
SPI_PORT[eSpiPort]->CNTRL.IE = 0;
if(eSpiPort == eDRVSPI_PORT0)
{
NVIC_DisableIRQ(SPI0_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT1)
{
NVIC_DisableIRQ(SPI1_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT2)
{
NVIC_DisableIRQ(SPI2_IRQn);
}
else
{
NVIC_DisableIRQ(SPI3_IRQn);
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_GetIntFlag */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* 0: SPI interrupt doesn't occur */
/* 1: SPI interrupt occurs */
/* */
/* Description: */
/* Return the SPI interrupt flag */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_GetIntFlag(E_DRVSPI_PORT eSpiPort)
{
return (SPI_PORT[eSpiPort]->CNTRL.IF);
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_ClrIntFlag */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None */
/* */
/* Description: */
/* Clear the SPI interrupt flag */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_ClrIntFlag(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL.IF = 1;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SingleRead */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pu32Data [out]: Store the data got from the SPI bus. */
/* */
/* Returns: */
/* TRUE: The data stored in pu32Data is valid. */
/* FALSE: The data stored in pu32Data is invalid. */
/* */
/* Description: */
/* Read data from SPI Rx registers and trigger SPI for next transfer. */
/*---------------------------------------------------------------------------------------------------------*/
uint8_t DrvSPI_SingleRead(E_DRVSPI_PORT eSpiPort, uint32_t *pu32Data)
{
if(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY==1)
return FALSE;
*pu32Data = SPI_PORT[eSpiPort]->RX[0];
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 1;
return TRUE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SingleWrite */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pu32Data [in]: Store the data which will be transmitted through the SPI bus. */
/* */
/* Returns: */
/* TRUE: The data stored in pu32Data has been transferred. */
/* FALSE: The SPI is in busy. The data stored in pu32Data has not been transferred. */
/* */
/* Description: */
/* Write data to SPI bus and trigger SPI to start transfer. */
/*---------------------------------------------------------------------------------------------------------*/
uint8_t DrvSPI_SingleWrite(E_DRVSPI_PORT eSpiPort, uint32_t *pu32Data)
{
if(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY==1)
return FALSE;
SPI_PORT[eSpiPort]->TX[0] = *pu32Data;
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 1;
return TRUE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_BurstRead */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pu32Buf [out]: Store the data got from the SPI bus. */
/* */
/* Returns: */
/* TRUE: The data stored in pu32Buf is valid. */
/* FALSE: The data stored in pu32Buf is invalid. */
/* */
/* Description: */
/* Read two words of data from SPI Rx registers and then trigger SPI for next transfer. */
/*---------------------------------------------------------------------------------------------------------*/
uint8_t DrvSPI_BurstRead(E_DRVSPI_PORT eSpiPort, uint32_t *pu32Buf)
{
if(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY==1)
return FALSE;
pu32Buf[0] = SPI_PORT[eSpiPort]->RX[0];
pu32Buf[1] = SPI_PORT[eSpiPort]->RX[1];
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 1;
return TRUE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_BurstWrite */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pu32Buf [in]: Store the data which will be transmitted through the SPI bus. */
/* */
/* Returns: */
/* TRUE: The data stored in pu32Buf has been transferred. */
/* FALSE: The SPI is in busy. The data stored in pu32Buf has not been transferred. */
/* */
/* Description: */
/* Write two words of data to SPI bus and then trigger SPI to start transfer. */
/*---------------------------------------------------------------------------------------------------------*/
uint8_t DrvSPI_BurstWrite(E_DRVSPI_PORT eSpiPort, uint32_t *pu32Buf)
{
if(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY==1)
return FALSE;
SPI_PORT[eSpiPort]->TX[0] = pu32Buf[0];
SPI_PORT[eSpiPort]->TX[1] = pu32Buf[1];
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 1;
return TRUE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_DumpRxRegister */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pu32Buf [out]: Store the data got from Rx registers. */
/* u32DataCount [in]: The count of data read from Rx registers. */
/* */
/* Returns: */
/* The count of data actually read from Rx registers. */
/* */
/* Description: */
/* Read data from Rx registers. This function will not trigger a SPI data transfer. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_DumpRxRegister(E_DRVSPI_PORT eSpiPort, uint32_t *pu32Buf, uint32_t u32DataCount)
{
uint32_t i;
if(u32DataCount>2)
u32DataCount = 2;
for(i=0; i<u32DataCount; i++)
{
pu32Buf[i] = SPI_PORT[eSpiPort]->RX[i];
}
return u32DataCount;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetTxRegister */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pu32Buf [in]: Store the data which will be written to Tx registers. */
/* u32DataCount [in]: The count of data write to Tx registers. */
/* */
/* Returns: */
/* The count of data actually written to Tx registers. */
/* */
/* Description: */
/* Write data to Tx registers. This function will not trigger a SPI data transfer. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_SetTxRegister(E_DRVSPI_PORT eSpiPort, uint32_t *pu32Buf, uint32_t u32DataCount)
{
uint32_t i;
if(u32DataCount>2)
u32DataCount = 2;
for(i=0; i<u32DataCount; i++)
{
SPI_PORT[eSpiPort]->TX[i] = pu32Buf[i];
}
return u32DataCount;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetGo */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Set the GO_BUSY bit to trigger a SPI data trasfer. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetGo(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 1;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_ClrGo */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Clear the GO_BUSY bit. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_ClrGo(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_SetPDMA */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* eDmaMode [in]: Specify the DMA mode. */
/* eDRVSPI_TX_DMA -- DMA-Transmitting */
/* eDRVSPI_RX_DMA -- DMA-Receiving */
/* bEnable [in]: TRUE -- Enable DMA; */
/* FALSE -- Disable DMA. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Configure the DMA settings. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_SetPDMA(E_DRVSPI_PORT eSpiPort, E_DRVSPI_DMA_MODE eDmaMode, uint8_t bEnable)
{
if(eDmaMode==eDRVSPI_TX_DMA)
{
if(bEnable)
SPI_PORT[eSpiPort]->DMA.TX_DMA_GO = 1;
else
SPI_PORT[eSpiPort]->DMA.TX_DMA_GO = 0;
}
else
{
if(bEnable)
SPI_PORT[eSpiPort]->DMA.RX_DMA_GO = 1;
else
SPI_PORT[eSpiPort]->DMA.RX_DMA_GO = 0;
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_EnableDivOne */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Enable the DIV_ONE feature. The SPI clock rate will be equal to system clock rate. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_EnableDivOne(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL2.DIV_ONE = 1;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_DisableDivOne */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Disable the DIV_ONE feature. The SPI clock rate is determined by the setting of SPI clock divider. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_DisableDivOne(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL2.DIV_ONE = 0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Enable3Wire */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Enable the SPI 3-wire function. In master mode, executing this function is unmeaningful. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Enable3Wire(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL2.NOSLVSEL = 1;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Disable3Wire */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Disable the SPI 3-wire function. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Disable3Wire(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL2.NOSLVSEL = 0;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_3WireAbort */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Abort transfer when using 3-wire SPI. */
/* If using 3-wire SPI as slave, when slave start interrupt status is set but transfer done flag */
/* doesn't be set over a reasonable time, use this function to abort this transfer. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_3WireAbort(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL2.SLV_ABORT = 1;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Enable3WireStartInt */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* pfnCallback [in]: The callback function of 3-wire SPI start interrupt. */
/* u32UserData [in]: The parameter which will be passed to the callback function. */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Enable the 3-wire SPI start interrupt of the specified SPI port and install the callback function. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Enable3WireStartInt(E_DRVSPI_PORT eSpiPort, PFN_DRVSPI_CALLBACK pfnCallback, uint32_t u32UserData)
{
if(pfnCallback != NULL)
{
g_sSpiHandler[eSpiPort].pfn3WireStartCallBack = pfnCallback;
g_sSpiHandler[eSpiPort].u32ThreeWireStartUserData = u32UserData;
}
SPI_PORT[eSpiPort]->CNTRL2.SSTA_INTEN = 1;
if(eSpiPort == eDRVSPI_PORT0)
{
NVIC_SetPriority(SPI0_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI0_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT1)
{
NVIC_SetPriority(SPI1_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI1_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT2)
{
NVIC_SetPriority(SPI2_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI2_IRQn);
}
else
{
NVIC_SetPriority(SPI3_IRQn, (1<<__NVIC_PRIO_BITS) - 2);
NVIC_EnableIRQ(SPI3_IRQn);
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Disable3WireStartInt */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Disable the 3-wire SPI start interrupt. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Disable3WireStartInt(E_DRVSPI_PORT eSpiPort)
{
g_sSpiHandler[eSpiPort].pfn3WireStartCallBack = NULL;
g_sSpiHandler[eSpiPort].u32ThreeWireStartUserData = 0;
SPI_PORT[eSpiPort]->CNTRL2.SSTA_INTEN = 0;
if(eSpiPort == eDRVSPI_PORT0)
{
NVIC_DisableIRQ(SPI0_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT1)
{
NVIC_DisableIRQ(SPI1_IRQn);
}
else if(eSpiPort == eDRVSPI_PORT2)
{
NVIC_DisableIRQ(SPI2_IRQn);
}
else
{
NVIC_DisableIRQ(SPI3_IRQn);
}
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Get3WireStartIntFlag */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* 0: SPI start interrupt doesn't occur */
/* 1: SPI start interrupt occurs */
/* */
/* Description: */
/* Return the 3-wire SPI start interrupt status. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_Get3WireStartIntFlag(E_DRVSPI_PORT eSpiPort)
{
return (SPI_PORT[eSpiPort]->CNTRL2.SLV_START_INTSTS);
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_Clr3WireStartIntFlag */
/* */
/* Parameters: */
/* eSpiPort [in]: Specify the SPI port */
/* */
/* Returns: */
/* None. */
/* */
/* Description: */
/* Clear the 3-wire SPI start interrupt status. */
/* Only the chips with the part number NUC1x0xxxCx, ex: NUC140VE3CN, can support this function. */
/*---------------------------------------------------------------------------------------------------------*/
void DrvSPI_Clr3WireStartIntFlag(E_DRVSPI_PORT eSpiPort)
{
SPI_PORT[eSpiPort]->CNTRL2.SLV_START_INTSTS = 1;
}
uint8_t DrvSPI_SingleWrite_byte(E_DRVSPI_PORT eSpiPort, uint32_t pu32Data)
{
if(SPI_PORT[eSpiPort]->CNTRL.GO_BUSY==1)
return FALSE;
SPI_PORT[eSpiPort]->TX[0] = pu32Data;
SPI_PORT[eSpiPort]->CNTRL.GO_BUSY = 1;
return TRUE;
}
/*---------------------------------------------------------------------------------------------------------*/
/* Function: DrvSPI_GetVersion */
/* */
/* Parameters: */
/* None. */
/* */
/* Returns: */
/* Version number. */
/* */
/* Description: */
/* Get the version number of NUC100 SPI driver. */
/*---------------------------------------------------------------------------------------------------------*/
uint32_t DrvSPI_GetVersion(void)
{
return DRVSPI_VERSION_NUM;
}
| mit |
randomstuff/dnsfwd | src/service.cpp | 1 | 2500 | /* The MIT License (MIT)
Copyright (c) 2015 Gabriel Corona
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "dnsfwd.hpp"
#include <memory>
#include <ctime>
#include <boost/asio/io_service.hpp>
#ifdef USE_SYSTEMD
#include <systemd/sd-daemon.h>
#else
#define SD_LISTEN_FDS_START 3
#endif
namespace dnsfwd {
service::service(boost::asio::io_service& io_service, dnsfwd::config config)
: io_service_(&io_service),
config_(std::move(config)),
random_(std::time(nullptr))
{
// TODO, multiple server objects
for(std::size_t i = 0; i < config_.listen_fds; ++i) {
servers_.push_back(std::unique_ptr<server>(
new server(io_service, *this, SD_LISTEN_FDS_START + i)
));
}
for (dnsfwd::endpoint const& endpoint : config_.bind_udp) {
servers_.push_back(std::unique_ptr<server>(
new server(io_service, *this, endpoint)
));
}
}
void service::add_request(std::unique_ptr<message>& context)
{
context->server_id_ = context->id();
if (!client_) {
client_ = std::make_shared<client>(*io_service_, *this);
client_->connect();
}
if (!client_->add_request(context)) {
this->queue_.push_back(*context);
context.release();
}
}
std::unique_ptr<message> service::unqueue()
{
if (queue_.empty()) {
return nullptr;
} else {
message& c = queue_.front();
queue_.pop_front();
return std::unique_ptr<message>(&c);
}
}
void service::unregister(std::shared_ptr<client> client)
{
if (client == client_) {
client_ = nullptr;
}
}
}
| mit |
simplemachines-italy/hempl | src/common_tmr.c | 1 | 12227 | // Common code, timer section
// Also implements virtual timers
#include "platform.h"
#include "platform_conf.h"
#include "type.h"
#include "common.h"
#include "elua_int.h"
#include "utils.h"
#include <stdio.h>
// [TODO] when the new build system is ready, automatically add the
// code below in platform_conf.h
#if defined( BUILD_LUA_INT_HANDLERS ) || defined( BUILD_C_INT_HANDLERS )
#define BUILD_INT_HANDLERS
extern const elua_int_descriptor elua_int_table[ INT_ELUA_LAST ];
#endif // #if defined( BUILD_LUA_INT_HANDLERS ) || defined( BUILD_C_INT_HANDLERS )
#ifndef VTMR_NUM_TIMERS
#define VTMR_NUM_TIMERS 0
#endif // #ifndef VTMR_NUM_TIMERS
#ifndef PLATFORM_HAS_SYSTIMER
#warning This platform does not have a system timer. Your eLua image might not work as expected.
#define SYSTIMER_SUPPORT 0
#else // #ifndef PLATFORM_HAS_SYSTIMER
#define SYSTIMER_SUPPORT 1
#endif // #ifndef PLATFORM_HAS_SYSTIMER
// ****************************************************************************
// Timers (and vtimers) functions
#if VTMR_NUM_TIMERS > 0
#define VTMR_MAX_PERIOD ( ( 1LL << 32 ) - 1 )
// ============================================================================
// VTMR functions
static volatile u32 vtmr_counters[ VTMR_NUM_TIMERS ];
static volatile s8 vtmr_reset_idx = -1;
#if defined( BUILD_INT_HANDLERS ) && defined( INT_TMR_MATCH )
#define CMN_TIMER_INT_SUPPORT
#endif // #if defined( BUILD_INT_HANDLERS ) && defined( INT_TMR_MATCH )
#ifdef CMN_TIMER_INT_SUPPORT
static volatile u32 vtmr_period_limit[ VTMR_NUM_TIMERS ];
static volatile u8 vtmr_int_periodic_flag[ ( VTMR_NUM_TIMERS + 7 ) >> 3 ];
static volatile u8 vtmr_int_enabled[ ( VTMR_NUM_TIMERS + 7 ) >> 3 ];
static volatile u8 vtmr_int_flag[ ( VTMR_NUM_TIMERS + 7 ) >> 3 ];
#endif // #ifdef CMN_TIMER_INT_SUPPORT
// This should be called from the platform's timer interrupt at VTMR_FREQ_HZ
void cmn_virtual_timer_cb()
{
unsigned i;
#ifdef CMN_TIMER_INT_SUPPORT
u8 msk;
#endif
for( i = 0; i < VTMR_NUM_TIMERS; i ++ )
{
vtmr_counters[ i ] ++;
#ifdef CMN_TIMER_INT_SUPPORT
msk = 1 << ( i & 0x07 );
if( vtmr_counters[ i ] >= vtmr_period_limit[ i ] )
{
vtmr_int_flag[ i >> 3 ] |= msk;
if( vtmr_int_enabled[ i >> 3 ] & msk )
elua_int_add( INT_TMR_MATCH, i + VTMR_FIRST_ID );
if( vtmr_int_periodic_flag[ i >> 3 ] & msk )
vtmr_counters[ i ] = 0;
else
vtmr_int_enabled[ i >> 3 ] &= ( u8 )~msk;
}
#endif // #ifdef CMN_TIMER_INT_SUPPORT
}
if( vtmr_reset_idx != -1 )
{
vtmr_counters[ vtmr_reset_idx ] = 0;
vtmr_reset_idx = -1;
}
}
static void vtmr_reset_timer( unsigned vid )
{
unsigned id = VTMR_GET_ID( vid );
vtmr_reset_idx = ( s8 )id;
while( vtmr_reset_idx != -1 );
}
static void vtmr_delay( unsigned vid, timer_data_type delay_us )
{
timer_data_type final;
unsigned id = VTMR_GET_ID( vid );
if( delay_us > VTMR_MAX_PERIOD )
return;
final = ( ( u64 )delay_us * VTMR_FREQ_HZ ) / 1000000;
vtmr_reset_timer( vid );
while( vtmr_counters[ id ] < final );
}
#ifdef CMN_TIMER_INT_SUPPORT
static int vtmr_set_match_int( unsigned vid, timer_data_type period_us, int type )
{
timer_data_type final;
unsigned id = VTMR_GET_ID( vid );
u8 msk = 1 << ( id & 0x07 );
if( period_us > VTMR_MAX_PERIOD )
return PLATFORM_TIMER_INT_TOO_LONG;
if( period_us == 0 )
{
vtmr_int_enabled[ id >> 3 ] &= ( u8 )~msk;
vtmr_int_flag[ id >> 3 ] &= ( u8 )~msk;
return PLATFORM_TIMER_INT_OK;
}
if( ( final = ( ( u64 )period_us * VTMR_FREQ_HZ ) / 1000000 ) == 0 )
return PLATFORM_TIMER_INT_TOO_SHORT;
vtmr_period_limit[ id ] = final;
if( type == PLATFORM_TIMER_INT_ONESHOT )
vtmr_int_periodic_flag[ id >> 3 ] &= ( u8 )~msk;
else
vtmr_int_periodic_flag[ id >> 3 ] |= msk;
vtmr_int_flag[ id >> 3 ] &= ( u8 )~msk;
vtmr_reset_timer( vid );
vtmr_int_enabled[ id >> 3 ] |= msk;
return PLATFORM_TIMER_INT_OK;
}
static int vtmr_int_get_flag( elua_int_resnum resnum, int clear )
{
unsigned id = VTMR_GET_ID( resnum );
u8 msk = 1 << ( id & 0x07 );
int status = ( vtmr_int_flag[ id >> 3 ] & msk ) != 0;
if( clear )
vtmr_int_flag[ id >> 3 ] &= ( u8 )~msk;
return status;
}
static int vtmr_int_set_status( elua_int_resnum resnum, int status )
{
unsigned id = VTMR_GET_ID( resnum );
u8 msk = 1 << ( id & 0x07 );
int prev = ( vtmr_int_enabled[ id >> 3 ] & msk ) != 0;
if( status == PLATFORM_CPU_ENABLE )
vtmr_int_enabled[ id >> 3 ] |= msk;
else
vtmr_int_enabled[ id >> 3 ] &= ( u8 )~msk;
return prev;
}
static int vtmr_int_get_status( elua_int_resnum resnum )
{
unsigned id = VTMR_GET_ID( resnum );
u8 msk = 1 << ( id & 0x07 );
return ( vtmr_int_enabled[ id >> 3 ] & msk ) != 0;
}
#endif // #ifdef CMN_TIMER_INT_SUPPORT
#else // #if VTMR_NUM_TIMERS > 0
void cmn_virtual_timer_cb()
{
}
#endif // #if VTMR_NUM_TIMERS > 0
// ============================================================================
// Actual timer functions
int platform_timer_sys_available()
{
return SYSTIMER_SUPPORT;
}
#ifndef PLATFORM_HAS_SYSTIMER
timer_data_type platform_timer_read_sys()
{
return 0;
}
#endif
int platform_timer_exists( unsigned id )
{
#if VTMR_NUM_TIMERS > 0
if( id >= VTMR_FIRST_ID )
return TIMER_IS_VIRTUAL( id );
else
#endif
return id < NUM_TIMER || ( id == PLATFORM_TIMER_SYS_ID && SYSTIMER_SUPPORT );
}
void platform_timer_delay( unsigned id, timer_data_type delay_us )
{
#if VTMR_NUM_TIMERS > 0
if( TIMER_IS_VIRTUAL( id ) )
vtmr_delay( id, delay_us );
else
#endif
if( id == PLATFORM_TIMER_SYS_ID )
{
if( !SYSTIMER_SUPPORT )
return;
if( delay_us > 0 )
{
u64 tstart = platform_timer_read_sys(), tend;
while( 1 )
{
if( ( tend = platform_timer_read_sys() ) < tstart ) // overflow
tend += ( u64 )PLATFORM_TIMER_SYS_MAX + 1;
if( tend - tstart >= delay_us )
return;
}
}
}
else
platform_s_timer_delay( id, delay_us );
}
timer_data_type platform_timer_op( unsigned id, int op, timer_data_type data )
{
timer_data_type res = 0;
if( id == PLATFORM_TIMER_SYS_ID ) // the system timer gets special treatment
{
if( !SYSTIMER_SUPPORT )
return 0;
switch( op )
{
case PLATFORM_TIMER_OP_START:
case PLATFORM_TIMER_OP_READ:
res = platform_timer_read_sys();
break;
case PLATFORM_TIMER_OP_SET_CLOCK:
case PLATFORM_TIMER_OP_GET_CLOCK:
res = PLATFORM_TIMER_SYS_FREQ;
break;
case PLATFORM_TIMER_OP_GET_MAX_DELAY:
res = PLATFORM_TIMER_SYS_MAX + 1;
break;
case PLATFORM_TIMER_OP_GET_MAX_CNT:
res = PLATFORM_TIMER_SYS_MAX;
break;
case PLATFORM_TIMER_OP_GET_MIN_DELAY:
res = 1;
break;
}
return res;
}
if( ( VTMR_NUM_TIMERS == 0 ) || ( !TIMER_IS_VIRTUAL( id ) ) )
{
// 'get min delay' and 'get max delay' are very common cases, handle them here
if( op == PLATFORM_TIMER_OP_GET_MAX_DELAY )
return platform_timer_get_diff_us( id, 0, platform_timer_get_max_cnt( id ) );
else if( op == PLATFORM_TIMER_OP_GET_MIN_DELAY )
return platform_timer_get_diff_us( id, 0, 1 );
#ifdef PLATFORM_TMR_COUNTS_DOWN
else if( op == PLATFORM_TIMER_OP_START || op == PLATFORM_TIMER_OP_READ )
return platform_s_timer_op( id, PLATFORM_TIMER_OP_GET_MAX_CNT, 0 ) - platform_s_timer_op( id, op, 0 );
#endif
else
return platform_s_timer_op( id, op, data );
}
#if VTMR_NUM_TIMERS > 0
switch( op )
{
case PLATFORM_TIMER_OP_START:
vtmr_reset_timer( id );
res = 0;
break;
case PLATFORM_TIMER_OP_READ:
res = vtmr_counters[ VTMR_GET_ID( id ) ];
break;
case PLATFORM_TIMER_OP_GET_MAX_DELAY:
res = platform_timer_get_diff_us( id, 0, 0xFFFFFFFF );
break;
case PLATFORM_TIMER_OP_GET_MIN_DELAY:
res = platform_timer_get_diff_us( id, 0, 1 );
break;
case PLATFORM_TIMER_OP_GET_MAX_CNT:
res = VTMR_MAX_PERIOD;
break;
case PLATFORM_TIMER_OP_SET_CLOCK:
case PLATFORM_TIMER_OP_GET_CLOCK:
res = VTMR_FREQ_HZ;
break;
}
#endif
return res;
}
timer_data_type platform_timer_get_diff_us( unsigned id, timer_data_type start, timer_data_type end )
{
u32 freq;
u64 tstart = ( u64 )start, tend = ( u64 )end;
freq = platform_timer_op( id, PLATFORM_TIMER_OP_GET_CLOCK, 0 );
if( tstart > tend )
tend += platform_timer_op( id, PLATFORM_TIMER_OP_GET_MAX_CNT, 0 ) + 1;
tstart = ( ( tend - tstart ) * 1000000 ) / freq;
return UMIN( tstart, PLATFORM_TIMER_SYS_MAX );
}
#ifdef BUILD_INT_HANDLERS
int platform_timer_set_match_int( unsigned id, timer_data_type period_us, int type )
{
#if VTMR_NUM_TIMERS > 0 && defined( CMN_TIMER_INT_SUPPORT )
if( TIMER_IS_VIRTUAL( id ) )
return vtmr_set_match_int( id, period_us, type );
else
#endif
if( id == PLATFORM_TIMER_SYS_ID )
return PLATFORM_TIMER_INT_INVALID_ID;
else
return platform_s_timer_set_match_int( id, period_us, type );
}
int cmn_tmr_int_set_status( elua_int_resnum resnum, int status )
{
#if VTMR_NUM_TIMERS > 00 && defined( CMN_TIMER_INT_SUPPORT )
if( TIMER_IS_VIRTUAL( resnum ) )
return vtmr_int_set_status( resnum, status );
#endif
if( resnum == PLATFORM_TIMER_SYS_ID )
return PLATFORM_INT_BAD_RESNUM;
#ifdef INT_TMR_MATCH
elua_int_p_set_status ps;
if( ( ps = elua_int_table[ INT_TMR_MATCH - ELUA_INT_FIRST_ID ].int_set_status ) == NULL )
return PLATFORM_INT_NOT_HANDLED;
return ps( resnum, status );
#else
return PLATFORM_INT_INVALID;
#endif
}
int cmn_tmr_int_get_status( elua_int_resnum resnum )
{
#if VTMR_NUM_TIMERS > 00 && defined( CMN_TIMER_INT_SUPPORT )
if( TIMER_IS_VIRTUAL( resnum ) )
return vtmr_int_get_status( resnum );
#endif
if( resnum == PLATFORM_TIMER_SYS_ID )
return PLATFORM_INT_BAD_RESNUM;
#ifdef INT_TMR_MATCH
elua_int_p_get_status pg;
if( ( pg = elua_int_table[ INT_TMR_MATCH - ELUA_INT_FIRST_ID ].int_get_status ) == NULL )
return PLATFORM_INT_NOT_HANDLED;
return pg( resnum );
#else
return PLATFORM_INT_INVALID;
#endif
}
int cmn_tmr_int_get_flag( elua_int_resnum resnum, int clear )
{
#if VTMR_NUM_TIMERS > 00 && defined( CMN_TIMER_INT_SUPPORT )
if( TIMER_IS_VIRTUAL( resnum ) )
return vtmr_int_get_flag( resnum, clear );
#endif
if( resnum == PLATFORM_TIMER_SYS_ID )
return PLATFORM_INT_BAD_RESNUM;
#ifdef INT_TMR_MATCH
elua_int_p_get_flag pf;
if( ( pf = elua_int_table[ INT_TMR_MATCH - ELUA_INT_FIRST_ID ].int_get_flag ) == NULL )
return PLATFORM_INT_NOT_HANDLED;
return pf( resnum, clear );
#else
return PLATFORM_INT_INVALID;
#endif
}
#else // #ifdef BUILD_INT_HANDLERS
int platform_timer_set_match_int( unsigned id, timer_data_type period_us, int type )
{
fprintf( stderr, "Timer match interrupt not available when eLua interrupt support is not enabled.\n" );
return 0;
}
#endif // #ifdef BUILD_INT_HANDLERS
// ****************************************************************************
// Generic system timer support
static u32 cmn_systimer_ticks_for_us;
static volatile u64 cmn_systimer_counter;
static u32 cmn_systimer_us_per_interrupt;
void cmn_systimer_set_base_freq( u32 freq_hz )
{
cmn_systimer_ticks_for_us = freq_hz / 1000000;
}
void cmn_systimer_set_interrupt_freq( u32 freq_hz )
{
cmn_systimer_us_per_interrupt = 1000000 / freq_hz;
}
void cmn_systimer_set_interrupt_period_us( u32 period )
{
cmn_systimer_us_per_interrupt = period;
}
void cmn_systimer_periodic()
{
cmn_systimer_counter += cmn_systimer_us_per_interrupt;
}
timer_data_type cmn_systimer_get()
{
u64 tempsys, tempcnt, crtsys;
tempcnt = platform_timer_sys_raw_read();
tempsys = cmn_systimer_counter;
while( ( crtsys = cmn_systimer_counter ) != tempsys )
{
tempcnt = platform_timer_sys_raw_read();
tempsys = crtsys;
}
crtsys += tempcnt / cmn_systimer_ticks_for_us;
if( crtsys > PLATFORM_TIMER_SYS_MAX ) // timer overflow
{
crtsys %= PLATFORM_TIMER_SYS_MAX;
platform_timer_sys_disable_int();
cmn_systimer_counter = 0;
platform_timer_sys_enable_int();
}
return ( timer_data_type )crtsys;
}
| mit |
Bitcoin-ABC/bitcoin-abc | src/compressor.cpp | 1 | 5681 | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <compressor.h>
#include <pubkey.h>
#include <script/standard.h>
/*
* These check for scripts for which a special case with a shorter encoding is
* defined. They are implemented separately from the CScript test, as these test
* for exact byte sequence correspondences, and are more strict. For example,
* IsToPubKey also verifies whether the public key is valid (as invalid ones
* cannot be represented in compressed form).
*/
static bool IsToKeyID(const CScript &script, CKeyID &hash) {
if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 &&
script[2] == 20 && script[23] == OP_EQUALVERIFY &&
script[24] == OP_CHECKSIG) {
memcpy(&hash, &script[3], 20);
return true;
}
return false;
}
static bool IsToScriptID(const CScript &script, CScriptID &hash) {
if (script.size() == 23 && script[0] == OP_HASH160 && script[1] == 20 &&
script[22] == OP_EQUAL) {
memcpy(&hash, &script[2], 20);
return true;
}
return false;
}
static bool IsToPubKey(const CScript &script, CPubKey &pubkey) {
if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG &&
(script[1] == 0x02 || script[1] == 0x03)) {
pubkey.Set(&script[1], &script[34]);
return true;
}
if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG &&
script[1] == 0x04) {
pubkey.Set(&script[1], &script[66]);
// if not fully valid, a case that would not be compressible
return pubkey.IsFullyValid();
}
return false;
}
bool CompressScript(const CScript &script, std::vector<uint8_t> &out) {
CKeyID keyID;
if (IsToKeyID(script, keyID)) {
out.resize(21);
out[0] = 0x00;
memcpy(&out[1], &keyID, 20);
return true;
}
CScriptID scriptID;
if (IsToScriptID(script, scriptID)) {
out.resize(21);
out[0] = 0x01;
memcpy(&out[1], &scriptID, 20);
return true;
}
CPubKey pubkey;
if (IsToPubKey(script, pubkey)) {
out.resize(33);
memcpy(&out[1], &pubkey[1], 32);
if (pubkey[0] == 0x02 || pubkey[0] == 0x03) {
out[0] = pubkey[0];
return true;
} else if (pubkey[0] == 0x04) {
out[0] = 0x04 | (pubkey[64] & 0x01);
return true;
}
}
return false;
}
unsigned int GetSpecialScriptSize(unsigned int nSize) {
if (nSize == 0 || nSize == 1) {
return 20;
}
if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5) {
return 32;
}
return 0;
}
bool DecompressScript(CScript &script, unsigned int nSize,
const std::vector<uint8_t> &in) {
switch (nSize) {
case 0x00:
script.resize(25);
script[0] = OP_DUP;
script[1] = OP_HASH160;
script[2] = 20;
memcpy(&script[3], in.data(), 20);
script[23] = OP_EQUALVERIFY;
script[24] = OP_CHECKSIG;
return true;
case 0x01:
script.resize(23);
script[0] = OP_HASH160;
script[1] = 20;
memcpy(&script[2], in.data(), 20);
script[22] = OP_EQUAL;
return true;
case 0x02:
case 0x03:
script.resize(35);
script[0] = 33;
script[1] = nSize;
memcpy(&script[2], in.data(), 32);
script[34] = OP_CHECKSIG;
return true;
case 0x04:
case 0x05:
uint8_t vch[33] = {};
vch[0] = nSize - 2;
memcpy(&vch[1], in.data(), 32);
CPubKey pubkey(&vch[0], &vch[33]);
if (!pubkey.Decompress()) {
return false;
}
assert(pubkey.size() == 65);
script.resize(67);
script[0] = 65;
memcpy(&script[1], pubkey.begin(), 65);
script[66] = OP_CHECKSIG;
return true;
}
return false;
}
// Amount compression:
// * If the amount is 0, output 0
// * first, divide the amount (in base units) by the largest power of 10
// possible; call the exponent e (e is max 9)
// * if e<9, the last digit of the resulting number cannot be 0; store it as d,
// and drop it (divide by 10)
// * call the result n
// * output 1 + 10*(9*n + d - 1) + e
// * if e==9, we only know the resulting number is not zero, so output 1 + 10*(n
// - 1) + 9
// (this is decodable, as d is in [1-9] and e is in [0-9])
uint64_t CompressAmount(Amount amt) {
uint64_t n = amt / SATOSHI;
if (n == 0) {
return 0;
}
int e = 0;
while (((n % 10) == 0) && e < 9) {
n /= 10;
e++;
}
if (e < 9) {
int d = (n % 10);
assert(d >= 1 && d <= 9);
n /= 10;
return 1 + (n * 9 + d - 1) * 10 + e;
} else {
return 1 + (n - 1) * 10 + 9;
}
}
Amount DecompressAmount(uint64_t x) {
// x = 0 OR x = 1+10*(9*n + d - 1) + e OR x = 1+10*(n - 1) + 9
if (x == 0) {
return Amount::zero();
}
x--;
// x = 10*(9*n + d - 1) + e
int e = x % 10;
x /= 10;
uint64_t n = 0;
if (e < 9) {
// x = 9*n + d - 1
int d = (x % 9) + 1;
x /= 9;
// x = n
n = x * 10 + d;
} else {
n = x + 1;
}
while (e) {
n *= 10;
e--;
}
return int64_t(n) * SATOSHI;
}
| mit |
jluttine/matlab | matrix_computations/lchol_grad_sparse.c | 1 | 3629 |
#include "mex.h"
#include "string.h"
#include "math.h"
/* TODO: THIS IMPLEMENTATION IS QUICK AND DIRTY, NOT OPTIMIZED NOR MADE EASY TO USE. */
int compare
(
const void * a,
const void * b
)
{
return (int)*(double*)a - (int)*(double*)b;
}
/*
* Cholesky decomposition and its derivative for a sparse matrix K.
* Decomposes the symmetric positive definite sparse matrix into a
* lower triangular matrix L and its derivatives dL.
*
* ind: The indices of the symbolic structure of L and dL. First index
* is zero.
*
* k: The values of matrix K for the indices.
*
* dk: The values of the derivative of K for the indices. This may
* contain several derivatives.
*
* length: The number of indices.
*
* d: The number of derivative vectors in dk.
*
* n: The dimensionality of the matrix K.
*/
int cholesky
(
double *array,
double *cols,
int length,
int D,
int N
)
{
int i, j, ind, jnd, ind_pivot, d, n;
double *item, key;
double *p, *k, *dk;
p = array;
k = array + length;
dk = array + 2*length;
ind = 0;
for (n=1; n<=N; n++) {
/* Check positive definiteness */
if (k[ind] <= 0.0)
return -2;
/* Define pivot */
k[ind] = sqrt(k[ind]);
for (d=0; d<D; d++) {
dk[ind+d*length] = 0.5 * dk[ind+d*length] / k[ind];
}
ind_pivot = ind;
/* Adjust lead column */
for (ind = ind_pivot+1; ind < length && p[ind] <= n*N; ind++) {
k[ind] = k[ind] / k[ind_pivot];
for (d=0; d<D; d++) {
dk[ind+d*length] = (dk[ind+d*length] - k[ind]*dk[ind_pivot+d*length]) / k[ind_pivot];
}
}
/* Row operations */
item = p+ind;
for (ind = ind_pivot+1; ind < length && p[ind] <= n*N; ind++) {
/* current row to column index */
i = ((int)(p[ind]-1) % N) + 1;
for (jnd = ind; jnd < length && p[jnd] <= n*N; jnd++) {
/* current row to row index */
j = ((int)(p[jnd]-1) % N) + 1;
/* find (j,i) from p using binary search */
key = (i-1)*N+j;
/*item = (double*)bsearch(&key, item+1, length-(item-p)-1, sizeof(double), compare);*/
item = (double*)bsearch(&key, p+(int)cols[i-1], cols[i]-cols[i-1], sizeof(double), compare);
/* item = (double*)bsearch(&key, p+jnd+1, length-jnd-1, sizeof(double), compare);*/
if (item==NULL)
return -1;
/*item = p+length-1;*/
*(item+length) = *(item+length) - k[ind]*k[jnd];
for (d=0; d<D; d++) {
*(item+(d+2)*length) = *(item+(d+2)*length) - dk[ind+d*length]*k[jnd] - dk[jnd+d*length]*k[ind];
}
}
}
}
return 0;
/*
for (i=0; i<length; i++) {
*(k+i) = *(k+i) + 1;
for (j=0; j<d; j++) {
*(dk+i+j*length) = *(dk+i+j*length) * (j+2);
}
}
*/
}
void mexFunction
(
int nout,
mxArray *pout[],
int nin,
const mxArray *pin[]
)
{
mwSize mrows, ncols;
double *x, *y, *cols;
int *p;
int N;
if (nin != 3)
mexErrMsgTxt("Three inputs required.");
if (nout != 1)
mexErrMsgTxt("One output required.");
mrows = mxGetM(pin[0]);
ncols = mxGetN(pin[0]);
/*pout[0] = pin[0];*/
pout[0] = mxCreateDoubleMatrix(mrows, ncols, mxREAL);
y = mxGetPr(pout[0]);
x = mxGetPr(pin[0]);
cols = mxGetPr(pin[1]);
memcpy(y, x, mrows*ncols*sizeof(double));
/*
p = malloc(mrows*sizeof(int));
for (int m=0; m<mrows; m++) {
p[m] = (int)x[m] - 1;
}
*/
N = (int)mxGetScalar(pin[2]);
int retval = cholesky(y, cols, mrows, ncols-2, N);
/*
int retval = cholesky(y, y+mrows, y+(2*mrows), mrows, ncols-2, N);
*/
/*free(p);*/
if (retval == -1)
mexErrMsgTxt("Symbolic structure not consistent.");
if (retval == -2)
mexErrMsgTxt("Matrix not positive definite.");
return;
}
| mit |
f0rki/cb-multios | original-challenges/Flight_Routes/src/utility.c | 1 | 1448 | /*
Author: Steve Wood <swood@cromulence.com>
Copyright (c) 2016 Cromulence LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <libcgc.h>
#include "stdlib.h"
#include "service.h"
// a simple routine to sum all the bytes of the magic page to use as a simple checksum test
unsigned int check_db() {
int i;
unsigned int total;
total = 0;
for (i=0; i < INIT_DATA_LEN; ++i) {
total += ((unsigned char *)INITIALIZATION_DATA)[i];
}
return total;
} | mit |
zhangjitao/Smart-3D | Extern/poco-1.5.2/Foundation/src/Path_WIN32.cpp | 1 | 3961 | //
// Path_WIN32.cpp
//
// $Id: //poco/1.4/Foundation/src/Path_WIN32.cpp#4 $
//
// Library: Foundation
// Package: Filesystem
// Module: Path
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#include "Poco/Path_WIN32.h"
#include "Poco/Environment_WIN32.h"
#include "Poco/UnWindows.h"
namespace Poco {
std::string PathImpl::currentImpl()
{
char buffer[MAX_PATH];
DWORD n = GetCurrentDirectoryA(sizeof(buffer), buffer);
if (n > 0 && n < sizeof(buffer))
{
std::string result(buffer, n);
if (result[n - 1] != '\\')
result.append("\\");
return result;
}
else throw SystemException("Cannot get current directory");
}
std::string PathImpl::systemImpl()
{
char buffer[MAX_PATH];
DWORD n = GetSystemDirectoryA(buffer, sizeof(buffer));
if (n > 0 && n < sizeof(buffer))
{
std::string result(buffer, n);
if (result[n - 1] != '\\')
result.append("\\");
return result;
}
else throw SystemException("Cannot get system directory");
}
std::string PathImpl::homeImpl()
{
std::string result;
// windows service has no home dir, return system directory instead
try
{
result = EnvironmentImpl::getImpl("HOMEDRIVE");
result.append(EnvironmentImpl::getImpl("HOMEPATH"));
}
catch (NotFoundException&)
{
result = systemImpl();
}
std::string::size_type n = result.size();
if (n > 0 && result[n - 1] != '\\')
result.append("\\");
return result;
}
std::string PathImpl::tempImpl()
{
char buffer[MAX_PATH];
DWORD n = GetTempPathA(sizeof(buffer), buffer);
if (n > 0 && n < sizeof(buffer))
{
n = GetLongPathNameA(buffer, buffer, static_cast<DWORD>(sizeof buffer));
if (n <= 0) throw SystemException("Cannot get temporary directory long path name");
std::string result(buffer, n);
if (result[n - 1] != '\\')
result.append("\\");
return result;
}
else throw SystemException("Cannot get temporary directory");
}
std::string PathImpl::nullImpl()
{
return "NUL:";
}
std::string PathImpl::expandImpl(const std::string& path)
{
char buffer[MAX_PATH];
DWORD n = ExpandEnvironmentStringsA(path.c_str(), buffer, sizeof(buffer));
if (n > 0 && n < sizeof(buffer))
return std::string(buffer, n - 1);
else
return path;
}
void PathImpl::listRootsImpl(std::vector<std::string>& roots)
{
roots.clear();
char buffer[128];
DWORD n = GetLogicalDriveStrings(sizeof(buffer) - 1, buffer);
char* it = buffer;
char* end = buffer + (n > sizeof(buffer) ? sizeof(buffer) : n);
while (it < end)
{
std::string dev;
while (it < end && *it) dev += *it++;
roots.push_back(dev);
++it;
}
}
} // namespace Poco
| mit |
Vault16Software/Blue-Flame-Engine | Blue-Flame-Engine/Core/BF/IO/OBJLoader.cpp | 1 | 8538 | #include "OBJLoader.h"
namespace BF
{
namespace IO
{
using namespace std;
using namespace BF::Graphics;
using namespace BF::Math;
struct OBJReader::Index
{
int positionIndex, texcoordIndex, normalIndex;
unsigned int index;
Index(int positionIndex, int texcoordIndex, int normalIndex, unsigned int index) :
positionIndex(0), texcoordIndex(0), normalIndex(0), index(0)
{
this->positionIndex = positionIndex;
this->texcoordIndex = texcoordIndex;
this->normalIndex = normalIndex;
this->index = index;
}
};
OBJReader::OBJReader() :
totalVertices(0), totalTexCoord(0), totalNormals(0)
{
meshes = new vector<Mesh>();
vertices = new vector<MeshVertexData>();
indices = new vector<unsigned int>();
}
OBJReader::~OBJReader()
{
}
vector<Mesh>* OBJReader::Load(std::string fileName)
{
size_t lastSlash = fileName.find_last_of("/");
filePath = fileName.substr(0, lastSlash + 1);
LoadOBJFile(fileName);
LoadMaterialFile();
return meshes;
}
void OBJReader::LoadOBJFile(std::string fileName)
{
FILE* file = fopen(fileName.c_str(), "r");
if (file == 0)
{
printf("Impossible to open the file !\n");
fclose(file);
return;
}
bool hasTextureCoords = false;
bool didFormatScan = false;
bool readFace = false;
bool addPreviousMesh = false;
bool containsGroups = false;
vector<Vector3> tempVertices;
vector<Vector2> tempTexcoord;
vector<Vector3> tempNormals;
vector<Index> tempIndecies;
while (true)
{
char lineHeader[512];
int res = fscanf(file, "%s", lineHeader);
if (strcmp(lineHeader, "mtllib") == 0)
{
char materialFileNameC[512];
fscanf(file, "%s", materialFileNameC);
materialFileName = materialFileNameC;
}
else if (res == EOF || strcmp(lineHeader, "o") == 0)
{
if ((res == EOF || strcmp(lineHeader, "o") == 0) && addPreviousMesh)
{
AddMesh(tempVertices, tempTexcoord, tempNormals, tempIndecies);
if (res == EOF)
break;
}
containsGroups = true;
addPreviousMesh = true;
}
else if (strcmp(lineHeader, "v") == 0)
{
if (strcmp(lineHeader, "v") == 0 && readFace && !containsGroups)
{
AddMesh(tempVertices, tempTexcoord, tempNormals, tempIndecies);
readFace = false;
}
Vector3 vertex(0.0f);
fscanf(file, "%f %f %f\n", &vertex.x, &vertex.y, &vertex.z);
tempVertices.push_back(vertex);
}
else if (strcmp(lineHeader, "vt") == 0)
{
Vector2 texcoord(0.0f);
fscanf(file, "%f %f\n", &texcoord.x, &texcoord.y);
tempTexcoord.push_back(texcoord);
}
else if (strcmp(lineHeader, "vn") == 0)
{
Vector3 normal(0.0f);
fscanf(file, "%f %f %f\n", &normal.x, &normal.y, &normal.z);
tempNormals.push_back(normal);
}
else if (strcmp(lineHeader, "usemtl") == 0)
{
char materialName[512];
fscanf(file, "%s", materialName);
meshMaterialNames.push_back(materialName);
}
else if (strcmp(lineHeader, "f") == 0)
{
int vertexIndex[3] = { -1, -1, -1 };
int texcoordIndex[3] = { -1, -1, -1 };
int normalIndex[3] = { -1, -1, -1 };
if (!didFormatScan)
{
//Check if file contains texture coordinates. 0//0
fscanf(file, "%s", lineHeader);
std::string s = lineHeader;
std::size_t dfs = s.find("//");
if (dfs == std::string::npos)
hasTextureCoords = true;
else
hasTextureCoords = false;
if (hasTextureCoords)
{
std::size_t ffs = s.find("/");
std::size_t sfs = s.find("/", ffs + 1);
vertexIndex[0] = std::stoi(s.substr(0, ffs));
texcoordIndex[0] = std::stoi(s.substr(0, sfs));
normalIndex[0] = std::stoi(s.substr(sfs + 1));
fscanf(file, "%d/%d/%d %d/%d/%d\n", &vertexIndex[1], &texcoordIndex[1], &normalIndex[1], &vertexIndex[2], &texcoordIndex[2], &normalIndex[2]);
}
else
{
vertexIndex[0] = std::stoi(s.substr(0, dfs));
normalIndex[0] = std::stoi(s.substr(dfs + 2));
fscanf(file, "%d//%d %d//%d\n", &vertexIndex[1], &normalIndex[1], &vertexIndex[2], &normalIndex[2]);
}
didFormatScan = true;
}
if (hasTextureCoords && didFormatScan)
{
fscanf(file, "%d/%d/%d %d/%d/%d %d/%d/%d\n",
&vertexIndex[0], &texcoordIndex[0], &normalIndex[0],
&vertexIndex[1], &texcoordIndex[1], &normalIndex[1],
&vertexIndex[2], &texcoordIndex[2], &normalIndex[2]);
}
else
{
fscanf(file, "%d//%d %d//%d %d//%d\n",
&vertexIndex[0], &normalIndex[0],
&vertexIndex[1], &normalIndex[1],
&vertexIndex[2], &normalIndex[2]);
}
for (int i = 0; i < 3; i++)
{
bool found = false;
if (hasTextureCoords)
{
for (size_t j = 0; j < tempIndecies.size(); j++)
{
if (tempIndecies[j].positionIndex == vertexIndex[i] - totalVertices - 1 &&
tempIndecies[j].texcoordIndex == texcoordIndex[i] - totalTexCoord - 1 &&
tempIndecies[j].normalIndex == normalIndex[i] - totalNormals - 1)
{
tempIndecies.push_back(Index(-10, -10, -10, tempIndecies[j].index));
found = true;
break;
}
}
if (!found)
tempIndecies.push_back(Index(vertexIndex[i] - totalVertices - 1, texcoordIndex[i] - totalTexCoord - 1, normalIndex[i] - totalNormals - 1, index));
}
else
{
for (size_t j = 0; j < tempIndecies.size(); j++)
{
if (tempIndecies[j].positionIndex == vertexIndex[i] - totalVertices - 1 &&
tempIndecies[j].normalIndex == normalIndex[i] - totalNormals - 1)
{
tempIndecies.push_back(Index(-10, -10, -10, tempIndecies[j].index));
found = true;
break;
}
}
if (!found)
tempIndecies.push_back(Index(vertexIndex[i] - totalVertices - 1, 0, normalIndex[i] - totalNormals - 1, index));
}
if (!found)
index++;
}
readFace = true;
}
}
fclose(file);
}
void OBJReader::LoadMaterialFile()
{
FILE* file = fopen((filePath + materialFileName).c_str(), "r");
if (file == 0)
{
printf("Impossible to open the file !\n");
fclose(file);
return;
}
bool temp = false;
while (true)
{
char lineHeader[512];
string textureFileName;
int res = fscanf(file, "%s", lineHeader);
if (res == EOF)
break;
if (strcmp(lineHeader, "newmtl") == 0)
{
res = fscanf(file, "%s", lineHeader);
if (res == EOF)
break;
for (size_t i = 0; i < meshMaterialNames.size(); i++)
{
if (strcmp(lineHeader, meshMaterialNames[i].c_str()) == 0)
{
while (true)
{
res = fscanf(file, "%s", lineHeader);
if (res == EOF || strcmp(lineHeader, "newmtl") == 0)
break;
if (strcmp(lineHeader, "map_Kd") == 0)
{
char c;
c = fgetc(file);
while ((c = fgetc(file)) != EOF && c != '\n')
textureFileName += c;
meshes[0][i].SetTextureFileName(filePath + textureFileName);
temp = true;
break;
}
}
break;
}
}
}
if (temp)
break;
}
fclose(file);
}
void OBJReader::AddMesh(vector<Vector3>& tempVertices, vector<Vector2>& tempTexcoord, vector<Vector3>& tempNormals, vector<Index>& tempIndecies)
{
for (size_t i = 0; i < tempIndecies.size(); i++)
{
if (tempIndecies[i].positionIndex != -10 && tempIndecies[i].texcoordIndex != -10 && tempIndecies[i].normalIndex != -10)
{
if (tempTexcoord.size() <= 0)
vertices->push_back(MeshVertexData(tempVertices[tempIndecies[i].positionIndex], Vector2(0), tempNormals[tempIndecies[i].normalIndex]));
else
vertices->push_back(MeshVertexData(tempVertices[tempIndecies[i].positionIndex], tempTexcoord[tempIndecies[i].texcoordIndex], tempNormals[tempIndecies[i].normalIndex]));
}
}
for (size_t i = 0; i < tempIndecies.size(); i++)
indices->push_back(tempIndecies[i].index);
meshes->push_back(Mesh(vertices, indices));
totalVertices += (unsigned int)tempVertices.size();
totalTexCoord += (unsigned int)tempTexcoord.size();
totalNormals += (unsigned int)tempNormals.size();
vertices = new vector<MeshVertexData>();
indices = new vector<unsigned int>();
tempVertices.clear();
tempTexcoord.clear();
tempNormals.clear();
tempIndecies.clear();
index = 0;
}
}
} | mit |
Duffycola/lasertowerspp | test/test.cpp | 1 | 1766 | //
// test.cpp
// lasertowerspp
//
// Created by Eduard Feicho <eduard.feicho@rwth-aachen.de> on 28.05.12.
//
//
// The MIT License (MIT)
//
// Copyright (c) 2012 Eduard Feicho
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
//
#include <iostream>
#include "UnitTestTemplate.h"
#include "UnitTestEnemyGenerator.h"
#include "UnitTestGameWin.h"
#include "UnitTestGameLose.h"
int main(int argc, char** argv)
{
vector<UnitTestTemplate*> testcases;
testcases.push_back( new UnitTestEnemyGenerator() );
testcases.push_back( new UnitTestGameWin() );
testcases.push_back( new UnitTestGameLose() );
for (vector<UnitTestTemplate*>::iterator it = testcases.begin(); it != testcases.end(); it++) {
(*it)->run();
}
return 0;
}
| mit |
pdrobek/polcoin-new | src/checkpoints.cpp | 1 | 5116 | // Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "main.h"
#include "uint256.h"
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
// How many times we expect transactions after the last checkpoint to
// be slower. This number is a compromise, as it can't be accurate for
// every system. When reindexing from a fast disk with a slow CPU, it
// can be up to 20, while when downloading from a slow network with a
// fast multicore CPU, it won't be much higher than 1.
static const double fSigcheckVerificationFactor = 5.0;
struct CCheckpointData {
const MapCheckpoints *mapCheckpoints;
int64 nTimeLastCheckpoint;
int64 nTransactionsLastCheckpoint;
double fTransactionsPerDay;
};
// What makes a good checkpoint block?
// + Is surrounded by blocks with reasonable timestamps
// (no blocks before with a timestamp after, none after with
// timestamp before)
// + Contains no strange transactions
static MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 0, uint256("0x5582ea402d65bd7445949da32c96217ae98d128a1afb37c78afd79df3d23b105"))
;
static const CCheckpointData data = {
&mapCheckpoints,
1375533383, // * UNIX timestamp of last checkpoint block
21491097, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
60000.0 // * estimated number of transactions per day after checkpoint
};
static MapCheckpoints mapCheckpointsTestnet =
boost::assign::map_list_of
( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70"))
;
static const CCheckpointData dataTestnet = {
&mapCheckpointsTestnet,
1338180505,
16341,
300
};
const CCheckpointData &Checkpoints() {
if (fTestNet)
return dataTestnet;
else
return data;
}
bool CheckBlock(int nHeight, const uint256& hash)
{
if (!GetBoolArg("-checkpoints", true))
return true;
//return true;
const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints;
MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
if (i == checkpoints.end()) return true;
return hash == i->second;
return true;
}
// Guess how far we are in the verification process at the given block index
double GuessVerificationProgress(CBlockIndex *pindex) {
if (pindex==NULL)
return 0.0;
//return 0.0;
int64 nNow = time(NULL);
double fWorkBefore = 0.0; // Amount of work done before pindex
double fWorkAfter = 0.0; // Amount of work left after pindex (estimated)
// Work is defined as: 1.0 per transaction before the last checkoint, and
// fSigcheckVerificationFactor per transaction after.
const CCheckpointData &data = Checkpoints();
if (pindex->nChainTx <= data.nTransactionsLastCheckpoint) {
double nCheapBefore = pindex->nChainTx;
double nCheapAfter = data.nTransactionsLastCheckpoint - pindex->nChainTx;
double nExpensiveAfter = (nNow - data.nTimeLastCheckpoint)/86400.0*data.fTransactionsPerDay;
fWorkBefore = nCheapBefore;
fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor;
} else {
double nCheapBefore = data.nTransactionsLastCheckpoint;
double nExpensiveBefore = pindex->nChainTx - data.nTransactionsLastCheckpoint;
double nExpensiveAfter = (nNow - pindex->nTime)/86400.0*data.fTransactionsPerDay;
fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor;
fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor;
}
return fWorkBefore / (fWorkBefore + fWorkAfter);
}
int GetTotalBlocksEstimate()
{
//return 0;
if (!GetBoolArg("-checkpoints", true))
return 0;
const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints;
return checkpoints.rbegin()->first;
//return 0;
}
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
{
return NULL;
if (!GetBoolArg("-checkpoints", true))
return NULL;
const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints;
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)
{
const uint256& hash = i.second;
std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
if (t != mapBlockIndex.end())
return t->second;
}
return NULL;
}
}
| mit |
kojiba/PRay | Classes/RayFoundation/REncoding/PurgeEvasionUtilsRay.c | 2 | 3918 | /**
* PurgeEvasionIUtilsRay.c
* Utils for work with cipher for libRay.
* Author Kucheruavyu Ilya (kojiba@protonmail.com)
* 8/26/15 Ukraine Kharkiv
* _ _ _ _
* | | (_|_) |
* | | _____ _ _| |__ __ _
* | |/ / _ \| | | '_ \ / _` |
* | < (_) | | | |_) | (_| |
* |_|\_\___/| |_|_.__/ \__,_|
* _/ |
* |__/
**/
#include "PurgeEvasionUtilsRay.h"
#include "PurgeEvasionUtils.h"
#include "RBase64.h"
constMethod(RData *, encryptPurgeEvasion, RData), const RData *key) {
RData *result = allocator(RData);
uint64_t resultSize;
byte tempKey[purgeBytesCount]; // 512 bits
if(key->size >= purgeBytesCount) {
memcpy(&tempKey, key->data, purgeBytesCount);
} else {
// set and cpy must have one calculating speed
memcpy(&tempKey, key->data, key->size);
memset(&tempKey, 0, purgeBytesCount - key->size); // add some zeros
}
if(result != nil) {
result->data = encryptPurgeEvasion(object->data,
object->size,
(uint64_t *) &tempKey,
&resultSize);
if(resultSize > UINT32_MAX
&& sizeof(size_t) == 4) {
RError("RData. encryptPurgeEvasionBase64. Lose data at 32-bit system and very long encryption.\n"
"Return pure not base64 array to store data.", result);
return result;
}
if (result->data != nil && resultSize > 6) {
result->size = resultSize;
return result;
}
}
return nil;
}
constMethod(RData *, decryptPurgeEvasion, RData), const RData *key) {
byte *temp;
uint64_t resultSize;
byte tempKey[purgeBytesCount]; // 512 bits
if(key->size >= purgeBytesCount) {
memcpy(&tempKey, key->data, purgeBytesCount);
} else {
memcpy(&tempKey, key->data, key->size);
memset(&tempKey, 0, purgeBytesCount - key->size); // add some zeros
}
temp = decryptPurgeEvasion(object->data,
object->size,
(uint64_t *) &tempKey,
&resultSize);
if (resultSize > UINT32_MAX
&& sizeof(size_t) == 4) {
RError("RString. decryptPurgeEvasionBase64. Lose data at 32-bit system and very long encryption.\n"
"Return pure not base64 array to store data.", object);
}
if(temp != nil) {
return makeRDataBytes(temp, resultSize);
} else {
return nil;
}
}
constMethod(RData *, evasionHash, RData)) {
uint64_t hash[8];
evasionHashData(object->data, object->size, hash);
return makeRDataBytes(getByteArrayCopy((const byte *) hash, evasionBytesCount), evasionBytesCount);
}
inline
constMethod(RString *, encryptPurgeEvasionBase64, RString), const RString *key) {
RData *temp;
RString *result = nil;
temp = $(object, m(encryptPurgeEvasion, RData)), temp);
if(temp != nil) {
result = $(temp, m(encodeBase64, RData)));
result->type = RDataTypeASCII;
deleter(temp, RData);
}
return result;
}
inline
constMethod(RString *, decryptPurgeEvasionBase64, RString), const RString *key) {
RData *tempResult;
RString *result = nil;
tempResult = $(object, m(decodeBase64, RString)));
if(tempResult != nil) {
result = $(tempResult, m(decryptPurgeEvasion, RData)), key);
result->type = RDataTypeASCII;
deleter(tempResult, RData);
}
return result;
}
constMethod(RString *, evasionHashBase64, RString)) {
RString *result = nil;
RData *hash = $(object, m(evasionHash, RData)));
if(hash != nil) {
result = $(hash, m(encodeBase64, RData)));
result->type = RDataTypeASCII;
deleter(hash, RData);
}
return result;
} | mit |
jrick/bitcoin | src/rpcmining.cpp | 2 | 29719 | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "amount.h"
#include "chainparams.h"
#include "consensus/consensus.h"
#include "core_io.h"
#include "init.h"
#include "main.h"
#include "miner.h"
#include "net.h"
#include "pow.h"
#include "rpcserver.h"
#include "util.h"
#include "validationinterface.h"
#ifdef ENABLE_WALLET
#include "wallet/wallet.h"
#endif
#include <stdint.h>
#include <boost/assign/list_of.hpp>
#include "json/json_spirit_utils.h"
#include "json/json_spirit_value.h"
using namespace json_spirit;
using namespace std;
/**
* Return average network hashes per second based on the last 'lookup' blocks,
* or from the last difficulty change if 'lookup' is nonpositive.
* If 'height' is nonnegative, compute the estimate at the time when a given block was found.
*/
Value GetNetworkHashPS(int lookup, int height) {
CBlockIndex *pb = chainActive.Tip();
if (height >= 0 && height < chainActive.Height())
pb = chainActive[height];
if (pb == NULL || !pb->nHeight)
return 0;
// If lookup is -1, then use blocks since last difficulty change.
if (lookup <= 0)
lookup = pb->nHeight % Params().GetConsensus().DifficultyAdjustmentInterval() + 1;
// If lookup is larger than chain, then set it to chain length.
if (lookup > pb->nHeight)
lookup = pb->nHeight;
CBlockIndex *pb0 = pb;
int64_t minTime = pb0->GetBlockTime();
int64_t maxTime = minTime;
for (int i = 0; i < lookup; i++) {
pb0 = pb0->pprev;
int64_t time = pb0->GetBlockTime();
minTime = std::min(time, minTime);
maxTime = std::max(time, maxTime);
}
// In case there's a situation where minTime == maxTime, we don't want a divide by zero exception.
if (minTime == maxTime)
return 0;
arith_uint256 workDiff = pb->nChainWork - pb0->nChainWork;
int64_t timeDiff = maxTime - minTime;
return (int64_t)(workDiff.getdouble() / timeDiff);
}
Value getnetworkhashps(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"getnetworkhashps ( blocks height )\n"
"\nReturns the estimated network hashes per second based on the last n blocks.\n"
"Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
"Pass in [height] to estimate the network speed at the time when a certain block was found.\n"
"\nArguments:\n"
"1. blocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n"
"2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
"\nResult:\n"
"x (numeric) Hashes per second estimated\n"
"\nExamples:\n"
+ HelpExampleCli("getnetworkhashps", "")
+ HelpExampleRpc("getnetworkhashps", "")
);
LOCK(cs_main);
return GetNetworkHashPS(params.size() > 0 ? params[0].get_int() : 120, params.size() > 1 ? params[1].get_int() : -1);
}
#ifdef ENABLE_WALLET
Value getgenerate(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getgenerate\n"
"\nReturn if the server is set to generate coins or not. The default is false.\n"
"It is set with the command line argument -gen (or bitcoin.conf setting gen)\n"
"It can also be set with the setgenerate call.\n"
"\nResult\n"
"true|false (boolean) If the server is set to generate coins or not\n"
"\nExamples:\n"
+ HelpExampleCli("getgenerate", "")
+ HelpExampleRpc("getgenerate", "")
);
LOCK(cs_main);
return GetBoolArg("-gen", false);
}
Value generate(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 1)
throw runtime_error(
"generate numblocks\n"
"\nMine blocks immediately (before the RPC call returns)\n"
"\nNote: this function can only be used on the regtest network\n"
"1. numblocks (numeric) How many blocks are generated immediately.\n"
"\nResult\n"
"[ blockhashes ] (array) hashes of blocks generated\n"
"\nExamples:\n"
"\nGenerate 11 blocks\n"
+ HelpExampleCli("generate", "11")
);
if (pwalletMain == NULL)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
if (!Params().MineBlocksOnDemand())
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "This method can only be used on regtest");
int nHeightStart = 0;
int nHeightEnd = 0;
int nHeight = 0;
int nGenerate = params[0].get_int();
CReserveKey reservekey(pwalletMain);
{ // Don't keep cs_main locked
LOCK(cs_main);
nHeightStart = chainActive.Height();
nHeight = nHeightStart;
nHeightEnd = nHeightStart+nGenerate;
}
unsigned int nExtraNonce = 0;
Array blockHashes;
while (nHeight < nHeightEnd)
{
auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
if (!pblocktemplate.get())
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
CBlock *pblock = &pblocktemplate->block;
{
LOCK(cs_main);
IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce);
}
while (!CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus())) {
// Yes, there is a chance every nonce could fail to satisfy the -regtest
// target -- 1 in 2^(2^32). That ain't gonna happen.
++pblock->nNonce;
}
CValidationState state;
if (!ProcessNewBlock(state, NULL, pblock))
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
++nHeight;
blockHashes.push_back(pblock->GetHash().GetHex());
}
return blockHashes;
}
Value setgenerate(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"setgenerate generate ( genproclimit )\n"
"\nSet 'generate' true or false to turn generation on or off.\n"
"Generation is limited to 'genproclimit' processors, -1 is unlimited.\n"
"See the getgenerate call for the current setting.\n"
"\nArguments:\n"
"1. generate (boolean, required) Set to true to turn on generation, off to turn off.\n"
"2. genproclimit (numeric, optional) Set the processor limit for when generation is on. Can be -1 for unlimited.\n"
"\nExamples:\n"
"\nSet the generation on with a limit of one processor\n"
+ HelpExampleCli("setgenerate", "true 1") +
"\nCheck the setting\n"
+ HelpExampleCli("getgenerate", "") +
"\nTurn off generation\n"
+ HelpExampleCli("setgenerate", "false") +
"\nUsing json rpc\n"
+ HelpExampleRpc("setgenerate", "true, 1")
);
if (pwalletMain == NULL)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
if (Params().MineBlocksOnDemand())
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Use the generate method instead of setgenerate on this network");
bool fGenerate = true;
if (params.size() > 0)
fGenerate = params[0].get_bool();
int nGenProcLimit = -1;
if (params.size() > 1)
{
nGenProcLimit = params[1].get_int();
if (nGenProcLimit == 0)
fGenerate = false;
}
mapArgs["-gen"] = (fGenerate ? "1" : "0");
mapArgs ["-genproclimit"] = itostr(nGenProcLimit);
GenerateBitcoins(fGenerate, pwalletMain, nGenProcLimit);
return Value::null;
}
#endif
Value getmininginfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getmininginfo\n"
"\nReturns a json object containing mining-related information."
"\nResult:\n"
"{\n"
" \"blocks\": nnn, (numeric) The current block\n"
" \"currentblocksize\": nnn, (numeric) The last block size\n"
" \"currentblocktx\": nnn, (numeric) The last block transaction\n"
" \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
" \"errors\": \"...\" (string) Current errors\n"
" \"generate\": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate calls)\n"
" \"genproclimit\": n (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)\n"
" \"pooledtx\": n (numeric) The size of the mem pool\n"
" \"testnet\": true|false (boolean) If using testnet or not\n"
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("getmininginfo", "")
+ HelpExampleRpc("getmininginfo", "")
);
LOCK(cs_main);
Object obj;
obj.push_back(Pair("blocks", (int)chainActive.Height()));
obj.push_back(Pair("currentblocksize", (uint64_t)nLastBlockSize));
obj.push_back(Pair("currentblocktx", (uint64_t)nLastBlockTx));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1)));
obj.push_back(Pair("networkhashps", getnetworkhashps(params, false)));
obj.push_back(Pair("pooledtx", (uint64_t)mempool.size()));
obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC()));
obj.push_back(Pair("chain", Params().NetworkIDString()));
#ifdef ENABLE_WALLET
obj.push_back(Pair("generate", getgenerate(params, false)));
#endif
return obj;
}
// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts
Value prioritisetransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 3)
throw runtime_error(
"prioritisetransaction <txid> <priority delta> <fee delta>\n"
"Accepts the transaction into mined blocks at a higher (or lower) priority\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id.\n"
"2. priority delta (numeric, required) The priority to add or subtract.\n"
" The transaction selection algorithm considers the tx as it would have a higher priority.\n"
" (priority of a transaction is calculated: coinage * value_in_satoshis / txsize) \n"
"3. fee delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n"
" The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
" considers the transaction as it would have paid a higher (or lower) fee.\n"
"\nResult\n"
"true (boolean) Returns true\n"
"\nExamples:\n"
+ HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 10000")
+ HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000")
);
LOCK(cs_main);
uint256 hash = ParseHashStr(params[0].get_str(), "txid");
CAmount nAmount = params[2].get_int64();
mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), nAmount);
return true;
}
// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
static Value BIP22ValidationResult(const CValidationState& state)
{
if (state.IsValid())
return Value::null;
std::string strRejectReason = state.GetRejectReason();
if (state.IsError())
throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
if (state.IsInvalid())
{
if (strRejectReason.empty())
return "rejected";
return strRejectReason;
}
// Should be impossible
return "valid?";
}
Value getblocktemplate(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getblocktemplate ( \"jsonrequestobject\" )\n"
"\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
"It returns data needed to construct a block to work on.\n"
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
"\nArguments:\n"
"1. \"jsonrequestobject\" (string, optional) A json object in the following spec\n"
" {\n"
" \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted\n"
" \"capabilities\":[ (array, optional) A list of strings\n"
" \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
" ,...\n"
" ]\n"
" }\n"
"\n"
"\nResult:\n"
"{\n"
" \"version\" : n, (numeric) The block version\n"
" \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
" \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
" {\n"
" \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
" \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n"
" \"depends\" : [ (array) array of numbers \n"
" n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
" ,...\n"
" ],\n"
" \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
" \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n"
" \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
" }\n"
" ,...\n"
" ],\n"
" \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
" \"flags\" : \"flags\" (string) \n"
" },\n"
" \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n"
" \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
" \"target\" : \"xxxx\", (string) The hash target\n"
" \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"mutable\" : [ (array of string) list of ways the block template may be changed \n"
" \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n"
" ,...\n"
" ],\n"
" \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
" \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
" \"sizelimit\" : n, (numeric) limit of block size\n"
" \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
" \"bits\" : \"xxx\", (string) compressed target of next block\n"
" \"height\" : n (numeric) The height of the next block\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("getblocktemplate", "")
+ HelpExampleRpc("getblocktemplate", "")
);
LOCK(cs_main);
std::string strMode = "template";
Value lpval = Value::null;
if (params.size() > 0)
{
const Object& oparam = params[0].get_obj();
const Value& modeval = find_value(oparam, "mode");
if (modeval.type() == str_type)
strMode = modeval.get_str();
else if (modeval.type() == null_type)
{
/* Do nothing */
}
else
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
lpval = find_value(oparam, "longpollid");
if (strMode == "proposal")
{
const Value& dataval = find_value(oparam, "data");
if (dataval.type() != str_type)
throw JSONRPCError(RPC_TYPE_ERROR, "Missing data String key for proposal");
CBlock block;
if (!DecodeHexBlk(block, dataval.get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed");
uint256 hash = block.GetHash();
BlockMap::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end()) {
CBlockIndex *pindex = mi->second;
if (pindex->IsValid(BLOCK_VALID_SCRIPTS))
return "duplicate";
if (pindex->nStatus & BLOCK_FAILED_MASK)
return "duplicate-invalid";
return "duplicate-inconclusive";
}
CBlockIndex* const pindexPrev = chainActive.Tip();
// TestBlockValidity only supports blocks built on the current Tip
if (block.hashPrevBlock != pindexPrev->GetBlockHash())
return "inconclusive-not-best-prevblk";
CValidationState state;
TestBlockValidity(state, block, pindexPrev, false, true);
return BIP22ValidationResult(state);
}
}
if (strMode != "template")
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks...");
static unsigned int nTransactionsUpdatedLast;
if (lpval.type() != null_type)
{
// Wait to respond until either the best block changes, OR a minute has passed and there are more transactions
uint256 hashWatchedChain;
boost::system_time checktxtime;
unsigned int nTransactionsUpdatedLastLP;
if (lpval.type() == str_type)
{
// Format: <hashBestChain><nTransactionsUpdatedLast>
std::string lpstr = lpval.get_str();
hashWatchedChain.SetHex(lpstr.substr(0, 64));
nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64));
}
else
{
// NOTE: Spec does not specify behaviour for non-string longpollid, but this makes testing easier
hashWatchedChain = chainActive.Tip()->GetBlockHash();
nTransactionsUpdatedLastLP = nTransactionsUpdatedLast;
}
// Release the wallet and main lock while waiting
LEAVE_CRITICAL_SECTION(cs_main);
{
checktxtime = boost::get_system_time() + boost::posix_time::minutes(1);
boost::unique_lock<boost::mutex> lock(csBestBlock);
while (chainActive.Tip()->GetBlockHash() == hashWatchedChain && IsRPCRunning())
{
if (!cvBlockChange.timed_wait(lock, checktxtime))
{
// Timeout: Check transactions for update
if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLastLP)
break;
checktxtime += boost::posix_time::seconds(10);
}
}
}
ENTER_CRITICAL_SECTION(cs_main);
if (!IsRPCRunning())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down");
// TODO: Maybe recheck connections/IBD and (if something wrong) send an expires-immediately template to stop miners?
}
// Update block
static CBlockIndex* pindexPrev;
static int64_t nStart;
static CBlockTemplate* pblocktemplate;
if (pindexPrev != chainActive.Tip() ||
(mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 5))
{
// Clear pindexPrev so future calls make a new block, despite any failures from here on
pindexPrev = NULL;
// Store the pindexBest used before CreateNewBlock, to avoid races
nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
CBlockIndex* pindexPrevNew = chainActive.Tip();
nStart = GetTime();
// Create new block
if(pblocktemplate)
{
delete pblocktemplate;
pblocktemplate = NULL;
}
CScript scriptDummy = CScript() << OP_TRUE;
pblocktemplate = CreateNewBlock(scriptDummy);
if (!pblocktemplate)
throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory");
// Need to update only after we know CreateNewBlock succeeded
pindexPrev = pindexPrevNew;
}
CBlock* pblock = &pblocktemplate->block; // pointer for convenience
// Update nTime
UpdateTime(pblock, Params().GetConsensus(), pindexPrev);
pblock->nNonce = 0;
static const Array aCaps = boost::assign::list_of("proposal");
Array transactions;
map<uint256, int64_t> setTxIndex;
int i = 0;
BOOST_FOREACH (CTransaction& tx, pblock->vtx)
{
uint256 txHash = tx.GetHash();
setTxIndex[txHash] = i++;
if (tx.IsCoinBase())
continue;
Object entry;
entry.push_back(Pair("data", EncodeHexTx(tx)));
entry.push_back(Pair("hash", txHash.GetHex()));
Array deps;
BOOST_FOREACH (const CTxIn &in, tx.vin)
{
if (setTxIndex.count(in.prevout.hash))
deps.push_back(setTxIndex[in.prevout.hash]);
}
entry.push_back(Pair("depends", deps));
int index_in_template = i - 1;
entry.push_back(Pair("fee", pblocktemplate->vTxFees[index_in_template]));
entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[index_in_template]));
transactions.push_back(entry);
}
Object aux;
aux.push_back(Pair("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end())));
arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits);
static Array aMutable;
if (aMutable.empty())
{
aMutable.push_back("time");
aMutable.push_back("transactions");
aMutable.push_back("prevblock");
}
Object result;
result.push_back(Pair("capabilities", aCaps));
result.push_back(Pair("version", pblock->nVersion));
result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex()));
result.push_back(Pair("transactions", transactions));
result.push_back(Pair("coinbaseaux", aux));
result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue));
result.push_back(Pair("longpollid", chainActive.Tip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast)));
result.push_back(Pair("target", hashTarget.GetHex()));
result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1));
result.push_back(Pair("mutable", aMutable));
result.push_back(Pair("noncerange", "00000000ffffffff"));
result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS));
result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE));
result.push_back(Pair("curtime", pblock->GetBlockTime()));
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));
return result;
}
class submitblock_StateCatcher : public CValidationInterface
{
public:
uint256 hash;
bool found;
CValidationState state;
submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {};
protected:
virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) {
if (block.GetHash() != hash)
return;
found = true;
state = stateIn;
};
};
Value submitblock(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"submitblock \"hexdata\" ( \"jsonparametersobject\" )\n"
"\nAttempts to submit new block to network.\n"
"The 'jsonparametersobject' parameter is currently ignored.\n"
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
"\nArguments\n"
"1. \"hexdata\" (string, required) the hex-encoded block data to submit\n"
"2. \"jsonparametersobject\" (string, optional) object of optional parameters\n"
" {\n"
" \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions\n"
" }\n"
"\nResult:\n"
"\nExamples:\n"
+ HelpExampleCli("submitblock", "\"mydata\"")
+ HelpExampleRpc("submitblock", "\"mydata\"")
);
CBlock block;
if (!DecodeHexBlk(block, params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed");
uint256 hash = block.GetHash();
bool fBlockPresent = false;
{
LOCK(cs_main);
BlockMap::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end()) {
CBlockIndex *pindex = mi->second;
if (pindex->IsValid(BLOCK_VALID_SCRIPTS))
return "duplicate";
if (pindex->nStatus & BLOCK_FAILED_MASK)
return "duplicate-invalid";
// Otherwise, we might only have the header - process the block before returning
fBlockPresent = true;
}
}
CValidationState state;
submitblock_StateCatcher sc(block.GetHash());
RegisterValidationInterface(&sc);
bool fAccepted = ProcessNewBlock(state, NULL, &block);
UnregisterValidationInterface(&sc);
if (fBlockPresent)
{
if (fAccepted && !sc.found)
return "duplicate-inconclusive";
return "duplicate";
}
if (fAccepted)
{
if (!sc.found)
return "inconclusive";
state = sc.state;
}
return BIP22ValidationResult(state);
}
Value estimatefee(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"estimatefee nblocks\n"
"\nEstimates the approximate fee per kilobyte\n"
"needed for a transaction to begin confirmation\n"
"within nblocks blocks.\n"
"\nArguments:\n"
"1. nblocks (numeric)\n"
"\nResult:\n"
"n : (numeric) estimated fee-per-kilobyte\n"
"\n"
"-1.0 is returned if not enough transactions and\n"
"blocks have been observed to make an estimate.\n"
"\nExample:\n"
+ HelpExampleCli("estimatefee", "6")
);
RPCTypeCheck(params, boost::assign::list_of(int_type));
int nBlocks = params[0].get_int();
if (nBlocks < 1)
nBlocks = 1;
CFeeRate feeRate = mempool.estimateFee(nBlocks);
if (feeRate == CFeeRate(0))
return -1.0;
return ValueFromAmount(feeRate.GetFeePerK());
}
Value estimatepriority(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"estimatepriority nblocks\n"
"\nEstimates the approximate priority\n"
"a zero-fee transaction needs to begin confirmation\n"
"within nblocks blocks.\n"
"\nArguments:\n"
"1. nblocks (numeric)\n"
"\nResult:\n"
"n : (numeric) estimated priority\n"
"\n"
"-1.0 is returned if not enough transactions and\n"
"blocks have been observed to make an estimate.\n"
"\nExample:\n"
+ HelpExampleCli("estimatepriority", "6")
);
RPCTypeCheck(params, boost::assign::list_of(int_type));
int nBlocks = params[0].get_int();
if (nBlocks < 1)
nBlocks = 1;
return mempool.estimatePriority(nBlocks);
}
| mit |
wsAndy/elevation_mapping | elevation_mapping/src/sensor_processors/SensorProcessorBase.cpp | 2 | 5642 | /*
* SensorProcessorBase.cpp
*
* Created on: Jun 6, 2014
* Author: Péter Fankhauser, Hannes Keller
* Institute: ETH Zurich, Autonomous Systems Lab
*/
#include <elevation_mapping/sensor_processors/SensorProcessorBase.hpp>
//PCL
#include <pcl/pcl_base.h>
#include <pcl/common/transforms.h>
#include <pcl/common/io.h>
#include <pcl/filters/passthrough.h>
#include <pcl/filters/extract_indices.h>
//TF
#include <tf_conversions/tf_eigen.h>
// STL
#include <limits>
#include <math.h>
#include <vector>
namespace elevation_mapping {
SensorProcessorBase::SensorProcessorBase(ros::NodeHandle& nodeHandle, tf::TransformListener& transformListener)
: nodeHandle_(nodeHandle),
transformListener_(transformListener),
mapFrameId_(""),
robotBaseFrameId_("")
{
pcl::console::setVerbosityLevel(pcl::console::L_ERROR);
transformationSensorToMap_.setIdentity();
transformListenerTimeout_.fromSec(1.0);
}
SensorProcessorBase::~SensorProcessorBase() {}
bool SensorProcessorBase::readParameters()
{
nodeHandle_.param("sensor_processor/ignore_points_above", ignorePointsUpperThreshold_, std::numeric_limits<double>::infinity());
nodeHandle_.param("sensor_processor/ignore_points_below", ignorePointsLowerThreshold_, -std::numeric_limits<double>::infinity());
return true;
}
bool SensorProcessorBase::process(
const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr pointCloudInput,
const Eigen::Matrix<double, 6, 6>& robotPoseCovariance,
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudMapFrame,
Eigen::VectorXf& variances)
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudSensorFrame(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::copyPointCloud(*pointCloudInput, *pointCloudSensorFrame);
cleanPointCloud(pointCloudSensorFrame);
ros::Time timeStamp;
timeStamp.fromNSec(1000 * pointCloudSensorFrame->header.stamp);
if (!updateTransformations(pointCloudSensorFrame->header.frame_id, timeStamp)) return false;
if (!transformPointCloud(pointCloudSensorFrame, pointCloudMapFrame, mapFrameId_)) return false;
std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> pointClouds({pointCloudMapFrame, pointCloudSensorFrame});
removePointsOutsideLimits(pointCloudMapFrame, pointClouds);
if (!computeVariances(pointCloudSensorFrame, robotPoseCovariance, variances)) return false;
return true;
}
bool SensorProcessorBase::updateTransformations(const std::string& sensorFrameId,
const ros::Time& timeStamp)
{
try {
transformListener_.waitForTransform(sensorFrameId, mapFrameId_, timeStamp, ros::Duration(1.0));
tf::StampedTransform transformTf;
transformListener_.lookupTransform(mapFrameId_, sensorFrameId, timeStamp, transformTf);
poseTFToEigen(transformTf, transformationSensorToMap_);
transformListener_.lookupTransform(robotBaseFrameId_, sensorFrameId, timeStamp, transformTf); // TODO Why wrong direction?
Eigen::Affine3d transform;
poseTFToEigen(transformTf, transform);
rotationBaseToSensor_.setMatrix(transform.rotation().matrix());
translationBaseToSensorInBaseFrame_.toImplementation() = transform.translation();
transformListener_.lookupTransform(mapFrameId_, robotBaseFrameId_, timeStamp, transformTf); // TODO Why wrong direction?
poseTFToEigen(transformTf, transform);
rotationMapToBase_.setMatrix(transform.rotation().matrix());
translationMapToBaseInMapFrame_.toImplementation() = transform.translation();
return true;
} catch (tf::TransformException &ex) {
ROS_ERROR("%s", ex.what());
return false;
}
}
bool SensorProcessorBase::transformPointCloud(
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloud,
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudTransformed,
const std::string& targetFrame)
{
pcl::transformPointCloud(*pointCloud, *pointCloudTransformed, transformationSensorToMap_.cast<float>());
pointCloudTransformed->header.frame_id = targetFrame;
ROS_DEBUG("Point cloud transformed to frame %s for time stamp %f.", targetFrame.c_str(),
ros::Time(pointCloudTransformed->header.stamp).toSec());
return true;
}
void SensorProcessorBase::removePointsOutsideLimits(
pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr reference, std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr>& pointClouds)
{
if (!std::isfinite(ignorePointsLowerThreshold_) && !std::isfinite(ignorePointsUpperThreshold_)) return;
ROS_DEBUG("Limiting point cloud to the height interval of [%f, %f] relative to the robot base.", ignorePointsLowerThreshold_, ignorePointsUpperThreshold_);
pcl::PassThrough<pcl::PointXYZRGB> passThroughFilter(true);
passThroughFilter.setInputCloud(reference);
passThroughFilter.setFilterFieldName("z"); // Should this be configurable?
double relativeLowerThreshold = translationMapToBaseInMapFrame_.z() + ignorePointsLowerThreshold_;
double relativeUpperThreshold = translationMapToBaseInMapFrame_.z() + ignorePointsUpperThreshold_;
passThroughFilter.setFilterLimits(relativeLowerThreshold, relativeUpperThreshold);
pcl::IndicesPtr insideIndeces(new std::vector<int>);
passThroughFilter.filter(*insideIndeces);
for (auto& pointCloud : pointClouds) {
pcl::ExtractIndices<pcl::PointXYZRGB> extractIndicesFilter;
extractIndicesFilter.setInputCloud(pointCloud);
extractIndicesFilter.setIndices(insideIndeces);
pcl::PointCloud<pcl::PointXYZRGB> tempPointCloud;
extractIndicesFilter.filter(tempPointCloud);
pointCloud->swap(tempPointCloud);
}
ROS_DEBUG("removePointsOutsideLimits() reduced point cloud to %i points.", (int) pointClouds[0]->size());
}
} /* namespace elevation_mapping */
| mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.