filename
stringlengths
3
9
code
stringlengths
4
1.05M
250145.c
/** * Author......: See docs/credits.txt * License.....: MIT */ #include "common.h" #include "types.h" #include "modules.h" #include "bitops.h" #include "convert.h" #include "shared.h" #include "memory.h" static const u32 ATTACK_EXEC = ATTACK_EXEC_OUTSIDE_KERNEL; static const u32 DGST_POS0 = 0; static const u32 DGST_POS1 = 1; static const u32 DGST_POS2 = 2; static const u32 DGST_POS3 = 3; static const u32 DGST_SIZE = DGST_SIZE_4_4; static const u32 HASH_CATEGORY = HASH_CATEGORY_PASSWORD_MANAGER; static const char *HASH_NAME = "Bitcoin/Litecoin wallet.dat"; static const u64 KERN_TYPE = 11300; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE | OPTI_TYPE_USES_BITS_64 | OPTI_TYPE_SLOW_HASH_SIMD_LOOP; static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE | OPTS_TYPE_ST_HEX | OPTS_TYPE_ST_ADD80 | OPTS_TYPE_HASH_COPY; static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; static const char *ST_PASS = "hashcat"; static const char *ST_HASH = "$bitcoin$96$c265931309b4a59307921cf054b4ec6b6e4554369be79802e94e16477645777d948ae1d375191831efc78e5acd1f0443$16$8017214013543185$200460$96$480008005625057442352316337722323437108374245623701184230273883222762730232857701607167815448714$66$014754433300175043011633205413774877455616682000536368706315333388"; u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; } u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; } u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; } u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; } u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; } u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_SIZE; } u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_CATEGORY; } const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; } u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return KERN_TYPE; } u32 module_opti_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTI_TYPE; } u64 module_opts_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTS_TYPE; } u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return SALT_TYPE; } const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; } const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; } typedef struct bitcoin_wallet { u32 cry_master_buf[64]; u32 cry_master_len; } bitcoin_wallet_t; typedef struct bitcoin_wallet_tmp { u64 dgst[8]; } bitcoin_wallet_tmp_t; static const char *SIGNATURE_BITCOIN_WALLET = "$bitcoin$"; u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { const u64 esalt_size = (const u64) sizeof (bitcoin_wallet_t); return esalt_size; } u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { const u64 tmp_size = (const u64) sizeof (bitcoin_wallet_tmp_t); return tmp_size; } u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { // this overrides the reductions of PW_MAX in case optimized kernel is selected // IOW, even in optimized kernel mode it support length 256 const u32 pw_max = PW_MAX; return pw_max; } char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) { char *jit_build_options = NULL; hc_asprintf (&jit_build_options, "-D NO_UNROLL"); return jit_build_options; } int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len) { u32 *digest = (u32 *) digest_buf; bitcoin_wallet_t *bitcoin_wallet = (bitcoin_wallet_t *) esalt_buf; token_t token; token.token_cnt = 10; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_BITCOIN_WALLET; token.len[0] = 9; token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; token.len_min[1] = 2; token.len_max[1] = 2; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; token.len_min[2] = 16; token.len_max[2] = 256; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; token.len_min[3] = 2; token.len_max[3] = 2; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; token.len_min[4] = 16; token.len_max[4] = 16; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; token.len_min[5] = 1; token.len_max[5] = 6; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; token.len_min[6] = 0; token.len_max[6] = 6; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[7] = '$'; token.len_min[7] = 0; token.len_max[7] = 999999; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = '$'; token.len_min[8] = 0; token.len_max[8] = 6; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[9] = '$'; token.len_min[9] = 0; token.len_max[9] = 999999; token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); const u8 *cry_master_len_pos = token.buf[1]; const u8 *cry_master_buf_pos = token.buf[2]; const u8 *cry_salt_len_pos = token.buf[3]; const u8 *cry_salt_buf_pos = token.buf[4]; const u8 *cry_rounds_pos = token.buf[5]; const u8 *ckey_len_pos = token.buf[6]; const u8 *public_key_len_pos = token.buf[8]; const int cry_master_buf_len = token.len[2]; const int cry_salt_buf_len = token.len[4]; const int ckey_buf_len = token.len[7]; const int public_key_buf_len = token.len[9]; // verify const int cry_master_len = hc_strtoul ((const char *) cry_master_len_pos, NULL, 10); const int cry_salt_len = hc_strtoul ((const char *) cry_salt_len_pos, NULL, 10); const int ckey_len = hc_strtoul ((const char *) ckey_len_pos, NULL, 10); const int public_key_len = hc_strtoul ((const char *) public_key_len_pos, NULL, 10); if (cry_master_buf_len != cry_master_len) return (PARSER_SALT_VALUE); if (cry_salt_buf_len != cry_salt_len) return (PARSER_SALT_VALUE); if (ckey_buf_len != ckey_len) return (PARSER_SALT_VALUE); if (public_key_buf_len != public_key_len) return (PARSER_SALT_VALUE); if (cry_master_len % 16) return (PARSER_SALT_VALUE); // esalt for (int i = 0, j = 0; j < cry_master_len; i += 1, j += 8) { bitcoin_wallet->cry_master_buf[i] = hex_to_u32 ((const u8 *) &cry_master_buf_pos[j]); } bitcoin_wallet->cry_master_len = cry_master_len / 2; // hash digest[0] = bitcoin_wallet->cry_master_buf[0]; digest[1] = bitcoin_wallet->cry_master_buf[1]; digest[2] = bitcoin_wallet->cry_master_buf[2]; digest[3] = bitcoin_wallet->cry_master_buf[3]; // iter const int cry_rounds = hc_strtoul ((const char *) cry_rounds_pos, NULL, 10); salt->salt_iter = cry_rounds - 1; // salt const bool parse_rc = generic_salt_decode (hashconfig, cry_salt_buf_pos, cry_salt_buf_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len); if (parse_rc == false) return (PARSER_SALT_LENGTH); return (PARSER_OK); } int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { return snprintf (line_buf, line_size, "%s", hash_info->orighash); } void module_init (module_ctx_t *module_ctx) { module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; module_ctx->module_interface_version = MODULE_INTERFACE_VERSION_CURRENT; module_ctx->module_attack_exec = module_attack_exec; module_ctx->module_benchmark_esalt = MODULE_DEFAULT; module_ctx->module_benchmark_hook_salt = MODULE_DEFAULT; module_ctx->module_benchmark_mask = MODULE_DEFAULT; module_ctx->module_benchmark_salt = MODULE_DEFAULT; module_ctx->module_build_plain_postprocess = MODULE_DEFAULT; module_ctx->module_deep_comp_kernel = MODULE_DEFAULT; module_ctx->module_dgst_pos0 = module_dgst_pos0; module_ctx->module_dgst_pos1 = module_dgst_pos1; module_ctx->module_dgst_pos2 = module_dgst_pos2; module_ctx->module_dgst_pos3 = module_dgst_pos3; module_ctx->module_dgst_size = module_dgst_size; module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; module_ctx->module_hash_binary_save = MODULE_DEFAULT; module_ctx->module_hash_decode_potfile = MODULE_DEFAULT; module_ctx->module_hash_decode_zero_hash = MODULE_DEFAULT; module_ctx->module_hash_decode = module_hash_decode; module_ctx->module_hash_encode_status = MODULE_DEFAULT; module_ctx->module_hash_encode_potfile = MODULE_DEFAULT; module_ctx->module_hash_encode = module_hash_encode; module_ctx->module_hash_init_selftest = MODULE_DEFAULT; module_ctx->module_hash_mode = MODULE_DEFAULT; module_ctx->module_hash_category = module_hash_category; module_ctx->module_hash_name = module_hash_name; module_ctx->module_hashes_count_min = MODULE_DEFAULT; module_ctx->module_hashes_count_max = MODULE_DEFAULT; module_ctx->module_hlfmt_disable = MODULE_DEFAULT; module_ctx->module_hook12 = MODULE_DEFAULT; module_ctx->module_hook23 = MODULE_DEFAULT; module_ctx->module_hook_salt_size = MODULE_DEFAULT; module_ctx->module_hook_size = MODULE_DEFAULT; module_ctx->module_jit_build_options = module_jit_build_options; module_ctx->module_jit_cache_disable = MODULE_DEFAULT; module_ctx->module_kernel_accel_max = MODULE_DEFAULT; module_ctx->module_kernel_accel_min = MODULE_DEFAULT; module_ctx->module_kernel_loops_max = MODULE_DEFAULT; module_ctx->module_kernel_loops_min = MODULE_DEFAULT; module_ctx->module_kernel_threads_max = MODULE_DEFAULT; module_ctx->module_kernel_threads_min = MODULE_DEFAULT; module_ctx->module_kern_type = module_kern_type; module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; module_ctx->module_opti_type = module_opti_type; module_ctx->module_opts_type = module_opts_type; module_ctx->module_outfile_check_disable = MODULE_DEFAULT; module_ctx->module_outfile_check_nocomp = MODULE_DEFAULT; module_ctx->module_potfile_custom_check = MODULE_DEFAULT; module_ctx->module_potfile_disable = MODULE_DEFAULT; module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT; module_ctx->module_pwdump_column = MODULE_DEFAULT; module_ctx->module_pw_max = module_pw_max; module_ctx->module_pw_min = MODULE_DEFAULT; module_ctx->module_salt_max = MODULE_DEFAULT; module_ctx->module_salt_min = MODULE_DEFAULT; module_ctx->module_salt_type = module_salt_type; module_ctx->module_separator = MODULE_DEFAULT; module_ctx->module_st_hash = module_st_hash; module_ctx->module_st_pass = module_st_pass; module_ctx->module_tmp_size = module_tmp_size; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; }
578108.c
#include <stdio.h> int main() { float altura; char sexo; do { printf ("Informe o sexo (masculino ou feminino): "); scanf (" %c", &sexo); if (sexo == 'm') { do { printf ("Informe a altura: "); scanf ("%f", &altura); if (altura > 0) { printf ("O seu peso ideal e: %.2f", altura * 72.7 - 58); } else printf ("Altura invalida. Tente novamente.\n"); } while (altura <= 0); } else if (sexo == 'f') { do { printf ("Informe a altura: "); scanf ("%f", &altura); if (altura > 0) { printf ("O seu peso ideal e: %.2f", altura * 62.1 - 44.7); } else printf ("Altura invalida. Tente novamente.\n"); } while (altura <= 0); } else printf ("Sexo informado invalido. Tente novamente.\n"); } while (sexo != 'm' && sexo != 'f'); return 0; }
277603.c
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * [email protected]. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: File callbacks for the native VOL connector * */ #define H5F_FRIEND /* Suppress error about including H5Fpkg */ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Cprivate.h" /* Cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ #include "H5Pprivate.h" /* Property lists */ #include "H5PBprivate.h" /* Page buffering */ #include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5VLnative_private.h" /* Native VOL connector */ /*------------------------------------------------------------------------- * Function: H5VL__native_file_create * * Purpose: Handles the file create callback * * Return: Success: file pointer * Failure: NULL * *------------------------------------------------------------------------- */ void * H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5F_t *new_file = NULL; void *ret_value = NULL; FUNC_ENTER_PACKAGE /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for * reading and writing. */ if(0 == (flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))) flags |= H5F_ACC_EXCL; /* default */ flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; /* Create the file */ if(NULL == (new_file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") new_file->id_exists = TRUE; ret_value = (void *)new_file; done: if(NULL == ret_value && new_file) if(H5F__close(new_file) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_file_create() */ /*------------------------------------------------------------------------- * Function: H5VL__native_file_open * * Purpose: Handles the file open callback * * Return: Success: file pointer * Failure: NULL * *------------------------------------------------------------------------- */ void * H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5F_t *new_file = NULL; void *ret_value = NULL; FUNC_ENTER_PACKAGE /* Open the file */ if(NULL == (new_file = H5F_open(name, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") new_file->id_exists = TRUE; ret_value = (void *)new_file; done: if(NULL == ret_value && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_file_open() */ /*------------------------------------------------------------------------- * Function: H5VL__native_file_get * * Purpose: Handles the file get callback * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5F_t *f = NULL; /* File struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE switch(get_type) { /* "get container info" */ case H5VL_FILE_GET_CONT_INFO: { H5VL_file_cont_info_t *info = HDva_arg(arguments, H5VL_file_cont_info_t *); /* Retrieve the file's container info */ if(H5F__get_cont_info((H5F_t *)obj, info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file container info") break; } /* H5Fget_access_plist */ case H5VL_FILE_GET_FAPL: { H5P_genplist_t *new_plist; /* New property list */ hid_t *plist_id = HDva_arg(arguments, hid_t *); f = (H5F_t *)obj; /* Retrieve the file's access property list */ if((*plist_id = H5F_get_access_plist(f, TRUE)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file access property list") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(*plist_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") break; } /* H5Fget_create_plist */ case H5VL_FILE_GET_FCPL: { H5P_genplist_t *plist; /* Property list */ hid_t *plist_id = HDva_arg(arguments, hid_t *); f = (H5F_t *)obj; if(NULL == (plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") /* Create the property list object to return */ if((*plist_id = H5P_copy_plist(plist, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy file creation properties") break; } /* H5Fget_intent */ case H5VL_FILE_GET_INTENT: { unsigned *intent_flags = HDva_arg(arguments, unsigned *); f = (H5F_t *)obj; /* HDF5 uses some flags internally that users don't know about. * Simplify things for them so that they only get either H5F_ACC_RDWR * or H5F_ACC_RDONLY and any SWMR flags. */ if(H5F_INTENT(f) & H5F_ACC_RDWR) { *intent_flags = H5F_ACC_RDWR; /* Check for SWMR write access on the file */ if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) *intent_flags |= H5F_ACC_SWMR_WRITE; } /* end if */ else { *intent_flags = H5F_ACC_RDONLY; /* Check for SWMR read access on the file */ if(H5F_INTENT(f) & H5F_ACC_SWMR_READ) *intent_flags |= H5F_ACC_SWMR_READ; } /* end else */ break; } /* H5Fget_fileno */ case H5VL_FILE_GET_FILENO: { unsigned long *fno = HDva_arg(arguments, unsigned long *); unsigned long my_fileno = 0; f = (H5F_t *)obj; H5F_GET_FILENO(f, my_fileno); *fno = my_fileno; /* sigh */ break; } /* H5Fget_name */ case H5VL_FILE_GET_NAME: { H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */ size_t size = HDva_arg(arguments, size_t); char *name = HDva_arg(arguments, char *); ssize_t *ret = HDva_arg(arguments, ssize_t *); size_t len; if(H5VL_native_get_file_struct(obj, type, &f) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") len = HDstrlen(H5F_OPEN_NAME(f)); if(name) { HDstrncpy(name, H5F_OPEN_NAME(f), MIN(len + 1,size)); if(len >= size) name[size-1]='\0'; } /* end if */ /* Set the return value for the API call */ *ret = (ssize_t)len; break; } /* H5Fget_obj_count */ case H5VL_FILE_GET_OBJ_COUNT: { unsigned types = HDva_arg(arguments, unsigned); ssize_t *ret = HDva_arg(arguments, ssize_t *); size_t obj_count = 0; /* Number of opened objects */ f = (H5F_t *)obj; /* Perform the query */ if(H5F_get_obj_count(f, types, TRUE, &obj_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_count failed") /* Set the return value */ *ret = (ssize_t)obj_count; break; } /* H5Fget_obj_ids */ case H5VL_FILE_GET_OBJ_IDS: { unsigned types = HDva_arg(arguments, unsigned); size_t max_objs = HDva_arg(arguments, size_t); hid_t *oid_list = HDva_arg(arguments, hid_t *); ssize_t *ret = HDva_arg(arguments, ssize_t *); size_t obj_count = 0; /* Number of opened objects */ f = (H5F_t *)obj; /* Perform the query */ if(H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE, &obj_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_ids failed") /* Set the return value */ *ret = (ssize_t)obj_count; break; } default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information") } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_file_get() */ /*------------------------------------------------------------------------- * Function: H5VL__native_file_specific * * Purpose: Handles the file specific callback * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE switch(specific_type) { /* H5Fflush */ case H5VL_FILE_FLUSH: { H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */ H5F_scope_t scope = (H5F_scope_t)HDva_arg(arguments, int); /* enum work-around */ H5F_t *f = NULL; /* File to flush */ /* Get the file for the object */ if(H5VL_native_get_file_struct(obj, type, &f) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Nothing to do if the file is read only. This determination is * made at the shared open(2) flags level, implying that opening a * file twice, once for read-only and once for read-write, and then * calling H5Fflush() with the read-only handle, still causes data * to be flushed. */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { /* Flush other files, depending on scope */ if(H5F_SCOPE_GLOBAL == scope) { /* Call the flush routine for mounted file hierarchies */ if(H5F_flush_mounts(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") } /* end if */ else { /* Call the flush routine, for this file */ if(H5F__flush(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") } /* end else */ } /* end if */ break; } /* H5Freopen */ case H5VL_FILE_REOPEN: { void **ret = HDva_arg(arguments, void **); H5F_t *new_file = NULL; /* Reopen the file through the VOL connector */ if(NULL == (new_file = H5F__reopen((H5F_t *)obj))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") new_file->id_exists = TRUE; *ret = (void *)new_file; break; } /* H5Fmount */ case H5VL_FILE_MOUNT: { H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */ const char *name = HDva_arg(arguments, const char *); H5F_t *child = HDva_arg(arguments, H5F_t *); hid_t fmpl_id = HDva_arg(arguments, hid_t); H5G_loc_t loc; if(H5G_loc_real(obj, type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Do the mount */ if(H5F__mount(&loc, name, child, fmpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") break; } /* H5Funmount */ case H5VL_FILE_UNMOUNT: { H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */ const char *name = HDva_arg(arguments, const char *); H5G_loc_t loc; if(H5G_loc_real(obj, type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Unmount */ if(H5F__unmount(&loc, name) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") break; } /* H5Fis_accessible */ case H5VL_FILE_IS_ACCESSIBLE: { hid_t fapl_id = HDva_arg(arguments, hid_t); const char *name = HDva_arg(arguments, const char *); htri_t *result = HDva_arg(arguments, htri_t *); /* Call private routine */ if((*result = H5F__is_hdf5(name, fapl_id)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "error in HDF5 file check") break; } /* H5Fdelete */ case H5VL_FILE_DELETE: { HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "H5Fdelete() is currently not supported in the native VOL connector") break; } /* Check if two files are the same */ case H5VL_FILE_IS_EQUAL: { H5F_t *file2 = (H5F_t *)HDva_arg(arguments, void *); hbool_t *is_equal = HDva_arg(arguments, hbool_t *); if(!obj || !file2) *is_equal = FALSE; else *is_equal = (((H5F_t *)obj)->shared == file2->shared); break; } default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_file_specific() */ /*------------------------------------------------------------------------- * Function: H5VL__native_file_optional * * Purpose: Handles the file optional callback * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5F_t *f = NULL; /* File */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE f = (H5F_t *)obj; switch(optional_type) { /* H5Fget_filesize */ case H5VL_NATIVE_FILE_GET_SIZE: { haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */ haddr_t base_addr; /* Base address for the file */ hsize_t *size = HDva_arg(arguments, hsize_t *); /* Go get the actual file size */ if(H5F__get_max_eof_eoa(f, &max_eof_eoa) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") base_addr = H5FD_get_base_addr(f->shared->lf); if(size) *size = (hsize_t)(max_eof_eoa + base_addr); /* Convert relative base address for file to absolute address */ break; } /* H5Fget_file_image */ case H5VL_NATIVE_FILE_GET_FILE_IMAGE: { void *buf_ptr = HDva_arg(arguments, void *); ssize_t *ret = HDva_arg(arguments, ssize_t *); size_t buf_len = HDva_arg(arguments, size_t ); /* Do the actual work */ if((*ret = H5F__get_file_image(f, buf_ptr, buf_len)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get file image failed") break; } /* H5Fget_freespace */ case H5VL_NATIVE_FILE_GET_FREE_SPACE: { hsize_t tot_space; /* Amount of free space in the file */ hssize_t *ret = HDva_arg(arguments, hssize_t *); /* Go get the actual amount of free space in the file */ if(H5MF_get_freespace(f, &tot_space, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") *ret = (hssize_t)tot_space; break; } /* H5Fget_free_sections */ case H5VL_NATIVE_FILE_GET_FREE_SECTIONS: { H5F_sect_info_t *sect_info = HDva_arg(arguments, H5F_sect_info_t *); ssize_t *ret = HDva_arg(arguments, ssize_t *); H5F_mem_t type = (H5F_mem_t)HDva_arg(arguments, int); /* enum work-around */ size_t nsects = HDva_arg(arguments, size_t); /* Go get the free-space section information in the file */ if((*ret = H5MF_get_free_sections(f, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") break; } /* H5Fget_info1/2 */ case H5VL_NATIVE_FILE_GET_INFO: { H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */ H5F_info2_t *finfo = HDva_arg(arguments, H5F_info2_t *); /* Get the file struct. This call is careful to not return the file pointer * for the top file in a mount hierarchy. */ if(H5VL_native_get_file_struct(obj, type, &f) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get a file struct") /* Get the file info */ if(H5F__get_info(f, finfo) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") break; } /* H5Fget_mdc_config */ case H5VL_NATIVE_FILE_GET_MDC_CONF: { H5AC_cache_config_t *config_ptr = HDva_arg(arguments, H5AC_cache_config_t *); /* Go get the resize configuration */ if(H5AC_get_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_auto_resize_config() failed.") break; } /* H5Fget_mdc_hit_rate */ case H5VL_NATIVE_FILE_GET_MDC_HR: { double *hit_rate_ptr = HDva_arg(arguments, double *); /* Go get the current hit rate */ if(H5AC_get_cache_hit_rate(f->shared->cache, hit_rate_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_hit_rate() failed.") break; } /* H5Fget_mdc_size */ case H5VL_NATIVE_FILE_GET_MDC_SIZE: { size_t *max_size_ptr = HDva_arg(arguments, size_t *); size_t *min_clean_size_ptr = HDva_arg(arguments, size_t *); size_t *cur_size_ptr = HDva_arg(arguments, size_t *); int *cur_num_entries_ptr = HDva_arg(arguments, int *); uint32_t cur_num_entries; /* Go get the size data */ if(H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, cur_size_ptr, &cur_num_entries) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_size() failed.") if(cur_num_entries_ptr != NULL) *cur_num_entries_ptr = (int)cur_num_entries; break; } /* H5Fget_vfd_handle */ case H5VL_NATIVE_FILE_GET_VFD_HANDLE: { void **file_handle = HDva_arg(arguments, void **); hid_t fapl_id = HDva_arg(arguments, hid_t); /* Retrieve the VFD handle for the file */ if(H5F_get_vfd_handle(f, fapl_id, file_handle) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve VFD handle") break; } /* H5Fclear_elink_file_cache */ case H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE: { /* Release the EFC */ if(f->shared->efc) if(H5F__efc_release(f->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") break; } /* H5Freset_mdc_hit_rate_stats */ case H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE: { /* Reset the hit rate statistic */ if(H5AC_reset_cache_hit_rate_stats(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't reset cache hit rate") break; } /* H5Fset_mdc_config */ case H5VL_NATIVE_FILE_SET_MDC_CONFIG: { H5AC_cache_config_t *config_ptr = HDva_arg(arguments, H5AC_cache_config_t *); /* set the resize configuration */ if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "H5AC_set_cache_auto_resize_config() failed") break; } /* H5Fget_metadata_read_retry_info */ case H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO: { H5F_retry_info_t *info = HDva_arg(arguments, H5F_retry_info_t *); if(H5F_get_metadata_read_retry_info(f, info) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't get metadata read retry info") break; } /* H5Fstart_swmr_write */ case H5VL_NATIVE_FILE_START_SWMR_WRITE: { if(H5F__start_swmr_write(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't start SWMR write") break; } /* H5Fstart_mdc_logging */ case H5VL_NATIVE_FILE_START_MDC_LOGGING: { /* Call mdc logging function */ if(H5C_start_logging(f->shared->cache) < 0) HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to start mdc logging") break; } /* H5Fstop_mdc_logging */ case H5VL_NATIVE_FILE_STOP_MDC_LOGGING: { /* Call mdc logging function */ if(H5C_stop_logging(f->shared->cache) < 0) HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to stop mdc logging") break; } /* H5Fget_mdc_logging_status */ case H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS: { hbool_t *is_enabled = HDva_arg(arguments, hbool_t *); hbool_t *is_currently_logging = HDva_arg(arguments, hbool_t *); /* Call mdc logging function */ if(H5C_get_logging_status(f->shared->cache, is_enabled, is_currently_logging) < 0) HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to get logging status") break; } /* H5Fformat_convert */ case H5VL_NATIVE_FILE_FORMAT_CONVERT: { /* Convert the format */ if(H5F__format_convert(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "can't convert file format") break; } /* H5Freset_page_buffering_stats */ case H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS: { /* Sanity check */ if(NULL == f->shared->page_buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page buffering not enabled on file") /* Reset the statistics */ if(H5PB_reset_stats(f->shared->page_buf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't reset stats for page buffering") break; } /* H5Fget_page_buffering_stats */ case H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS: { unsigned *accesses = HDva_arg(arguments, unsigned *); unsigned *hits = HDva_arg(arguments, unsigned *); unsigned *misses = HDva_arg(arguments, unsigned *); unsigned *evictions = HDva_arg(arguments, unsigned *); unsigned *bypasses = HDva_arg(arguments, unsigned *); /* Sanity check */ if(NULL == f->shared->page_buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page buffering not enabled on file") /* Get the statistics */ if(H5PB_get_stats(f->shared->page_buf, accesses, hits, misses, evictions, bypasses) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve stats for page buffering") break; } /* H5Fget_mdc_image_info */ case H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO: { haddr_t *image_addr = HDva_arg(arguments, haddr_t *); hsize_t *image_len = HDva_arg(arguments, hsize_t *); /* Go get the address and size of the cache image */ if(H5AC_get_mdc_image_info(f->shared->cache, image_addr, image_len) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve cache image info") break; } /* H5Fget_eoa */ case H5VL_NATIVE_FILE_GET_EOA: { haddr_t *eoa = HDva_arg(arguments, haddr_t *); haddr_t rel_eoa; /* Relative address of EOA */ /* Sanity check */ HDassert(eoa); /* This routine will work only for drivers with this feature enabled.*/ /* We might introduce a new feature flag in the future */ if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO)) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") /* The real work */ if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get_eoa request failed") /* Set return value */ /* (Note compensating for base address subtraction in internal routine) */ *eoa = rel_eoa + H5F_get_base_addr(f); break; } /* H5Fincrement_filesize */ case H5VL_NATIVE_FILE_INCR_FILESIZE: { hsize_t increment = HDva_arg(arguments, hsize_t); haddr_t max_eof_eoa; /* Maximum of the relative EOA & EOF */ /* This public routine will work only for drivers with this feature enabled.*/ /* We might introduce a new feature flag in the future */ if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO)) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") /* Get the maximum of EOA and EOF */ if(H5F__get_max_eof_eoa(f, &max_eof_eoa) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") /* Set EOA to the maximum value + increment */ if(H5F__set_eoa(f, H5FD_MEM_DEFAULT, max_eof_eoa + increment) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") break; } /* H5Fset_latest_format, H5Fset_libver_bounds */ case H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS: { H5F_libver_t low = (H5F_libver_t)HDva_arg(arguments, int); /* enum work-around */ H5F_libver_t high = (H5F_libver_t)HDva_arg(arguments, int); /* enum work-around */ /* Call internal set_libver_bounds function */ if(H5F__set_libver_bounds(f, low, high) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") break; } /* H5Fget_dset_no_attrs_hint */ case H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG: { hbool_t *minimize = HDva_arg(arguments, hbool_t *); *minimize = H5F_GET_MIN_DSET_OHDR(f); break; } /* H5Fset_dset_no_attrs_hint */ case H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG: { int minimize = HDva_arg(arguments, int); if(H5F_set_min_dset_ohdr(f, (hbool_t)minimize) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set file's dataset object header minimization flag") break; } #ifdef H5_HAVE_PARALLEL /* H5Fget_mpi_atomicity */ case H5VL_NATIVE_FILE_GET_MPI_ATOMICITY: { hbool_t *flag = (hbool_t *)HDva_arg(arguments, hbool_t *); if (H5F_get_mpi_atomicity(f, flag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "cannot get MPI atomicity"); break; } /* H5Fset_mpi_atomicity */ case H5VL_NATIVE_FILE_SET_MPI_ATOMICITY: { hbool_t flag = (hbool_t)HDva_arg(arguments, int); if (H5F_set_mpi_atomicity(f, flag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set MPI atomicity"); break; } #endif /* H5_HAVE_PARALLEL */ /* Finalize H5Fopen */ case H5VL_NATIVE_FILE_POST_OPEN: { /* Call package routine */ if(H5F__post_open((H5F_t *)obj) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't finish opening file") break; } default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_file_optional() */ /*------------------------------------------------------------------------- * Function: H5VL__native_file_close * * Purpose: Handles the file close callback * * Return: Success: SUCCEED * Failure: FAIL (file will not be closed) * *------------------------------------------------------------------------- */ herr_t H5VL__native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { int nref; H5F_t *f = (H5F_t *)file; hid_t file_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* This routine should only be called when a file ID's ref count drops to zero */ HDassert(H5F_ID_EXISTS(f)); /* Flush file if this is the last reference to this id and we have write * intent, unless it will be flushed by the "shared" file being closed. * This is only necessary to replicate previous behaviour, and could be * disabled by an option/property to improve performance. */ if((H5F_NREFS(f) > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { /* Get the file ID corresponding to the H5F_t struct */ if(H5I_find_id(f, H5I_FILE, &file_id) < 0 || H5I_INVALID_HID == file_id) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "invalid atom") /* Get the number of references outstanding for this file ID */ if((nref = H5I_get_ref(file_id, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") if(nref == 1) if(H5F__flush(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") } /* end if */ /* Close the file */ if(H5F__close(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close file") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_file_close() */
616469.c
/* * vim:ts=8:expandtab * * i3 - an improved dynamic tiling window manager * * © 2009-2010 Michael Stapelberg and contributors * * See file LICENSE for license information. * * debug.c: Contains debugging functions, especially FormatEvent, which prints unhandled events. * This code is from xcb-util. * */ #include <stdio.h> #include <xcb/xcb.h> #include "log.h" static const char *labelError[] = { "Success", "BadRequest", "BadValue", "BadWindow", "BadPixmap", "BadAtom", "BadCursor", "BadFont", "BadMatch", "BadDrawable", "BadAccess", "BadAlloc", "BadColor", "BadGC", "BadIDChoice", "BadName", "BadLength", "BadImplementation", }; static const char *labelRequest[] = { "no request", "CreateWindow", "ChangeWindowAttributes", "GetWindowAttributes", "DestroyWindow", "DestroySubwindows", "ChangeSaveSet", "ReparentWindow", "MapWindow", "MapSubwindows", "UnmapWindow", "UnmapSubwindows", "ConfigureWindow", "CirculateWindow", "GetGeometry", "QueryTree", "InternAtom", "GetAtomName", "ChangeProperty", "DeleteProperty", "GetProperty", "ListProperties", "SetSelectionOwner", "GetSelectionOwner", "ConvertSelection", "SendEvent", "GrabPointer", "UngrabPointer", "GrabButton", "UngrabButton", "ChangeActivePointerGrab", "GrabKeyboard", "UngrabKeyboard", "GrabKey", "UngrabKey", "AllowEvents", "GrabServer", "UngrabServer", "QueryPointer", "GetMotionEvents", "TranslateCoords", "WarpPointer", "SetInputFocus", "GetInputFocus", "QueryKeymap", "OpenFont", "CloseFont", "QueryFont", "QueryTextExtents", "ListFonts", "ListFontsWithInfo", "SetFontPath", "GetFontPath", "CreatePixmap", "FreePixmap", "CreateGC", "ChangeGC", "CopyGC", "SetDashes", "SetClipRectangles", "FreeGC", "ClearArea", "CopyArea", "CopyPlane", "PolyPoint", "PolyLine", "PolySegment", "PolyRectangle", "PolyArc", "FillPoly", "PolyFillRectangle", "PolyFillArc", "PutImage", "GetImage", "PolyText", "PolyText", "ImageText", "ImageText", "CreateColormap", "FreeColormap", "CopyColormapAndFree", "InstallColormap", "UninstallColormap", "ListInstalledColormaps", "AllocColor", "AllocNamedColor", "AllocColorCells", "AllocColorPlanes", "FreeColors", "StoreColors", "StoreNamedColor", "QueryColors", "LookupColor", "CreateCursor", "CreateGlyphCursor", "FreeCursor", "RecolorCursor", "QueryBestSize", "QueryExtension", "ListExtensions", "ChangeKeyboardMapping", "GetKeyboardMapping", "ChangeKeyboardControl", "GetKeyboardControl", "Bell", "ChangePointerControl", "GetPointerControl", "SetScreenSaver", "GetScreenSaver", "ChangeHosts", "ListHosts", "SetAccessControl", "SetCloseDownMode", "KillClient", "RotateProperties", "ForceScreenSaver", "SetPointerMapping", "GetPointerMapping", "SetModifierMapping", "GetModifierMapping", "major 120", "major 121", "major 122", "major 123", "major 124", "major 125", "major 126", "NoOperation", }; static const char *labelEvent[] = { "error", "reply", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify", "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear", "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify", }; static const char *labelSendEvent[] = { "", " (from SendEvent)", }; int format_event(xcb_generic_event_t *e) { uint8_t sendEvent; uint16_t seqnum; sendEvent = (e->response_type & 0x80) ? 1 : 0; e->response_type &= ~0x80; seqnum = *((uint16_t *) e + 1); switch(e->response_type) { case 0: DLOG("Error %s on seqnum %d (%s).\n", labelError[*((uint8_t *) e + 1)], seqnum, labelRequest[*((uint8_t *) e + 10)]); break; default: if (e->response_type > sizeof(labelEvent) / sizeof(char*)) break; DLOG("Event %s following seqnum %d%s.\n", labelEvent[e->response_type], seqnum, labelSendEvent[sendEvent]); break; case XCB_KEYMAP_NOTIFY: DLOG("Event %s%s.\n", labelEvent[e->response_type], labelSendEvent[sendEvent]); break; } fflush(stdout); return 1; }
119362.c
/** \file * \brief GL Font functions. * * See Copyright Notice in "iup.h" */ #ifdef WIN32 #include <windows.h> #else #include <iconv.h> #endif #include <FTGL/ftgl.h> #include <stdio.h> #include <stdlib.h> #include "iup.h" #include "iupgl.h" #include "iup_assert.h" #include "iup_object.h" #include "iup_attrib.h" #include "iup_str.h" #include "iup_array.h" #include "iup_drvfont.h" #include "iup_glcontrols.h" #include "iup_glfont.h" typedef struct _IglFont { char filename[10240]; int size; FTGLfont *font; int charwidth, charheight; } IglFont; static char* utf8_buffer = NULL; static int utf8_buffer_len = 0; #ifndef WIN32 iconv_t gl_iconv = (iconv_t)-1; #endif #ifdef WIN32 typedef char regName[MAX_PATH]; static regName* win_fonts = NULL; static int win_fonts_count = 0; static int iCompareStr(const void *a, const void *b) { const regName*aa = a; const regName*bb = b; return strcmp(*aa, *bb); } static void winInitFontNames(void) { const CHAR* subkey = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"; HKEY hkey = NULL; DWORD dwIndex = 0; LONG ret; DWORD dwValuesCount, dwValueSize; ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_READ, &hkey); if (ret != ERROR_SUCCESS) return; ret = RegQueryInfoKey(hkey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValuesCount, NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS) return; win_fonts_count = (int)dwValuesCount; win_fonts = malloc(sizeof(regName) * win_fonts_count); for (dwIndex = 0; dwIndex < dwValuesCount; dwIndex++) { dwValueSize = MAX_PATH - 1; ret = RegEnumValueA(hkey, dwIndex, win_fonts[dwIndex], &dwValueSize, NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS) { win_fonts_count = (int)dwIndex; break; } } qsort(win_fonts, win_fonts_count, sizeof(regName), iCompareStr); RegCloseKey(hkey); } static int winReadStringKey(HKEY base_key, const char* subkey, const char* value_name, char* value) { HKEY key; DWORD max_size = 1024; if (RegOpenKeyExA(base_key, subkey, 0, KEY_READ, &key) != ERROR_SUCCESS) return 0; if (RegQueryValueExA(key, value_name, NULL, NULL, (LPBYTE)value, &max_size) != ERROR_SUCCESS) { RegCloseKey(key); return 0; } RegCloseKey(key); return 1; } static char* winGetFontDir(void) { static char font_dir[1024]; if (!winReadStringKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Fonts", font_dir)) return ""; else return font_dir; } static int iGLGetFontFilenameFromSystem(const char *font_name, int is_bold, int is_italic, char* fileName) { CHAR szData[1024]; const CHAR* subkey = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"; char localFontName[MAX_PATH]; int i; if (iupStrEqualNoCase(font_name, "Courier") || iupStrEqualNoCase(font_name, "Monospace")) font_name = "Courier New"; else if (iupStrEqualNoCase(font_name, "Times") || iupStrEqualNoCase(font_name, "Serif")) font_name = "Times New Roman"; else if (iupStrEqualNoCase(font_name, "Helvetica") || iupStrEqualNoCase(font_name, "Sans")) font_name = "Arial"; strcpy(localFontName, font_name); if (is_bold) strcat(localFontName, " Bold"); if (is_italic) strcat(localFontName, " Italic"); for (i = 0; i < win_fonts_count; i++) { if (iupStrEqualNoCasePartial(win_fonts[i], localFontName)) { if (winReadStringKey(HKEY_LOCAL_MACHINE, subkey, win_fonts[i], szData)) { /* szData already includes file extension */ sprintf(fileName, "%s\\%s", winGetFontDir(), szData); return 1; } } } return 0; } #else #ifndef NO_FONTCONFIG #include <fontconfig/fontconfig.h> static int iGLGetFontFilenameFromSystem(const char *font_name, int is_bold, int is_italic, char* fileName) { char styles[4][20]; int style_size; FcObjectSet *os = 0; FcFontSet *fs; FcPattern *pat; int bResult = 0; if (iupStrEqualNoCase(font_name, "Courier") || iupStrEqualNoCase(font_name, "Courier New") || iupStrEqualNoCase(font_name, "Monospace")) font_name = "freemono"; else if (iupStrEqualNoCase(font_name, "Times") || iupStrEqualNoCase(font_name, "Times New Roman") || iupStrEqualNoCase(font_name, "Serif")) font_name = "freeserif"; else if (iupStrEqualNoCase(font_name, "Helvetica") || iupStrEqualNoCase(font_name, "Arial") || iupStrEqualNoCase(font_name, "Sans")) font_name = "freesans"; if (is_bold && is_italic) { strcpy(styles[0], "BoldItalic"); strcpy(styles[1], "Bold Italic"); strcpy(styles[2], "Bold Oblique"); strcpy(styles[3], "BoldOblique"); style_size = 4; } else if (is_bold) { strcpy(styles[0], "Bold"); style_size = 1; } else if (is_italic) { strcpy(styles[0], "Italic"); strcpy(styles[1], "Oblique"); style_size = 2; } else { strcpy(styles[0], "Regular"); strcpy(styles[1], "Normal"); strcpy(styles[2], "Medium"); style_size = 3; } pat = FcPatternCreate(); os = FcObjectSetBuild(FC_FAMILY, FC_FILE, FC_STYLE, NULL); fs = FcFontList(NULL, pat, os); if (pat) FcPatternDestroy(pat); if (fs) { int j, s; for (j = 0; j < fs->nfont; j++) { FcChar8 *file; FcChar8 *style; FcChar8 *family; FcPatternGetString(fs->fonts[j], FC_FILE, 0, &file); FcPatternGetString(fs->fonts[j], FC_STYLE, 0, &style); FcPatternGetString(fs->fonts[j], FC_FAMILY, 0, &family); if (iupStrEqualNoCasePartial((char*)family, font_name)) { /* check if the font is of the correct type. */ for (s = 0; s < style_size; s++) { if (iupStrEqualNoCase(styles[s], (char*)style)) { strcpy(fileName, (char*)file); bResult = 1; FcFontSetDestroy(fs); return bResult; } /* set value to use if no more correct font of same family is found. */ strcpy(fileName, (char*)file); bResult = 1; } } } FcFontSetDestroy(fs); } return bResult; } #else static int iGLGetFontFilenameFromSystem(const char *font_name, int is_bold, int is_italic, char* fileName) { (void)font_name; (void)is_bold; (void)is_italic; (void)fileName; return 0; } #endif #endif static int iGLGetFontFilenameFromTypeface(const char* path, const char* typeface, const char* ext, char* filename) { FILE *file; /* current directory */ sprintf(filename, "%s.%s", typeface, ext); file = fopen(filename, "r"); if (!file) { /* path from the environment */ if (path) { sprintf(filename, "%s/%s.%s", path, typeface, ext); file = fopen(filename, "r"); } if (!file) { #ifdef WIN32 /* Windows Font folder */ sprintf(filename, "%s\\%s.%s", winGetFontDir(), typeface, ext); file = fopen(filename, "r"); if (!file) return 0; #else return 0; #endif } } fclose(file); return 1; } static char* iGLGetFontNameTex(const char* typeface) { if (iupStrEqualNoCase(typeface, "sans") || iupStrEqualNoCase(typeface, "helvetica") || iupStrEqualNoCase(typeface, "arial")) return "heros"; if (iupStrEqualNoCase(typeface, "monospace") || iupStrEqualNoCase(typeface, "courier") || iupStrEqualNoCase(typeface, "courier new")) return "cursor"; if (iupStrEqualNoCase(typeface, "serif") || iupStrEqualNoCase(typeface, "times") || iupStrEqualNoCase(typeface, "times new roman")) return "termes"; return NULL; } static char* iGLGetFontNameTTF(const char* typeface) { if (iupStrEqualNoCase(typeface, "sans") || iupStrEqualNoCase(typeface, "helvetica") || iupStrEqualNoCase(typeface, "arial")) return "arial"; if (iupStrEqualNoCase(typeface, "monospace") || iupStrEqualNoCase(typeface, "courier") || iupStrEqualNoCase(typeface, "courier new")) return "cour"; if (iupStrEqualNoCase(typeface, "serif") || iupStrEqualNoCase(typeface, "times") || iupStrEqualNoCase(typeface, "times new roman")) return "times"; return NULL; } static int iGLGetFontFilenameFromNamesOTF(const char* path, const char* typeface, char* filename, int is_bold, int is_italic) { char fontname[100]; char* face = iGLGetFontNameTex(typeface); if (face) sprintf(fontname, "texgyre%s-", face); else sprintf(fontname, "texgyre%s-", typeface); if (is_bold && is_italic) strcat(fontname, "bolditalic"); else if (is_italic) strcat(fontname, "italic"); else if (is_bold) strcat(fontname, "bold"); else strcat(fontname, "regular"); return iGLGetFontFilenameFromTypeface(path, fontname, "otf", filename); } static int iGLGetFontFilenameFromNamesTTF(const char* path, const char* typeface, char* filename, int is_bold, int is_italic) { char fontname[100]; char* face = iGLGetFontNameTTF(typeface); if (face) strcpy(fontname, face); else strcpy(fontname, typeface); if (is_bold && is_italic) strcat(fontname, "bi"); else if (is_italic) strcat(fontname, "i"); else if (is_bold) strcat(fontname, "bd"); return iGLGetFontFilenameFromTypeface(path, fontname, "ttf", filename); } static void iGLGetFontFilename(char* filename, const char *typeface, int is_bold, int is_italic) { char *path = getenv("FREETYPEFONTS_DIR"); if (!path) path = IupGetGlobal("FREETYPEFONTS_DIR"); /* search for the font in the system */ /* "Helvetica" "Courier" "Times" "Segoe UI" "Tahoma" etc */ if (iGLGetFontFilenameFromSystem(typeface, is_bold, is_italic, filename)) return; /* try typeface as a file title, compose with path to get a filename assume style already in the typeface */ /* "ariali" "courbd" "texgyrecursor-bold" */ if (iGLGetFontFilenameFromTypeface(path, typeface, "ttf", filename)) return; if (iGLGetFontFilenameFromTypeface(path, typeface, "otf", filename)) return; /* check for the pre-defined names, and use style to compose the filename */ /* "cursor" */ if (iGLGetFontFilenameFromNamesTTF(path, typeface, filename, is_bold, is_italic)) return; if (iGLGetFontFilenameFromNamesOTF(path, typeface, filename, is_bold, is_italic)) return; /* try the typeface as file name */ strcpy(filename, typeface); } static int iGLFontGetFontAveWidth(FTGLfont* font); static IglFont* iGLFindFont(Ihandle* ih, Ihandle* gl_parent, const char *standardfont) { char filename[10240]; char typeface[50] = ""; FTGLfont* font; int size = 8; int is_bold = 0, is_italic = 0, is_underline = 0, is_strikeout = 0; int i, count; IglFont* fonts; double res = IupGetDouble(NULL, "SCREENDPI"); Iarray* gl_fonts = (Iarray*)iupAttribGet(gl_parent, "GL_FONTLIST"); if (!gl_fonts) { gl_fonts = iupArrayCreate(50, sizeof(IglFont)); iupAttribSet(gl_parent, "GL_FONTLIST", (char*)gl_fonts); } if (!iupGetFontInfo(standardfont, typeface, &size, &is_bold, &is_italic, &is_underline, &is_strikeout)) return NULL; if (is_underline) iupAttribSet(ih, "UNDERLINE", "1"); else iupAttribSet(ih, "UNDERLINE", NULL); iGLGetFontFilename(filename, typeface, is_bold, is_italic); if (size < 0) size = (int)((-size*72.0) / res + 0.5); /* convert to points */ /* Check if the filename already exists in cache */ fonts = (IglFont*)iupArrayGetData(gl_fonts); count = iupArrayCount(gl_fonts); for (i = 0; i < count; i++) { if (iupStrEqualNoCase(filename, fonts[i].filename) && fonts[i].size == size) return &fonts[i]; } font = ftglCreateTextureFont(filename); if (!font) return NULL; ftglSetFontFaceSize(font, size, (int)res); /* create room in the array */ fonts = (IglFont*)iupArrayInc(gl_fonts); strcpy(fonts[i].filename, filename); fonts[i].font = font; fonts[i].size = size; /* NOTICE that this is different from CD, here we need average width, there is maximum width. */ fonts[i].charwidth = iGLFontGetFontAveWidth(font); fonts[i].charheight = iupRound(ftglGetFontLineHeight(font)); return &fonts[i]; } static IglFont* iGLFontCreateNativeFont(Ihandle *ih, const char* value) { IglFont* glfont; Ihandle* gl_parent = (Ihandle*)iupAttribGet(ih, "GL_CANVAS"); IupGLMakeCurrent(gl_parent); glfont = iGLFindFont(ih, gl_parent, value); if (!glfont) { iupERROR1("Failed to create Font: %s", value); return NULL; } iupAttribSet(ih, "_IUP_GLFONT", (char*)glfont); return glfont; } static IglFont* iGLFontGet(Ihandle *ih) { IglFont* glfont = (IglFont*)iupAttribGet(ih, "_IUP_GLFONT"); if (!glfont) glfont = iGLFontCreateNativeFont(ih, iupAttribGetStr(ih, "STANDARDFONT")); return glfont; } static void iGLFontCheckUtf8Buffer(int len) { if (!utf8_buffer) { utf8_buffer = malloc(len + 1); utf8_buffer_len = len; } else if (utf8_buffer_len < len) { utf8_buffer = realloc(utf8_buffer, len + 1); utf8_buffer_len = len; } } static void iGLFontConvertToUTF8(const char* str, int len) { /* FTGL multibute strings are always UTF-8 */ int utf8mode = IupGetInt(NULL, "UTF8MODE"); if (utf8mode || iupStrIsAscii(str)) { iGLFontCheckUtf8Buffer(len); memcpy(utf8_buffer, str, len); utf8_buffer[len] = 0; return; } #ifdef WIN32 { wchar_t* wstr; int wlen = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0); if (!wlen) { iGLFontCheckUtf8Buffer(1); utf8_buffer[0] = 0; return; } wstr = (wchar_t*)calloc((wlen + 1), sizeof(wchar_t)); MultiByteToWideChar(CP_ACP, 0, str, len, wstr, wlen); wstr[wlen] = 0; len = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, NULL, 0, NULL, NULL); if (!len) { iGLFontCheckUtf8Buffer(1); utf8_buffer[0] = 0; free(wstr); return; } iGLFontCheckUtf8Buffer(len); WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, utf8_buffer, len, NULL, NULL); utf8_buffer[len] = 0; free(wstr); } #else { if (gl_iconv == (iconv_t)-1) { iGLFontCheckUtf8Buffer(1); utf8_buffer[0] = 0; return; } size_t ulen = (size_t)len; size_t utf8len = ulen * 2; iGLFontCheckUtf8Buffer(utf8len); char* utf8 = utf8_buffer; iconv(gl_iconv, (char**)&str, &ulen, &utf8, &utf8len); } #endif } static int iGLFontGetFontAveWidth(FTGLfont* font) { static int first = 1; static char sample[512] = ""; if (first) { int utf8mode = IupGetInt(NULL, "UTF8MODE"); /* use all Latin-1 characters */ int i; for (i = 32; i < 256; i++) sample[i - 32] = (char)i; if (utf8mode) IupSetGlobal("UTF8MODE", "No"); iGLFontConvertToUTF8(sample, 256 - 32); if (utf8mode) IupSetGlobal("UTF8MODE", "Yes"); i = (int)strlen(utf8_buffer); memcpy(sample, utf8_buffer, i + 1); first = 0; } return iupRound(ftglGetFontAdvance(font, sample) / (256.0f - 32.0f)); } int iupGLFontGetStringWidth(Ihandle* ih, const char* str, int len) { IglFont* glfont; if (!ih->handle) return 0; glfont = iGLFontGet(ih); if (!glfont) return 0; iGLFontConvertToUTF8(str, len); return iupRound(ftglGetFontAdvance(glfont->font, utf8_buffer)); } void iupGLFontGetMultiLineStringSize(Ihandle* ih, const char* str, int *w, int *h) { int max_w = 0; IglFont* glfont; if (!ih->handle) { iupdrvFontGetMultiLineStringSize(ih, str, w, h); return; } glfont = iGLFontGet(ih); if (!glfont) { if (w) *w = 0; if (h) *h = 0; return; } if (!str) { if (w) *w = 0; if (h) *h = glfont->charheight * 1; return; } if (str[0] && w) { int size; int len; const char *nextstr; const char *curstr = str; do { nextstr = iupStrNextLine(curstr, &len); if (len) { iGLFontConvertToUTF8(curstr, len); size = iupRound(ftglGetFontAdvance(glfont->font, utf8_buffer)); max_w = iupMAX(max_w, size); } curstr = nextstr; } while (*nextstr); } if (w) *w = max_w; if (h) *h = glfont->charheight * iupStrLineCount(str); } int iupGLFontSetStandardFontAttrib(Ihandle* ih, const char* value) { IglFont* glfont; if (!ih->handle) return iupdrvSetStandardFontAttrib(ih, value); glfont = iGLFontCreateNativeFont(ih, value); if (glfont) { /* If FONT is changed, must update the SIZE attribute */ char* value = iupAttribGet(ih, "SIZE"); if (!value) return 1; IupSetStrAttribute(ih, "SIZE", value); } return 1; } void iupGLFontGetCharSize(Ihandle* ih, int *charwidth, int *charheight) { IglFont* glfont; if (!ih->handle) { iupdrvFontGetCharSize(ih, charwidth, charheight); return; } glfont = iGLFontGet(ih); if (!glfont) { if (charwidth) *charwidth = 0; if (charheight) *charheight = 0; return; } if (charwidth) *charwidth = glfont->charwidth; if (charheight) *charheight = glfont->charheight; } void iupGLFontGetDim(Ihandle* ih, int *maxwidth, int *height, int *ascent, int *descent) { IglFont* glfont; if (!ih->handle) return; glfont = iGLFontGet(ih); if (!glfont) return; if (maxwidth) *maxwidth = glfont->charwidth; if (height) *height = glfont->charheight; if (ascent) *ascent = iupRound(ftglGetFontAscender(glfont->font)); if (descent) *descent = iupRound(-ftglGetFontDescender(glfont->font)); } void iupGLFontRenderString(Ihandle* ih, const char* str, int len) { IglFont* glfont; if (!ih->handle) return; glfont = iGLFontGet(ih); if (!glfont) return; iGLFontConvertToUTF8(str, len); /* render always at baseline */ ftglRenderFont(glfont->font, utf8_buffer, FTGL_RENDER_ALL); } void iupGLFontInit(void) { #ifdef WIN32 if (!win_fonts) winInitFontNames(); #else if (gl_iconv == (iconv_t)-1) gl_iconv = iconv_open("UTF-8", "ISO-8859-1"); #endif } void iupGLFontRelease(Ihandle* gl_parent) { Iarray* gl_fonts = (Iarray*)iupAttribGet(gl_parent, "GL_FONTLIST"); if (gl_fonts) { int i, count = iupArrayCount(gl_fonts); IglFont* fonts = (IglFont*)iupArrayGetData(gl_fonts); for (i = 0; i < count; i++) { ftglDestroyFont(fonts[i].font); fonts[i].font = NULL; } iupArrayDestroy(gl_fonts); iupAttribSet(gl_parent, "GL_FONTLIST", NULL); } } void iupGLFontFinish(void) { if (utf8_buffer) { free(utf8_buffer); utf8_buffer = NULL; utf8_buffer_len = 0; } #ifdef WIN32 if (win_fonts) free(win_fonts); win_fonts = NULL; win_fonts_count = 0; #else if (gl_iconv != (iconv_t)-1) iconv_close(gl_iconv); gl_iconv = (iconv_t)-1; #endif }
359130.c
#include "ibscommon.h" #include "ibsdictionary.h" #include <string.h> /******************************************************** Private *********************************************************/ PIbsDictEntry createNewEntry(PIbsAllocator a, const char* key, void* value) { PIbsDictEntry newElem = ibsAlloc(a, sizeof(struct IbsDictEntry)); newElem->keyPart = key; newElem->keyPartLength = strlen(key); newElem->values = ibsAlloc(a, sizeof(struct IbsDictEntryValue)); newElem->values->value = value; return newElem; } /******************************************************** Public *********************************************************/ PIbsDict ibsDictCreate(PIbsAllocator a) { PIbsDict dict = ibsAlloc(a, sizeof(struct IbsDict)); dict->a = a; return dict; } PIbsDictEntry ibsDictGetEntry(PIbsDict dict, const char * key) { if (key == NULL || key[0] == 0) return NULL; if (dict->lastKey && (key == dict->lastKey || strcmp(key, dict->lastKey) == 0)) { return dict->lastEntry; } dict->lastKey = key; dict->lastEntry = NULL; PIbsDictEntry* el = &dict->entries; PIbsDictEntry entry; while (*el) { entry = *el; size_t i = 0; while (key[i] == entry->keyPart[i] && key[i] != 0 && entry->keyPartLength > i) { i++; } if (key[i] == 0) { if (entry->keyPartLength == i) { dict->lastEntry = entry; return entry; } return NULL; } if (i > 0 && i < entry->keyPartLength) { return NULL; } if (i == 0) { el = &entry->next; } else { PIbsDictEntry* nextField = &entry->children; while (*nextField && (*nextField)->keyPart[0] != key[i]) nextField = &(*nextField)->next; if (!*nextField) { return NULL; } key = &key[i]; el = nextField; } } return NULL; } void* ibsDictGet(PIbsDict dict, const char * key) { PIbsDictEntry entry = ibsDictGetEntry(dict, key); if (entry == NULL || entry->values == NULL) return NULL; return entry->values->value; } void ibsDictPut(PIbsDict dict, const char* key, void* value) { if (key == NULL || key[0] == 0) return; PIbsDictEntry* el = &dict->entries; PIbsDictEntry entry; dict->lastKey = key; while (*el) { entry = *el; size_t i = 0; while (key[i] == entry->keyPart[i] && key[i] != 0 && entry->keyPartLength > i) { i++; } if (key[i] == 0 || (i > 0 && i < entry->keyPartLength)) { if (entry->keyPartLength == i) { // Existing key so create a value if it doesn't exist and return it if (!entry->values) { entry->values = ibsAlloc(dict->a, sizeof(struct IbsDictEntryValue)); } entry->values->value = value; dict->lastEntry = entry; return; } // We got a key that is a part of existing key so we need to split existing into parts PIbsDictEntry newElem = ibsAlloc(dict->a, sizeof(struct IbsDictEntry)); newElem->keyPart = &entry->keyPart[i]; newElem->keyPartLength = entry->keyPartLength - i; newElem->values = entry->values; newElem->children = entry->children; entry->children = newElem; entry->keyPartLength = i; if (key[i] == 0) { entry->values = ibsAlloc(dict->a, sizeof(struct IbsDictEntryValue)); entry->values->value = value; dict->lastEntry = entry; return; } entry->values = NULL; newElem = createNewEntry(dict->a, &key[i], value); newElem->next = entry->children; dict->lastEntry = newElem; entry->children = newElem; return; } if (entry->keyPartLength == i) { PIbsDictEntry* nextField = &entry->children; while (*nextField && (*nextField)->keyPart[0] != key[i]) nextField = &(*nextField)->next; if (!*nextField) { PIbsDictEntry newElem = createNewEntry(dict->a, &key[i], value); *nextField = newElem; dict->lastEntry = newElem; return; } key = &key[i]; el = nextField; } else { el = &entry->next; } } entry = createNewEntry(dict->a, dict->lastKey, value); dict->lastEntry = entry; *el = entry; } void ibsDictPush(PIbsDict dict, const char* key, void* value) { PIbsDictEntry entry = ibsDictGetEntry(dict, key); if (!entry) { ibsDictPut(dict, key, value); return; } PIbsDictEntryValue newVal = ibsAlloc(dict->a, sizeof(struct IbsDictEntryValue)); newVal->value = value; newVal->next = entry->values; entry->values = newVal; } void* ibsDictPop(PIbsDict dict, const char* key) { PIbsDictEntry entry = ibsDictGetEntry(dict, key); if (!entry || !entry->values) return NULL; PIbsDictEntryValue val = entry->values; entry->values = val->next; return val->value; }
796890.c
#include "tsl2561.h" inline uint16_t TSL2561_read16(uint8_t reg) { uint16_t temp ; I2C_Master_Start(); I2C_Master_Write(TSL2561_ADDRESS); //selection egistre I2C_Master_Wait(); I2C_Master_Write(reg); //selection egistre I2C_Master_Wait(); I2C_Master_Stop(); I2C_Master_Start(); I2C_Master_Write(TSL2561_ADDRESS); //lecture I2C_Master_Wait(); temp = I2C_Master_Read(I2C_ACK); temp<<=8; temp |= I2C_Master_Read(I2C_NACK); I2C_Master_Wait(); I2C_Master_Stop(); return temp; } inline int8_t TSL2561_write8(uint8_t reg,uint8_t value) { I2C_Master_Start(); I2C_Master_Write(TSL2561_ADDRESS); //selection egistre I2C_Master_Wait(); I2C_Master_Write(reg); //selection egistre I2C_Master_Wait(); I2C_Master_Write(value); //selection egistre I2C_Master_Wait(); I2C_Master_Stop(); }
297345.c
/* * SPDX-License-Identifier: MIT * * (C) Copyright 2016 Intel Corporation */ #include <linux/slab.h> #include <linux/dma-fence.h> #include <linux/irq_work.h> #include <linux/dma-resv.h> #include "i915_sw_fence.h" #include "i915_selftest.h" #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) #define I915_SW_FENCE_BUG_ON(expr) BUG_ON(expr) #else #define I915_SW_FENCE_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr) #endif static DEFINE_SPINLOCK(i915_sw_fence_lock); #define WQ_FLAG_BITS \ BITS_PER_TYPE(typeof_member(struct wait_queue_entry, flags)) /* after WQ_FLAG_* for safety */ #define I915_SW_FENCE_FLAG_FENCE BIT(WQ_FLAG_BITS - 1) #define I915_SW_FENCE_FLAG_ALLOC BIT(WQ_FLAG_BITS - 2) enum { DEBUG_FENCE_IDLE = 0, DEBUG_FENCE_NOTIFY, }; static void *i915_sw_fence_debug_hint(void *addr) { return (void *)(((struct i915_sw_fence *)addr)->flags & I915_SW_FENCE_MASK); } #ifdef CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS static const struct debug_obj_descr i915_sw_fence_debug_descr = { .name = "i915_sw_fence", .debug_hint = i915_sw_fence_debug_hint, }; static inline void debug_fence_init(struct i915_sw_fence *fence) { debug_object_init(fence, &i915_sw_fence_debug_descr); } static inline void debug_fence_init_onstack(struct i915_sw_fence *fence) { debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr); } static inline void debug_fence_activate(struct i915_sw_fence *fence) { debug_object_activate(fence, &i915_sw_fence_debug_descr); } static inline void debug_fence_set_state(struct i915_sw_fence *fence, int old, int new) { debug_object_active_state(fence, &i915_sw_fence_debug_descr, old, new); } static inline void debug_fence_deactivate(struct i915_sw_fence *fence) { debug_object_deactivate(fence, &i915_sw_fence_debug_descr); } static inline void debug_fence_destroy(struct i915_sw_fence *fence) { debug_object_destroy(fence, &i915_sw_fence_debug_descr); } static inline void debug_fence_free(struct i915_sw_fence *fence) { debug_object_free(fence, &i915_sw_fence_debug_descr); smp_wmb(); /* flush the change in state before reallocation */ } static inline void debug_fence_assert(struct i915_sw_fence *fence) { debug_object_assert_init(fence, &i915_sw_fence_debug_descr); } #else static inline void debug_fence_init(struct i915_sw_fence *fence) { } static inline void debug_fence_init_onstack(struct i915_sw_fence *fence) { } static inline void debug_fence_activate(struct i915_sw_fence *fence) { } static inline void debug_fence_set_state(struct i915_sw_fence *fence, int old, int new) { } static inline void debug_fence_deactivate(struct i915_sw_fence *fence) { } static inline void debug_fence_destroy(struct i915_sw_fence *fence) { } static inline void debug_fence_free(struct i915_sw_fence *fence) { } static inline void debug_fence_assert(struct i915_sw_fence *fence) { } #endif static int __i915_sw_fence_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) { i915_sw_fence_notify_t fn; fn = (i915_sw_fence_notify_t)(fence->flags & I915_SW_FENCE_MASK); return fn(fence, state); } #ifdef CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS void i915_sw_fence_fini(struct i915_sw_fence *fence) { debug_fence_free(fence); } #endif static void __i915_sw_fence_wake_up_all(struct i915_sw_fence *fence, struct list_head *continuation) { wait_queue_head_t *x = &fence->wait; wait_queue_entry_t *pos, *next; unsigned long flags; debug_fence_deactivate(fence); atomic_set_release(&fence->pending, -1); /* 0 -> -1 [done] */ /* * To prevent unbounded recursion as we traverse the graph of * i915_sw_fences, we move the entry list from this, the next ready * fence, to the tail of the original fence's entry list * (and so added to the list to be woken). */ spin_lock_irqsave_nested(&x->lock, flags, 1 + !!continuation); if (continuation) { list_for_each_entry_safe(pos, next, &x->head, entry) { if (pos->flags & I915_SW_FENCE_FLAG_FENCE) list_move_tail(&pos->entry, continuation); else pos->func(pos, TASK_NORMAL, 0, continuation); } } else { LIST_HEAD(extra); do { list_for_each_entry_safe(pos, next, &x->head, entry) { int wake_flags; wake_flags = 0; if (pos->flags & I915_SW_FENCE_FLAG_FENCE) wake_flags = fence->error; pos->func(pos, TASK_NORMAL, wake_flags, &extra); } if (list_empty(&extra)) break; list_splice_tail_init(&extra, &x->head); } while (1); } spin_unlock_irqrestore(&x->lock, flags); debug_fence_assert(fence); } static void __i915_sw_fence_complete(struct i915_sw_fence *fence, struct list_head *continuation) { debug_fence_assert(fence); if (!atomic_dec_and_test(&fence->pending)) return; debug_fence_set_state(fence, DEBUG_FENCE_IDLE, DEBUG_FENCE_NOTIFY); if (__i915_sw_fence_notify(fence, FENCE_COMPLETE) != NOTIFY_DONE) return; debug_fence_set_state(fence, DEBUG_FENCE_NOTIFY, DEBUG_FENCE_IDLE); __i915_sw_fence_wake_up_all(fence, continuation); debug_fence_destroy(fence); __i915_sw_fence_notify(fence, FENCE_FREE); } void i915_sw_fence_complete(struct i915_sw_fence *fence) { debug_fence_assert(fence); if (WARN_ON(i915_sw_fence_done(fence))) return; __i915_sw_fence_complete(fence, NULL); } bool i915_sw_fence_await(struct i915_sw_fence *fence) { int pending; /* * It is only safe to add a new await to the fence while it has * not yet been signaled (i.e. there are still existing signalers). */ pending = atomic_read(&fence->pending); do { if (pending < 1) return false; } while (!atomic_try_cmpxchg(&fence->pending, &pending, pending + 1)); return true; } void __i915_sw_fence_init(struct i915_sw_fence *fence, i915_sw_fence_notify_t fn, const char *name, struct lock_class_key *key) { BUG_ON(!fn || (unsigned long)fn & ~I915_SW_FENCE_MASK); __init_waitqueue_head(&fence->wait, name, key); fence->flags = (unsigned long)fn; i915_sw_fence_reinit(fence); } void i915_sw_fence_reinit(struct i915_sw_fence *fence) { debug_fence_init(fence); atomic_set(&fence->pending, 1); fence->error = 0; I915_SW_FENCE_BUG_ON(!fence->flags); I915_SW_FENCE_BUG_ON(!list_empty(&fence->wait.head)); } void i915_sw_fence_commit(struct i915_sw_fence *fence) { debug_fence_activate(fence); i915_sw_fence_complete(fence); } static int i915_sw_fence_wake(wait_queue_entry_t *wq, unsigned mode, int flags, void *key) { i915_sw_fence_set_error_once(wq->private, flags); list_del(&wq->entry); __i915_sw_fence_complete(wq->private, key); if (wq->flags & I915_SW_FENCE_FLAG_ALLOC) kfree(wq); return 0; } static bool __i915_sw_fence_check_if_after(struct i915_sw_fence *fence, const struct i915_sw_fence * const signaler) { wait_queue_entry_t *wq; if (__test_and_set_bit(I915_SW_FENCE_CHECKED_BIT, &fence->flags)) return false; if (fence == signaler) return true; list_for_each_entry(wq, &fence->wait.head, entry) { if (wq->func != i915_sw_fence_wake) continue; if (__i915_sw_fence_check_if_after(wq->private, signaler)) return true; } return false; } static void __i915_sw_fence_clear_checked_bit(struct i915_sw_fence *fence) { wait_queue_entry_t *wq; if (!__test_and_clear_bit(I915_SW_FENCE_CHECKED_BIT, &fence->flags)) return; list_for_each_entry(wq, &fence->wait.head, entry) { if (wq->func != i915_sw_fence_wake) continue; __i915_sw_fence_clear_checked_bit(wq->private); } } static bool i915_sw_fence_check_if_after(struct i915_sw_fence *fence, const struct i915_sw_fence * const signaler) { unsigned long flags; bool err; if (!IS_ENABLED(CONFIG_DRM_I915_SW_FENCE_CHECK_DAG)) return false; spin_lock_irqsave(&i915_sw_fence_lock, flags); err = __i915_sw_fence_check_if_after(fence, signaler); __i915_sw_fence_clear_checked_bit(fence); spin_unlock_irqrestore(&i915_sw_fence_lock, flags); return err; } static int __i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence, struct i915_sw_fence *signaler, wait_queue_entry_t *wq, gfp_t gfp) { unsigned int pending; unsigned long flags; debug_fence_assert(fence); might_sleep_if(gfpflags_allow_blocking(gfp)); if (i915_sw_fence_done(signaler)) { i915_sw_fence_set_error_once(fence, signaler->error); return 0; } debug_fence_assert(signaler); /* The dependency graph must be acyclic. */ if (unlikely(i915_sw_fence_check_if_after(fence, signaler))) return -EINVAL; pending = I915_SW_FENCE_FLAG_FENCE; if (!wq) { wq = kmalloc(sizeof(*wq), gfp); if (!wq) { if (!gfpflags_allow_blocking(gfp)) return -ENOMEM; i915_sw_fence_wait(signaler); i915_sw_fence_set_error_once(fence, signaler->error); return 0; } pending |= I915_SW_FENCE_FLAG_ALLOC; } INIT_LIST_HEAD(&wq->entry); wq->flags = pending; wq->func = i915_sw_fence_wake; wq->private = fence; i915_sw_fence_await(fence); spin_lock_irqsave(&signaler->wait.lock, flags); if (likely(!i915_sw_fence_done(signaler))) { __add_wait_queue_entry_tail(&signaler->wait, wq); pending = 1; } else { i915_sw_fence_wake(wq, 0, signaler->error, NULL); pending = 0; } spin_unlock_irqrestore(&signaler->wait.lock, flags); return pending; } int i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence, struct i915_sw_fence *signaler, wait_queue_entry_t *wq) { return __i915_sw_fence_await_sw_fence(fence, signaler, wq, 0); } int i915_sw_fence_await_sw_fence_gfp(struct i915_sw_fence *fence, struct i915_sw_fence *signaler, gfp_t gfp) { return __i915_sw_fence_await_sw_fence(fence, signaler, NULL, gfp); } struct i915_sw_dma_fence_cb_timer { struct i915_sw_dma_fence_cb base; struct dma_fence *dma; struct timer_list timer; struct irq_work work; struct rcu_head rcu; }; static void dma_i915_sw_fence_wake(struct dma_fence *dma, struct dma_fence_cb *data) { struct i915_sw_dma_fence_cb *cb = container_of(data, typeof(*cb), base); i915_sw_fence_set_error_once(cb->fence, dma->error); i915_sw_fence_complete(cb->fence); kfree(cb); } static void timer_i915_sw_fence_wake(struct timer_list *t) { struct i915_sw_dma_fence_cb_timer *cb = from_timer(cb, t, timer); struct i915_sw_fence *fence; fence = xchg(&cb->base.fence, NULL); if (!fence) return; pr_notice("Asynchronous wait on fence %s:%s:%llx timed out (hint:%ps)\n", cb->dma->ops->get_driver_name(cb->dma), cb->dma->ops->get_timeline_name(cb->dma), cb->dma->seqno, i915_sw_fence_debug_hint(fence)); i915_sw_fence_set_error_once(fence, -ETIMEDOUT); i915_sw_fence_complete(fence); } static void dma_i915_sw_fence_wake_timer(struct dma_fence *dma, struct dma_fence_cb *data) { struct i915_sw_dma_fence_cb_timer *cb = container_of(data, typeof(*cb), base.base); struct i915_sw_fence *fence; fence = xchg(&cb->base.fence, NULL); if (fence) { i915_sw_fence_set_error_once(fence, dma->error); i915_sw_fence_complete(fence); } irq_work_queue(&cb->work); } static void irq_i915_sw_fence_work(struct irq_work *wrk) { struct i915_sw_dma_fence_cb_timer *cb = container_of(wrk, typeof(*cb), work); del_timer_sync(&cb->timer); dma_fence_put(cb->dma); kfree_rcu(cb, rcu); } int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence, struct dma_fence *dma, unsigned long timeout, gfp_t gfp) { struct i915_sw_dma_fence_cb *cb; dma_fence_func_t func; int ret; debug_fence_assert(fence); might_sleep_if(gfpflags_allow_blocking(gfp)); if (dma_fence_is_signaled(dma)) { i915_sw_fence_set_error_once(fence, dma->error); return 0; } cb = kmalloc(timeout ? sizeof(struct i915_sw_dma_fence_cb_timer) : sizeof(struct i915_sw_dma_fence_cb), gfp); if (!cb) { if (!gfpflags_allow_blocking(gfp)) return -ENOMEM; ret = dma_fence_wait(dma, false); if (ret) return ret; i915_sw_fence_set_error_once(fence, dma->error); return 0; } cb->fence = fence; i915_sw_fence_await(fence); func = dma_i915_sw_fence_wake; if (timeout) { struct i915_sw_dma_fence_cb_timer *timer = container_of(cb, typeof(*timer), base); timer->dma = dma_fence_get(dma); init_irq_work(&timer->work, irq_i915_sw_fence_work); timer_setup(&timer->timer, timer_i915_sw_fence_wake, TIMER_IRQSAFE); mod_timer(&timer->timer, round_jiffies_up(jiffies + timeout)); func = dma_i915_sw_fence_wake_timer; } ret = dma_fence_add_callback(dma, &cb->base, func); if (ret == 0) { ret = 1; } else { func(dma, &cb->base); if (ret == -ENOENT) /* fence already signaled */ ret = 0; } return ret; } static void __dma_i915_sw_fence_wake(struct dma_fence *dma, struct dma_fence_cb *data) { struct i915_sw_dma_fence_cb *cb = container_of(data, typeof(*cb), base); i915_sw_fence_set_error_once(cb->fence, dma->error); i915_sw_fence_complete(cb->fence); } int __i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence, struct dma_fence *dma, struct i915_sw_dma_fence_cb *cb) { int ret; debug_fence_assert(fence); if (dma_fence_is_signaled(dma)) { i915_sw_fence_set_error_once(fence, dma->error); return 0; } cb->fence = fence; i915_sw_fence_await(fence); ret = 1; if (dma_fence_add_callback(dma, &cb->base, __dma_i915_sw_fence_wake)) { /* fence already signaled */ __dma_i915_sw_fence_wake(dma, &cb->base); ret = 0; } return ret; } int i915_sw_fence_await_reservation(struct i915_sw_fence *fence, struct dma_resv *resv, const struct dma_fence_ops *exclude, bool write, unsigned long timeout, gfp_t gfp) { struct dma_fence *excl; int ret = 0, pending; debug_fence_assert(fence); might_sleep_if(gfpflags_allow_blocking(gfp)); if (write) { struct dma_fence **shared; unsigned int count, i; ret = dma_resv_get_fences(resv, &excl, &count, &shared); if (ret) return ret; for (i = 0; i < count; i++) { if (shared[i]->ops == exclude) continue; pending = i915_sw_fence_await_dma_fence(fence, shared[i], timeout, gfp); if (pending < 0) { ret = pending; break; } ret |= pending; } for (i = 0; i < count; i++) dma_fence_put(shared[i]); kfree(shared); } else { excl = dma_resv_get_excl_unlocked(resv); } if (ret >= 0 && excl && excl->ops != exclude) { pending = i915_sw_fence_await_dma_fence(fence, excl, timeout, gfp); if (pending < 0) ret = pending; else ret |= pending; } dma_fence_put(excl); return ret; } #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) #include "selftests/lib_sw_fence.c" #include "selftests/i915_sw_fence.c" #endif
579280.c
/* Copyright (c) 2021, Stephen P. Shoecraft All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. */ #include <stdio.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <time.h> #include <stdarg.h> #ifdef DEBUG #undef DEBUG #endif //#define DEBUG 1 #include "utils.h" #include "debug.h" FILE *logfp = (FILE *) 0; int logopts; int log_open(char *ident,char *filename,int opts) { DPRINTF("filename: %s\n",filename); if (filename) { char *op; /* Open the file */ op = (opts & LOG_CREATE ? "w+" : "a+"); logfp = fopen(filename,op); if (!logfp) { perror("log_open: unable to create logfile"); return 1; } } else if (opts & LOG_STDERR) { DPRINTF("logging to stderr\n"); logfp = stderr; } else { DPRINTF("logging to stdout\n"); logfp = stdout; } logopts = opts; DPRINTF("log is opened.\n"); return 0; } int log_write(int type,char *format,...) { char message[16384]; va_list ap; char dt[32],error[128]; register char *ptr; int len; /* Make sure log_open was called */ if (!logfp) log_open("",0,LOG_INFO|LOG_WARNING|LOG_ERROR|LOG_SYSERR|LOG_DEBUG); /* Do we even log this type? */ DPRINTF("logopts: %0x, type: %0x\n",logopts,type); if ( (logopts | type) != logopts) return 0; /* get the error text asap before it's gone */ if (type & LOG_SYSERR) { error[0] = 0; strncat(error,strerror(errno),sizeof(error)); } /* Prepend the time? */ ptr = message; if (logopts & LOG_TIME || type & LOG_TIME) { // struct tm *tptr; // time_t t; DPRINTF("prepending time...\n"); get_timestamp(dt,sizeof(dt),1); #if 0 /* Fill the tm struct */ t = time(NULL); tptr = 0; DPRINTF("getting localtime\n"); tptr = localtime(&t); if (!tptr) { DPRINTF("unable to get localtime!\n"); return 1; } /* Set month to 1 if month is out of range */ if (tptr->tm_mon < 0 || tptr->tm_mon > 11) tptr->tm_mon = 0; /* Fill string with yyyymmddhhmmss */ sprintf(dt,"%04d-%02d-%02d %02d:%02d:%02d", 1900+tptr->tm_year,tptr->tm_mon+1,tptr->tm_mday, tptr->tm_hour,tptr->tm_min,tptr->tm_sec); #endif strcat(dt," "); ptr += sprintf(ptr,"%s",dt); } /* If it's a warning, prepend warning: */ if (type & LOG_WARNING) { DPRINTF("prepending warning...\n"); sprintf(ptr,"warning: "); ptr += strlen(ptr); } /* If it's an error, prepend error: */ else if ((type & LOG_ERROR) || (type & LOG_SYSERR)) { DPRINTF("prepending error...\n"); sprintf(ptr,"error: "); ptr += strlen(ptr); } len = (sizeof(message) - strlen(message)) - 1; /* Build the rest of the message */ DPRINTF("adding message...\n"); DPRINTF("format: %p\n", format); va_start(ap,format); vsnprintf(ptr,len,format,ap); va_end(ap); /* Trim */ trim(message); /* If it's a system error, concat the system message */ if (type & LOG_SYSERR) { DPRINTF("adding error text...\n"); strcat(message,": "); strcat(message, error); } /* Strip all CRs and LFs */ DPRINTF("stripping newlines...\n"); for(ptr = message; *ptr; ptr++) { if (*ptr == '\n' || *ptr == '\r') strcpy(ptr,ptr+1); } /* Write the message */ DPRINTF("message: %s\n",message); fprintf(logfp,"%s\n",message); fflush(logfp); return 0; }
1003179.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_atoi.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: exam <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/07/27 19:12:17 by exam #+# #+# */ /* Updated: 2018/07/27 19:17:25 by exam ### ########.fr */ /* */ /* ************************************************************************** */ int ft_atoi(char *c) { int i; int ans; int flag; int x; i = 0; flag = 0; ans = 0; while (c[i] != '\0' && (c[i] == ' ' || c[i] == '\t' || c[i] == '\r' || c[i] == '\n')) i++; x = i; while (c[i] != '\0' && ((c[i] >= '0' && c[i] <= '9') || (i == x && (c[i] == '-' || c[i] == '+')))) { if (c[i] == '-') flag = 1; if (c[i] >= '0' && c[i] <= '9') { ans *= 10; ans += (c[i] - '0'); } i++; } if (flag) ans *= -1; return (ans); }
750918.c
/* $OpenBSD: pfkeyv2_parsemessage.c,v 1.44 2010/07/01 02:09:45 reyk Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 * * NRL grants permission for redistribution and use in source and binary * forms, with or without modification, of the software and documentation * created at NRL 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 acknowledgements: * This product includes software developed by the University of * California, Berkeley and its contributors. * This product includes software developed at the Information * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THE SOFTWARE PROVIDED BY NRL IS PROVIDED BY NRL 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 NRL 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 US Naval * Research Laboratory (NRL). */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 Craig Metz. 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 author 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 REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "pf.h" #include <sys/param.h> #include <sys/systm.h> #include <sys/socket.h> #include <sys/mbuf.h> #include <sys/proc.h> #include <netinet/ip_ipsp.h> #include <net/pfkeyv2.h> #if NPF > 0 #include <net/if.h> #include <net/pfvar.h> #endif extern int encdebug; #ifdef ENCDEBUG #define DPRINTF(x) if (encdebug) printf x #else #define DPRINTF(x) #endif #define BITMAP_SA (1LL << SADB_EXT_SA) #define BITMAP_LIFETIME_CURRENT (1LL << SADB_EXT_LIFETIME_CURRENT) #define BITMAP_LIFETIME_HARD (1LL << SADB_EXT_LIFETIME_HARD) #define BITMAP_LIFETIME_SOFT (1LL << SADB_EXT_LIFETIME_SOFT) #define BITMAP_ADDRESS_SRC (1LL << SADB_EXT_ADDRESS_SRC) #define BITMAP_ADDRESS_DST (1LL << SADB_EXT_ADDRESS_DST) #define BITMAP_ADDRESS_PROXY (1LL << SADB_EXT_ADDRESS_PROXY) #define BITMAP_KEY_AUTH (1LL << SADB_EXT_KEY_AUTH) #define BITMAP_KEY_ENCRYPT (1LL << SADB_EXT_KEY_ENCRYPT) #define BITMAP_IDENTITY_SRC (1LL << SADB_EXT_IDENTITY_SRC) #define BITMAP_IDENTITY_DST (1LL << SADB_EXT_IDENTITY_DST) #define BITMAP_SENSITIVITY (1LL << SADB_EXT_SENSITIVITY) #define BITMAP_PROPOSAL (1LL << SADB_EXT_PROPOSAL) #define BITMAP_SUPPORTED_AUTH (1LL << SADB_EXT_SUPPORTED_AUTH) #define BITMAP_SUPPORTED_ENCRYPT (1LL << SADB_EXT_SUPPORTED_ENCRYPT) #define BITMAP_SPIRANGE (1LL << SADB_EXT_SPIRANGE) #define BITMAP_LIFETIME (BITMAP_LIFETIME_CURRENT | BITMAP_LIFETIME_HARD | BITMAP_LIFETIME_SOFT) #define BITMAP_ADDRESS (BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_ADDRESS_PROXY) #define BITMAP_KEY (BITMAP_KEY_AUTH | BITMAP_KEY_ENCRYPT) #define BITMAP_IDENTITY (BITMAP_IDENTITY_SRC | BITMAP_IDENTITY_DST) #define BITMAP_MSG 1 #define BITMAP_X_SRC_MASK (1LL << SADB_X_EXT_SRC_MASK) #define BITMAP_X_DST_MASK (1LL << SADB_X_EXT_DST_MASK) #define BITMAP_X_PROTOCOL (1LL << SADB_X_EXT_PROTOCOL) #define BITMAP_X_SRC_FLOW (1LL << SADB_X_EXT_SRC_FLOW) #define BITMAP_X_DST_FLOW (1LL << SADB_X_EXT_DST_FLOW) #define BITMAP_X_FLOW_TYPE (1LL << SADB_X_EXT_FLOW_TYPE) #define BITMAP_X_SA2 (1LL << SADB_X_EXT_SA2) #define BITMAP_X_DST2 (1LL << SADB_X_EXT_DST2) #define BITMAP_X_POLICY (1LL << SADB_X_EXT_POLICY) #define BITMAP_X_LOCAL_CREDENTIALS (1LL << SADB_X_EXT_LOCAL_CREDENTIALS) #define BITMAP_X_REMOTE_CREDENTIALS (1LL << SADB_X_EXT_REMOTE_CREDENTIALS) #define BITMAP_X_LOCAL_AUTH (1LL << SADB_X_EXT_LOCAL_AUTH) #define BITMAP_X_REMOTE_AUTH (1LL << SADB_X_EXT_REMOTE_AUTH) #define BITMAP_X_CREDENTIALS (BITMAP_X_LOCAL_CREDENTIALS | BITMAP_X_REMOTE_CREDENTIALS | BITMAP_X_LOCAL_AUTH | BITMAP_X_REMOTE_AUTH) #define BITMAP_X_FLOW (BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_PROTOCOL | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE) #define BITMAP_X_SUPPORTED_COMP (1LL << SADB_X_EXT_SUPPORTED_COMP) #define BITMAP_X_UDPENCAP (1LL << SADB_X_EXT_UDPENCAP) #define BITMAP_X_LIFETIME_LASTUSE (1LL << SADB_X_EXT_LIFETIME_LASTUSE) #define BITMAP_X_TAG (1LL << SADB_X_EXT_TAG) #define BITMAP_X_TAP (1LL << SADB_X_EXT_TAP) uint64_t sadb_exts_allowed_in[SADB_MAX+1] = { /* RESERVED */ ~0, /* GETSPI */ BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_SPIRANGE, /* UPDATE */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS | BITMAP_KEY | BITMAP_IDENTITY | BITMAP_X_CREDENTIALS | BITMAP_X_FLOW | BITMAP_X_UDPENCAP | BITMAP_X_TAG | BITMAP_X_TAP, /* ADD */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS | BITMAP_KEY | BITMAP_IDENTITY | BITMAP_X_CREDENTIALS | BITMAP_X_FLOW | BITMAP_X_UDPENCAP | BITMAP_X_LIFETIME_LASTUSE | BITMAP_X_TAG | BITMAP_X_TAP, /* DELETE */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* GET */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* ACQUIRE */ BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_IDENTITY | BITMAP_PROPOSAL | BITMAP_X_CREDENTIALS, /* REGISTER */ 0, /* EXPIRE */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* FLUSH */ 0, /* DUMP */ 0, /* X_PROMISC */ 0, /* X_ADDFLOW */ BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_IDENTITY_SRC | BITMAP_IDENTITY_DST | BITMAP_X_FLOW, /* X_DELFLOW */ BITMAP_X_FLOW, /* X_GRPSPIS */ BITMAP_SA | BITMAP_X_SA2 | BITMAP_X_DST2 | BITMAP_ADDRESS_DST | BITMAP_X_PROTOCOL, /* X_ASKPOLICY */ BITMAP_X_POLICY, }; uint64_t sadb_exts_required_in[SADB_MAX+1] = { /* RESERVED */ 0, /* GETSPI */ BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_SPIRANGE, /* UPDATE */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* ADD */ BITMAP_SA | BITMAP_ADDRESS_DST, /* DELETE */ BITMAP_SA | BITMAP_ADDRESS_DST, /* GET */ BITMAP_SA | BITMAP_ADDRESS_DST, /* ACQUIRE */ 0, /* REGISTER */ 0, /* EXPIRE */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* FLUSH */ 0, /* DUMP */ 0, /* X_PROMISC */ 0, /* X_ADDFLOW */ BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE, /* X_DELFLOW */ BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE, /* X_GRPSPIS */ BITMAP_SA | BITMAP_X_SA2 | BITMAP_X_DST2 | BITMAP_ADDRESS_DST | BITMAP_X_PROTOCOL, /* X_ASKPOLICY */ BITMAP_X_POLICY, }; uint64_t sadb_exts_allowed_out[SADB_MAX+1] = { /* RESERVED */ ~0, /* GETSPI */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* UPDATE */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS | BITMAP_IDENTITY | BITMAP_X_CREDENTIALS | BITMAP_X_FLOW | BITMAP_X_UDPENCAP | BITMAP_X_TAG | BITMAP_X_TAP, /* ADD */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS | BITMAP_IDENTITY | BITMAP_X_CREDENTIALS | BITMAP_X_FLOW | BITMAP_X_UDPENCAP | BITMAP_X_TAG | BITMAP_X_TAP, /* DELETE */ BITMAP_SA | BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST, /* GET */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS | BITMAP_KEY | BITMAP_IDENTITY | BITMAP_X_CREDENTIALS | BITMAP_X_UDPENCAP | BITMAP_X_LIFETIME_LASTUSE | BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_PROTOCOL | BITMAP_X_FLOW_TYPE | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_TAG | BITMAP_X_TAP, /* ACQUIRE */ BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_IDENTITY | BITMAP_PROPOSAL | BITMAP_X_CREDENTIALS, /* REGISTER */ BITMAP_SUPPORTED_AUTH | BITMAP_SUPPORTED_ENCRYPT | BITMAP_X_SUPPORTED_COMP, /* EXPIRE */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS, /* FLUSH */ 0, /* DUMP */ BITMAP_SA | BITMAP_LIFETIME | BITMAP_ADDRESS | BITMAP_IDENTITY, /* X_PROMISC */ 0, /* X_ADDFLOW */ BITMAP_ADDRESS_SRC | BITMAP_ADDRESS_DST | BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_PROTOCOL | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE | BITMAP_IDENTITY_SRC | BITMAP_IDENTITY_DST, /* X_DELFLOW */ BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_PROTOCOL | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE, /* X_GRPSPIS */ BITMAP_SA | BITMAP_X_SA2 | BITMAP_X_DST2 | BITMAP_ADDRESS_DST | BITMAP_X_PROTOCOL, /* X_ASKPOLICY */ BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_FLOW_TYPE | BITMAP_X_POLICY, }; uint64_t sadb_exts_required_out[SADB_MAX+1] = { /* RESERVED */ 0, /* GETSPI */ BITMAP_SA | BITMAP_ADDRESS_DST, /* UPDATE */ BITMAP_SA | BITMAP_ADDRESS_DST, /* ADD */ BITMAP_SA | BITMAP_ADDRESS_DST, /* DELETE */ BITMAP_SA | BITMAP_ADDRESS_DST, /* GET */ BITMAP_SA | BITMAP_LIFETIME_CURRENT | BITMAP_ADDRESS_DST, /* ACQUIRE */ 0, /* REGISTER */ BITMAP_SUPPORTED_AUTH | BITMAP_SUPPORTED_ENCRYPT | BITMAP_X_SUPPORTED_COMP, /* EXPIRE */ BITMAP_SA | BITMAP_ADDRESS_DST, /* FLUSH */ 0, /* DUMP */ 0, /* X_PROMISC */ 0, /* X_ADDFLOW */ BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE, /* X_DELFLOW */ BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_FLOW_TYPE, /* X_GRPSPIS */ BITMAP_SA | BITMAP_X_SA2 | BITMAP_X_DST2 | BITMAP_ADDRESS_DST | BITMAP_X_PROTOCOL, /* X_REPPOLICY */ BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_FLOW_TYPE, }; int pfkeyv2_parsemessage(void *, int, void **); #define RETURN_EINVAL(line) goto einval; int pfkeyv2_parsemessage(void *p, int len, void **headers) { struct sadb_ext *sadb_ext; int i, left = len; uint64_t allow, seen = 1; struct sadb_msg *sadb_msg = (struct sadb_msg *) p; bzero(headers, (SADB_EXT_MAX + 1) * sizeof(void *)); if (left < sizeof(struct sadb_msg)) { DPRINTF(("pfkeyv2_parsemessage: message too short\n")); return (EINVAL); } headers[0] = p; if (sadb_msg->sadb_msg_len * sizeof(uint64_t) != left) { DPRINTF(("pfkeyv2_parsemessage: length not a multiple of 64\n")); return (EINVAL); } p += sizeof(struct sadb_msg); left -= sizeof(struct sadb_msg); if (sadb_msg->sadb_msg_reserved) { DPRINTF(("pfkeyv2_parsemessage: message header reserved " "field set\n")); return (EINVAL); } if (sadb_msg->sadb_msg_type > SADB_MAX) { DPRINTF(("pfkeyv2_parsemessage: message type > %d\n", SADB_MAX)); return (EINVAL); } if (!sadb_msg->sadb_msg_type) { DPRINTF(("pfkeyv2_parsemessage: message type unset\n")); return (EINVAL); } if (sadb_msg->sadb_msg_pid != curproc->p_pid) { DPRINTF(("pfkeyv2_parsemessage: bad PID value\n")); return (EINVAL); } if (sadb_msg->sadb_msg_errno) { if (left) { DPRINTF(("pfkeyv2_parsemessage: too-large error message\n")); return (EINVAL); } return (0); } if (sadb_msg->sadb_msg_type == SADB_X_PROMISC) { DPRINTF(("pfkeyv2_parsemessage: message type promiscuous\n")); return (0); } allow = sadb_exts_allowed_in[sadb_msg->sadb_msg_type]; while (left > 0) { sadb_ext = (struct sadb_ext *)p; if (left < sizeof(struct sadb_ext)) { DPRINTF(("pfkeyv2_parsemessage: extension header too " "short\n")); return (EINVAL); } i = sadb_ext->sadb_ext_len * sizeof(uint64_t); if (left < i) { DPRINTF(("pfkeyv2_parsemessage: extension header " "exceeds message length\n")); return (EINVAL); } if (sadb_ext->sadb_ext_type > SADB_EXT_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown extension " "header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (!sadb_ext->sadb_ext_type) { DPRINTF(("pfkeyv2_parsemessage: unset extension " "header\n")); return (EINVAL); } if (!(allow & (1LL << sadb_ext->sadb_ext_type))) { DPRINTF(("pfkeyv2_parsemessage: extension header %d " "not permitted on message type %d\n", sadb_ext->sadb_ext_type, sadb_msg->sadb_msg_type)); return (EINVAL); } if (headers[sadb_ext->sadb_ext_type]) { DPRINTF(("pfkeyv2_parsemessage: duplicate extension " "header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } seen |= (1LL << sadb_ext->sadb_ext_type); switch (sadb_ext->sadb_ext_type) { case SADB_EXT_SA: case SADB_X_EXT_SA2: { struct sadb_sa *sadb_sa = (struct sadb_sa *)p; if (i != sizeof(struct sadb_sa)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length for SA extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_sa->sadb_sa_state > SADB_SASTATE_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown SA " "state %d in SA extension header %d\n", sadb_sa->sadb_sa_state, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_sa->sadb_sa_state == SADB_SASTATE_DEAD) { DPRINTF(("pfkeyv2_parsemessage: cannot set SA " "state to dead, SA extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_sa->sadb_sa_encrypt > SADB_EALG_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown " "encryption algorithm %d in SA extension " "header %d\n", sadb_sa->sadb_sa_encrypt, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_sa->sadb_sa_auth > SADB_AALG_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown " "authentication algorithm %d in SA " "extension header %d\n", sadb_sa->sadb_sa_auth, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_sa->sadb_sa_replay > 32) { DPRINTF(("pfkeyv2_parsemessage: unsupported " "replay window size %d in SA extension " "header %d\n", sadb_sa->sadb_sa_replay, sadb_ext->sadb_ext_type)); return (EINVAL); } } break; case SADB_X_EXT_PROTOCOL: case SADB_X_EXT_FLOW_TYPE: if (i != sizeof(struct sadb_protocol)) { DPRINTF(("pfkeyv2_parsemessage: bad " "PROTOCOL/FLOW header length in extension " "header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } break; case SADB_X_EXT_POLICY: if (i != sizeof(struct sadb_x_policy)) { DPRINTF(("pfkeyv2_parsemessage: bad POLICY " "header length\n")); return (EINVAL); } break; case SADB_EXT_LIFETIME_CURRENT: case SADB_EXT_LIFETIME_HARD: case SADB_EXT_LIFETIME_SOFT: case SADB_X_EXT_LIFETIME_LASTUSE: if (i != sizeof(struct sadb_lifetime)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length for LIFETIME extension header " "%d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } break; case SADB_EXT_ADDRESS_SRC: case SADB_EXT_ADDRESS_DST: case SADB_X_EXT_SRC_MASK: case SADB_X_EXT_DST_MASK: case SADB_X_EXT_SRC_FLOW: case SADB_X_EXT_DST_FLOW: case SADB_X_EXT_DST2: case SADB_EXT_ADDRESS_PROXY: { struct sadb_address *sadb_address = (struct sadb_address *)p; struct sockaddr *sa = (struct sockaddr *)(p + sizeof(struct sadb_address)); if (i < sizeof(struct sadb_address) + sizeof(struct sockaddr)) { DPRINTF(("pfkeyv2_parsemessage: bad ADDRESS " "extension header %d length\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_address->sadb_address_reserved) { DPRINTF(("pfkeyv2_parsemessage: ADDRESS " "extension header %d reserved field set\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sa->sa_len && (i != sizeof(struct sadb_address) + PADUP(sa->sa_len))) { DPRINTF(("pfkeyv2_parsemessage: bad sockaddr " "length field in ADDRESS extension " "header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } switch (sa->sa_family) { case AF_INET: if (sizeof(struct sadb_address) + PADUP(sizeof(struct sockaddr_in)) != i) { DPRINTF(("pfkeyv2_parsemessage: " "invalid ADDRESS extension header " "%d length\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sa->sa_len != sizeof(struct sockaddr_in)) { DPRINTF(("pfkeyv2_parsemessage: bad " "sockaddr_in length in ADDRESS " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } /* Only check the right pieces */ switch (sadb_ext->sadb_ext_type) { case SADB_X_EXT_SRC_MASK: case SADB_X_EXT_DST_MASK: case SADB_X_EXT_SRC_FLOW: case SADB_X_EXT_DST_FLOW: break; default: if (((struct sockaddr_in *)sa)->sin_port) { DPRINTF(("pfkeyv2_parsemessage" ": port field set in " "sockaddr_in of ADDRESS " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } break; } { char zero[sizeof(((struct sockaddr_in *)sa)->sin_zero)]; bzero(zero, sizeof(zero)); if (bcmp(&((struct sockaddr_in *)sa)->sin_zero, zero, sizeof(zero))) { DPRINTF(("pfkeyv2_parsemessage" ": reserved sockaddr_in " "field non-zero'ed in " "ADDRESS extension header " "%d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } } break; #ifdef INET6 case AF_INET6: if (i != sizeof(struct sadb_address) + PADUP(sizeof(struct sockaddr_in6))) { DPRINTF(("pfkeyv2_parsemessage: " "invalid sockaddr_in6 length in " "ADDRESS extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sa->sa_len != sizeof(struct sockaddr_in6)) { DPRINTF(("pfkeyv2_parsemessage: bad " "sockaddr_in6 length in ADDRESS " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (((struct sockaddr_in6 *)sa)->sin6_flowinfo) { DPRINTF(("pfkeyv2_parsemessage: " "flowinfo field set in " "sockaddr_in6 of ADDRESS " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } /* Only check the right pieces */ switch (sadb_ext->sadb_ext_type) { case SADB_X_EXT_SRC_MASK: case SADB_X_EXT_DST_MASK: case SADB_X_EXT_SRC_FLOW: case SADB_X_EXT_DST_FLOW: break; default: if (((struct sockaddr_in6 *)sa)->sin6_port) { DPRINTF(("pfkeyv2_parsemessage" ": port field set in " "sockaddr_in6 of ADDRESS " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } break; } break; #endif /* INET6 */ default: if (sadb_msg->sadb_msg_satype == SADB_X_SATYPE_TCPSIGNATURE && sa->sa_family == 0) break; DPRINTF(("pfkeyv2_parsemessage: unknown " "address family %d in ADDRESS extension " "header %d\n", sa->sa_family, sadb_ext->sadb_ext_type)); return (EINVAL); } } break; case SADB_EXT_KEY_AUTH: case SADB_EXT_KEY_ENCRYPT: { struct sadb_key *sadb_key = (struct sadb_key *)p; if (i < sizeof(struct sadb_key)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length in KEY extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (!sadb_key->sadb_key_bits) { DPRINTF(("pfkeyv2_parsemessage: key length " "unset in KEY extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (((sadb_key->sadb_key_bits + 63) / 64) * sizeof(uint64_t) != i - sizeof(struct sadb_key)) { DPRINTF(("pfkeyv2_parsemessage: invalid key " "length in KEY extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_key->sadb_key_reserved) { DPRINTF(("pfkeyv2_parsemessage: reserved field" " set in KEY extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } } break; case SADB_X_EXT_LOCAL_AUTH: case SADB_X_EXT_REMOTE_AUTH: { struct sadb_x_cred *sadb_cred = (struct sadb_x_cred *)p; if (i < sizeof(struct sadb_x_cred)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length for AUTH extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_cred->sadb_x_cred_type > SADB_X_AUTHTYPE_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown auth " "type %d in AUTH extension header %d\n", sadb_cred->sadb_x_cred_type, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_cred->sadb_x_cred_reserved) { DPRINTF(("pfkeyv2_parsemessage: reserved field" " set in AUTH extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } } break; case SADB_X_EXT_LOCAL_CREDENTIALS: case SADB_X_EXT_REMOTE_CREDENTIALS: { struct sadb_x_cred *sadb_cred = (struct sadb_x_cred *)p; if (i < sizeof(struct sadb_x_cred)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length of CREDENTIALS extension header " "%d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_cred->sadb_x_cred_type > SADB_X_CREDTYPE_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown " "credential type %d in CREDENTIALS " "extension header %d\n", sadb_cred->sadb_x_cred_type, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_cred->sadb_x_cred_reserved) { DPRINTF(("pfkeyv2_parsemessage: reserved " "field set in CREDENTIALS extension " "header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } } break; case SADB_EXT_IDENTITY_SRC: case SADB_EXT_IDENTITY_DST: { struct sadb_ident *sadb_ident = (struct sadb_ident *)p; if (i < sizeof(struct sadb_ident)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length of IDENTITY extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_ident->sadb_ident_type > SADB_IDENTTYPE_MAX) { DPRINTF(("pfkeyv2_parsemessage: unknown " "identity type %d in IDENTITY extension " "header %d\n", sadb_ident->sadb_ident_type, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_ident->sadb_ident_reserved) { DPRINTF(("pfkeyv2_parsemessage: reserved " "field set in IDENTITY extension header " "%d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (i > sizeof(struct sadb_ident)) { char *c = (char *)(p + sizeof(struct sadb_ident)); int j; if (*(char *)(p + i - 1)) { DPRINTF(("pfkeyv2_parsemessage: non " "NUL-terminated identity in " "IDENTITY extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } j = PADUP(strlen(c) + 1) + sizeof(struct sadb_ident); if (i != j) { DPRINTF(("pfkeyv2_parsemessage: actual" " identity length does not match " "expected length in identity " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } } } break; case SADB_EXT_SENSITIVITY: { struct sadb_sens *sadb_sens = (struct sadb_sens *)p; if (i < sizeof(struct sadb_sens)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length for SENSITIVITY extension " "header\n")); return (EINVAL); } if (i != (sadb_sens->sadb_sens_sens_len + sadb_sens->sadb_sens_integ_len) * sizeof(uint64_t) + sizeof(struct sadb_sens)) { DPRINTF(("pfkeyv2_parsemessage: bad payload " "length for SENSITIVITY extension " "header\n")); return (EINVAL); } } break; case SADB_EXT_PROPOSAL: { struct sadb_prop *sadb_prop = (struct sadb_prop *)p; if (i < sizeof(struct sadb_prop)) { DPRINTF(("pfkeyv2_parsemessage: bad PROPOSAL " "header length\n")); return (EINVAL); } if (sadb_prop->sadb_prop_reserved) { DPRINTF(("pfkeyv2_parsemessage: reserved field" "set in PROPOSAL extension header\n")); return (EINVAL); } if ((i - sizeof(struct sadb_prop)) % sizeof(struct sadb_comb)) { DPRINTF(("pfkeyv2_parsemessage: bad proposal " "length\n")); return (EINVAL); } { struct sadb_comb *sadb_comb = (struct sadb_comb *)(p + sizeof(struct sadb_prop)); int j; for (j = 0; j < (i - sizeof(struct sadb_prop))/ sizeof(struct sadb_comb); j++) { if (sadb_comb->sadb_comb_auth > SADB_AALG_MAX) { DPRINTF(("pfkeyv2_parsemessage" ": unknown authentication " "algorithm %d in " "PROPOSAL\n", sadb_comb->sadb_comb_auth)); return (EINVAL); } if (sadb_comb->sadb_comb_encrypt > SADB_EALG_MAX) { DPRINTF(("pfkeyv2_parsemessage" ": unknown encryption " "algorithm %d in " "PROPOSAL\n", sadb_comb->sadb_comb_encrypt)); return (EINVAL); } if (sadb_comb->sadb_comb_reserved) { DPRINTF(("pfkeyv2_parsemessage" ": reserved field set in " "COMB header\n")); return (EINVAL); } } } } break; case SADB_EXT_SUPPORTED_AUTH: case SADB_EXT_SUPPORTED_ENCRYPT: case SADB_X_EXT_SUPPORTED_COMP: { struct sadb_supported *sadb_supported = (struct sadb_supported *)p; int j; if (i < sizeof(struct sadb_supported)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length for SUPPORTED extension header " "%d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_supported->sadb_supported_reserved) { DPRINTF(("pfkeyv2_parsemessage: reserved " "field set in SUPPORTED extension " "header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } { struct sadb_alg *sadb_alg = (struct sadb_alg *)(p + sizeof(struct sadb_supported)); int max_alg; max_alg = sadb_ext->sadb_ext_type == SADB_EXT_SUPPORTED_AUTH ? SADB_AALG_MAX : SADB_EXT_SUPPORTED_ENCRYPT ? SADB_EALG_MAX : SADB_X_CALG_MAX; for (j = 0; j < sadb_supported->sadb_supported_len - 1; j++) { if (sadb_alg->sadb_alg_id > max_alg) { DPRINTF(("pfkeyv2_parsemessage" ": unknown algorithm %d " "in SUPPORTED extension " "header %d\n", sadb_alg->sadb_alg_id, sadb_ext->sadb_ext_type)); return (EINVAL); } if (sadb_alg->sadb_alg_reserved) { DPRINTF(("pfkeyv2_parsemessage" ": reserved field set in " "supported algorithms " "header inside SUPPORTED " "extension header %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } sadb_alg++; } } } break; case SADB_EXT_SPIRANGE: { struct sadb_spirange *sadb_spirange = (struct sadb_spirange *)p; if (i != sizeof(struct sadb_spirange)) { DPRINTF(("pfkeyv2_parsemessage: bad header " "length of SPIRANGE extension header\n")); return (EINVAL); } if (sadb_spirange->sadb_spirange_min > sadb_spirange->sadb_spirange_max) { DPRINTF(("pfkeyv2_parsemessage: bad SPI " "range\n")); return (EINVAL); } } break; case SADB_X_EXT_UDPENCAP: if (i != sizeof(struct sadb_x_udpencap)) { DPRINTF(("pfkeyv2_parsemessage: bad UDPENCAP " "header length\n")); return (EINVAL); } break; #if NPF > 0 case SADB_X_EXT_TAG: if (i < sizeof(struct sadb_x_tag)) { DPRINTF(("pfkeyv2_parsemessage: " "TAG extension header too small")); return (EINVAL); } if (i > (sizeof(struct sadb_x_tag) + PF_TAG_NAME_SIZE)) { DPRINTF(("pfkeyv2_parsemessage: " "TAG extension header too long")); return (EINVAL); } break; case SADB_X_EXT_TAP: if (i < sizeof(struct sadb_x_tap)) { DPRINTF(("pfkeyv2_parsemessage: " "TAP extension header too small")); return (EINVAL); } if (i > sizeof(struct sadb_x_tap)) { DPRINTF(("pfkeyv2_parsemessage: " "TAP extension header too long")); return (EINVAL); } break; #endif default: DPRINTF(("pfkeyv2_parsemessage: unknown extension " "header type %d\n", sadb_ext->sadb_ext_type)); return (EINVAL); } headers[sadb_ext->sadb_ext_type] = p; p += i; left -= i; } if (left) { DPRINTF(("pfkeyv2_parsemessage: message too long\n")); return (EINVAL); } { uint64_t required; required = sadb_exts_required_in[sadb_msg->sadb_msg_type]; if ((seen & required) != required) { DPRINTF(("pfkeyv2_parsemessage: required fields " "missing\n")); return (EINVAL); } } switch (((struct sadb_msg *)headers[0])->sadb_msg_type) { case SADB_UPDATE: if (((struct sadb_sa *)headers[SADB_EXT_SA])->sadb_sa_state != SADB_SASTATE_MATURE) { DPRINTF(("pfkeyv2_parsemessage: updating non-mature " "SA prohibited\n")); return (EINVAL); } break; case SADB_ADD: if (((struct sadb_sa *)headers[SADB_EXT_SA])->sadb_sa_state != SADB_SASTATE_MATURE) { DPRINTF(("pfkeyv2_parsemessage: adding non-mature " "SA prohibited\n")); return (EINVAL); } break; } return (0); }
171920.c
// REQUIRES: system-linux // RUN: clang -o %t %s -O3 -fno-inline // RUN: llvm-mctoll -d -I /usr/include/stdio.h %t // RUN: clang -o %t1 %t-dis.ll // RUN: %t1 2>&1 | FileCheck %s // CHECK: x > 0 // CHECK-EMPTY #include <stdio.h> typedef struct { int x; } Data; void test(Data *data) { if (data->x > 0) { printf("x > 0\n"); } else { printf("x <= 0\n"); } } int main() { Data data; data.x = 1 << 16; test(&data); }
923705.c
#include <ansi.h> inherit QUARRY; void create() { set_name(NOR + WHT "斑鸠" NOR, ({ "ban jiu", "ban", "jiu" })); set("long", WHT "这是一只小斑鸠,在田地间跳上跳下。\n" NOR); set("no_auto_kill", 1); set("aves", 1); set("age", 1); set("str", 5); set("dex", 28); set("max_qi", 120); set("max_jing", 120); set("combat_exp", 1000); set("power", 3); set_temp("apply/dodge", 60); set_temp("apply/defense", 60); setup(); }
904043.c
/**************************************************************************** * arch/mips/src/mips32/up_blocktask.c * * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <[email protected]> * * 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 NuttX 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <stdbool.h> #include <sched.h> #include <syscall.h> #include <debug.h> #include <nuttx/arch.h> #include "os_internal.h" #include "up_internal.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: up_block_task * * Description: * The currently executing task at the head of * the ready to run list must be stopped. Save its context * and move it to the inactive list specified by task_state. * * Inputs: * tcb: Refers to a task in the ready-to-run list (normally * the task at the head of the list). It most be * stopped, its context saved and moved into one of the * waiting task lists. It it was the task at the head * of the ready-to-run list, then a context to the new * ready to run task must be performed. * task_state: Specifies which waiting task list should be * hold the blocked task TCB. * ****************************************************************************/ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && (tcb->task_state <= LAST_READY_TO_RUN_STATE)); /* Remove the tcb task from the ready-to-run list. If we * are blocking the task at the head of the task list (the * most likely case), then a context switch to the next * ready-to-run task is needed. In this case, it should * also be true that rtcb == tcb. */ switch_needed = sched_removereadytorun(tcb); /* Add the task to the specified blocked task list */ sched_addblocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the g_readytorun * task list now */ if (g_pendingtasks.head) { switch_needed |= sched_mergepending(); } /* Now, perform the context switch if one is needed */ if (switch_needed) { /* Are we in an interrupt handler? */ if (current_regs) { /* Yes, then we have to do things differently. * Just copy the current_regs into the OLD rtcb. */ up_savestate(rtcb->xcp.regs); /* Restore the exception context of the rtcb at the (new) head * of the g_readytorun task list. */ rtcb = (struct tcb_s*)g_readytorun.head; /* Then switch contexts */ up_restorestate(rtcb->xcp.regs); } /* No, then we will need to perform the user context switch */ else { /* Switch context to the context of the task at the head of the * ready to run list. */ struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); /* up_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. */ } } }
540702.c
/* * fs/dcache.c * * Complete reimplementation * (C) 1997 Thomas Schoebel-Theuer, * with heavy changes by Linus Torvalds */ /* * Notes on the allocation strategy: * * The dcache is a master of the icache - whenever a dcache entry * exists, the inode will always exist. "iput()" is done either when * the dcache entry is deleted or garbage collected. */ #include <linux/syscalls.h> #include <linux/string.h> #include <linux/mm.h> #include <linux/fs.h> #include <linux/fsnotify.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/hash.h> #include <linux/cache.h> #include <linux/export.h> #include <linux/mount.h> #include <linux/file.h> #include <asm/uaccess.h> #include <linux/security.h> #include <linux/seqlock.h> #include <linux/swap.h> #include <linux/bootmem.h> #include <linux/fs_struct.h> #include <linux/hardirq.h> #include <linux/bit_spinlock.h> #include <linux/rculist_bl.h> #include <linux/prefetch.h> #include <linux/ratelimit.h> #include <linux/list_lru.h> #include "internal.h" #include "mount.h" /* * Usage: * dcache->d_inode->i_lock protects: * - i_dentry, d_alias, d_inode of aliases * dcache_hash_bucket lock protects: * - the dcache hash table * s_anon bl list spinlock protects: * - the s_anon list (see __d_drop) * dentry->d_sb->s_dentry_lru_lock protects: * - the dcache lru lists and counters * d_lock protects: * - d_flags * - d_name * - d_lru * - d_count * - d_unhashed() * - d_parent and d_subdirs * - childrens' d_child and d_parent * - d_alias, d_inode * * Ordering: * dentry->d_inode->i_lock * dentry->d_lock * dentry->d_sb->s_dentry_lru_lock * dcache_hash_bucket lock * s_anon lock * * If there is an ancestor relationship: * dentry->d_parent->...->d_parent->d_lock * ... * dentry->d_parent->d_lock * dentry->d_lock * * If no ancestor relationship: * if (dentry1 < dentry2) * dentry1->d_lock * dentry2->d_lock */ int sysctl_vfs_cache_pressure __read_mostly = 100; EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); __cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock); EXPORT_SYMBOL(rename_lock); static struct kmem_cache *dentry_cache __read_mostly; /* * This is the single most critical data structure when it comes * to the dcache: the hashtable for lookups. Somebody should try * to make this good - I've just made it work. * * This hash-function tries to avoid losing too many bits of hash * information, yet avoid using a prime hash-size or similar. */ static unsigned int d_hash_mask __read_mostly; static unsigned int d_hash_shift __read_mostly; static struct hlist_bl_head *dentry_hashtable __read_mostly; static inline struct hlist_bl_head *d_hash(const struct dentry *parent, unsigned int hash) { hash += (unsigned long) parent / L1_CACHE_BYTES; hash = hash + (hash >> d_hash_shift); return dentry_hashtable + (hash & d_hash_mask); } /* Statistics gathering. */ struct dentry_stat_t dentry_stat = { .age_limit = 45, }; static DEFINE_PER_CPU(long, nr_dentry); static DEFINE_PER_CPU(long, nr_dentry_unused); #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) /* * Here we resort to our own counters instead of using generic per-cpu counters * for consistency with what the vfs inode code does. We are expected to harvest * better code and performance by having our own specialized counters. * * Please note that the loop is done over all possible CPUs, not over all online * CPUs. The reason for this is that we don't want to play games with CPUs going * on and off. If one of them goes off, we will just keep their counters. * * glommer: See cffbc8a for details, and if you ever intend to change this, * please update all vfs counters to match. */ static long get_nr_dentry(void) { int i; long sum = 0; for_each_possible_cpu(i) sum += per_cpu(nr_dentry, i); return sum < 0 ? 0 : sum; } static long get_nr_dentry_unused(void) { int i; long sum = 0; for_each_possible_cpu(i) sum += per_cpu(nr_dentry_unused, i); return sum < 0 ? 0 : sum; } int proc_nr_dentry(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { dentry_stat.nr_dentry = get_nr_dentry(); dentry_stat.nr_unused = get_nr_dentry_unused(); return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); } #endif /* * Compare 2 name strings, return 0 if they match, otherwise non-zero. * The strings are both count bytes long, and count is non-zero. */ #ifdef CONFIG_DCACHE_WORD_ACCESS #include <asm/word-at-a-time.h> /* * NOTE! 'cs' and 'scount' come from a dentry, so it has a * aligned allocation for this particular component. We don't * strictly need the load_unaligned_zeropad() safety, but it * doesn't hurt either. * * In contrast, 'ct' and 'tcount' can be from a pathname, and do * need the careful unaligned handling. */ static inline int dentry_string_cmp(const unsigned char *cs, const unsigned char *ct, unsigned tcount) { unsigned long a,b,mask; for (;;) { a = *(unsigned long *)cs; b = load_unaligned_zeropad(ct); if (tcount < sizeof(unsigned long)) break; if (unlikely(a != b)) return 1; cs += sizeof(unsigned long); ct += sizeof(unsigned long); tcount -= sizeof(unsigned long); if (!tcount) return 0; } mask = bytemask_from_count(tcount); return unlikely(!!((a ^ b) & mask)); } #else static inline int dentry_string_cmp(const unsigned char *cs, const unsigned char *ct, unsigned tcount) { do { if (*cs != *ct) return 1; cs++; ct++; tcount--; } while (tcount); return 0; } #endif static inline int dentry_cmp(const struct dentry *dentry, const unsigned char *ct, unsigned tcount) { const unsigned char *cs; /* * Be careful about RCU walk racing with rename: * use ACCESS_ONCE to fetch the name pointer. * * NOTE! Even if a rename will mean that the length * was not loaded atomically, we don't care. The * RCU walk will check the sequence count eventually, * and catch it. And we won't overrun the buffer, * because we're reading the name pointer atomically, * and a dentry name is guaranteed to be properly * terminated with a NUL byte. * * End result: even if 'len' is wrong, we'll exit * early because the data cannot match (there can * be no NUL in the ct/tcount data) */ cs = ACCESS_ONCE(dentry->d_name.name); smp_read_barrier_depends(); return dentry_string_cmp(cs, ct, tcount); } static void __d_free(struct rcu_head *head) { struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); WARN_ON(!hlist_unhashed(&dentry->d_alias)); if (dname_external(dentry)) kfree(dentry->d_name.name); kmem_cache_free(dentry_cache, dentry); } /* * no locks, please. */ static void d_free(struct dentry *dentry) { BUG_ON((int)dentry->d_lockref.count > 0); this_cpu_dec(nr_dentry); if (dentry->d_op && dentry->d_op->d_release) dentry->d_op->d_release(dentry); /* if dentry was never visible to RCU, immediate free is OK */ if (!(dentry->d_flags & DCACHE_RCUACCESS)) __d_free(&dentry->d_u.d_rcu); else call_rcu(&dentry->d_u.d_rcu, __d_free); } /** * dentry_rcuwalk_barrier - invalidate in-progress rcu-walk lookups * @dentry: the target dentry * After this call, in-progress rcu-walk path lookup will fail. This * should be called after unhashing, and after changing d_inode (if * the dentry has not already been unhashed). */ static inline void dentry_rcuwalk_barrier(struct dentry *dentry) { assert_spin_locked(&dentry->d_lock); /* Go through a barrier */ write_seqcount_barrier(&dentry->d_seq); } /* * Release the dentry's inode, using the filesystem * d_iput() operation if defined. Dentry has no refcount * and is unhashed. */ static void dentry_iput(struct dentry * dentry) __releases(dentry->d_lock) __releases(dentry->d_inode->i_lock) { struct inode *inode = dentry->d_inode; if (inode) { dentry->d_inode = NULL; hlist_del_init(&dentry->d_alias); spin_unlock(&dentry->d_lock); spin_unlock(&inode->i_lock); if (!inode->i_nlink) fsnotify_inoderemove(inode); if (dentry->d_op && dentry->d_op->d_iput) dentry->d_op->d_iput(dentry, inode); else iput(inode); } else { spin_unlock(&dentry->d_lock); } } /* * Release the dentry's inode, using the filesystem * d_iput() operation if defined. dentry remains in-use. */ static void dentry_unlink_inode(struct dentry * dentry) __releases(dentry->d_lock) __releases(dentry->d_inode->i_lock) { struct inode *inode = dentry->d_inode; __d_clear_type(dentry); dentry->d_inode = NULL; hlist_del_init(&dentry->d_alias); dentry_rcuwalk_barrier(dentry); spin_unlock(&dentry->d_lock); spin_unlock(&inode->i_lock); if (!inode->i_nlink) fsnotify_inoderemove(inode); if (dentry->d_op && dentry->d_op->d_iput) dentry->d_op->d_iput(dentry, inode); else iput(inode); } /* * The DCACHE_LRU_LIST bit is set whenever the 'd_lru' entry * is in use - which includes both the "real" per-superblock * LRU list _and_ the DCACHE_SHRINK_LIST use. * * The DCACHE_SHRINK_LIST bit is set whenever the dentry is * on the shrink list (ie not on the superblock LRU list). * * The per-cpu "nr_dentry_unused" counters are updated with * the DCACHE_LRU_LIST bit. * * These helper functions make sure we always follow the * rules. d_lock must be held by the caller. */ #define D_FLAG_VERIFY(dentry,x) WARN_ON_ONCE(((dentry)->d_flags & (DCACHE_LRU_LIST | DCACHE_SHRINK_LIST)) != (x)) static void d_lru_add(struct dentry *dentry) { D_FLAG_VERIFY(dentry, 0); dentry->d_flags |= DCACHE_LRU_LIST; this_cpu_inc(nr_dentry_unused); WARN_ON_ONCE(!list_lru_add(&dentry->d_sb->s_dentry_lru, &dentry->d_lru)); } static void d_lru_del(struct dentry *dentry) { D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST); dentry->d_flags &= ~DCACHE_LRU_LIST; this_cpu_dec(nr_dentry_unused); WARN_ON_ONCE(!list_lru_del(&dentry->d_sb->s_dentry_lru, &dentry->d_lru)); } static void d_shrink_del(struct dentry *dentry) { D_FLAG_VERIFY(dentry, DCACHE_SHRINK_LIST | DCACHE_LRU_LIST); list_del_init(&dentry->d_lru); dentry->d_flags &= ~(DCACHE_SHRINK_LIST | DCACHE_LRU_LIST); this_cpu_dec(nr_dentry_unused); } static void d_shrink_add(struct dentry *dentry, struct list_head *list) { D_FLAG_VERIFY(dentry, 0); list_add(&dentry->d_lru, list); dentry->d_flags |= DCACHE_SHRINK_LIST | DCACHE_LRU_LIST; this_cpu_inc(nr_dentry_unused); } /* * These can only be called under the global LRU lock, ie during the * callback for freeing the LRU list. "isolate" removes it from the * LRU lists entirely, while shrink_move moves it to the indicated * private list. */ static void d_lru_isolate(struct dentry *dentry) { D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST); dentry->d_flags &= ~DCACHE_LRU_LIST; this_cpu_dec(nr_dentry_unused); list_del_init(&dentry->d_lru); } static void d_lru_shrink_move(struct dentry *dentry, struct list_head *list) { D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST); dentry->d_flags |= DCACHE_SHRINK_LIST; list_move_tail(&dentry->d_lru, list); } /* * dentry_lru_(add|del)_list) must be called with d_lock held. */ static void dentry_lru_add(struct dentry *dentry) { if (unlikely(!(dentry->d_flags & DCACHE_LRU_LIST))) d_lru_add(dentry); } /* * Remove a dentry with references from the LRU. * * If we are on the shrink list, then we can get to try_prune_one_dentry() and * lose our last reference through the parent walk. In this case, we need to * remove ourselves from the shrink list, not the LRU. */ static void dentry_lru_del(struct dentry *dentry) { if (dentry->d_flags & DCACHE_LRU_LIST) { if (dentry->d_flags & DCACHE_SHRINK_LIST) return d_shrink_del(dentry); d_lru_del(dentry); } } /** * d_kill - kill dentry and return parent * @dentry: dentry to kill * @parent: parent dentry * * The dentry must already be unhashed and removed from the LRU. * * If this is the root of the dentry tree, return NULL. * * dentry->d_lock and parent->d_lock must be held by caller, and are dropped by * d_kill. */ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) __releases(dentry->d_lock) __releases(parent->d_lock) __releases(dentry->d_inode->i_lock) { list_del(&dentry->d_u.d_child); /* * Inform d_walk() that we are no longer attached to the * dentry tree */ dentry->d_flags |= DCACHE_DENTRY_KILLED; if (parent) spin_unlock(&parent->d_lock); dentry_iput(dentry); /* * dentry_iput drops the locks, at which point nobody (except * transient RCU lookups) can reach this dentry. */ d_free(dentry); return parent; } /** * d_drop - drop a dentry * @dentry: dentry to drop * * d_drop() unhashes the entry from the parent dentry hashes, so that it won't * be found through a VFS lookup any more. Note that this is different from * deleting the dentry - d_delete will try to mark the dentry negative if * possible, giving a successful _negative_ lookup, while d_drop will * just make the cache lookup fail. * * d_drop() is used mainly for stuff that wants to invalidate a dentry for some * reason (NFS timeouts or autofs deletes). * * __d_drop requires dentry->d_lock. */ void __d_drop(struct dentry *dentry) { if (!d_unhashed(dentry)) { struct hlist_bl_head *b; /* * Hashed dentries are normally on the dentry hashtable, * with the exception of those newly allocated by * d_obtain_alias, which are always IS_ROOT: */ if (unlikely(IS_ROOT(dentry))) b = &dentry->d_sb->s_anon; else b = d_hash(dentry->d_parent, dentry->d_name.hash); hlist_bl_lock(b); __hlist_bl_del(&dentry->d_hash); dentry->d_hash.pprev = NULL; hlist_bl_unlock(b); dentry_rcuwalk_barrier(dentry); } } EXPORT_SYMBOL(__d_drop); void d_drop(struct dentry *dentry) { spin_lock(&dentry->d_lock); __d_drop(dentry); spin_unlock(&dentry->d_lock); } EXPORT_SYMBOL(d_drop); /* * Finish off a dentry we've decided to kill. * dentry->d_lock must be held, returns with it unlocked. * If ref is non-zero, then decrement the refcount too. * Returns dentry requiring refcount drop, or NULL if we're done. */ static struct dentry * dentry_kill(struct dentry *dentry, int unlock_on_failure) __releases(dentry->d_lock) { struct inode *inode; struct dentry *parent; inode = dentry->d_inode; if (inode && !spin_trylock(&inode->i_lock)) { relock: if (unlock_on_failure) { spin_unlock(&dentry->d_lock); cpu_relax(); } return dentry; /* try again with same dentry */ } if (IS_ROOT(dentry)) parent = NULL; else parent = dentry->d_parent; if (parent && !spin_trylock(&parent->d_lock)) { if (inode) spin_unlock(&inode->i_lock); goto relock; } /* * The dentry is now unrecoverably dead to the world. */ lockref_mark_dead(&dentry->d_lockref); /* * inform the fs via d_prune that this dentry is about to be * unhashed and destroyed. */ if ((dentry->d_flags & DCACHE_OP_PRUNE) && !d_unhashed(dentry)) dentry->d_op->d_prune(dentry); dentry_lru_del(dentry); /* if it was on the hash then remove it */ __d_drop(dentry); return d_kill(dentry, parent); } /* * This is dput * * This is complicated by the fact that we do not want to put * dentries that are no longer on any hash chain on the unused * list: we'd much rather just get rid of them immediately. * * However, that implies that we have to traverse the dentry * tree upwards to the parents which might _also_ now be * scheduled for deletion (it may have been only waiting for * its last child to go away). * * This tail recursion is done by hand as we don't want to depend * on the compiler to always get this right (gcc generally doesn't). * Real recursion would eat up our stack space. */ /* * dput - release a dentry * @dentry: dentry to release * * Release a dentry. This will drop the usage count and if appropriate * call the dentry unlink method as well as removing it from the queues and * releasing its resources. If the parent dentries were scheduled for release * they too may now get deleted. */ void dput(struct dentry *dentry) { if (unlikely(!dentry)) return; repeat: if (lockref_put_or_lock(&dentry->d_lockref)) return; /* Unreachable? Get rid of it */ if (unlikely(d_unhashed(dentry))) goto kill_it; if (unlikely(dentry->d_flags & DCACHE_OP_DELETE)) { if (dentry->d_op->d_delete(dentry)) goto kill_it; } if (!(dentry->d_flags & DCACHE_REFERENCED)) dentry->d_flags |= DCACHE_REFERENCED; dentry_lru_add(dentry); dentry->d_lockref.count--; spin_unlock(&dentry->d_lock); return; kill_it: dentry = dentry_kill(dentry, 1); if (dentry) goto repeat; } EXPORT_SYMBOL(dput); /** * d_invalidate - invalidate a dentry * @dentry: dentry to invalidate * * Try to invalidate the dentry if it turns out to be * possible. If there are other dentries that can be * reached through this one we can't delete it and we * return -EBUSY. On success we return 0. * * no dcache lock. */ int d_invalidate(struct dentry * dentry) { /* * If it's already been dropped, return OK. */ spin_lock(&dentry->d_lock); if (d_unhashed(dentry)) { spin_unlock(&dentry->d_lock); return 0; } /* * Check whether to do a partial shrink_dcache * to get rid of unused child entries. */ if (!list_empty(&dentry->d_subdirs)) { spin_unlock(&dentry->d_lock); shrink_dcache_parent(dentry); spin_lock(&dentry->d_lock); } /* * Somebody else still using it? * * If it's a directory, we can't drop it * for fear of somebody re-populating it * with children (even though dropping it * would make it unreachable from the root, * we might still populate it if it was a * working directory or similar). * We also need to leave mountpoints alone, * directory or not. */ if (dentry->d_lockref.count > 1 && dentry->d_inode) { if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) { spin_unlock(&dentry->d_lock); return -EBUSY; } } __d_drop(dentry); spin_unlock(&dentry->d_lock); return 0; } EXPORT_SYMBOL(d_invalidate); /* This must be called with d_lock held */ static inline void __dget_dlock(struct dentry *dentry) { dentry->d_lockref.count++; } static inline void __dget(struct dentry *dentry) { lockref_get(&dentry->d_lockref); } struct dentry *dget_parent(struct dentry *dentry) { int gotref; struct dentry *ret; /* * Do optimistic parent lookup without any * locking. */ rcu_read_lock(); ret = ACCESS_ONCE(dentry->d_parent); gotref = lockref_get_not_zero(&ret->d_lockref); rcu_read_unlock(); if (likely(gotref)) { if (likely(ret == ACCESS_ONCE(dentry->d_parent))) return ret; dput(ret); } repeat: /* * Don't need rcu_dereference because we re-check it was correct under * the lock. */ rcu_read_lock(); ret = dentry->d_parent; spin_lock(&ret->d_lock); if (unlikely(ret != dentry->d_parent)) { spin_unlock(&ret->d_lock); rcu_read_unlock(); goto repeat; } rcu_read_unlock(); BUG_ON(!ret->d_lockref.count); ret->d_lockref.count++; spin_unlock(&ret->d_lock); return ret; } EXPORT_SYMBOL(dget_parent); /** * d_find_alias - grab a hashed alias of inode * @inode: inode in question * @want_discon: flag, used by d_splice_alias, to request * that only a DISCONNECTED alias be returned. * * If inode has a hashed alias, or is a directory and has any alias, * acquire the reference to alias and return it. Otherwise return NULL. * Notice that if inode is a directory there can be only one alias and * it can be unhashed only if it has no children, or if it is the root * of a filesystem. * * If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer * any other hashed alias over that one unless @want_discon is set, * in which case only return an IS_ROOT, DCACHE_DISCONNECTED alias. */ static struct dentry *__d_find_alias(struct inode *inode, int want_discon) { struct dentry *alias, *discon_alias; again: discon_alias = NULL; hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { spin_lock(&alias->d_lock); if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) { if (IS_ROOT(alias) && (alias->d_flags & DCACHE_DISCONNECTED)) { discon_alias = alias; } else if (!want_discon) { __dget_dlock(alias); spin_unlock(&alias->d_lock); return alias; } } spin_unlock(&alias->d_lock); } if (discon_alias) { alias = discon_alias; spin_lock(&alias->d_lock); if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) { if (IS_ROOT(alias) && (alias->d_flags & DCACHE_DISCONNECTED)) { __dget_dlock(alias); spin_unlock(&alias->d_lock); return alias; } } spin_unlock(&alias->d_lock); goto again; } return NULL; } struct dentry *d_find_alias(struct inode *inode) { struct dentry *de = NULL; if (!hlist_empty(&inode->i_dentry)) { spin_lock(&inode->i_lock); de = __d_find_alias(inode, 0); spin_unlock(&inode->i_lock); } return de; } EXPORT_SYMBOL(d_find_alias); /* * Try to kill dentries associated with this inode. * WARNING: you must own a reference to inode. */ void d_prune_aliases(struct inode *inode) { struct dentry *dentry; restart: spin_lock(&inode->i_lock); hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { spin_lock(&dentry->d_lock); if (!dentry->d_lockref.count) { /* * inform the fs via d_prune that this dentry * is about to be unhashed and destroyed. */ if ((dentry->d_flags & DCACHE_OP_PRUNE) && !d_unhashed(dentry)) dentry->d_op->d_prune(dentry); __dget_dlock(dentry); __d_drop(dentry); spin_unlock(&dentry->d_lock); spin_unlock(&inode->i_lock); dput(dentry); goto restart; } spin_unlock(&dentry->d_lock); } spin_unlock(&inode->i_lock); } EXPORT_SYMBOL(d_prune_aliases); /* * Try to throw away a dentry - free the inode, dput the parent. * Requires dentry->d_lock is held, and dentry->d_count == 0. * Releases dentry->d_lock. * * This may fail if locks cannot be acquired no problem, just try again. */ static struct dentry * try_prune_one_dentry(struct dentry *dentry) __releases(dentry->d_lock) { struct dentry *parent; parent = dentry_kill(dentry, 0); /* * If dentry_kill returns NULL, we have nothing more to do. * if it returns the same dentry, trylocks failed. In either * case, just loop again. * * Otherwise, we need to prune ancestors too. This is necessary * to prevent quadratic behavior of shrink_dcache_parent(), but * is also expected to be beneficial in reducing dentry cache * fragmentation. */ if (!parent) return NULL; if (parent == dentry) return dentry; /* Prune ancestors. */ dentry = parent; while (dentry) { if (lockref_put_or_lock(&dentry->d_lockref)) return NULL; dentry = dentry_kill(dentry, 1); } return NULL; } static void shrink_dentry_list(struct list_head *list) { struct dentry *dentry; rcu_read_lock(); for (;;) { dentry = list_entry_rcu(list->prev, struct dentry, d_lru); if (&dentry->d_lru == list) break; /* empty */ /* * Get the dentry lock, and re-verify that the dentry is * this on the shrinking list. If it is, we know that * DCACHE_SHRINK_LIST and DCACHE_LRU_LIST are set. */ spin_lock(&dentry->d_lock); if (dentry != list_entry(list->prev, struct dentry, d_lru)) { spin_unlock(&dentry->d_lock); continue; } /* * The dispose list is isolated and dentries are not accounted * to the LRU here, so we can simply remove it from the list * here regardless of whether it is referenced or not. */ d_shrink_del(dentry); /* * We found an inuse dentry which was not removed from * the LRU because of laziness during lookup. Do not free it. */ if (dentry->d_lockref.count) { spin_unlock(&dentry->d_lock); continue; } rcu_read_unlock(); /* * If 'try_to_prune()' returns a dentry, it will * be the same one we passed in, and d_lock will * have been held the whole time, so it will not * have been added to any other lists. We failed * to get the inode lock. * * We just add it back to the shrink list. */ dentry = try_prune_one_dentry(dentry); rcu_read_lock(); if (dentry) { d_shrink_add(dentry, list); spin_unlock(&dentry->d_lock); } } rcu_read_unlock(); } static enum lru_status dentry_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg) { struct list_head *freeable = arg; struct dentry *dentry = container_of(item, struct dentry, d_lru); /* * we are inverting the lru lock/dentry->d_lock here, * so use a trylock. If we fail to get the lock, just skip * it */ if (!spin_trylock(&dentry->d_lock)) return LRU_SKIP; /* * Referenced dentries are still in use. If they have active * counts, just remove them from the LRU. Otherwise give them * another pass through the LRU. */ if (dentry->d_lockref.count) { d_lru_isolate(dentry); spin_unlock(&dentry->d_lock); return LRU_REMOVED; } if (dentry->d_flags & DCACHE_REFERENCED) { dentry->d_flags &= ~DCACHE_REFERENCED; spin_unlock(&dentry->d_lock); /* * The list move itself will be made by the common LRU code. At * this point, we've dropped the dentry->d_lock but keep the * lru lock. This is safe to do, since every list movement is * protected by the lru lock even if both locks are held. * * This is guaranteed by the fact that all LRU management * functions are intermediated by the LRU API calls like * list_lru_add and list_lru_del. List movement in this file * only ever occur through this functions or through callbacks * like this one, that are called from the LRU API. * * The only exceptions to this are functions like * shrink_dentry_list, and code that first checks for the * DCACHE_SHRINK_LIST flag. Those are guaranteed to be * operating only with stack provided lists after they are * properly isolated from the main list. It is thus, always a * local access. */ return LRU_ROTATE; } d_lru_shrink_move(dentry, freeable); spin_unlock(&dentry->d_lock); return LRU_REMOVED; } /** * prune_dcache_sb - shrink the dcache * @sb: superblock * @nr_to_scan : number of entries to try to free * @nid: which node to scan for freeable entities * * Attempt to shrink the superblock dcache LRU by @nr_to_scan entries. This is * done when we need more memory an called from the superblock shrinker * function. * * This function may fail to free any resources if all the dentries are in * use. */ long prune_dcache_sb(struct super_block *sb, unsigned long nr_to_scan, int nid) { LIST_HEAD(dispose); long freed; freed = list_lru_walk_node(&sb->s_dentry_lru, nid, dentry_lru_isolate, &dispose, &nr_to_scan); shrink_dentry_list(&dispose); return freed; } static enum lru_status dentry_lru_isolate_shrink(struct list_head *item, spinlock_t *lru_lock, void *arg) { struct list_head *freeable = arg; struct dentry *dentry = container_of(item, struct dentry, d_lru); /* * we are inverting the lru lock/dentry->d_lock here, * so use a trylock. If we fail to get the lock, just skip * it */ if (!spin_trylock(&dentry->d_lock)) return LRU_SKIP; d_lru_shrink_move(dentry, freeable); spin_unlock(&dentry->d_lock); return LRU_REMOVED; } /** * shrink_dcache_sb - shrink dcache for a superblock * @sb: superblock * * Shrink the dcache for the specified super block. This is used to free * the dcache before unmounting a file system. */ void shrink_dcache_sb(struct super_block *sb) { long freed; do { LIST_HEAD(dispose); freed = list_lru_walk(&sb->s_dentry_lru, dentry_lru_isolate_shrink, &dispose, UINT_MAX); this_cpu_sub(nr_dentry_unused, freed); shrink_dentry_list(&dispose); } while (freed > 0); } EXPORT_SYMBOL(shrink_dcache_sb); /** * enum d_walk_ret - action to talke during tree walk * @D_WALK_CONTINUE: contrinue walk * @D_WALK_QUIT: quit walk * @D_WALK_NORETRY: quit when retry is needed * @D_WALK_SKIP: skip this dentry and its children */ enum d_walk_ret { D_WALK_CONTINUE, D_WALK_QUIT, D_WALK_NORETRY, D_WALK_SKIP, }; /** * d_walk - walk the dentry tree * @parent: start of walk * @data: data passed to @enter() and @finish() * @enter: callback when first entering the dentry * @finish: callback when successfully finished the walk * * The @enter() and @finish() callbacks are called with d_lock held. */ static void d_walk(struct dentry *parent, void *data, enum d_walk_ret (*enter)(void *, struct dentry *), void (*finish)(void *)) { struct dentry *this_parent; struct list_head *next; unsigned seq = 0; enum d_walk_ret ret; bool retry = true; again: read_seqbegin_or_lock(&rename_lock, &seq); this_parent = parent; spin_lock(&this_parent->d_lock); ret = enter(data, this_parent); switch (ret) { case D_WALK_CONTINUE: break; case D_WALK_QUIT: case D_WALK_SKIP: goto out_unlock; case D_WALK_NORETRY: retry = false; break; } repeat: next = this_parent->d_subdirs.next; resume: while (next != &this_parent->d_subdirs) { struct list_head *tmp = next; struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child); next = tmp->next; spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); ret = enter(data, dentry); switch (ret) { case D_WALK_CONTINUE: break; case D_WALK_QUIT: spin_unlock(&dentry->d_lock); goto out_unlock; case D_WALK_NORETRY: retry = false; break; case D_WALK_SKIP: spin_unlock(&dentry->d_lock); continue; } if (!list_empty(&dentry->d_subdirs)) { spin_unlock(&this_parent->d_lock); spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_); this_parent = dentry; spin_acquire(&this_parent->d_lock.dep_map, 0, 1, _RET_IP_); goto repeat; } spin_unlock(&dentry->d_lock); } /* * All done at this level ... ascend and resume the search. */ if (this_parent != parent) { struct dentry *child = this_parent; this_parent = child->d_parent; rcu_read_lock(); spin_unlock(&child->d_lock); spin_lock(&this_parent->d_lock); /* * might go back up the wrong parent if we have had a rename * or deletion */ if (this_parent != child->d_parent || (child->d_flags & DCACHE_DENTRY_KILLED) || need_seqretry(&rename_lock, seq)) { spin_unlock(&this_parent->d_lock); rcu_read_unlock(); goto rename_retry; } rcu_read_unlock(); next = child->d_u.d_child.next; goto resume; } if (need_seqretry(&rename_lock, seq)) { spin_unlock(&this_parent->d_lock); goto rename_retry; } if (finish) finish(data); out_unlock: spin_unlock(&this_parent->d_lock); done_seqretry(&rename_lock, seq); return; rename_retry: if (!retry) return; seq = 1; goto again; } /* * Search for at least 1 mount point in the dentry's subdirs. * We descend to the next level whenever the d_subdirs * list is non-empty and continue searching. */ static enum d_walk_ret check_mount(void *data, struct dentry *dentry) { int *ret = data; if (d_mountpoint(dentry)) { *ret = 1; return D_WALK_QUIT; } return D_WALK_CONTINUE; } /** * have_submounts - check for mounts over a dentry * @parent: dentry to check. * * Return true if the parent or its subdirectories contain * a mount point */ int have_submounts(struct dentry *parent) { int ret = 0; d_walk(parent, &ret, check_mount, NULL); return ret; } EXPORT_SYMBOL(have_submounts); /* * Called by mount code to set a mountpoint and check if the mountpoint is * reachable (e.g. NFS can unhash a directory dentry and then the complete * subtree can become unreachable). * * Only one of check_submounts_and_drop() and d_set_mounted() must succeed. For * this reason take rename_lock and d_lock on dentry and ancestors. */ int d_set_mounted(struct dentry *dentry) { struct dentry *p; int ret = -ENOENT; write_seqlock(&rename_lock); for (p = dentry->d_parent; !IS_ROOT(p); p = p->d_parent) { /* Need exclusion wrt. check_submounts_and_drop() */ spin_lock(&p->d_lock); if (unlikely(d_unhashed(p))) { spin_unlock(&p->d_lock); goto out; } spin_unlock(&p->d_lock); } spin_lock(&dentry->d_lock); if (!d_unlinked(dentry)) { dentry->d_flags |= DCACHE_MOUNTED; ret = 0; } spin_unlock(&dentry->d_lock); out: write_sequnlock(&rename_lock); return ret; } /* * Search the dentry child list of the specified parent, * and move any unused dentries to the end of the unused * list for prune_dcache(). We descend to the next level * whenever the d_subdirs list is non-empty and continue * searching. * * It returns zero iff there are no unused children, * otherwise it returns the number of children moved to * the end of the unused list. This may not be the total * number of unused children, because select_parent can * drop the lock and return early due to latency * constraints. */ struct select_data { struct dentry *start; struct list_head dispose; int found; }; static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) { struct select_data *data = _data; enum d_walk_ret ret = D_WALK_CONTINUE; if (data->start == dentry) goto out; /* * move only zero ref count dentries to the dispose list. * * Those which are presently on the shrink list, being processed * by shrink_dentry_list(), shouldn't be moved. Otherwise the * loop in shrink_dcache_parent() might not make any progress * and loop forever. */ if (dentry->d_lockref.count) { dentry_lru_del(dentry); } else if (!(dentry->d_flags & DCACHE_SHRINK_LIST)) { /* * We can't use d_lru_shrink_move() because we * need to get the global LRU lock and do the * LRU accounting. */ d_lru_del(dentry); d_shrink_add(dentry, &data->dispose); data->found++; ret = D_WALK_NORETRY; } /* * We can return to the caller if we have found some (this * ensures forward progress). We'll be coming back to find * the rest. */ if (data->found && need_resched()) ret = D_WALK_QUIT; out: return ret; } /** * shrink_dcache_parent - prune dcache * @parent: parent of entries to prune * * Prune the dcache to remove unused children of the parent dentry. */ void shrink_dcache_parent(struct dentry *parent) { for (;;) { struct select_data data; INIT_LIST_HEAD(&data.dispose); data.start = parent; data.found = 0; d_walk(parent, &data, select_collect, NULL); if (!data.found) break; shrink_dentry_list(&data.dispose); cond_resched(); } } EXPORT_SYMBOL(shrink_dcache_parent); static enum d_walk_ret umount_collect(void *_data, struct dentry *dentry) { struct select_data *data = _data; enum d_walk_ret ret = D_WALK_CONTINUE; if (dentry->d_lockref.count) { dentry_lru_del(dentry); if (likely(!list_empty(&dentry->d_subdirs))) goto out; if (dentry == data->start && dentry->d_lockref.count == 1) goto out; printk(KERN_ERR "BUG: Dentry %p{i=%lx,n=%s}" " still in use (%d)" " [unmount of %s %s]\n", dentry, dentry->d_inode ? dentry->d_inode->i_ino : 0UL, dentry->d_name.name, dentry->d_lockref.count, dentry->d_sb->s_type->name, dentry->d_sb->s_id); BUG(); } else if (!(dentry->d_flags & DCACHE_SHRINK_LIST)) { /* * We can't use d_lru_shrink_move() because we * need to get the global LRU lock and do the * LRU accounting. */ if (dentry->d_flags & DCACHE_LRU_LIST) d_lru_del(dentry); d_shrink_add(dentry, &data->dispose); data->found++; ret = D_WALK_NORETRY; } out: if (data->found && need_resched()) ret = D_WALK_QUIT; return ret; } /* * destroy the dentries attached to a superblock on unmounting */ void shrink_dcache_for_umount(struct super_block *sb) { struct dentry *dentry; if (down_read_trylock(&sb->s_umount)) BUG(); dentry = sb->s_root; sb->s_root = NULL; for (;;) { struct select_data data; INIT_LIST_HEAD(&data.dispose); data.start = dentry; data.found = 0; d_walk(dentry, &data, umount_collect, NULL); if (!data.found) break; shrink_dentry_list(&data.dispose); cond_resched(); } d_drop(dentry); dput(dentry); while (!hlist_bl_empty(&sb->s_anon)) { struct select_data data; dentry = hlist_bl_entry(hlist_bl_first(&sb->s_anon), struct dentry, d_hash); INIT_LIST_HEAD(&data.dispose); data.start = NULL; data.found = 0; d_walk(dentry, &data, umount_collect, NULL); if (data.found) shrink_dentry_list(&data.dispose); cond_resched(); } } static enum d_walk_ret check_and_collect(void *_data, struct dentry *dentry) { struct select_data *data = _data; if (d_mountpoint(dentry)) { data->found = -EBUSY; return D_WALK_QUIT; } return select_collect(_data, dentry); } static void check_and_drop(void *_data) { struct select_data *data = _data; if (d_mountpoint(data->start)) data->found = -EBUSY; if (!data->found) __d_drop(data->start); } /** * check_submounts_and_drop - prune dcache, check for submounts and drop * * All done as a single atomic operation relative to has_unlinked_ancestor(). * Returns 0 if successfully unhashed @parent. If there were submounts then * return -EBUSY. * * @dentry: dentry to prune and drop */ int check_submounts_and_drop(struct dentry *dentry) { int ret = 0; /* Negative dentries can be dropped without further checks */ if (!dentry->d_inode) { d_drop(dentry); goto out; } for (;;) { struct select_data data; INIT_LIST_HEAD(&data.dispose); data.start = dentry; data.found = 0; d_walk(dentry, &data, check_and_collect, check_and_drop); ret = data.found; if (!list_empty(&data.dispose)) shrink_dentry_list(&data.dispose); if (ret <= 0) break; cond_resched(); } out: return ret; } EXPORT_SYMBOL(check_submounts_and_drop); /** * __d_alloc - allocate a dcache entry * @sb: filesystem it will belong to * @name: qstr of the name * * Allocates a dentry. It returns %NULL if there is insufficient memory * available. On a success the dentry is returned. The name passed in is * copied and the copy passed in may be reused after this call. */ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) { struct dentry *dentry; char *dname; dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); if (!dentry) return NULL; /* * We guarantee that the inline name is always NUL-terminated. * This way the memcpy() done by the name switching in rename * will still always have a NUL at the end, even if we might * be overwriting an internal NUL character */ dentry->d_iname[DNAME_INLINE_LEN-1] = 0; if (name->len > DNAME_INLINE_LEN-1) { dname = kmalloc(name->len + 1, GFP_KERNEL); if (!dname) { kmem_cache_free(dentry_cache, dentry); return NULL; } } else { dname = dentry->d_iname; } dentry->d_name.len = name->len; dentry->d_name.hash = name->hash; memcpy(dname, name->name, name->len); dname[name->len] = 0; /* Make sure we always see the terminating NUL character */ smp_wmb(); dentry->d_name.name = dname; dentry->d_lockref.count = 1; dentry->d_flags = 0; spin_lock_init(&dentry->d_lock); seqcount_init(&dentry->d_seq); dentry->d_inode = NULL; dentry->d_parent = dentry; dentry->d_sb = sb; dentry->d_op = NULL; dentry->d_fsdata = NULL; INIT_HLIST_BL_NODE(&dentry->d_hash); INIT_LIST_HEAD(&dentry->d_lru); INIT_LIST_HEAD(&dentry->d_subdirs); INIT_HLIST_NODE(&dentry->d_alias); INIT_LIST_HEAD(&dentry->d_u.d_child); d_set_d_op(dentry, dentry->d_sb->s_d_op); this_cpu_inc(nr_dentry); return dentry; } /** * d_alloc - allocate a dcache entry * @parent: parent of entry to allocate * @name: qstr of the name * * Allocates a dentry. It returns %NULL if there is insufficient memory * available. On a success the dentry is returned. The name passed in is * copied and the copy passed in may be reused after this call. */ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name) { struct dentry *dentry = __d_alloc(parent->d_sb, name); if (!dentry) return NULL; spin_lock(&parent->d_lock); /* * don't need child lock because it is not subject * to concurrency here */ __dget_dlock(parent); dentry->d_parent = parent; list_add(&dentry->d_u.d_child, &parent->d_subdirs); spin_unlock(&parent->d_lock); return dentry; } EXPORT_SYMBOL(d_alloc); /** * d_alloc_pseudo - allocate a dentry (for lookup-less filesystems) * @sb: the superblock * @name: qstr of the name * * For a filesystem that just pins its dentries in memory and never * performs lookups at all, return an unhashed IS_ROOT dentry. */ struct dentry *d_alloc_pseudo(struct super_block *sb, const struct qstr *name) { return __d_alloc(sb, name); } EXPORT_SYMBOL(d_alloc_pseudo); struct dentry *d_alloc_name(struct dentry *parent, const char *name) { struct qstr q; q.name = name; q.len = strlen(name); q.hash = full_name_hash(q.name, q.len); return d_alloc(parent, &q); } EXPORT_SYMBOL(d_alloc_name); void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op) { WARN_ON_ONCE(dentry->d_op); WARN_ON_ONCE(dentry->d_flags & (DCACHE_OP_HASH | DCACHE_OP_COMPARE | DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE | DCACHE_OP_DELETE )); dentry->d_op = op; if (!op) return; if (op->d_hash) dentry->d_flags |= DCACHE_OP_HASH; if (op->d_compare) dentry->d_flags |= DCACHE_OP_COMPARE; if (op->d_revalidate) dentry->d_flags |= DCACHE_OP_REVALIDATE; if (op->d_weak_revalidate) dentry->d_flags |= DCACHE_OP_WEAK_REVALIDATE; if (op->d_delete) dentry->d_flags |= DCACHE_OP_DELETE; if (op->d_prune) dentry->d_flags |= DCACHE_OP_PRUNE; } EXPORT_SYMBOL(d_set_d_op); static unsigned d_flags_for_inode(struct inode *inode) { unsigned add_flags = DCACHE_FILE_TYPE; if (!inode) return DCACHE_MISS_TYPE; if (S_ISDIR(inode->i_mode)) { add_flags = DCACHE_DIRECTORY_TYPE; if (unlikely(!(inode->i_opflags & IOP_LOOKUP))) { if (unlikely(!inode->i_op->lookup)) add_flags = DCACHE_AUTODIR_TYPE; else inode->i_opflags |= IOP_LOOKUP; } } else if (unlikely(!(inode->i_opflags & IOP_NOFOLLOW))) { if (unlikely(inode->i_op->follow_link)) add_flags = DCACHE_SYMLINK_TYPE; else inode->i_opflags |= IOP_NOFOLLOW; } if (unlikely(IS_AUTOMOUNT(inode))) add_flags |= DCACHE_NEED_AUTOMOUNT; return add_flags; } static void __d_instantiate(struct dentry *dentry, struct inode *inode) { unsigned add_flags = d_flags_for_inode(inode); spin_lock(&dentry->d_lock); dentry->d_flags &= ~DCACHE_ENTRY_TYPE; dentry->d_flags |= add_flags; if (inode) hlist_add_head(&dentry->d_alias, &inode->i_dentry); dentry->d_inode = inode; dentry_rcuwalk_barrier(dentry); spin_unlock(&dentry->d_lock); fsnotify_d_instantiate(dentry, inode); } /** * d_instantiate - fill in inode information for a dentry * @entry: dentry to complete * @inode: inode to attach to this dentry * * Fill in inode information in the entry. * * This turns negative dentries into productive full members * of society. * * NOTE! This assumes that the inode count has been incremented * (or otherwise set) by the caller to indicate that it is now * in use by the dcache. */ void d_instantiate(struct dentry *entry, struct inode * inode) { BUG_ON(!hlist_unhashed(&entry->d_alias)); if (inode) spin_lock(&inode->i_lock); __d_instantiate(entry, inode); if (inode) spin_unlock(&inode->i_lock); security_d_instantiate(entry, inode); } EXPORT_SYMBOL(d_instantiate); /** * d_instantiate_unique - instantiate a non-aliased dentry * @entry: dentry to instantiate * @inode: inode to attach to this dentry * * Fill in inode information in the entry. On success, it returns NULL. * If an unhashed alias of "entry" already exists, then we return the * aliased dentry instead and drop one reference to inode. * * Note that in order to avoid conflicts with rename() etc, the caller * had better be holding the parent directory semaphore. * * This also assumes that the inode count has been incremented * (or otherwise set) by the caller to indicate that it is now * in use by the dcache. */ static struct dentry *__d_instantiate_unique(struct dentry *entry, struct inode *inode) { struct dentry *alias; int len = entry->d_name.len; const char *name = entry->d_name.name; unsigned int hash = entry->d_name.hash; if (!inode) { __d_instantiate(entry, NULL); return NULL; } hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { /* * Don't need alias->d_lock here, because aliases with * d_parent == entry->d_parent are not subject to name or * parent changes, because the parent inode i_mutex is held. */ if (alias->d_name.hash != hash) continue; if (alias->d_parent != entry->d_parent) continue; if (alias->d_name.len != len) continue; if (dentry_cmp(alias, name, len)) continue; __dget(alias); return alias; } __d_instantiate(entry, inode); return NULL; } struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode) { struct dentry *result; BUG_ON(!hlist_unhashed(&entry->d_alias)); if (inode) spin_lock(&inode->i_lock); result = __d_instantiate_unique(entry, inode); if (inode) spin_unlock(&inode->i_lock); if (!result) { security_d_instantiate(entry, inode); return NULL; } BUG_ON(!d_unhashed(result)); iput(inode); return result; } EXPORT_SYMBOL(d_instantiate_unique); /** * d_instantiate_no_diralias - instantiate a non-aliased dentry * @entry: dentry to complete * @inode: inode to attach to this dentry * * Fill in inode information in the entry. If a directory alias is found, then * return an error (and drop inode). Together with d_materialise_unique() this * guarantees that a directory inode may never have more than one alias. */ int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode) { BUG_ON(!hlist_unhashed(&entry->d_alias)); spin_lock(&inode->i_lock); if (S_ISDIR(inode->i_mode) && !hlist_empty(&inode->i_dentry)) { spin_unlock(&inode->i_lock); iput(inode); return -EBUSY; } __d_instantiate(entry, inode); spin_unlock(&inode->i_lock); security_d_instantiate(entry, inode); return 0; } EXPORT_SYMBOL(d_instantiate_no_diralias); struct dentry *d_make_root(struct inode *root_inode) { struct dentry *res = NULL; if (root_inode) { static const struct qstr name = QSTR_INIT("/", 1); res = __d_alloc(root_inode->i_sb, &name); if (res) d_instantiate(res, root_inode); else iput(root_inode); } return res; } EXPORT_SYMBOL(d_make_root); static struct dentry * __d_find_any_alias(struct inode *inode) { struct dentry *alias; if (hlist_empty(&inode->i_dentry)) return NULL; alias = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); __dget(alias); return alias; } /** * d_find_any_alias - find any alias for a given inode * @inode: inode to find an alias for * * If any aliases exist for the given inode, take and return a * reference for one of them. If no aliases exist, return %NULL. */ struct dentry *d_find_any_alias(struct inode *inode) { struct dentry *de; spin_lock(&inode->i_lock); de = __d_find_any_alias(inode); spin_unlock(&inode->i_lock); return de; } EXPORT_SYMBOL(d_find_any_alias); /** * d_obtain_alias - find or allocate a dentry for a given inode * @inode: inode to allocate the dentry for * * Obtain a dentry for an inode resulting from NFS filehandle conversion or * similar open by handle operations. The returned dentry may be anonymous, * or may have a full name (if the inode was already in the cache). * * When called on a directory inode, we must ensure that the inode only ever * has one dentry. If a dentry is found, that is returned instead of * allocating a new one. * * On successful return, the reference to the inode has been transferred * to the dentry. In case of an error the reference on the inode is released. * To make it easier to use in export operations a %NULL or IS_ERR inode may * be passed in and will be the error will be propagate to the return value, * with a %NULL @inode replaced by ERR_PTR(-ESTALE). */ struct dentry *d_obtain_alias(struct inode *inode) { static const struct qstr anonstring = QSTR_INIT("/", 1); struct dentry *tmp; struct dentry *res; unsigned add_flags; if (!inode) return ERR_PTR(-ESTALE); if (IS_ERR(inode)) return ERR_CAST(inode); res = d_find_any_alias(inode); if (res) goto out_iput; tmp = __d_alloc(inode->i_sb, &anonstring); if (!tmp) { res = ERR_PTR(-ENOMEM); goto out_iput; } spin_lock(&inode->i_lock); res = __d_find_any_alias(inode); if (res) { spin_unlock(&inode->i_lock); dput(tmp); goto out_iput; } /* attach a disconnected dentry */ add_flags = d_flags_for_inode(inode) | DCACHE_DISCONNECTED; spin_lock(&tmp->d_lock); tmp->d_inode = inode; tmp->d_flags |= add_flags; hlist_add_head(&tmp->d_alias, &inode->i_dentry); hlist_bl_lock(&tmp->d_sb->s_anon); hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon); hlist_bl_unlock(&tmp->d_sb->s_anon); spin_unlock(&tmp->d_lock); spin_unlock(&inode->i_lock); security_d_instantiate(tmp, inode); return tmp; out_iput: if (res && !IS_ERR(res)) security_d_instantiate(res, inode); iput(inode); return res; } EXPORT_SYMBOL(d_obtain_alias); /** * d_splice_alias - splice a disconnected dentry into the tree if one exists * @inode: the inode which may have a disconnected dentry * @dentry: a negative dentry which we want to point to the inode. * * If inode is a directory and has a 'disconnected' dentry (i.e. IS_ROOT and * DCACHE_DISCONNECTED), then d_move that in place of the given dentry * and return it, else simply d_add the inode to the dentry and return NULL. * * This is needed in the lookup routine of any filesystem that is exportable * (via knfsd) so that we can build dcache paths to directories effectively. * * If a dentry was found and moved, then it is returned. Otherwise NULL * is returned. This matches the expected return value of ->lookup. * * Cluster filesystems may call this function with a negative, hashed dentry. * In that case, we know that the inode will be a regular file, and also this * will only occur during atomic_open. So we need to check for the dentry * being already hashed only in the final case. */ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) { struct dentry *new = NULL; if (IS_ERR(inode)) return ERR_CAST(inode); if (inode && S_ISDIR(inode->i_mode)) { spin_lock(&inode->i_lock); new = __d_find_alias(inode, 1); if (new) { BUG_ON(!(new->d_flags & DCACHE_DISCONNECTED)); spin_unlock(&inode->i_lock); security_d_instantiate(new, inode); d_move(new, dentry); iput(inode); } else { /* already taking inode->i_lock, so d_add() by hand */ __d_instantiate(dentry, inode); spin_unlock(&inode->i_lock); security_d_instantiate(dentry, inode); d_rehash(dentry); } } else { d_instantiate(dentry, inode); if (d_unhashed(dentry)) d_rehash(dentry); } return new; } EXPORT_SYMBOL(d_splice_alias); /** * d_add_ci - lookup or allocate new dentry with case-exact name * @inode: the inode case-insensitive lookup has found * @dentry: the negative dentry that was passed to the parent's lookup func * @name: the case-exact name to be associated with the returned dentry * * This is to avoid filling the dcache with case-insensitive names to the * same inode, only the actual correct case is stored in the dcache for * case-insensitive filesystems. * * For a case-insensitive lookup match and if the the case-exact dentry * already exists in in the dcache, use it and return it. * * If no entry exists with the exact case name, allocate new dentry with * the exact case, and return the spliced entry. */ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode, struct qstr *name) { struct dentry *found; struct dentry *new; /* * First check if a dentry matching the name already exists, * if not go ahead and create it now. */ found = d_hash_and_lookup(dentry->d_parent, name); if (unlikely(IS_ERR(found))) goto err_out; if (!found) { new = d_alloc(dentry->d_parent, name); if (!new) { found = ERR_PTR(-ENOMEM); goto err_out; } found = d_splice_alias(inode, new); if (found) { dput(new); return found; } return new; } /* * If a matching dentry exists, and it's not negative use it. * * Decrement the reference count to balance the iget() done * earlier on. */ if (found->d_inode) { if (unlikely(found->d_inode != inode)) { /* This can't happen because bad inodes are unhashed. */ BUG_ON(!is_bad_inode(inode)); BUG_ON(!is_bad_inode(found->d_inode)); } iput(inode); return found; } /* * Negative dentry: instantiate it unless the inode is a directory and * already has a dentry. */ new = d_splice_alias(inode, found); if (new) { dput(found); found = new; } return found; err_out: iput(inode); return found; } EXPORT_SYMBOL(d_add_ci); /* * Do the slow-case of the dentry name compare. * * Unlike the dentry_cmp() function, we need to atomically * load the name and length information, so that the * filesystem can rely on them, and can use the 'name' and * 'len' information without worrying about walking off the * end of memory etc. * * Thus the read_seqcount_retry() and the "duplicate" info * in arguments (the low-level filesystem should not look * at the dentry inode or name contents directly, since * rename can change them while we're in RCU mode). */ enum slow_d_compare { D_COMP_OK, D_COMP_NOMATCH, D_COMP_SEQRETRY, }; static noinline enum slow_d_compare slow_dentry_cmp( const struct dentry *parent, struct dentry *dentry, unsigned int seq, const struct qstr *name) { int tlen = dentry->d_name.len; const char *tname = dentry->d_name.name; if (read_seqcount_retry(&dentry->d_seq, seq)) { cpu_relax(); return D_COMP_SEQRETRY; } if (parent->d_op->d_compare(parent, dentry, tlen, tname, name)) return D_COMP_NOMATCH; return D_COMP_OK; } /** * __d_lookup_rcu - search for a dentry (racy, store-free) * @parent: parent dentry * @name: qstr of name we wish to find * @seqp: returns d_seq value at the point where the dentry was found * Returns: dentry, or NULL * * __d_lookup_rcu is the dcache lookup function for rcu-walk name * resolution (store-free path walking) design described in * Documentation/filesystems/path-lookup.txt. * * This is not to be used outside core vfs. * * __d_lookup_rcu must only be used in rcu-walk mode, ie. with vfsmount lock * held, and rcu_read_lock held. The returned dentry must not be stored into * without taking d_lock and checking d_seq sequence count against @seq * returned here. * * A refcount may be taken on the found dentry with the d_rcu_to_refcount * function. * * Alternatively, __d_lookup_rcu may be called again to look up the child of * the returned dentry, so long as its parent's seqlock is checked after the * child is looked up. Thus, an interlocking stepping of sequence lock checks * is formed, giving integrity down the path walk. * * NOTE! The caller *has* to check the resulting dentry against the sequence * number we've returned before using any of the resulting dentry state! */ struct dentry *__d_lookup_rcu(const struct dentry *parent, const struct qstr *name, unsigned *seqp) { u64 hashlen = name->hash_len; const unsigned char *str = name->name; struct hlist_bl_head *b = d_hash(parent, hashlen_hash(hashlen)); struct hlist_bl_node *node; struct dentry *dentry; /* * Note: There is significant duplication with __d_lookup_rcu which is * required to prevent single threaded performance regressions * especially on architectures where smp_rmb (in seqcounts) are costly. * Keep the two functions in sync. */ /* * The hash list is protected using RCU. * * Carefully use d_seq when comparing a candidate dentry, to avoid * races with d_move(). * * It is possible that concurrent renames can mess up our list * walk here and result in missing our dentry, resulting in the * false-negative result. d_lookup() protects against concurrent * renames using rename_lock seqlock. * * See Documentation/filesystems/path-lookup.txt for more details. */ hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { unsigned seq; seqretry: /* * The dentry sequence count protects us from concurrent * renames, and thus protects parent and name fields. * * The caller must perform a seqcount check in order * to do anything useful with the returned dentry. * * NOTE! We do a "raw" seqcount_begin here. That means that * we don't wait for the sequence count to stabilize if it * is in the middle of a sequence change. If we do the slow * dentry compare, we will do seqretries until it is stable, * and if we end up with a successful lookup, we actually * want to exit RCU lookup anyway. */ seq = raw_seqcount_begin(&dentry->d_seq); if (dentry->d_parent != parent) continue; if (d_unhashed(dentry)) continue; if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { if (dentry->d_name.hash != hashlen_hash(hashlen)) continue; *seqp = seq; switch (slow_dentry_cmp(parent, dentry, seq, name)) { case D_COMP_OK: return dentry; case D_COMP_NOMATCH: continue; default: goto seqretry; } } if (dentry->d_name.hash_len != hashlen) continue; *seqp = seq; if (!dentry_cmp(dentry, str, hashlen_len(hashlen))) return dentry; } return NULL; } /** * d_lookup - search for a dentry * @parent: parent dentry * @name: qstr of name we wish to find * Returns: dentry, or NULL * * d_lookup searches the children of the parent dentry for the name in * question. If the dentry is found its reference count is incremented and the * dentry is returned. The caller must use dput to free the entry when it has * finished using it. %NULL is returned if the dentry does not exist. */ struct dentry *d_lookup(const struct dentry *parent, const struct qstr *name) { struct dentry *dentry; unsigned seq; do { seq = read_seqbegin(&rename_lock); dentry = __d_lookup(parent, name); if (dentry) break; } while (read_seqretry(&rename_lock, seq)); return dentry; } EXPORT_SYMBOL(d_lookup); /** * __d_lookup - search for a dentry (racy) * @parent: parent dentry * @name: qstr of name we wish to find * Returns: dentry, or NULL * * __d_lookup is like d_lookup, however it may (rarely) return a * false-negative result due to unrelated rename activity. * * __d_lookup is slightly faster by avoiding rename_lock read seqlock, * however it must be used carefully, eg. with a following d_lookup in * the case of failure. * * __d_lookup callers must be commented. */ struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name) { unsigned int len = name->len; unsigned int hash = name->hash; const unsigned char *str = name->name; struct hlist_bl_head *b = d_hash(parent, hash); struct hlist_bl_node *node; struct dentry *found = NULL; struct dentry *dentry; /* * Note: There is significant duplication with __d_lookup_rcu which is * required to prevent single threaded performance regressions * especially on architectures where smp_rmb (in seqcounts) are costly. * Keep the two functions in sync. */ /* * The hash list is protected using RCU. * * Take d_lock when comparing a candidate dentry, to avoid races * with d_move(). * * It is possible that concurrent renames can mess up our list * walk here and result in missing our dentry, resulting in the * false-negative result. d_lookup() protects against concurrent * renames using rename_lock seqlock. * * See Documentation/filesystems/path-lookup.txt for more details. */ rcu_read_lock(); hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { if (dentry->d_name.hash != hash) continue; spin_lock(&dentry->d_lock); if (dentry->d_parent != parent) goto next; if (d_unhashed(dentry)) goto next; /* * It is safe to compare names since d_move() cannot * change the qstr (protected by d_lock). */ if (parent->d_flags & DCACHE_OP_COMPARE) { int tlen = dentry->d_name.len; const char *tname = dentry->d_name.name; if (parent->d_op->d_compare(parent, dentry, tlen, tname, name)) goto next; } else { if (dentry->d_name.len != len) goto next; if (dentry_cmp(dentry, str, len)) goto next; } dentry->d_lockref.count++; found = dentry; spin_unlock(&dentry->d_lock); break; next: spin_unlock(&dentry->d_lock); } rcu_read_unlock(); return found; } /** * d_hash_and_lookup - hash the qstr then search for a dentry * @dir: Directory to search in * @name: qstr of name we wish to find * * On lookup failure NULL is returned; on bad name - ERR_PTR(-error) */ struct dentry *d_hash_and_lookup(struct dentry *dir, struct qstr *name) { /* * Check for a fs-specific hash function. Note that we must * calculate the standard hash first, as the d_op->d_hash() * routine may choose to leave the hash value unchanged. */ name->hash = full_name_hash(name->name, name->len); if (dir->d_flags & DCACHE_OP_HASH) { int err = dir->d_op->d_hash(dir, name); if (unlikely(err < 0)) return ERR_PTR(err); } return d_lookup(dir, name); } EXPORT_SYMBOL(d_hash_and_lookup); /** * d_validate - verify dentry provided from insecure source (deprecated) * @dentry: The dentry alleged to be valid child of @dparent * @dparent: The parent dentry (known to be valid) * * An insecure source has sent us a dentry, here we verify it and dget() it. * This is used by ncpfs in its readdir implementation. * Zero is returned in the dentry is invalid. * * This function is slow for big directories, and deprecated, do not use it. */ int d_validate(struct dentry *dentry, struct dentry *dparent) { struct dentry *child; spin_lock(&dparent->d_lock); list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) { if (dentry == child) { spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); __dget_dlock(dentry); spin_unlock(&dentry->d_lock); spin_unlock(&dparent->d_lock); return 1; } } spin_unlock(&dparent->d_lock); return 0; } EXPORT_SYMBOL(d_validate); /* * When a file is deleted, we have two options: * - turn this dentry into a negative dentry * - unhash this dentry and free it. * * Usually, we want to just turn this into * a negative dentry, but if anybody else is * currently using the dentry or the inode * we can't do that and we fall back on removing * it from the hash queues and waiting for * it to be deleted later when it has no users */ /** * d_delete - delete a dentry * @dentry: The dentry to delete * * Turn the dentry into a negative dentry if possible, otherwise * remove it from the hash queues so it can be deleted later */ void d_delete(struct dentry * dentry) { struct inode *inode; int isdir = 0; /* * Are we the only user? */ again: spin_lock(&dentry->d_lock); inode = dentry->d_inode; isdir = S_ISDIR(inode->i_mode); if (dentry->d_lockref.count == 1) { if (!spin_trylock(&inode->i_lock)) { spin_unlock(&dentry->d_lock); cpu_relax(); goto again; } dentry->d_flags &= ~DCACHE_CANT_MOUNT; dentry_unlink_inode(dentry); fsnotify_nameremove(dentry, isdir); return; } if (!d_unhashed(dentry)) __d_drop(dentry); spin_unlock(&dentry->d_lock); fsnotify_nameremove(dentry, isdir); } EXPORT_SYMBOL(d_delete); static void __d_rehash(struct dentry * entry, struct hlist_bl_head *b) { BUG_ON(!d_unhashed(entry)); hlist_bl_lock(b); entry->d_flags |= DCACHE_RCUACCESS; hlist_bl_add_head_rcu(&entry->d_hash, b); hlist_bl_unlock(b); } static void _d_rehash(struct dentry * entry) { __d_rehash(entry, d_hash(entry->d_parent, entry->d_name.hash)); } /** * d_rehash - add an entry back to the hash * @entry: dentry to add to the hash * * Adds a dentry to the hash according to its name. */ void d_rehash(struct dentry * entry) { spin_lock(&entry->d_lock); _d_rehash(entry); spin_unlock(&entry->d_lock); } EXPORT_SYMBOL(d_rehash); /** * dentry_update_name_case - update case insensitive dentry with a new name * @dentry: dentry to be updated * @name: new name * * Update a case insensitive dentry with new case of name. * * dentry must have been returned by d_lookup with name @name. Old and new * name lengths must match (ie. no d_compare which allows mismatched name * lengths). * * Parent inode i_mutex must be held over d_lookup and into this call (to * keep renames and concurrent inserts, and readdir(2) away). */ void dentry_update_name_case(struct dentry *dentry, struct qstr *name) { BUG_ON(!mutex_is_locked(&dentry->d_parent->d_inode->i_mutex)); BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */ spin_lock(&dentry->d_lock); write_seqcount_begin(&dentry->d_seq); memcpy((unsigned char *)dentry->d_name.name, name->name, name->len); write_seqcount_end(&dentry->d_seq); spin_unlock(&dentry->d_lock); } EXPORT_SYMBOL(dentry_update_name_case); static void switch_names(struct dentry *dentry, struct dentry *target) { if (dname_external(target)) { if (dname_external(dentry)) { /* * Both external: swap the pointers */ swap(target->d_name.name, dentry->d_name.name); } else { /* * dentry:internal, target:external. Steal target's * storage and make target internal. */ memcpy(target->d_iname, dentry->d_name.name, dentry->d_name.len + 1); dentry->d_name.name = target->d_name.name; target->d_name.name = target->d_iname; } } else { if (dname_external(dentry)) { /* * dentry:external, target:internal. Give dentry's * storage to target and make dentry internal */ memcpy(dentry->d_iname, target->d_name.name, target->d_name.len + 1); target->d_name.name = dentry->d_name.name; dentry->d_name.name = dentry->d_iname; } else { /* * Both are internal. Just copy target to dentry */ memcpy(dentry->d_iname, target->d_name.name, target->d_name.len + 1); dentry->d_name.len = target->d_name.len; return; } } swap(dentry->d_name.len, target->d_name.len); } static void dentry_lock_for_move(struct dentry *dentry, struct dentry *target) { /* * XXXX: do we really need to take target->d_lock? */ if (IS_ROOT(dentry) || dentry->d_parent == target->d_parent) spin_lock(&target->d_parent->d_lock); else { if (d_ancestor(dentry->d_parent, target->d_parent)) { spin_lock(&dentry->d_parent->d_lock); spin_lock_nested(&target->d_parent->d_lock, DENTRY_D_LOCK_NESTED); } else { spin_lock(&target->d_parent->d_lock); spin_lock_nested(&dentry->d_parent->d_lock, DENTRY_D_LOCK_NESTED); } } if (target < dentry) { spin_lock_nested(&target->d_lock, 2); spin_lock_nested(&dentry->d_lock, 3); } else { spin_lock_nested(&dentry->d_lock, 2); spin_lock_nested(&target->d_lock, 3); } } static void dentry_unlock_parents_for_move(struct dentry *dentry, struct dentry *target) { if (target->d_parent != dentry->d_parent) spin_unlock(&dentry->d_parent->d_lock); if (target->d_parent != target) spin_unlock(&target->d_parent->d_lock); } /* * When switching names, the actual string doesn't strictly have to * be preserved in the target - because we're dropping the target * anyway. As such, we can just do a simple memcpy() to copy over * the new name before we switch. * * Note that we have to be a lot more careful about getting the hash * switched - we have to switch the hash value properly even if it * then no longer matches the actual (corrupted) string of the target. * The hash value has to match the hash queue that the dentry is on.. */ /* * __d_move - move a dentry * @dentry: entry to move * @target: new dentry * * Update the dcache to reflect the move of a file name. Negative * dcache entries should not be moved in this way. Caller must hold * rename_lock, the i_mutex of the source and target directories, * and the sb->s_vfs_rename_mutex if they differ. See lock_rename(). */ static void __d_move(struct dentry * dentry, struct dentry * target) { if (!dentry->d_inode) printk(KERN_WARNING "VFS: moving negative dcache entry\n"); BUG_ON(d_ancestor(dentry, target)); BUG_ON(d_ancestor(target, dentry)); dentry_lock_for_move(dentry, target); write_seqcount_begin(&dentry->d_seq); write_seqcount_begin_nested(&target->d_seq, DENTRY_D_LOCK_NESTED); /* __d_drop does write_seqcount_barrier, but they're OK to nest. */ /* * Move the dentry to the target hash queue. Don't bother checking * for the same hash queue because of how unlikely it is. */ __d_drop(dentry); __d_rehash(dentry, d_hash(target->d_parent, target->d_name.hash)); /* Unhash the target: dput() will then get rid of it */ __d_drop(target); list_del(&dentry->d_u.d_child); list_del(&target->d_u.d_child); /* Switch the names.. */ switch_names(dentry, target); swap(dentry->d_name.hash, target->d_name.hash); /* ... and switch the parents */ if (IS_ROOT(dentry)) { dentry->d_parent = target->d_parent; target->d_parent = target; INIT_LIST_HEAD(&target->d_u.d_child); } else { swap(dentry->d_parent, target->d_parent); /* And add them back to the (new) parent lists */ list_add(&target->d_u.d_child, &target->d_parent->d_subdirs); } list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); write_seqcount_end(&target->d_seq); write_seqcount_end(&dentry->d_seq); dentry_unlock_parents_for_move(dentry, target); spin_unlock(&target->d_lock); fsnotify_d_move(dentry); spin_unlock(&dentry->d_lock); } /* * d_move - move a dentry * @dentry: entry to move * @target: new dentry * * Update the dcache to reflect the move of a file name. Negative * dcache entries should not be moved in this way. See the locking * requirements for __d_move. */ void d_move(struct dentry *dentry, struct dentry *target) { write_seqlock(&rename_lock); __d_move(dentry, target); write_sequnlock(&rename_lock); } EXPORT_SYMBOL(d_move); /** * d_ancestor - search for an ancestor * @p1: ancestor dentry * @p2: child dentry * * Returns the ancestor dentry of p2 which is a child of p1, if p1 is * an ancestor of p2, else NULL. */ struct dentry *d_ancestor(struct dentry *p1, struct dentry *p2) { struct dentry *p; for (p = p2; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p1) return p; } return NULL; } /* * This helper attempts to cope with remotely renamed directories * * It assumes that the caller is already holding * dentry->d_parent->d_inode->i_mutex, inode->i_lock and rename_lock * * Note: If ever the locking in lock_rename() changes, then please * remember to update this too... */ static struct dentry *__d_unalias(struct inode *inode, struct dentry *dentry, struct dentry *alias) { struct mutex *m1 = NULL, *m2 = NULL; struct dentry *ret = ERR_PTR(-EBUSY); /* If alias and dentry share a parent, then no extra locks required */ if (alias->d_parent == dentry->d_parent) goto out_unalias; /* See lock_rename() */ if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex)) goto out_err; m1 = &dentry->d_sb->s_vfs_rename_mutex; if (!mutex_trylock(&alias->d_parent->d_inode->i_mutex)) goto out_err; m2 = &alias->d_parent->d_inode->i_mutex; out_unalias: if (likely(!d_mountpoint(alias))) { __d_move(alias, dentry); ret = alias; } out_err: spin_unlock(&inode->i_lock); if (m2) mutex_unlock(m2); if (m1) mutex_unlock(m1); return ret; } /* * Prepare an anonymous dentry for life in the superblock's dentry tree as a * named dentry in place of the dentry to be replaced. * returns with anon->d_lock held! */ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) { struct dentry *dparent; dentry_lock_for_move(anon, dentry); write_seqcount_begin(&dentry->d_seq); write_seqcount_begin_nested(&anon->d_seq, DENTRY_D_LOCK_NESTED); dparent = dentry->d_parent; switch_names(dentry, anon); swap(dentry->d_name.hash, anon->d_name.hash); dentry->d_parent = dentry; list_del_init(&dentry->d_u.d_child); anon->d_parent = dparent; list_move(&anon->d_u.d_child, &dparent->d_subdirs); write_seqcount_end(&dentry->d_seq); write_seqcount_end(&anon->d_seq); dentry_unlock_parents_for_move(anon, dentry); spin_unlock(&dentry->d_lock); /* anon->d_lock still locked, returns locked */ } /** * d_materialise_unique - introduce an inode into the tree * @dentry: candidate dentry * @inode: inode to bind to the dentry, to which aliases may be attached * * Introduces an dentry into the tree, substituting an extant disconnected * root directory alias in its place if there is one. Caller must hold the * i_mutex of the parent directory. */ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode) { struct dentry *actual; BUG_ON(!d_unhashed(dentry)); if (!inode) { actual = dentry; __d_instantiate(dentry, NULL); d_rehash(actual); goto out_nolock; } spin_lock(&inode->i_lock); if (S_ISDIR(inode->i_mode)) { struct dentry *alias; /* Does an aliased dentry already exist? */ alias = __d_find_alias(inode, 0); if (alias) { actual = alias; write_seqlock(&rename_lock); if (d_ancestor(alias, dentry)) { /* Check for loops */ actual = ERR_PTR(-ELOOP); spin_unlock(&inode->i_lock); } else if (IS_ROOT(alias)) { /* Is this an anonymous mountpoint that we * could splice into our tree? */ __d_materialise_dentry(dentry, alias); write_sequnlock(&rename_lock); __d_drop(alias); goto found; } else { /* Nope, but we must(!) avoid directory * aliasing. This drops inode->i_lock */ actual = __d_unalias(inode, dentry, alias); } write_sequnlock(&rename_lock); if (IS_ERR(actual)) { if (PTR_ERR(actual) == -ELOOP) pr_warn_ratelimited( "VFS: Lookup of '%s' in %s %s" " would have caused loop\n", dentry->d_name.name, inode->i_sb->s_type->name, inode->i_sb->s_id); dput(alias); } goto out_nolock; } } /* Add a unique reference */ actual = __d_instantiate_unique(dentry, inode); if (!actual) actual = dentry; else BUG_ON(!d_unhashed(actual)); spin_lock(&actual->d_lock); found: _d_rehash(actual); spin_unlock(&actual->d_lock); spin_unlock(&inode->i_lock); out_nolock: if (actual == dentry) { security_d_instantiate(dentry, inode); return NULL; } iput(inode); return actual; } EXPORT_SYMBOL_GPL(d_materialise_unique); static int prepend(char **buffer, int *buflen, const char *str, int namelen) { *buflen -= namelen; if (*buflen < 0) return -ENAMETOOLONG; *buffer -= namelen; memcpy(*buffer, str, namelen); return 0; } /** * prepend_name - prepend a pathname in front of current buffer pointer * @buffer: buffer pointer * @buflen: allocated length of the buffer * @name: name string and length qstr structure * * With RCU path tracing, it may race with d_move(). Use ACCESS_ONCE() to * make sure that either the old or the new name pointer and length are * fetched. However, there may be mismatch between length and pointer. * The length cannot be trusted, we need to copy it byte-by-byte until * the length is reached or a null byte is found. It also prepends "/" at * the beginning of the name. The sequence number check at the caller will * retry it again when a d_move() does happen. So any garbage in the buffer * due to mismatched pointer and length will be discarded. */ static int prepend_name(char **buffer, int *buflen, struct qstr *name) { const char *dname = ACCESS_ONCE(name->name); u32 dlen = ACCESS_ONCE(name->len); char *p; *buflen -= dlen + 1; if (*buflen < 0) return -ENAMETOOLONG; p = *buffer -= dlen + 1; *p++ = '/'; while (dlen--) { char c = *dname++; if (!c) break; *p++ = c; } return 0; } /** * prepend_path - Prepend path string to a buffer * @path: the dentry/vfsmount to report * @root: root vfsmnt/dentry * @buffer: pointer to the end of the buffer * @buflen: pointer to buffer length * * The function will first try to write out the pathname without taking any * lock other than the RCU read lock to make sure that dentries won't go away. * It only checks the sequence number of the global rename_lock as any change * in the dentry's d_seq will be preceded by changes in the rename_lock * sequence number. If the sequence number had been changed, it will restart * the whole pathname back-tracing sequence again by taking the rename_lock. * In this case, there is no need to take the RCU read lock as the recursive * parent pointer references will keep the dentry chain alive as long as no * rename operation is performed. */ static int prepend_path(const struct path *path, const struct path *root, char **buffer, int *buflen) { struct dentry *dentry; struct vfsmount *vfsmnt; struct mount *mnt; int error = 0; unsigned seq, m_seq = 0; char *bptr; int blen; rcu_read_lock(); restart_mnt: read_seqbegin_or_lock(&mount_lock, &m_seq); seq = 0; rcu_read_lock(); restart: bptr = *buffer; blen = *buflen; error = 0; dentry = path->dentry; vfsmnt = path->mnt; mnt = real_mount(vfsmnt); read_seqbegin_or_lock(&rename_lock, &seq); while (dentry != root->dentry || vfsmnt != root->mnt) { struct dentry * parent; if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { struct mount *parent = ACCESS_ONCE(mnt->mnt_parent); /* Global root? */ if (mnt != parent) { dentry = ACCESS_ONCE(mnt->mnt_mountpoint); mnt = parent; vfsmnt = &mnt->mnt; continue; } /* * Filesystems needing to implement special "root names" * should do so with ->d_dname() */ if (IS_ROOT(dentry) && (dentry->d_name.len != 1 || dentry->d_name.name[0] != '/')) { WARN(1, "Root dentry has weird name <%.*s>\n", (int) dentry->d_name.len, dentry->d_name.name); } if (!error) error = is_mounted(vfsmnt) ? 1 : 2; break; } parent = dentry->d_parent; prefetch(parent); error = prepend_name(&bptr, &blen, &dentry->d_name); if (error) break; dentry = parent; } if (!(seq & 1)) rcu_read_unlock(); if (need_seqretry(&rename_lock, seq)) { seq = 1; goto restart; } done_seqretry(&rename_lock, seq); if (!(m_seq & 1)) rcu_read_unlock(); if (need_seqretry(&mount_lock, m_seq)) { m_seq = 1; goto restart_mnt; } done_seqretry(&mount_lock, m_seq); if (error >= 0 && bptr == *buffer) { if (--blen < 0) error = -ENAMETOOLONG; else *--bptr = '/'; } *buffer = bptr; *buflen = blen; return error; } /** * __d_path - return the path of a dentry * @path: the dentry/vfsmount to report * @root: root vfsmnt/dentry * @buf: buffer to return value in * @buflen: buffer length * * Convert a dentry into an ASCII path name. * * Returns a pointer into the buffer or an error code if the * path was too long. * * "buflen" should be positive. * * If the path is not reachable from the supplied root, return %NULL. */ char *__d_path(const struct path *path, const struct path *root, char *buf, int buflen) { char *res = buf + buflen; int error; prepend(&res, &buflen, "\0", 1); error = prepend_path(path, root, &res, &buflen); if (error < 0) return ERR_PTR(error); if (error > 0) return NULL; return res; } char *d_absolute_path(const struct path *path, char *buf, int buflen) { struct path root = {}; char *res = buf + buflen; int error; prepend(&res, &buflen, "\0", 1); error = prepend_path(path, &root, &res, &buflen); if (error > 1) error = -EINVAL; if (error < 0) return ERR_PTR(error); return res; } /* * same as __d_path but appends "(deleted)" for unlinked files. */ static int path_with_deleted(const struct path *path, const struct path *root, char **buf, int *buflen) { prepend(buf, buflen, "\0", 1); if (d_unlinked(path->dentry)) { int error = prepend(buf, buflen, " (deleted)", 10); if (error) return error; } return prepend_path(path, root, buf, buflen); } static int prepend_unreachable(char **buffer, int *buflen) { return prepend(buffer, buflen, "(unreachable)", 13); } static void get_fs_root_rcu(struct fs_struct *fs, struct path *root) { unsigned seq; do { seq = read_seqcount_begin(&fs->seq); *root = fs->root; } while (read_seqcount_retry(&fs->seq, seq)); } /** * d_path - return the path of a dentry * @path: path to report * @buf: buffer to return value in * @buflen: buffer length * * Convert a dentry into an ASCII path name. If the entry has been deleted * the string " (deleted)" is appended. Note that this is ambiguous. * * Returns a pointer into the buffer or an error code if the path was * too long. Note: Callers should use the returned pointer, not the passed * in buffer, to use the name! The implementation often starts at an offset * into the buffer, and may leave 0 bytes at the start. * * "buflen" should be positive. */ char *d_path(const struct path *path, char *buf, int buflen) { char *res = buf + buflen; struct path root; int error; /* * We have various synthetic filesystems that never get mounted. On * these filesystems dentries are never used for lookup purposes, and * thus don't need to be hashed. They also don't need a name until a * user wants to identify the object in /proc/pid/fd/. The little hack * below allows us to generate a name for these objects on demand: * * Some pseudo inodes are mountable. When they are mounted * path->dentry == path->mnt->mnt_root. In that case don't call d_dname * and instead have d_path return the mounted path. */ if (path->dentry->d_op && path->dentry->d_op->d_dname && (!IS_ROOT(path->dentry) || path->dentry != path->mnt->mnt_root)) return path->dentry->d_op->d_dname(path->dentry, buf, buflen); rcu_read_lock(); get_fs_root_rcu(current->fs, &root); error = path_with_deleted(path, &root, &res, &buflen); rcu_read_unlock(); if (error < 0) res = ERR_PTR(error); return res; } EXPORT_SYMBOL(d_path); /* * Helper function for dentry_operations.d_dname() members */ char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen, const char *fmt, ...) { va_list args; char temp[64]; int sz; va_start(args, fmt); sz = vsnprintf(temp, sizeof(temp), fmt, args) + 1; va_end(args); if (sz > sizeof(temp) || sz > buflen) return ERR_PTR(-ENAMETOOLONG); buffer += buflen - sz; return memcpy(buffer, temp, sz); } char *simple_dname(struct dentry *dentry, char *buffer, int buflen) { char *end = buffer + buflen; /* these dentries are never renamed, so d_lock is not needed */ if (prepend(&end, &buflen, " (deleted)", 11) || prepend(&end, &buflen, dentry->d_name.name, dentry->d_name.len) || prepend(&end, &buflen, "/", 1)) end = ERR_PTR(-ENAMETOOLONG); return end; } /* * Write full pathname from the root of the filesystem into the buffer. */ static char *__dentry_path(struct dentry *d, char *buf, int buflen) { struct dentry *dentry; char *end, *retval; int len, seq = 0; int error = 0; if (buflen < 2) goto Elong; rcu_read_lock(); restart: dentry = d; end = buf + buflen; len = buflen; prepend(&end, &len, "\0", 1); /* Get '/' right */ retval = end-1; *retval = '/'; read_seqbegin_or_lock(&rename_lock, &seq); while (!IS_ROOT(dentry)) { struct dentry *parent = dentry->d_parent; prefetch(parent); error = prepend_name(&end, &len, &dentry->d_name); if (error) break; retval = end; dentry = parent; } if (!(seq & 1)) rcu_read_unlock(); if (need_seqretry(&rename_lock, seq)) { seq = 1; goto restart; } done_seqretry(&rename_lock, seq); if (error) goto Elong; return retval; Elong: return ERR_PTR(-ENAMETOOLONG); } char *dentry_path_raw(struct dentry *dentry, char *buf, int buflen) { return __dentry_path(dentry, buf, buflen); } EXPORT_SYMBOL(dentry_path_raw); char *dentry_path(struct dentry *dentry, char *buf, int buflen) { char *p = NULL; char *retval; if (d_unlinked(dentry)) { p = buf + buflen; if (prepend(&p, &buflen, "//deleted", 10) != 0) goto Elong; buflen++; } retval = __dentry_path(dentry, buf, buflen); if (!IS_ERR(retval) && p) *p = '/'; /* restore '/' overriden with '\0' */ return retval; Elong: return ERR_PTR(-ENAMETOOLONG); } static void get_fs_root_and_pwd_rcu(struct fs_struct *fs, struct path *root, struct path *pwd) { unsigned seq; do { seq = read_seqcount_begin(&fs->seq); *root = fs->root; *pwd = fs->pwd; } while (read_seqcount_retry(&fs->seq, seq)); } /* * NOTE! The user-level library version returns a * character pointer. The kernel system call just * returns the length of the buffer filled (which * includes the ending '\0' character), or a negative * error value. So libc would do something like * * char *getcwd(char * buf, size_t size) * { * int retval; * * retval = sys_getcwd(buf, size); * if (retval >= 0) * return buf; * errno = -retval; * return NULL; * } */ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size) { int error; struct path pwd, root; char *page = __getname(); if (!page) return -ENOMEM; rcu_read_lock(); get_fs_root_and_pwd_rcu(current->fs, &root, &pwd); error = -ENOENT; if (!d_unlinked(pwd.dentry)) { unsigned long len; char *cwd = page + PATH_MAX; int buflen = PATH_MAX; prepend(&cwd, &buflen, "\0", 1); error = prepend_path(&pwd, &root, &cwd, &buflen); rcu_read_unlock(); if (error < 0) goto out; /* Unreachable from current root */ if (error > 0) { error = prepend_unreachable(&cwd, &buflen); if (error) goto out; } error = -ERANGE; len = PATH_MAX + page - cwd; if (len <= size) { error = len; if (copy_to_user(buf, cwd, len)) error = -EFAULT; } } else { rcu_read_unlock(); } out: __putname(page); return error; } /* * Test whether new_dentry is a subdirectory of old_dentry. * * Trivially implemented using the dcache structure */ /** * is_subdir - is new dentry a subdirectory of old_dentry * @new_dentry: new dentry * @old_dentry: old dentry * * Returns 1 if new_dentry is a subdirectory of the parent (at any depth). * Returns 0 otherwise. * Caller must ensure that "new_dentry" is pinned before calling is_subdir() */ int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry) { int result; unsigned seq; if (new_dentry == old_dentry) return 1; do { /* for restarting inner loop in case of seq retry */ seq = read_seqbegin(&rename_lock); /* * Need rcu_readlock to protect against the d_parent trashing * due to d_move */ rcu_read_lock(); if (d_ancestor(old_dentry, new_dentry)) result = 1; else result = 0; rcu_read_unlock(); } while (read_seqretry(&rename_lock, seq)); return result; } static enum d_walk_ret d_genocide_kill(void *data, struct dentry *dentry) { struct dentry *root = data; if (dentry != root) { if (d_unhashed(dentry) || !dentry->d_inode) return D_WALK_SKIP; if (!(dentry->d_flags & DCACHE_GENOCIDE)) { dentry->d_flags |= DCACHE_GENOCIDE; dentry->d_lockref.count--; } } return D_WALK_CONTINUE; } void d_genocide(struct dentry *parent) { d_walk(parent, parent, d_genocide_kill, NULL); } void d_tmpfile(struct dentry *dentry, struct inode *inode) { inode_dec_link_count(inode); BUG_ON(dentry->d_name.name != dentry->d_iname || !hlist_unhashed(&dentry->d_alias) || !d_unlinked(dentry)); spin_lock(&dentry->d_parent->d_lock); spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); dentry->d_name.len = sprintf(dentry->d_iname, "#%llu", (unsigned long long)inode->i_ino); spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_parent->d_lock); d_instantiate(dentry, inode); } EXPORT_SYMBOL(d_tmpfile); static __initdata unsigned long dhash_entries; static int __init set_dhash_entries(char *str) { if (!str) return 0; dhash_entries = simple_strtoul(str, &str, 0); return 1; } __setup("dhash_entries=", set_dhash_entries); static void __init dcache_init_early(void) { unsigned int loop; /* If hashes are distributed across NUMA nodes, defer * hash allocation until vmalloc space is available. */ if (hashdist) return; dentry_hashtable = alloc_large_system_hash("Dentry cache", sizeof(struct hlist_bl_head), dhash_entries, 13, HASH_EARLY, &d_hash_shift, &d_hash_mask, 0, 0); for (loop = 0; loop < (1U << d_hash_shift); loop++) INIT_HLIST_BL_HEAD(dentry_hashtable + loop); } static void __init dcache_init(void) { unsigned int loop; /* * A constructor could be added for stable state like the lists, * but it is probably not worth it because of the cache nature * of the dcache. */ dentry_cache = KMEM_CACHE(dentry, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD); /* Hash may have been set up in dcache_init_early */ if (!hashdist) return; dentry_hashtable = alloc_large_system_hash("Dentry cache", sizeof(struct hlist_bl_head), dhash_entries, 13, 0, &d_hash_shift, &d_hash_mask, 0, 0); for (loop = 0; loop < (1U << d_hash_shift); loop++) INIT_HLIST_BL_HEAD(dentry_hashtable + loop); } /* SLAB cache for __getname() consumers */ struct kmem_cache *names_cachep __read_mostly; EXPORT_SYMBOL(names_cachep); EXPORT_SYMBOL(d_genocide); void __init vfs_caches_init_early(void) { dcache_init_early(); inode_init_early(); } void __init vfs_caches_init(unsigned long mempages) { unsigned long reserve; /* Base hash sizes on available memory, with a reserve equal to 150% of current kernel size */ reserve = min((mempages - nr_free_pages()) * 3/2, mempages - 1); mempages -= reserve; names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); dcache_init(); inode_init(); files_init(mempages); mnt_init(); bdev_cache_init(); chrdev_init(); }
37772.c
// muyu.c #include <weapon.h> inherit HAMMER; void create() { set_name("木魚錘", ({ "muyu" }) ); set_weight(8000); if( clonep() ) set_default_object(__FILE__); else { set("unit", "把"); set("long", "這是一把很沉的鐵木魚錘\n"); set("value", 10000); set("material", "steel"); set("wield_msg", "$N拿出一把$n,試了試重量,然後握在手中。\n"); set("unwield_msg", "$N放下手中的$n。\n"); } init_hammer(15); setup(); }
10034.c
// Lean compiler output // Module: Init.Prelude // Imports: #include <lean/lean.h> #if defined(__clang__) #pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wunused-label" #elif defined(__GNUC__) && !defined(__CLANG__) #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-label" #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif #ifdef __cplusplus extern "C" { #endif lean_object* lean_string_data(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedSubstring; LEAN_EXPORT lean_object* l_Array_getD(lean_object*); LEAN_EXPORT lean_object* l_String_endPos___boxed(lean_object*); LEAN_EXPORT lean_object* l_instHShiftRight___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_run___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_String_csize(uint32_t); LEAN_EXPORT lean_object* l_Lean_Macro_resolveNamespace_x3f(lean_object*, lean_object*, lean_object*); lean_object* lean_array_set(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Macro_instMonadRefMacroM___closed__2; LEAN_EXPORT lean_object* l_Char_ofNatAux___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_getThe(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt64_val___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_extractMacroScopes(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqPos(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_lengthTRAux___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_mkSimple(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static uint32_t l_Char_utf8Size___closed__7; LEAN_EXPORT lean_object* l_Lean_fieldIdxKind; LEAN_EXPORT lean_object* l_instMonadWithReader___rarg(lean_object*); LEAN_EXPORT lean_object* l_EStateM_tryCatch(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt32_decLe___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHashableString; static lean_object* l_Lean_scientificLitKind___closed__1; LEAN_EXPORT lean_object* lean_erase_macro_scopes(lean_object*); LEAN_EXPORT lean_object* l_USize_mk___boxed(lean_object*); LEAN_EXPORT lean_object* l_withTheReader(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_sub___boxed(lean_object*, lean_object*); uint64_t lean_uint64_of_nat_mk(lean_object*); LEAN_EXPORT lean_object* l_Functor_mapConst___default(lean_object*); LEAN_EXPORT lean_object* l_instHAddPosString___boxed(lean_object*, lean_object*); size_t lean_usize_of_nat_mk(lean_object*); LEAN_EXPORT lean_object* l_Fin_decLe___boxed(lean_object*); LEAN_EXPORT lean_object* l_Array_getD___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_mk_empty_array_with_capacity(lean_object*); LEAN_EXPORT lean_object* l_Applicative_seqRight___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_seqRight___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_get___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__2___boxed(lean_object*, lean_object*); uint8_t lean_uint64_dec_eq(uint64_t, uint64_t); LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f(lean_object*); static lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__4; static lean_object* l_Applicative_seqLeft___default___rarg___closed__1; LEAN_EXPORT lean_object* l_Lean_Macro_throwErrorAt(lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__10; LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_nullKind; LEAN_EXPORT lean_object* l_instMonadFunctorT(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getPos_x3f___boxed(lean_object*, lean_object*); static lean_object* l_EStateM_instMonadStateOfEStateM___closed__2; LEAN_EXPORT lean_object* l_Lean_Macro_getCurrNamespace(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Fin_decLt___rarg___boxed(lean_object*, lean_object*); static lean_object* l_Lean_Macro_instInhabitedState___closed__1; uint8_t lean_uint8_dec_eq(uint8_t, uint8_t); LEAN_EXPORT lean_object* l_Lean_Macro_throwUnsupported___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqUInt32___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM___lambda__1(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_identKind___closed__1; LEAN_EXPORT lean_object* l_UInt64_decEq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* lean_name_mk_string(lean_object*, lean_object*); static lean_object* l_Lean_fieldIdxKind___closed__2; uint8_t lean_usize_dec_eq(size_t, size_t); LEAN_EXPORT lean_object* l_instHXor(lean_object*); LEAN_EXPORT lean_object* l_dite(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_String_mk___boxed(lean_object*); LEAN_EXPORT lean_object* l_getModify___rarg___lambda__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedForAll(lean_object*, lean_object*); uint64_t lean_uint64_of_nat(lean_object*); LEAN_EXPORT lean_object* l_Option_getD___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_matchesLit___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableLePosInstLEPos___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadQuotation___rarg___lambda__1(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_beq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_set___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_redLength___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_unsafeCast___rarg___boxed(lean_object*); static lean_object* l_UInt64_size___closed__1; LEAN_EXPORT lean_object* l_Lean_SourceInfo_fromRef(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_map___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_trace___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqUInt8___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedState; LEAN_EXPORT lean_object* l_Lean_withRef___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_bind___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_run(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadStateOf___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_maxRecDepthErrorMessage; LEAN_EXPORT lean_object* l_System_Platform_numBits; LEAN_EXPORT uint8_t l_Lean_Syntax_matchesLit(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_absurd(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_identKind___closed__2; LEAN_EXPORT lean_object* l_instMonadState___rarg(lean_object*); LEAN_EXPORT lean_object* l_instSubNat; LEAN_EXPORT lean_object* l_ReaderT_instMonadFunctorReaderT___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_foldl___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_run(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt8_size; static lean_object* l_instPowNat___closed__1; static lean_object* l___private_Init_Prelude_0__Lean_extractMainModule___closed__1; LEAN_EXPORT lean_object* l_Monad_seqLeft___default(lean_object*); LEAN_EXPORT lean_object* l_Function_comp(lean_object*, lean_object*, lean_object*); static lean_object* l_Array_empty___closed__1; LEAN_EXPORT lean_object* l_getModify___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Option_getD(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadFunctorReaderT(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_namedPattern(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instInhabitedResult___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadQuotation___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_read___at_Lean_Macro_instMonadRefMacroM___spec__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_isOfKind___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_State_traceMsgs___default; static lean_object* l_Applicative_seqRight___default___rarg___closed__2; LEAN_EXPORT lean_object* l_Lean_Syntax_matchesNull___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_dummyRestore___rarg(lean_object*, lean_object*); static lean_object* l_Lean_fieldIdxKind___closed__1; LEAN_EXPORT lean_object* l_instHAddPos(lean_object*, lean_object*); static lean_object* l_Lean_Macro_instInhabitedMethods___closed__5; LEAN_EXPORT lean_object* l_id___rarg___boxed(lean_object*); static uint64_t l_Lean_Name_mkNum___closed__1; LEAN_EXPORT lean_object* l_Monad_seqRight___default___rarg___lambda__1___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instHashableName; LEAN_EXPORT uint8_t l_Fin_decLe___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_String_csize___boxed(lean_object*); static lean_object* l_Lean_instInhabitedParserDescr___closed__1; static lean_object* l_Lean_charLitKind___closed__2; LEAN_EXPORT lean_object* l_Lean_withRef___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_pred___boxed(lean_object*); LEAN_EXPORT lean_object* l_modifyThe(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_lengthTR___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_String_toSubstring(lean_object*); LEAN_EXPORT lean_object* l_instHMod(lean_object*); LEAN_EXPORT lean_object* l_Nat_decLt___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqNat___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_USize_val___boxed(lean_object*); LEAN_EXPORT lean_object* l_instHOr___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_withFreshMacroScope(lean_object*); static lean_object* l_EStateM_instMonadStateOfEStateM___closed__4; LEAN_EXPORT uint8_t l_instInhabitedUInt8; static lean_object* l_USize_size___closed__1; static lean_object* l_Lean_Macro_instInhabitedMethods___closed__3; LEAN_EXPORT lean_object* l_instInhabitedNat; LEAN_EXPORT lean_object* l_Lean_instInhabitedMacroScopesView; static lean_object* l_Lean_instHashableName___closed__1; LEAN_EXPORT lean_object* l_Lean_instInhabitedParserDescr; LEAN_EXPORT lean_object* l_instLTFin(lean_object*); LEAN_EXPORT lean_object* l_EStateM_dummySave(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedOption(lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); static lean_object* l_Lean_charLitKind___closed__1; LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__4(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadQuotation(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_interpolatedStrKind; LEAN_EXPORT lean_object* l_Monad_seqRight___default___rarg___lambda__1(lean_object*, lean_object*); lean_object* lean_nat_pow(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadLiftT__1___rarg(lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__4; LEAN_EXPORT lean_object* l_instDecidableAnd___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadReaderOfReaderT___rarg(lean_object*); LEAN_EXPORT lean_object* l_instMonadWithReaderOfReaderT___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_namedPattern___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedForAll___rarg___boxed(lean_object*, lean_object*); lean_object* lean_uint64_to_nat(uint64_t); LEAN_EXPORT lean_object* l_instInhabitedForAll__1(lean_object*, lean_object*); static lean_object* l_Applicative_seqRight___default___rarg___closed__1; LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM; LEAN_EXPORT lean_object* l_instTransEq__1(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getNumArgs___boxed(lean_object*); LEAN_EXPORT lean_object* l_readThe___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_Context_currRecDepth___default; static lean_object* l_EStateM_instMonadStateOfEStateM___closed__1; LEAN_EXPORT lean_object* l_Applicative_seqRight___default(lean_object*); LEAN_EXPORT lean_object* l_EStateM_adaptExcept(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_string_utf8_byte_size(lean_object*); LEAN_EXPORT lean_object* l_cond___rarg(uint8_t, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_mkAtom(lean_object*); LEAN_EXPORT lean_object* l_EStateM_instInhabitedEStateM(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_adapt___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt8_ofNatCore___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_False_elim(lean_object*, uint8_t); LEAN_EXPORT lean_object* l_List_concat___rarg(lean_object*, lean_object*); static lean_object* l_instInhabitedSubstring___closed__2; LEAN_EXPORT lean_object* l_EStateM_dummySave___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableLtUInt32InstLTUInt32___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_nameLitKind; static lean_object* l_instInhabitedSubstring___closed__1; LEAN_EXPORT lean_object* l_cond(lean_object*); LEAN_EXPORT lean_object* l_MonadExcept_orElse___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_dummyRestore(lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__9; LEAN_EXPORT lean_object* l_Applicative_map___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_groupKind___closed__1; LEAN_EXPORT lean_object* l_String_endPos(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_maxRecDepthErrorMessage___closed__1; LEAN_EXPORT lean_object* l_instHOrElse(lean_object*); static lean_object* l_Lean_Name_instAppendName___closed__1; lean_object* lean_nat_add(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_get___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_and(uint8_t, uint8_t); LEAN_EXPORT lean_object* l_monadFunctorRefl(lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_extractMainModule(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_System_Platform_getNumBits___boxed(lean_object*); static lean_object* l_EStateM_instMonadStateOfEStateM___closed__3; uint32_t lean_uint32_of_nat_mk(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqUInt64(uint64_t, uint64_t); static lean_object* l_EStateM_instMonadEStateM___closed__8; LEAN_EXPORT lean_object* l_USize_decEq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqFin(lean_object*); static lean_object* l_Lean_interpolatedStrLitKind___closed__2; static uint32_t l_Char_utf8Size___closed__6; LEAN_EXPORT lean_object* l_instMonadFunctorT___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadRef(lean_object*, lean_object*); static lean_object* l_Lean_Syntax_getKind___closed__2; LEAN_EXPORT lean_object* l_instMonadExcept(lean_object*, lean_object*); static lean_object* l_Lean_Syntax_getKind___closed__1; LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); size_t lean_uint64_to_usize(uint64_t); LEAN_EXPORT lean_object* l_ReaderT_instMonadLiftReaderT(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_throwErrorAt___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Macro_instInhabitedMethods___closed__4; LEAN_EXPORT lean_object* l_monadFunctorRefl___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_get_x21___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Function_const___rarg(lean_object*, lean_object*); LEAN_EXPORT uint64_t l_instInhabitedUInt64; LEAN_EXPORT lean_object* l_ReaderT_instMonadLiftReaderT___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqUInt16___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadRef___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_cast___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_inferInstance___rarg(lean_object*); LEAN_EXPORT lean_object* l_instHAddPos___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__3___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_getThe___rarg(lean_object*); LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_extractMacroScopesAux(lean_object*, lean_object*); static lean_object* l_instBEqNat___closed__1; LEAN_EXPORT uint8_t l_Lean_Name_hasMacroScopes(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqChar(uint32_t, uint32_t); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__7___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_dummyRestore___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__2(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_namedPattern___rarg(lean_object*, lean_object*); static lean_object* l_instSubNat___closed__1; LEAN_EXPORT uint8_t l_not(uint8_t); LEAN_EXPORT lean_object* l_min(lean_object*, lean_object*); static uint32_t l_Char_utf8Size___closed__3; LEAN_EXPORT lean_object* l_instMonadStateOf(lean_object*, lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_push___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadState(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Function_const___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_lengthTRAux(lean_object*); LEAN_EXPORT lean_object* l_EStateM_set___rarg___boxed(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_modifyThe___rarg___lambda__1(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_instDecidableNot___rarg(uint8_t); LEAN_EXPORT lean_object* l_EStateM_get___rarg(lean_object*); LEAN_EXPORT uint8_t l_Lean_Syntax_matchesNull(lean_object*, lean_object*); static lean_object* l_Lean_interpolatedStrLitKind___closed__1; static lean_object* l_Lean_Macro_instInhabitedMethods___closed__1; LEAN_EXPORT lean_object* l_ite(lean_object*, lean_object*); static lean_object* l_Lean_groupKind___closed__2; LEAN_EXPORT lean_object* l_Lean_numLitKind; LEAN_EXPORT lean_object* l_EStateM_run_x27___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2(lean_object*); LEAN_EXPORT lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_choiceKind___closed__1; LEAN_EXPORT lean_object* l_not___boxed(lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_instAppendName; LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethodsRef; static lean_object* l_Lean_choiceKind___closed__2; LEAN_EXPORT lean_object* l_ReaderT_read___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_withTheReader___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt16_val___boxed(lean_object*); static lean_object* l_Lean_Macro_instInhabitedMethods___closed__2; LEAN_EXPORT lean_object* l_Lean_strLitKind; static uint32_t l_Char_utf8Size___closed__5; LEAN_EXPORT lean_object* l_EStateM_modifyGet___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_mixHash___boxed(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqList___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_map(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getId___boxed(lean_object*); LEAN_EXPORT lean_object* l_instMonadWithReaderOfReaderT___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__1(lean_object*, lean_object*, lean_object*); static uint32_t l_Char_utf8Size___closed__2; LEAN_EXPORT lean_object* l_sorryAx___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_modify(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt8_val___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_addMacroScope(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedForAll__1___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instLTNat; LEAN_EXPORT lean_object* l_Applicative_map___default___rarg___lambda__1___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_withIncRecDepth___rarg(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_firstFrontendMacroScope___closed__1; LEAN_EXPORT lean_object* l_Lean_replaceRef(lean_object*, lean_object*); lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); uint8_t lean_uint32_dec_lt(uint32_t, uint32_t); static lean_object* l_Lean_numLitKind___closed__1; LEAN_EXPORT lean_object* l_Array_appendCore___rarg___boxed(lean_object*, lean_object*); static lean_object* l_Lean_strLitKind___closed__1; LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT size_t l_instInhabitedUSize; LEAN_EXPORT lean_object* l_UInt64_mk___boxed(lean_object*); LEAN_EXPORT uint8_t l_instDecidableAnd___rarg(uint8_t, uint8_t); LEAN_EXPORT lean_object* l_inferInstanceAs___rarg___boxed(lean_object*); lean_object* lean_array_fset(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_setD___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadFunctorReaderT___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqList(lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getArgs___boxed(lean_object*); LEAN_EXPORT lean_object* l_Applicative_map___default___rarg___lambda__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_setKind(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Applicative_seqLeft___default(lean_object*); LEAN_EXPORT lean_object* l_instInhabited___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt32_decLt___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt32_toNat___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_reservedMacroScope; LEAN_EXPORT lean_object* l_typedExpr___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM; LEAN_EXPORT lean_object* l_instLEFin(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_throwError(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__1(lean_object*, lean_object*); uint8_t lean_uint8_of_nat_mk(lean_object*); static lean_object* l_Lean_scientificLitKind___closed__2; LEAN_EXPORT lean_object* l_instHAddPosChar___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_set(lean_object*); LEAN_EXPORT uint8_t l_List_hasDecEq___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Char_utf8Size___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_strLitKind___closed__2; LEAN_EXPORT lean_object* l_Lean_Syntax_setArgs(lean_object*, lean_object*); LEAN_EXPORT uint64_t l_Lean_Name_hash(lean_object*); LEAN_EXPORT lean_object* l_EStateM_instOrElseEStateM___rarg(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_bind___at_Lean_Macro_instMonadRefMacroM___spec__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*); static uint8_t l_instInhabitedUInt8___closed__1; LEAN_EXPORT lean_object* l_instMonadFunctorT___rarg___lambda__1(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqPos___boxed(lean_object*, lean_object*); static uint16_t l_instInhabitedUInt16___closed__1; static uint32_t l_Char_utf8Size___closed__1; LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__1___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_bind(lean_object*, lean_object*); static lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__1; LEAN_EXPORT lean_object* l_Lean_Syntax_getId(lean_object*); LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_modifyGet(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mkEmpty___boxed(lean_object*, lean_object*); static lean_object* l_EStateM_nonBacktrackable___closed__1; LEAN_EXPORT lean_object* l_Lean_choiceKind; LEAN_EXPORT lean_object* l_panic___at___private_Init_Prelude_0__Lean_extractImported___spec__1(lean_object*); LEAN_EXPORT lean_object* l_Lean_charLitKind; LEAN_EXPORT lean_object* l_EStateM_instMonadStateOfEStateM(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_hasDecEq(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHPow(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMulNat; static lean_object* l_Lean_Macro_instMonadRefMacroM___closed__1; LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__2___boxed(lean_object*, lean_object*); size_t lean_usize_of_nat(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_read___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_inferInstance___rarg___boxed(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqUInt8(uint8_t, uint8_t); LEAN_EXPORT lean_object* l_Function_comp___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Functor_mapConst___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_run___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__1___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableNot(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqNat(lean_object*, lean_object*); static lean_object* l_instMulNat___closed__1; LEAN_EXPORT lean_object* l_Lean_Macro_throwErrorAt___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_False_elim___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedList(lean_object*); LEAN_EXPORT lean_object* l_instMonadWithReaderOf(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_getOp(lean_object*); static lean_object* l_Lean_numLitKind___closed__2; LEAN_EXPORT lean_object* l_Lean_Syntax_isMissing___boxed(lean_object*); static lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__2; LEAN_EXPORT lean_object* l_Unit_unit; LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_simpMacroScopesAux(lean_object*); LEAN_EXPORT lean_object* l_Nat_pow___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__4___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_EStateM_nonBacktrackable___closed__2; LEAN_EXPORT uint8_t l_instDecidableEqUSize(size_t, size_t); LEAN_EXPORT lean_object* l_instHSub(lean_object*); LEAN_EXPORT lean_object* l_instHAppend___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt16_size; LEAN_EXPORT lean_object* l_UInt32_ofNatCore___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_decEq(lean_object*); LEAN_EXPORT lean_object* l_instDecidableLeUInt32InstLEUInt32___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_or___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_withRef___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f_loop___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_pred(lean_object*); LEAN_EXPORT lean_object* l_instHAppend(lean_object*); LEAN_EXPORT lean_object* l_throwThe(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadExcept___rarg(lean_object*); LEAN_EXPORT lean_object* l_instHSubPos___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadStateOf___rarg___lambda__1(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHMod___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_panic___at___private_Init_Prelude_0__Lean_assembleParts___spec__1(lean_object*); LEAN_EXPORT lean_object* l_decEq___rarg(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_interpolatedStrKind___closed__2; LEAN_EXPORT uint8_t l_instDecidableLeUInt32InstLEUInt32(uint32_t, uint32_t); LEAN_EXPORT lean_object* l_inferInstance(lean_object*); LEAN_EXPORT lean_object* l_instAddNat; LEAN_EXPORT lean_object* l_instInhabitedPos; LEAN_EXPORT lean_object* l_instMonadReader___rarg(lean_object*); LEAN_EXPORT lean_object* l_instMonadReaderOfReaderT(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instInhabitedSyntax; LEAN_EXPORT lean_object* l_Lean_firstFrontendMacroScope; LEAN_EXPORT lean_object* l_typedExpr(lean_object*); LEAN_EXPORT lean_object* l_instHDiv(lean_object*); LEAN_EXPORT lean_object* l_Substring_bsize(lean_object*); LEAN_EXPORT lean_object* l_List_set___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_hasDecl(lean_object*, lean_object*, lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__1; LEAN_EXPORT lean_object* l_Array_appendCore_loop___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_MonadExcept_orElse(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableOr(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f_loop(uint8_t, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__2(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Monad_seq___default(lean_object*); LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadLiftT__1___rarg___boxed(lean_object*); uint16_t lean_uint16_of_nat_mk(lean_object*); LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_assembleParts(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_min___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instOrElseEStateM(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedForAll__2___rarg(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqFin___rarg(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Fin_decLt___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_String_data___boxed(lean_object*); LEAN_EXPORT lean_object* l_instMonadWithReaderOf___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_size___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_length(lean_object*); static uint32_t l_instInhabitedUInt32___closed__1; LEAN_EXPORT lean_object* l_ReaderT_instMonadLiftReaderT___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadFunctorT___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ite___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_namedPattern___boxed(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_or(uint8_t, uint8_t); LEAN_EXPORT lean_object* l_instInhabitedExcept(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Monad_map___default(lean_object*); LEAN_EXPORT uint8_t l_instDecidableLePosInstLEPos(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_mkMethodsImp(lean_object*); LEAN_EXPORT lean_object* l_instBEq(lean_object*); LEAN_EXPORT lean_object* l_Nat_add___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt64_ofNatCore___boxed(lean_object*, lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__2; static uint64_t l_instInhabitedUInt64___closed__1; static lean_object* l_Lean_nullKind___closed__1; LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos(lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqString___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt8_mk___boxed(lean_object*); LEAN_EXPORT lean_object* l_List_toArrayAux(lean_object*); LEAN_EXPORT uint8_t l_Decidable_decide___rarg(uint8_t); LEAN_EXPORT lean_object* l_readThe(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_USize_toUInt64___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_addMacroScope(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_String_decEq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Fin_decLe(lean_object*); LEAN_EXPORT lean_object* l_UInt16_mk___boxed(lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqFin___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_appendCore_loop(lean_object*); LEAN_EXPORT lean_object* l_instMonadLiftT__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instLEUInt32; LEAN_EXPORT lean_object* l_instDecidableEqChar___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt16_decEq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_typedExpr___rarg(lean_object*); static lean_object* l_Lean_nullKind___closed__2; LEAN_EXPORT lean_object* l_Lean_Syntax_matchesIdent___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_MonadExcept_instOrElse(lean_object*, lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__5; LEAN_EXPORT lean_object* l_Array_getOp___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_data___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_expandMacro_x3f(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_inferInstanceAs___rarg(lean_object*); LEAN_EXPORT lean_object* l_Lean_replaceRef___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_getD___rarg___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__6; LEAN_EXPORT lean_object* l_ReaderT_read(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHShiftRight(lean_object*); LEAN_EXPORT lean_object* l_Eq_ndrec___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_mkAtomFrom(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_and___boxed(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Lean_Syntax_isNodeOf(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadReaderOf(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_seqRight(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Eq_ndrec(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_groupKind; LEAN_EXPORT uint8_t l_Lean_Syntax_isMissing(lean_object*); LEAN_EXPORT lean_object* l_EStateM_throw___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_setArg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__3(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_identKind; LEAN_EXPORT lean_object* l_MonadExcept_instOrElse___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ite___rarg(uint8_t, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getPos_x3f(lean_object*, uint8_t); LEAN_EXPORT lean_object* l_Eq_ndrec___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_nonBacktrackable(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__4___boxed(lean_object*, lean_object*, lean_object*); uint8_t lean_uint32_dec_eq(uint32_t, uint32_t); LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_EStateM_nonBacktrackable___closed__3; LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_eraseMacroScopesAux(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedNonemptyType; LEAN_EXPORT lean_object* l_instHMul(lean_object*); LEAN_EXPORT lean_object* l_Substring_bsize___boxed(lean_object*); LEAN_EXPORT lean_object* l_List_redLength___rarg(lean_object*); LEAN_EXPORT lean_object* l_EStateM_map___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint32_t l_instInhabitedUInt32; LEAN_EXPORT lean_object* l_unsafeCast___rarg(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_throwError___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg___lambda__1(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Macro_instMonadQuotationMacroM___closed__3; LEAN_EXPORT lean_object* l_Fin_decLt(lean_object*); LEAN_EXPORT lean_object* l_tryCatchThe___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHSub___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_instInhabitedBool; LEAN_EXPORT lean_object* l_Lean_Syntax_isNodeOf___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getNumArgs(lean_object*); LEAN_EXPORT lean_object* l_instMonadWithReader(lean_object*, lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__3; LEAN_EXPORT lean_object* l_Lean_Macro_throwError___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_inferInstanceAs(lean_object*); LEAN_EXPORT lean_object* l_instHAnd(lean_object*); LEAN_EXPORT lean_object* l_Lean_scientificLitKind; LEAN_EXPORT lean_object* l_Lean_Syntax_setArg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Monad_seqRight___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_mk(lean_object*); LEAN_EXPORT lean_object* l_tryCatchThe(lean_object*, lean_object*); LEAN_EXPORT lean_object* lean_list_to_array(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_decLe___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_adapt(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f___boxed(lean_object*); LEAN_EXPORT lean_object* l_List_lengthTR___rarg(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_mkMethodsImp___boxed(lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__6; uint8_t lean_nat_dec_le(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_max(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_withIncRecDepth(lean_object*); static lean_object* l_Lean_Name_instBEqName___closed__1; LEAN_EXPORT lean_object* l_EStateM_adaptExcept___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHAddPosChar(lean_object*, uint32_t); LEAN_EXPORT lean_object* l_Lean_Syntax_getArgs(lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_append(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Applicative_map___default(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_resolveGlobalName(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqList___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedReaderT___rarg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getKind(lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadLiftT___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHShiftLeft___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_MacroScopesView_review(lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_beq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_appendCore_loop___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadReaderOf___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getArg___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadReader___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_Monad_seq___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_liftM(lean_object*, lean_object*); static size_t l_instInhabitedUSize___closed__1; LEAN_EXPORT lean_object* l_panic(lean_object*); LEAN_EXPORT lean_object* l_getModify(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo___boxed(lean_object*); LEAN_EXPORT lean_object* l_List_redLength(lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f_loop(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqUInt64___boxed(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqUInt32(uint32_t, uint32_t); LEAN_EXPORT lean_object* l_panic___rarg(lean_object*, lean_object*); uint64_t lean_usize_to_uint64(size_t); LEAN_EXPORT lean_object* l_Array_appendCore___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instMonadExceptOfEStateM___rarg(lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqUSize___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_set(lean_object*, lean_object*); uint8_t lean_nat_dec_le(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHMul___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_mul___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_throwUnsupported___rarg(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedExcept___rarg(lean_object*); LEAN_EXPORT lean_object* l_EStateM_pure(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint32_t l_Char_utf8Size(uint32_t); LEAN_EXPORT lean_object* l_EStateM_run_x27(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_getThe___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_Array_setD(lean_object*); LEAN_EXPORT lean_object* l_instDecidableAnd(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_hasMacroScopes___boxed(lean_object*); static uint32_t l_Char_utf8Size___closed__4; LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_getMethodsImp(lean_object*, lean_object*); static lean_object* l_Lean_Name_hasMacroScopes___closed__1; LEAN_EXPORT lean_object* l_Lean_instMonadQuotation___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_nat_mul(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_max___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_throwThe___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt32_decEq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM; LEAN_EXPORT lean_object* l_cast(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHDiv___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_panicCore___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Macro_instMonadQuotationMacroM___closed__1; lean_object* lean_sorry(uint8_t); LEAN_EXPORT lean_object* l_liftM___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_set___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_foldl___at_Lean_MacroScopesView_review___spec__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM___lambda__1___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqUInt16(uint16_t, uint16_t); LEAN_EXPORT uint8_t l_instDecidableEqString(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_sequenceMap___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instInhabitedName; LEAN_EXPORT lean_object* l_instHAdd___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_appendCore(lean_object*); LEAN_EXPORT lean_object* l_instHAnd___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_pure___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_getMethodsImp___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Decidable_decide___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_USize_size; LEAN_EXPORT lean_object* l_UInt32_mk___boxed(lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqBool___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_orElse(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_cond___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_instDecidableLtPosInstLTPos(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_toArrayAux___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__7(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_getModify___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* lean_name_mk_numeral(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instBEq___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt64_toUSize___boxed(lean_object*); static lean_object* l_Char_ofNat___closed__1; LEAN_EXPORT lean_object* l_instHAddPosString(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instInhabitedEStateM___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Function_const(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Char_ofNat___boxed(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_map(lean_object*, lean_object*); static lean_object* l_System_Platform_numBits___closed__1; LEAN_EXPORT uint8_t l_instDecidableLtUInt32InstLTUInt32(uint32_t, uint32_t); lean_object* lean_panic_fn(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHOr(lean_object*); LEAN_EXPORT lean_object* l_EStateM_instInhabitedResult(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instLEFin___boxed(lean_object*); LEAN_EXPORT lean_object* l_instLENat; LEAN_EXPORT lean_object* l_Array_getOp___rarg(lean_object*, lean_object*, lean_object*); uint8_t lean_uint8_of_nat(lean_object*); LEAN_EXPORT lean_object* l_Fin_decLe___rarg___boxed(lean_object*, lean_object*); static lean_object* l_Lean_Macro_instMonadQuotationMacroM___closed__4; LEAN_EXPORT lean_object* l_Lean_Macro_trace(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_modifyGetThe(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instMonadLiftT(lean_object*, lean_object*, lean_object*); static lean_object* l_EStateM_instMonadExceptOfEStateM___rarg___closed__1; LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___boxed(lean_object*); LEAN_EXPORT lean_object* l_UInt16_ofNatCore___boxed(lean_object*, lean_object*); uint32_t lean_uint32_of_nat(lean_object*); LEAN_EXPORT lean_object* l_instLTPos; lean_object* lean_array_data(lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__4(lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Lean_Syntax_isOfKind(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instOfNatNat(lean_object*); uint64_t lean_uint64_mix_hash(uint64_t, uint64_t); LEAN_EXPORT lean_object* l_UInt32_size; static lean_object* l_Lean_instInhabitedMacroScopesView___closed__1; LEAN_EXPORT lean_object* l_Array_sequenceMap_loop(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_USize_ofNatCore___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg(lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f(lean_object*, uint8_t); LEAN_EXPORT lean_object* l_instInhabited(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Fin_decLt___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadRef___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_get(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableEqFin___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___rarg___lambda__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_withRef(lean_object*); LEAN_EXPORT lean_object* l_List_concat(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_adapt___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_sequenceMap(lean_object*, lean_object*, lean_object*); uint8_t lean_uint16_dec_eq(uint16_t, uint16_t); static lean_object* l_instAddNat___closed__1; LEAN_EXPORT lean_object* l_Lean_Macro_withFreshMacroScope___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_modifyThe___rarg(lean_object*, lean_object*); static lean_object* l_Lean_nameLitKind___closed__2; static lean_object* l___private_Init_Prelude_0__Lean_extractImported___closed__1; LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg(lean_object*); LEAN_EXPORT lean_object* l_instLTUInt32; LEAN_EXPORT lean_object* l_instHShiftLeft(lean_object*); LEAN_EXPORT lean_object* l_List_lengthTRAux___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_throwUnsupported(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_instHashableString___closed__1; static lean_object* l_Lean_Macro_instMonadRefMacroM___closed__3; LEAN_EXPORT lean_object* l_instMonadStateOf___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_bind___at_Lean_Macro_instMonadRefMacroM___spec__2(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_id(lean_object*); LEAN_EXPORT uint8_t l_instDecidableEqBool(uint8_t, uint8_t); static lean_object* l___private_Init_Prelude_0__Lean_assembleParts___closed__1; LEAN_EXPORT lean_object* l_Lean_Syntax_getOp___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods; LEAN_EXPORT lean_object* l_instHOrElse___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_Macro_MethodsRefPointed; LEAN_EXPORT lean_object* l_dite___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_String_utf8ByteSize___boxed(lean_object*); LEAN_EXPORT lean_object* l_id___rarg(lean_object*); LEAN_EXPORT lean_object* l_instHSubPos(lean_object*, lean_object*); static lean_object* l_Lean_interpolatedStrKind___closed__1; LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Eq_ndrec___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_SourceInfo_getPos_x3f(lean_object*, uint8_t); LEAN_EXPORT lean_object* lean_simp_macro_scopes(lean_object*); LEAN_EXPORT lean_object* l_max___rarg(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__3; LEAN_EXPORT lean_object* l_EStateM_bind(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instBEqNat; LEAN_EXPORT lean_object* l_UInt32_val___boxed(lean_object*); LEAN_EXPORT lean_object* l_dite___rarg(uint8_t, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_unsafeCast(lean_object*, lean_object*); lean_object* lean_system_platform_nbits(lean_object*); LEAN_EXPORT lean_object* l_instMonadState___rarg___lambda__1(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_throw(lean_object*, lean_object*, lean_object*); lean_object* lean_usize_to_nat(size_t); LEAN_EXPORT lean_object* l_instDecidableNot___rarg___boxed(lean_object*); LEAN_EXPORT uint16_t l_instInhabitedUInt16; LEAN_EXPORT lean_object* l_String_Pos_byteIdx___default; LEAN_EXPORT lean_object* l_Option_getD___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_pure(lean_object*, lean_object*); lean_object* lean_uint16_to_nat(uint16_t); uint16_t lean_uint16_of_nat(lean_object*); LEAN_EXPORT lean_object* l_Array_setD___rarg___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Macro_instMonadQuotationMacroM___closed__2; uint8_t lean_uint32_dec_le(uint32_t, uint32_t); LEAN_EXPORT uint8_t l_instDecidableOr___rarg(uint8_t, uint8_t); LEAN_EXPORT lean_object* l_EStateM_pure___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHAndThen(lean_object*); LEAN_EXPORT lean_object* l_instOfNatNat___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope(lean_object*); uint32_t lean_uint32_of_nat(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedSort; LEAN_EXPORT lean_object* l_Array_empty(lean_object*); LEAN_EXPORT lean_object* l_Monad_seq___default___rarg___lambda__1(lean_object*, lean_object*, lean_object*); static lean_object* l_EStateM_instMonadEStateM___closed__7; LEAN_EXPORT uint8_t l_Lean_Syntax_matchesIdent(lean_object*, lean_object*); static lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__5; LEAN_EXPORT lean_object* l_instMonadReader(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instPowNat; LEAN_EXPORT lean_object* l_instInhabitedReaderT___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__2(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_UInt64_size; LEAN_EXPORT lean_object* l_instLEPos; LEAN_EXPORT lean_object* l_Monad_seqRight___default(lean_object*); LEAN_EXPORT lean_object* l_USize_ofNat32___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_hash___boxed(lean_object*); LEAN_EXPORT lean_object* l_List_lengthTR(lean_object*); LEAN_EXPORT lean_object* l_instHPow___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_defaultMaxRecDepth; LEAN_EXPORT lean_object* l_Applicative_seqLeft___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___rarg(lean_object*, lean_object*); static lean_object* l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1; LEAN_EXPORT lean_object* l_Lean_Syntax_getOp(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mk___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHAndThen___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableLtPosInstLTPos___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instLTFin___boxed(lean_object*); LEAN_EXPORT lean_object* l_modifyGetThe___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_modify___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_EStateM_instMonadExceptOfEStateM(lean_object*, lean_object*, lean_object*); lean_object* lean_uint32_to_nat(uint32_t); LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_uint32_to_nat(uint32_t); size_t lean_usize_of_nat(lean_object*); LEAN_EXPORT lean_object* l_UInt8_decEq___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_SourceInfo_getPos_x3f___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instInhabitedForAll__2(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Nat_ble___boxed(lean_object*, lean_object*); static uint64_t l_Lean_Name_hash___closed__1; LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_length___rarg___boxed(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedForAll___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_hasDecEq___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instDecidableOr___rarg___boxed(lean_object*, lean_object*); lean_object* lean_string_mk(lean_object*); uint64_t lean_string_hash(lean_object*); LEAN_EXPORT lean_object* l_EStateM_orElse___rarg(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_extractImported(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_interpolatedStrLitKind; LEAN_EXPORT lean_object* l_Array_set_x21___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_set___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_append___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_cast___rarg(lean_object*); LEAN_EXPORT lean_object* l_instMonadWithReaderOfReaderT(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Macro_Context_maxRecDepth___default; LEAN_EXPORT lean_object* l_String_utf8ByteSize_go(lean_object*); LEAN_EXPORT lean_object* l_instHAdd(lean_object*); LEAN_EXPORT lean_object* l_min___rarg(lean_object*, lean_object*, lean_object*); static lean_object* l___private_Init_Prelude_0__Lean_extractMacroScopesAux___closed__1; LEAN_EXPORT lean_object* l_String_hash___boxed(lean_object*); LEAN_EXPORT lean_object* l_Decidable_decide(lean_object*); LEAN_EXPORT lean_object* l_Monad_map___default___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instHXor___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instMonadRef___rarg(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_isIdent___boxed(lean_object*); LEAN_EXPORT lean_object* l_instInhabitedReaderT(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_length___rarg(lean_object*); LEAN_EXPORT lean_object* l_List_foldl(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_instInhabitedSourceInfo; lean_object* lean_uint8_to_nat(uint8_t); LEAN_EXPORT lean_object* l_List_get(lean_object*); LEAN_EXPORT lean_object* l_Nat_decEq___boxed(lean_object*, lean_object*); static lean_object* l_Lean_nameLitKind___closed__1; LEAN_EXPORT lean_object* l_List_get___rarg___boxed(lean_object*, lean_object*); uint8_t lean_string_dec_eq(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Char_ofNat(lean_object*); LEAN_EXPORT lean_object* l_ReaderT_pure___rarg(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_lt(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Name_instBEqName; LEAN_EXPORT lean_object* l_instMonadWithReaderOf___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_instTransEq(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f_loop___boxed(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Lean_Syntax_isIdent(lean_object*); LEAN_EXPORT lean_object* l_readThe___rarg(lean_object*); LEAN_EXPORT lean_object* l_EStateM_tryCatch___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_id___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_id(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_id___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_id___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_id___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_Function_comp___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_apply_1(x_2, x_3); x_5 = lean_apply_1(x_1, x_4); return x_5; } } LEAN_EXPORT lean_object* l_Function_comp(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_Function_comp___rarg), 3, 0); return x_4; } } LEAN_EXPORT lean_object* l_Function_const___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_Function_const(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_Function_const___rarg___boxed), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_Function_const___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Function_const___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_inferInstance___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_inferInstance(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_inferInstance___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_inferInstance___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_inferInstance___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_inferInstanceAs___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_inferInstanceAs(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_inferInstanceAs___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_inferInstanceAs___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_inferInstanceAs___rarg(x_1); lean_dec(x_1); return x_2; } } static lean_object* _init_l_Unit_unit() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } LEAN_EXPORT lean_object* l_False_elim(lean_object* x_1, uint8_t x_2) { _start: { lean_internal_panic_unreachable(); } } LEAN_EXPORT lean_object* l_False_elim___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_unbox(x_2); lean_dec(x_2); x_4 = l_False_elim(x_1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_absurd(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_internal_panic_unreachable(); } } LEAN_EXPORT lean_object* l_Eq_ndrec___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_Eq_ndrec(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_Eq_ndrec___rarg___boxed), 3, 0); return x_4; } } LEAN_EXPORT lean_object* l_Eq_ndrec___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Eq_ndrec___rarg(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Eq_ndrec___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Eq_ndrec(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_cast___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_cast(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_cast___rarg___boxed), 1, 0); return x_4; } } LEAN_EXPORT lean_object* l_cast___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_cast___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_typedExpr___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_typedExpr(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_typedExpr___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_typedExpr___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_typedExpr___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_namedPattern___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_namedPattern(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_namedPattern___rarg___boxed), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_namedPattern___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_namedPattern___rarg(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_namedPattern___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_namedPattern(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_sorryAx___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_unbox(x_2); lean_dec(x_2); x_4 = lean_sorry(x_3); return x_4; } } static lean_object* _init_l_instInhabitedSort() { _start: { return lean_box(0); } } LEAN_EXPORT lean_object* l_instInhabitedForAll___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_instInhabitedForAll(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instInhabitedForAll___rarg___boxed), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedForAll___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_instInhabitedForAll___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedForAll__1___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_apply_1(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedForAll__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instInhabitedForAll__1___rarg), 2, 0); return x_3; } } static uint8_t _init_l_instInhabitedBool() { _start: { uint8_t x_1; x_1 = 0; return x_1; } } static lean_object* _init_l_instInhabitedNonemptyType() { _start: { return lean_box(0); } } LEAN_EXPORT uint8_t l_Decidable_decide___rarg(uint8_t x_1) { _start: { return x_1; } } LEAN_EXPORT lean_object* l_Decidable_decide(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Decidable_decide___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_Decidable_decide___rarg___boxed(lean_object* x_1) { _start: { uint8_t x_2; uint8_t x_3; lean_object* x_4; x_2 = lean_unbox(x_1); lean_dec(x_1); x_3 = l_Decidable_decide___rarg(x_2); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_decEq___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_decEq(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_decEq___rarg), 3, 0); return x_2; } } LEAN_EXPORT uint8_t l_instDecidableEqBool(uint8_t x_1, uint8_t x_2) { _start: { if (x_1 == 0) { if (x_2 == 0) { uint8_t x_3; x_3 = 1; return x_3; } else { uint8_t x_4; x_4 = 0; return x_4; } } else { return x_2; } } } LEAN_EXPORT lean_object* l_instDecidableEqBool___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_instDecidableEqBool(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT lean_object* l_instBEq___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instBEq(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instBEq___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_dite___rarg(uint8_t x_1, lean_object* x_2, lean_object* x_3) { _start: { if (x_1 == 0) { lean_object* x_4; lean_dec(x_2); x_4 = lean_apply_1(x_3, lean_box(0)); return x_4; } else { lean_object* x_5; lean_dec(x_3); x_5 = lean_apply_1(x_2, lean_box(0)); return x_5; } } } LEAN_EXPORT lean_object* l_dite(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_dite___rarg___boxed), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_dite___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = lean_unbox(x_1); lean_dec(x_1); x_5 = l_dite___rarg(x_4, x_2, x_3); return x_5; } } LEAN_EXPORT lean_object* l_ite___rarg(uint8_t x_1, lean_object* x_2, lean_object* x_3) { _start: { if (x_1 == 0) { lean_inc(x_3); return x_3; } else { lean_inc(x_2); return x_2; } } } LEAN_EXPORT lean_object* l_ite(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ite___rarg___boxed), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_ite___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = lean_unbox(x_1); lean_dec(x_1); x_5 = l_ite___rarg(x_4, x_2, x_3); lean_dec(x_3); lean_dec(x_2); return x_5; } } LEAN_EXPORT uint8_t l_instDecidableAnd___rarg(uint8_t x_1, uint8_t x_2) { _start: { if (x_1 == 0) { uint8_t x_3; x_3 = 0; return x_3; } else { return x_2; } } } LEAN_EXPORT lean_object* l_instDecidableAnd(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instDecidableAnd___rarg___boxed), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableAnd___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_instDecidableAnd___rarg(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableOr___rarg(uint8_t x_1, uint8_t x_2) { _start: { if (x_1 == 0) { return x_2; } else { uint8_t x_3; x_3 = 1; return x_3; } } } LEAN_EXPORT lean_object* l_instDecidableOr(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instDecidableOr___rarg___boxed), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableOr___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_instDecidableOr___rarg(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableNot___rarg(uint8_t x_1) { _start: { if (x_1 == 0) { uint8_t x_2; x_2 = 1; return x_2; } else { uint8_t x_3; x_3 = 0; return x_3; } } } LEAN_EXPORT lean_object* l_instDecidableNot(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instDecidableNot___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_instDecidableNot___rarg___boxed(lean_object* x_1) { _start: { uint8_t x_2; uint8_t x_3; lean_object* x_4; x_2 = lean_unbox(x_1); lean_dec(x_1); x_3 = l_instDecidableNot___rarg(x_2); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_cond___rarg(uint8_t x_1, lean_object* x_2, lean_object* x_3) { _start: { if (x_1 == 0) { lean_inc(x_3); return x_3; } else { lean_inc(x_2); return x_2; } } } LEAN_EXPORT lean_object* l_cond(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_cond___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_cond___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = lean_unbox(x_1); lean_dec(x_1); x_5 = l_cond___rarg(x_4, x_2, x_3); lean_dec(x_3); lean_dec(x_2); return x_5; } } LEAN_EXPORT uint8_t l_or(uint8_t x_1, uint8_t x_2) { _start: { if (x_1 == 0) { return x_2; } else { uint8_t x_3; x_3 = 1; return x_3; } } } LEAN_EXPORT lean_object* l_or___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_or(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_and(uint8_t x_1, uint8_t x_2) { _start: { if (x_1 == 0) { uint8_t x_3; x_3 = 0; return x_3; } else { return x_2; } } } LEAN_EXPORT lean_object* l_and___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_and(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_not(uint8_t x_1) { _start: { if (x_1 == 0) { uint8_t x_2; x_2 = 1; return x_2; } else { uint8_t x_3; x_3 = 0; return x_3; } } } LEAN_EXPORT lean_object* l_not___boxed(lean_object* x_1) { _start: { uint8_t x_2; uint8_t x_3; lean_object* x_4; x_2 = lean_unbox(x_1); lean_dec(x_1); x_3 = l_not(x_2); x_4 = lean_box(x_3); return x_4; } } static lean_object* _init_l_instInhabitedNat() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(0u); return x_1; } } LEAN_EXPORT lean_object* l_instOfNatNat(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_instOfNatNat___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_instOfNatNat(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_max___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; uint8_t x_5; lean_inc(x_2); lean_inc(x_3); x_4 = lean_apply_2(x_1, x_3, x_2); x_5 = lean_unbox(x_4); lean_dec(x_4); if (x_5 == 0) { lean_dec(x_2); return x_3; } else { lean_dec(x_3); return x_2; } } } LEAN_EXPORT lean_object* l_max(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_max___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_max___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_max(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_min___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; uint8_t x_5; lean_inc(x_3); lean_inc(x_2); x_4 = lean_apply_2(x_1, x_2, x_3); x_5 = lean_unbox(x_4); lean_dec(x_4); if (x_5 == 0) { lean_dec(x_2); return x_3; } else { lean_dec(x_3); return x_2; } } } LEAN_EXPORT lean_object* l_min(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_min___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_min___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_min(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_instTransEq(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_box(0); return x_4; } } LEAN_EXPORT lean_object* l_instTransEq__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_box(0); return x_4; } } LEAN_EXPORT lean_object* l_instHAdd___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHAdd(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHAdd___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHSub___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHSub(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHSub___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHMul___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHMul(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHMul___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHDiv___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHDiv(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHDiv___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHMod___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHMod(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHMod___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHPow___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHPow(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instHPow___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_instHAppend___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHAppend(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHAppend___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHOrElse___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHOrElse(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHOrElse___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHAndThen___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHAndThen(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHAndThen___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHAnd___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHAnd(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHAnd___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHXor___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHXor(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHXor___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHOr___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHOr(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHOr___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHShiftLeft___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHShiftLeft(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHShiftLeft___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instHShiftRight___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHShiftRight(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instHShiftRight___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Nat_add___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_nat_add(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_instAddNat___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Nat_add___boxed), 2, 0); return x_1; } } static lean_object* _init_l_instAddNat() { _start: { lean_object* x_1; x_1 = l_instAddNat___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_Nat_mul___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_nat_mul(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_instMulNat___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Nat_mul___boxed), 2, 0); return x_1; } } static lean_object* _init_l_instMulNat() { _start: { lean_object* x_1; x_1 = l_instMulNat___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_Nat_pow___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_nat_pow(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_instPowNat___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Nat_pow___boxed), 2, 0); return x_1; } } static lean_object* _init_l_instPowNat() { _start: { lean_object* x_1; x_1 = l_instPowNat___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_Nat_beq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_nat_dec_eq(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } static lean_object* _init_l_instBEqNat___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Nat_beq___boxed), 2, 0); return x_1; } } static lean_object* _init_l_instBEqNat() { _start: { lean_object* x_1; x_1 = l_instBEqNat___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_Nat_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_nat_dec_eq(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT uint8_t l_instDecidableEqNat(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqNat___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_instDecidableEqNat(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Nat_ble___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_nat_dec_le(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } static lean_object* _init_l_instLENat() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } static lean_object* _init_l_instLTNat() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } LEAN_EXPORT lean_object* l_Nat_pred___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_nat_sub(x_1, lean_box(1)); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_Nat_decLe___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_nat_dec_le(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Nat_decLt___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_nat_dec_lt(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Nat_sub___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_nat_sub(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_instSubNat___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Nat_sub___boxed), 2, 0); return x_1; } } static lean_object* _init_l_instSubNat() { _start: { lean_object* x_1; x_1 = l_instSubNat___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_System_Platform_getNumBits___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_system_platform_nbits(x_1); return x_2; } } static lean_object* _init_l_System_Platform_numBits___closed__1() { _start: { lean_object* x_1; lean_object* x_2; x_1 = lean_box(0); x_2 = lean_system_platform_nbits(x_1); return x_2; } } static lean_object* _init_l_System_Platform_numBits() { _start: { lean_object* x_1; x_1 = l_System_Platform_numBits___closed__1; return x_1; } } LEAN_EXPORT uint8_t l_instDecidableEqFin___rarg(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqFin(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instDecidableEqFin___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_instDecidableEqFin___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_instDecidableEqFin___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_instDecidableEqFin___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_instDecidableEqFin(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_instLTFin(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_box(0); return x_2; } } LEAN_EXPORT lean_object* l_instLTFin___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_instLTFin(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_instLEFin(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_box(0); return x_2; } } LEAN_EXPORT lean_object* l_instLEFin___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_instLEFin(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT uint8_t l_Fin_decLt___rarg(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_lt(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_Fin_decLt(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Fin_decLt___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_Fin_decLt___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_Fin_decLt___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Fin_decLt___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Fin_decLt(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT uint8_t l_Fin_decLe___rarg(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_le(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_Fin_decLe(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Fin_decLe___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_Fin_decLe___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_Fin_decLe___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Fin_decLe___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Fin_decLe(x_1); lean_dec(x_1); return x_2; } } static lean_object* _init_l_UInt8_size() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(256u); return x_1; } } LEAN_EXPORT lean_object* l_UInt8_mk___boxed(lean_object* x_1) { _start: { uint8_t x_2; lean_object* x_3; x_2 = lean_uint8_of_nat_mk(x_1); x_3 = lean_box(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt8_val___boxed(lean_object* x_1) { _start: { uint8_t x_2; lean_object* x_3; x_2 = lean_unbox(x_1); lean_dec(x_1); x_3 = lean_uint8_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt8_ofNatCore___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_uint8_of_nat(x_1); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_UInt8_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = lean_uint8_dec_eq(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableEqUInt8(uint8_t x_1, uint8_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint8_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqUInt8___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_instDecidableEqUInt8(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static uint8_t _init_l_instInhabitedUInt8___closed__1() { _start: { lean_object* x_1; uint8_t x_2; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_uint8_of_nat(x_1); return x_2; } } static uint8_t _init_l_instInhabitedUInt8() { _start: { uint8_t x_1; x_1 = l_instInhabitedUInt8___closed__1; return x_1; } } static lean_object* _init_l_UInt16_size() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(65536u); return x_1; } } LEAN_EXPORT lean_object* l_UInt16_mk___boxed(lean_object* x_1) { _start: { uint16_t x_2; lean_object* x_3; x_2 = lean_uint16_of_nat_mk(x_1); x_3 = lean_box(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt16_val___boxed(lean_object* x_1) { _start: { uint16_t x_2; lean_object* x_3; x_2 = lean_unbox(x_1); lean_dec(x_1); x_3 = lean_uint16_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt16_ofNatCore___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint16_t x_3; lean_object* x_4; x_3 = lean_uint16_of_nat(x_1); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_UInt16_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint16_t x_3; uint16_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = lean_uint16_dec_eq(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableEqUInt16(uint16_t x_1, uint16_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint16_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqUInt16___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint16_t x_3; uint16_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox(x_1); lean_dec(x_1); x_4 = lean_unbox(x_2); lean_dec(x_2); x_5 = l_instDecidableEqUInt16(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static uint16_t _init_l_instInhabitedUInt16___closed__1() { _start: { lean_object* x_1; uint16_t x_2; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_uint16_of_nat(x_1); return x_2; } } static uint16_t _init_l_instInhabitedUInt16() { _start: { uint16_t x_1; x_1 = l_instInhabitedUInt16___closed__1; return x_1; } } static lean_object* _init_l_UInt32_size() { _start: { lean_object* x_1; x_1 = lean_cstr_to_nat("4294967296"); return x_1; } } LEAN_EXPORT lean_object* l_UInt32_mk___boxed(lean_object* x_1) { _start: { uint32_t x_2; lean_object* x_3; x_2 = lean_uint32_of_nat_mk(x_1); x_3 = lean_box_uint32(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt32_val___boxed(lean_object* x_1) { _start: { uint32_t x_2; lean_object* x_3; x_2 = lean_unbox_uint32(x_1); lean_dec(x_1); x_3 = lean_uint32_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt32_ofNatCore___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; lean_object* x_4; x_3 = lean_uint32_of_nat(x_1); lean_dec(x_1); x_4 = lean_box_uint32(x_3); return x_4; } } LEAN_EXPORT lean_object* l_UInt32_toNat___boxed(lean_object* x_1) { _start: { uint32_t x_2; lean_object* x_3; x_2 = lean_unbox_uint32(x_1); lean_dec(x_1); x_3 = lean_uint32_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt32_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = lean_uint32_dec_eq(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableEqUInt32(uint32_t x_1, uint32_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint32_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqUInt32___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = l_instDecidableEqUInt32(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static uint32_t _init_l_instInhabitedUInt32___closed__1() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_instInhabitedUInt32() { _start: { uint32_t x_1; x_1 = l_instInhabitedUInt32___closed__1; return x_1; } } static lean_object* _init_l_instLTUInt32() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } static lean_object* _init_l_instLEUInt32() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } LEAN_EXPORT lean_object* l_UInt32_decLt___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = lean_uint32_dec_lt(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT lean_object* l_UInt32_decLe___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = lean_uint32_dec_le(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableLtUInt32InstLTUInt32(uint32_t x_1, uint32_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint32_dec_lt(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableLtUInt32InstLTUInt32___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = l_instDecidableLtUInt32InstLTUInt32(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableLeUInt32InstLEUInt32(uint32_t x_1, uint32_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint32_dec_le(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableLeUInt32InstLEUInt32___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = l_instDecidableLeUInt32InstLEUInt32(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static lean_object* _init_l_UInt64_size___closed__1() { _start: { lean_object* x_1; x_1 = lean_cstr_to_nat("18446744073709551616"); return x_1; } } static lean_object* _init_l_UInt64_size() { _start: { lean_object* x_1; x_1 = l_UInt64_size___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_UInt64_mk___boxed(lean_object* x_1) { _start: { uint64_t x_2; lean_object* x_3; x_2 = lean_uint64_of_nat_mk(x_1); x_3 = lean_box_uint64(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt64_val___boxed(lean_object* x_1) { _start: { uint64_t x_2; lean_object* x_3; x_2 = lean_unbox_uint64(x_1); lean_dec(x_1); x_3 = lean_uint64_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_UInt64_ofNatCore___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint64_t x_3; lean_object* x_4; x_3 = lean_uint64_of_nat(x_1); lean_dec(x_1); x_4 = lean_box_uint64(x_3); return x_4; } } LEAN_EXPORT lean_object* l_UInt64_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint64_t x_3; uint64_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint64(x_1); lean_dec(x_1); x_4 = lean_unbox_uint64(x_2); lean_dec(x_2); x_5 = lean_uint64_dec_eq(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableEqUInt64(uint64_t x_1, uint64_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint64_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqUInt64___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint64_t x_3; uint64_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint64(x_1); lean_dec(x_1); x_4 = lean_unbox_uint64(x_2); lean_dec(x_2); x_5 = l_instDecidableEqUInt64(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static uint64_t _init_l_instInhabitedUInt64___closed__1() { _start: { lean_object* x_1; uint64_t x_2; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_uint64_of_nat(x_1); return x_2; } } static uint64_t _init_l_instInhabitedUInt64() { _start: { uint64_t x_1; x_1 = l_instInhabitedUInt64___closed__1; return x_1; } } static lean_object* _init_l_USize_size___closed__1() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_unsigned_to_nat(2u); x_2 = l_System_Platform_numBits; x_3 = lean_nat_pow(x_1, x_2); return x_3; } } static lean_object* _init_l_USize_size() { _start: { lean_object* x_1; x_1 = l_USize_size___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_USize_mk___boxed(lean_object* x_1) { _start: { size_t x_2; lean_object* x_3; x_2 = lean_usize_of_nat_mk(x_1); x_3 = lean_box_usize(x_2); return x_3; } } LEAN_EXPORT lean_object* l_USize_val___boxed(lean_object* x_1) { _start: { size_t x_2; lean_object* x_3; x_2 = lean_unbox_usize(x_1); lean_dec(x_1); x_3 = lean_usize_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_USize_ofNatCore___boxed(lean_object* x_1, lean_object* x_2) { _start: { size_t x_3; lean_object* x_4; x_3 = lean_usize_of_nat(x_1); lean_dec(x_1); x_4 = lean_box_usize(x_3); return x_4; } } LEAN_EXPORT lean_object* l_USize_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { size_t x_3; size_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_usize(x_1); lean_dec(x_1); x_4 = lean_unbox_usize(x_2); lean_dec(x_2); x_5 = lean_usize_dec_eq(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } LEAN_EXPORT uint8_t l_instDecidableEqUSize(size_t x_1, size_t x_2) { _start: { uint8_t x_3; x_3 = lean_usize_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqUSize___boxed(lean_object* x_1, lean_object* x_2) { _start: { size_t x_3; size_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_usize(x_1); lean_dec(x_1); x_4 = lean_unbox_usize(x_2); lean_dec(x_2); x_5 = l_instDecidableEqUSize(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static size_t _init_l_instInhabitedUSize___closed__1() { _start: { lean_object* x_1; size_t x_2; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_usize_of_nat(x_1); return x_2; } } static size_t _init_l_instInhabitedUSize() { _start: { size_t x_1; x_1 = l_instInhabitedUSize___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_USize_ofNat32___boxed(lean_object* x_1, lean_object* x_2) { _start: { size_t x_3; lean_object* x_4; x_3 = lean_usize_of_nat(x_1); lean_dec(x_1); x_4 = lean_box_usize(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Char_ofNatAux___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; lean_object* x_4; x_3 = lean_uint32_of_nat(x_1); lean_dec(x_1); x_4 = lean_box_uint32(x_3); return x_4; } } static lean_object* _init_l_Char_ofNat___closed__1() { _start: { lean_object* x_1; uint32_t x_2; lean_object* x_3; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_uint32_of_nat_mk(x_1); x_3 = lean_box_uint32(x_2); return x_3; } } LEAN_EXPORT lean_object* l_Char_ofNat(lean_object* x_1) { _start: { lean_object* x_2; uint8_t x_3; x_2 = lean_unsigned_to_nat(55296u); x_3 = lean_nat_dec_lt(x_1, x_2); if (x_3 == 0) { lean_object* x_4; uint8_t x_5; x_4 = lean_unsigned_to_nat(57343u); x_5 = lean_nat_dec_lt(x_4, x_1); if (x_5 == 0) { lean_object* x_6; x_6 = l_Char_ofNat___closed__1; return x_6; } else { lean_object* x_7; uint8_t x_8; x_7 = lean_unsigned_to_nat(1114112u); x_8 = lean_nat_dec_lt(x_1, x_7); if (x_8 == 0) { lean_object* x_9; x_9 = l_Char_ofNat___closed__1; return x_9; } else { uint32_t x_10; lean_object* x_11; x_10 = lean_uint32_of_nat(x_1); x_11 = lean_box_uint32(x_10); return x_11; } } } else { uint32_t x_12; lean_object* x_13; x_12 = lean_uint32_of_nat(x_1); x_13 = lean_box_uint32(x_12); return x_13; } } } LEAN_EXPORT lean_object* l_Char_ofNat___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Char_ofNat(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT uint8_t l_instDecidableEqChar(uint32_t x_1, uint32_t x_2) { _start: { uint8_t x_3; x_3 = lean_uint32_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqChar___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; uint32_t x_4; uint8_t x_5; lean_object* x_6; x_3 = lean_unbox_uint32(x_1); lean_dec(x_1); x_4 = lean_unbox_uint32(x_2); lean_dec(x_2); x_5 = l_instDecidableEqChar(x_3, x_4); x_6 = lean_box(x_5); return x_6; } } static uint32_t _init_l_Char_utf8Size___closed__1() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(127u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_Char_utf8Size___closed__2() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(2047u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_Char_utf8Size___closed__3() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(65535u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_Char_utf8Size___closed__4() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(4u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_Char_utf8Size___closed__5() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(3u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_Char_utf8Size___closed__6() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(2u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } static uint32_t _init_l_Char_utf8Size___closed__7() { _start: { lean_object* x_1; uint32_t x_2; x_1 = lean_unsigned_to_nat(1u); x_2 = lean_uint32_of_nat(x_1); return x_2; } } LEAN_EXPORT uint32_t l_Char_utf8Size(uint32_t x_1) { _start: { uint32_t x_2; uint8_t x_3; x_2 = l_Char_utf8Size___closed__1; x_3 = lean_uint32_dec_le(x_1, x_2); if (x_3 == 0) { uint32_t x_4; uint8_t x_5; x_4 = l_Char_utf8Size___closed__2; x_5 = lean_uint32_dec_le(x_1, x_4); if (x_5 == 0) { uint32_t x_6; uint8_t x_7; x_6 = l_Char_utf8Size___closed__3; x_7 = lean_uint32_dec_le(x_1, x_6); if (x_7 == 0) { uint32_t x_8; x_8 = l_Char_utf8Size___closed__4; return x_8; } else { uint32_t x_9; x_9 = l_Char_utf8Size___closed__5; return x_9; } } else { uint32_t x_10; x_10 = l_Char_utf8Size___closed__6; return x_10; } } else { uint32_t x_11; x_11 = l_Char_utf8Size___closed__7; return x_11; } } } LEAN_EXPORT lean_object* l_Char_utf8Size___boxed(lean_object* x_1) { _start: { uint32_t x_2; uint32_t x_3; lean_object* x_4; x_2 = lean_unbox_uint32(x_1); lean_dec(x_1); x_3 = l_Char_utf8Size(x_2); x_4 = lean_box_uint32(x_3); return x_4; } } LEAN_EXPORT lean_object* l_instInhabitedOption(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_box(0); return x_2; } } LEAN_EXPORT lean_object* l_Option_getD___rarg(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 0) { lean_inc(x_2); return x_2; } else { lean_object* x_3; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); return x_3; } } } LEAN_EXPORT lean_object* l_Option_getD(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Option_getD___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_Option_getD___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Option_getD___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedList(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_box(0); return x_2; } } LEAN_EXPORT uint8_t l_List_hasDecEq___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { if (lean_obj_tag(x_2) == 0) { lean_dec(x_1); if (lean_obj_tag(x_3) == 0) { uint8_t x_4; x_4 = 1; return x_4; } else { uint8_t x_5; lean_dec(x_3); x_5 = 0; return x_5; } } else { if (lean_obj_tag(x_3) == 0) { uint8_t x_6; lean_dec(x_2); lean_dec(x_1); x_6 = 0; return x_6; } else { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12; x_7 = lean_ctor_get(x_2, 0); lean_inc(x_7); x_8 = lean_ctor_get(x_2, 1); lean_inc(x_8); lean_dec(x_2); x_9 = lean_ctor_get(x_3, 0); lean_inc(x_9); x_10 = lean_ctor_get(x_3, 1); lean_inc(x_10); lean_dec(x_3); lean_inc(x_1); x_11 = lean_apply_2(x_1, x_7, x_9); x_12 = lean_unbox(x_11); lean_dec(x_11); if (x_12 == 0) { uint8_t x_13; lean_dec(x_10); lean_dec(x_8); lean_dec(x_1); x_13 = 0; return x_13; } else { x_2 = x_8; x_3 = x_10; goto _start; } } } } } LEAN_EXPORT lean_object* l_List_hasDecEq(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_hasDecEq___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_hasDecEq___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = l_List_hasDecEq___rarg(x_1, x_2, x_3); x_5 = lean_box(x_4); return x_5; } } LEAN_EXPORT uint8_t l_instDecidableEqList___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; x_4 = l_List_hasDecEq___rarg(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instDecidableEqList(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_instDecidableEqList___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_instDecidableEqList___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = l_instDecidableEqList___rarg(x_1, x_2, x_3); x_5 = lean_box(x_4); return x_5; } } LEAN_EXPORT lean_object* l_List_foldl___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { if (lean_obj_tag(x_3) == 0) { lean_dec(x_1); return x_2; } else { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_3, 0); lean_inc(x_4); x_5 = lean_ctor_get(x_3, 1); lean_inc(x_5); lean_dec(x_3); lean_inc(x_1); x_6 = lean_apply_2(x_1, x_2, x_4); x_2 = x_6; x_3 = x_5; goto _start; } } } LEAN_EXPORT lean_object* l_List_foldl(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_List_foldl___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_List_set___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { if (lean_obj_tag(x_1) == 0) { lean_object* x_4; lean_dec(x_3); x_4 = lean_box(0); return x_4; } else { uint8_t x_5; x_5 = !lean_is_exclusive(x_1); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; lean_object* x_8; uint8_t x_9; x_6 = lean_ctor_get(x_1, 0); x_7 = lean_ctor_get(x_1, 1); x_8 = lean_unsigned_to_nat(0u); x_9 = lean_nat_dec_eq(x_2, x_8); if (x_9 == 0) { lean_object* x_10; lean_object* x_11; lean_object* x_12; x_10 = lean_unsigned_to_nat(1u); x_11 = lean_nat_sub(x_2, x_10); x_12 = l_List_set___rarg(x_7, x_11, x_3); lean_dec(x_11); lean_ctor_set(x_1, 1, x_12); return x_1; } else { lean_dec(x_6); lean_ctor_set(x_1, 0, x_3); return x_1; } } else { lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16; x_13 = lean_ctor_get(x_1, 0); x_14 = lean_ctor_get(x_1, 1); lean_inc(x_14); lean_inc(x_13); lean_dec(x_1); x_15 = lean_unsigned_to_nat(0u); x_16 = lean_nat_dec_eq(x_2, x_15); if (x_16 == 0) { lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; x_17 = lean_unsigned_to_nat(1u); x_18 = lean_nat_sub(x_2, x_17); x_19 = l_List_set___rarg(x_14, x_18, x_3); lean_dec(x_18); x_20 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_20, 0, x_13); lean_ctor_set(x_20, 1, x_19); return x_20; } else { lean_object* x_21; lean_dec(x_13); x_21 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_21, 0, x_3); lean_ctor_set(x_21, 1, x_14); return x_21; } } } } } LEAN_EXPORT lean_object* l_List_set(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_set___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_set___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_List_set___rarg(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_List_length___rarg(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 0) { lean_object* x_2; x_2 = lean_unsigned_to_nat(0u); return x_2; } else { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_3 = lean_ctor_get(x_1, 1); x_4 = l_List_length___rarg(x_3); x_5 = lean_unsigned_to_nat(1u); x_6 = lean_nat_add(x_4, x_5); lean_dec(x_4); return x_6; } } } LEAN_EXPORT lean_object* l_List_length(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_length___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_length___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_List_length___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_List_lengthTRAux___rarg(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 0) { return x_2; } else { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_1, 1); x_4 = lean_unsigned_to_nat(1u); x_5 = lean_nat_add(x_2, x_4); lean_dec(x_2); x_1 = x_3; x_2 = x_5; goto _start; } } } LEAN_EXPORT lean_object* l_List_lengthTRAux(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_lengthTRAux___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_lengthTRAux___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_List_lengthTRAux___rarg(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_List_lengthTR___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; x_2 = lean_unsigned_to_nat(0u); x_3 = l_List_lengthTRAux___rarg(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_List_lengthTR(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_lengthTR___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_lengthTR___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_List_lengthTR___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_List_concat___rarg(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 0) { lean_object* x_3; lean_object* x_4; x_3 = lean_box(0); x_4 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_4, 0, x_2); lean_ctor_set(x_4, 1, x_3); return x_4; } else { uint8_t x_5; x_5 = !lean_is_exclusive(x_1); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; x_6 = lean_ctor_get(x_1, 1); x_7 = l_List_concat___rarg(x_6, x_2); lean_ctor_set(x_1, 1, x_7); return x_1; } else { lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; x_8 = lean_ctor_get(x_1, 0); x_9 = lean_ctor_get(x_1, 1); lean_inc(x_9); lean_inc(x_8); lean_dec(x_1); x_10 = l_List_concat___rarg(x_9, x_2); x_11 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_11, 0, x_8); lean_ctor_set(x_11, 1, x_10); return x_11; } } } } LEAN_EXPORT lean_object* l_List_concat(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_concat___rarg), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_get___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; x_3 = lean_ctor_get(x_1, 0); x_4 = lean_ctor_get(x_1, 1); x_5 = lean_unsigned_to_nat(0u); x_6 = lean_nat_dec_eq(x_2, x_5); if (x_6 == 0) { lean_object* x_7; lean_object* x_8; x_7 = lean_unsigned_to_nat(1u); x_8 = lean_nat_sub(x_2, x_7); lean_dec(x_2); x_1 = x_4; x_2 = x_8; goto _start; } else { lean_dec(x_2); lean_inc(x_3); return x_3; } } } LEAN_EXPORT lean_object* l_List_get(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_get___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_get___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_List_get___rarg(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_String_mk___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_string_mk(x_1); return x_2; } } LEAN_EXPORT lean_object* l_String_data___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_string_data(x_1); return x_2; } } LEAN_EXPORT lean_object* l_String_decEq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_string_dec_eq(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT uint8_t l_instDecidableEqString(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_string_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqString___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_instDecidableEqString(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } static lean_object* _init_l_String_Pos_byteIdx___default() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(0u); return x_1; } } static lean_object* _init_l_instInhabitedPos() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(0u); return x_1; } } LEAN_EXPORT uint8_t l_instDecidableEqPos(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_eq(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableEqPos___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_instDecidableEqPos(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } static lean_object* _init_l_instInhabitedSubstring___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string(""); return x_1; } } static lean_object* _init_l_instInhabitedSubstring___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_instInhabitedSubstring___closed__1; x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 3, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); lean_ctor_set(x_3, 2, x_2); return x_3; } } static lean_object* _init_l_instInhabitedSubstring() { _start: { lean_object* x_1; x_1 = l_instInhabitedSubstring___closed__2; return x_1; } } LEAN_EXPORT lean_object* l_Substring_bsize(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; x_2 = lean_ctor_get(x_1, 1); x_3 = lean_ctor_get(x_1, 2); x_4 = lean_nat_sub(x_3, x_2); return x_4; } } LEAN_EXPORT lean_object* l_Substring_bsize___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Substring_bsize(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_String_csize(uint32_t x_1) { _start: { uint32_t x_2; lean_object* x_3; x_2 = l_Char_utf8Size(x_1); x_3 = lean_uint32_to_nat(x_2); return x_3; } } LEAN_EXPORT lean_object* l_String_csize___boxed(lean_object* x_1) { _start: { uint32_t x_2; lean_object* x_3; x_2 = lean_unbox_uint32(x_1); lean_dec(x_1); x_3 = l_String_csize(x_2); return x_3; } } LEAN_EXPORT lean_object* l_String_utf8ByteSize_go(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 0) { lean_object* x_2; x_2 = lean_unsigned_to_nat(0u); return x_2; } else { lean_object* x_3; lean_object* x_4; lean_object* x_5; uint32_t x_6; lean_object* x_7; lean_object* x_8; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); x_4 = lean_ctor_get(x_1, 1); lean_inc(x_4); lean_dec(x_1); x_5 = l_String_utf8ByteSize_go(x_4); x_6 = lean_unbox_uint32(x_3); lean_dec(x_3); x_7 = l_String_csize(x_6); x_8 = lean_nat_add(x_5, x_7); lean_dec(x_7); lean_dec(x_5); return x_8; } } } LEAN_EXPORT lean_object* l_String_utf8ByteSize___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_string_utf8_byte_size(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_instHAddPos(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_nat_add(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instHAddPos___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_instHAddPos(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_instHSubPos(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_nat_sub(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instHSubPos___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_instHSubPos(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_instHAddPosChar(lean_object* x_1, uint32_t x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = l_String_csize(x_2); x_4 = lean_nat_add(x_1, x_3); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHAddPosChar___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint32_t x_3; lean_object* x_4; x_3 = lean_unbox_uint32(x_2); lean_dec(x_2); x_4 = l_instHAddPosChar(x_1, x_3); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_instHAddPosString(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_string_utf8_byte_size(x_2); x_4 = lean_nat_add(x_1, x_3); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_instHAddPosString___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_instHAddPosString(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_instLEPos() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } static lean_object* _init_l_instLTPos() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } LEAN_EXPORT uint8_t l_instDecidableLePosInstLEPos(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_le(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableLePosInstLEPos___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_instDecidableLePosInstLEPos(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT uint8_t l_instDecidableLtPosInstLTPos(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = lean_nat_dec_lt(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_instDecidableLtPosInstLTPos___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_instDecidableLtPosInstLTPos(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_String_endPos(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_string_utf8_byte_size(x_1); return x_2; } } LEAN_EXPORT lean_object* l_String_endPos___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_String_endPos(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_String_toSubstring(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; x_2 = lean_string_utf8_byte_size(x_1); x_3 = lean_unsigned_to_nat(0u); x_4 = lean_alloc_ctor(0, 3, 0); lean_ctor_set(x_4, 0, x_1); lean_ctor_set(x_4, 1, x_3); lean_ctor_set(x_4, 2, x_2); return x_4; } } LEAN_EXPORT lean_object* l_unsafeCast___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_unsafeCast(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_unsafeCast___rarg___boxed), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_unsafeCast___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_unsafeCast___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_panicCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_panic_fn(x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_panic___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_panic_fn(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_panic(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_panic___rarg), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_Array_data___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_array_data(x_2); return x_3; } } LEAN_EXPORT lean_object* l_Array_mk___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_array_mk(x_2); return x_3; } } LEAN_EXPORT lean_object* l_Array_mkEmpty___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_mk_empty_array_with_capacity(x_2); lean_dec(x_2); return x_3; } } static lean_object* _init_l_Array_empty___closed__1() { _start: { lean_object* x_1; lean_object* x_2; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_mk_empty_array_with_capacity(x_1); return x_2; } } LEAN_EXPORT lean_object* l_Array_empty(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Array_empty___closed__1; return x_2; } } LEAN_EXPORT lean_object* l_Array_size___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_array_get_size(x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_Array_get___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_array_fget(x_2, x_3); lean_dec(x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_Array_getD___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; uint8_t x_5; x_4 = lean_array_get_size(x_1); x_5 = lean_nat_dec_lt(x_2, x_4); lean_dec(x_4); if (x_5 == 0) { lean_inc(x_3); return x_3; } else { lean_object* x_6; x_6 = lean_array_fget(x_1, x_2); return x_6; } } } LEAN_EXPORT lean_object* l_Array_getD(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Array_getD___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Array_getD___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Array_getD___rarg(x_1, x_2, x_3); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Array_get_x21___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_array_get(x_2, x_3, x_4); lean_dec(x_4); lean_dec(x_3); return x_5; } } LEAN_EXPORT lean_object* l_Array_getOp___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_array_get(x_1, x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_Array_getOp(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Array_getOp___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Array_getOp___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Array_getOp___rarg(x_1, x_2, x_3); lean_dec(x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_Array_push___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_array_push(x_2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_Array_set___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_array_fset(x_2, x_3, x_4); lean_dec(x_3); return x_5; } } LEAN_EXPORT lean_object* l_Array_setD___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; uint8_t x_5; x_4 = lean_array_get_size(x_1); x_5 = lean_nat_dec_lt(x_2, x_4); lean_dec(x_4); if (x_5 == 0) { lean_dec(x_3); return x_1; } else { lean_object* x_6; x_6 = lean_array_fset(x_1, x_2, x_3); return x_6; } } } LEAN_EXPORT lean_object* l_Array_setD(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Array_setD___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Array_setD___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Array_setD___rarg(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_Array_set_x21___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_array_set(x_2, x_3, x_4); lean_dec(x_3); return x_5; } } LEAN_EXPORT lean_object* l_Array_appendCore_loop___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; uint8_t x_6; x_5 = lean_array_get_size(x_1); x_6 = lean_nat_dec_lt(x_3, x_5); lean_dec(x_5); if (x_6 == 0) { lean_dec(x_3); lean_dec(x_2); return x_4; } else { lean_object* x_7; uint8_t x_8; x_7 = lean_unsigned_to_nat(0u); x_8 = lean_nat_dec_eq(x_2, x_7); if (x_8 == 0) { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; x_9 = lean_unsigned_to_nat(1u); x_10 = lean_nat_sub(x_2, x_9); lean_dec(x_2); x_11 = lean_nat_add(x_3, x_9); x_12 = lean_array_fget(x_1, x_3); lean_dec(x_3); x_13 = lean_array_push(x_4, x_12); x_2 = x_10; x_3 = x_11; x_4 = x_13; goto _start; } else { lean_dec(x_3); lean_dec(x_2); return x_4; } } } } LEAN_EXPORT lean_object* l_Array_appendCore_loop(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Array_appendCore_loop___rarg___boxed), 4, 0); return x_2; } } LEAN_EXPORT lean_object* l_Array_appendCore_loop___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_Array_appendCore_loop___rarg(x_1, x_2, x_3, x_4); lean_dec(x_1); return x_5; } } LEAN_EXPORT lean_object* l_Array_appendCore___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_array_get_size(x_2); x_4 = lean_unsigned_to_nat(0u); x_5 = l_Array_appendCore_loop___rarg(x_2, x_3, x_4, x_1); return x_5; } } LEAN_EXPORT lean_object* l_Array_appendCore(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Array_appendCore___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_Array_appendCore___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Array_appendCore___rarg(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_List_toArrayAux___rarg(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 0) { return x_2; } else { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); x_4 = lean_ctor_get(x_1, 1); lean_inc(x_4); lean_dec(x_1); x_5 = lean_array_push(x_2, x_3); x_1 = x_4; x_2 = x_5; goto _start; } } } LEAN_EXPORT lean_object* l_List_toArrayAux(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_toArrayAux___rarg), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_redLength___rarg(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 0) { lean_object* x_2; x_2 = lean_unsigned_to_nat(0u); return x_2; } else { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_3 = lean_ctor_get(x_1, 1); x_4 = l_List_redLength___rarg(x_3); x_5 = lean_unsigned_to_nat(1u); x_6 = lean_nat_add(x_4, x_5); lean_dec(x_4); return x_6; } } } LEAN_EXPORT lean_object* l_List_redLength(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_List_redLength___rarg___boxed), 1, 0); return x_2; } } LEAN_EXPORT lean_object* l_List_redLength___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_List_redLength___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* lean_list_to_array(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = l_List_redLength___rarg(x_2); x_4 = lean_mk_empty_array_with_capacity(x_3); lean_dec(x_3); x_5 = l_List_toArrayAux___rarg(x_2, x_4); return x_5; } } LEAN_EXPORT lean_object* l_Functor_mapConst___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; x_6 = lean_alloc_closure((void*)(l_Function_const___rarg___boxed), 2, 1); lean_closure_set(x_6, 0, x_4); x_7 = lean_apply_4(x_1, lean_box(0), lean_box(0), x_6, x_5); return x_7; } } LEAN_EXPORT lean_object* l_Functor_mapConst___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Functor_mapConst___default___rarg), 5, 0); return x_2; } } LEAN_EXPORT lean_object* l_Applicative_map___default___rarg___lambda__1(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_Applicative_map___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; x_7 = lean_apply_2(x_1, lean_box(0), x_5); x_8 = lean_alloc_closure((void*)(l_Applicative_map___default___rarg___lambda__1___boxed), 2, 1); lean_closure_set(x_8, 0, x_6); x_9 = lean_apply_4(x_2, lean_box(0), lean_box(0), x_7, x_8); return x_9; } } LEAN_EXPORT lean_object* l_Applicative_map___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Applicative_map___default___rarg), 6, 0); return x_2; } } LEAN_EXPORT lean_object* l_Applicative_map___default___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Applicative_map___default___rarg___lambda__1(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_Applicative_seqLeft___default___rarg___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Function_const___rarg___boxed), 2, 0); return x_1; } } LEAN_EXPORT lean_object* l_Applicative_seqLeft___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 0); lean_inc(x_7); lean_dec(x_1); x_8 = l_Applicative_seqLeft___default___rarg___closed__1; x_9 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_8, x_5); x_10 = lean_apply_4(x_2, lean_box(0), lean_box(0), x_9, x_6); return x_10; } } LEAN_EXPORT lean_object* l_Applicative_seqLeft___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Applicative_seqLeft___default___rarg), 6, 0); return x_2; } } static lean_object* _init_l_Applicative_seqRight___default___rarg___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_id___rarg___boxed), 1, 0); return x_1; } } static lean_object* _init_l_Applicative_seqRight___default___rarg___closed__2() { _start: { lean_object* x_1; lean_object* x_2; x_1 = l_Applicative_seqRight___default___rarg___closed__1; x_2 = lean_alloc_closure((void*)(l_Function_const___rarg___boxed), 2, 1); lean_closure_set(x_2, 0, x_1); return x_2; } } LEAN_EXPORT lean_object* l_Applicative_seqRight___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 0); lean_inc(x_7); lean_dec(x_1); x_8 = l_Applicative_seqRight___default___rarg___closed__2; x_9 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_8, x_5); x_10 = lean_apply_4(x_2, lean_box(0), lean_box(0), x_9, x_6); return x_10; } } LEAN_EXPORT lean_object* l_Applicative_seqRight___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Applicative_seqRight___default___rarg), 6, 0); return x_2; } } LEAN_EXPORT lean_object* l_Monad_map___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 1); lean_inc(x_7); lean_dec(x_1); x_8 = lean_apply_1(x_7, lean_box(0)); x_9 = lean_alloc_closure((void*)(l_Function_comp___rarg), 3, 2); lean_closure_set(x_9, 0, x_8); lean_closure_set(x_9, 1, x_5); x_10 = lean_apply_4(x_2, lean_box(0), lean_box(0), x_6, x_9); return x_10; } } LEAN_EXPORT lean_object* l_Monad_map___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Monad_map___default___rarg), 6, 0); return x_2; } } LEAN_EXPORT lean_object* l_Monad_seq___default___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_4 = lean_ctor_get(x_1, 0); lean_inc(x_4); lean_dec(x_1); x_5 = lean_ctor_get(x_4, 0); lean_inc(x_5); lean_dec(x_4); x_6 = lean_box(0); x_7 = lean_apply_1(x_2, x_6); x_8 = lean_apply_4(x_5, lean_box(0), lean_box(0), x_3, x_7); return x_8; } } LEAN_EXPORT lean_object* l_Monad_seq___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; x_7 = lean_alloc_closure((void*)(l_Monad_seq___default___rarg___lambda__1), 3, 2); lean_closure_set(x_7, 0, x_1); lean_closure_set(x_7, 1, x_6); x_8 = lean_apply_4(x_2, lean_box(0), lean_box(0), x_5, x_7); return x_8; } } LEAN_EXPORT lean_object* l_Monad_seq___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Monad_seq___default___rarg), 6, 0); return x_2; } } LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_ctor_get(x_1, 1); lean_inc(x_4); lean_dec(x_1); x_5 = lean_apply_2(x_4, lean_box(0), x_2); return x_5; } } LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_5 = lean_box(0); x_6 = lean_apply_1(x_1, x_5); x_7 = lean_alloc_closure((void*)(l_Monad_seqLeft___default___rarg___lambda__1___boxed), 3, 2); lean_closure_set(x_7, 0, x_2); lean_closure_set(x_7, 1, x_4); x_8 = lean_apply_4(x_3, lean_box(0), lean_box(0), x_6, x_7); return x_8; } } LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_inc(x_2); x_7 = lean_alloc_closure((void*)(l_Monad_seqLeft___default___rarg___lambda__2), 4, 3); lean_closure_set(x_7, 0, x_6); lean_closure_set(x_7, 1, x_1); lean_closure_set(x_7, 2, x_2); x_8 = lean_apply_4(x_2, lean_box(0), lean_box(0), x_5, x_7); return x_8; } } LEAN_EXPORT lean_object* l_Monad_seqLeft___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Monad_seqLeft___default___rarg), 6, 0); return x_2; } } LEAN_EXPORT lean_object* l_Monad_seqLeft___default___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Monad_seqLeft___default___rarg___lambda__1(x_1, x_2, x_3); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Monad_seqRight___default___rarg___lambda__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_box(0); x_4 = lean_apply_1(x_1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_Monad_seqRight___default___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; x_6 = lean_alloc_closure((void*)(l_Monad_seqRight___default___rarg___lambda__1___boxed), 2, 1); lean_closure_set(x_6, 0, x_5); x_7 = lean_apply_4(x_1, lean_box(0), lean_box(0), x_4, x_6); return x_7; } } LEAN_EXPORT lean_object* l_Monad_seqRight___default(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Monad_seqRight___default___rarg), 5, 0); return x_2; } } LEAN_EXPORT lean_object* l_Monad_seqRight___default___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Monad_seqRight___default___rarg___lambda__1(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedForAll__2___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; x_2 = lean_ctor_get(x_1, 0); lean_inc(x_2); lean_dec(x_1); x_3 = lean_ctor_get(x_2, 1); lean_inc(x_3); lean_dec(x_2); x_4 = lean_apply_1(x_3, lean_box(0)); return x_4; } } LEAN_EXPORT lean_object* l_instInhabitedForAll__2(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instInhabitedForAll__2___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_instInhabited___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); lean_dec(x_1); x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = lean_apply_2(x_4, lean_box(0), x_2); return x_5; } } LEAN_EXPORT lean_object* l_instInhabited(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instInhabited___rarg), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; x_8 = lean_unsigned_to_nat(1u); x_9 = lean_nat_add(x_1, x_8); lean_dec(x_1); x_10 = lean_array_push(x_2, x_7); x_11 = l_Array_sequenceMap_loop___rarg(x_3, x_4, x_5, x_6, x_9, x_10); lean_dec(x_6); return x_11; } } LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; uint8_t x_8; x_7 = lean_array_get_size(x_2); x_8 = lean_nat_dec_lt(x_5, x_7); lean_dec(x_7); if (x_8 == 0) { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); x_9 = lean_ctor_get(x_1, 0); lean_inc(x_9); lean_dec(x_1); x_10 = lean_ctor_get(x_9, 1); lean_inc(x_10); lean_dec(x_9); x_11 = lean_apply_2(x_10, lean_box(0), x_6); return x_11; } else { lean_object* x_12; uint8_t x_13; x_12 = lean_unsigned_to_nat(0u); x_13 = lean_nat_dec_eq(x_4, x_12); if (x_13 == 0) { lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; x_14 = lean_unsigned_to_nat(1u); x_15 = lean_nat_sub(x_4, x_14); x_16 = lean_ctor_get(x_1, 1); lean_inc(x_16); x_17 = lean_array_fget(x_2, x_5); lean_inc(x_3); x_18 = lean_apply_1(x_3, x_17); x_19 = lean_alloc_closure((void*)(l_Array_sequenceMap_loop___rarg___lambda__1), 7, 6); lean_closure_set(x_19, 0, x_5); lean_closure_set(x_19, 1, x_6); lean_closure_set(x_19, 2, x_1); lean_closure_set(x_19, 3, x_2); lean_closure_set(x_19, 4, x_3); lean_closure_set(x_19, 5, x_15); x_20 = lean_apply_4(x_16, lean_box(0), lean_box(0), x_18, x_19); return x_20; } else { lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); x_21 = lean_ctor_get(x_1, 0); lean_inc(x_21); lean_dec(x_1); x_22 = lean_ctor_get(x_21, 1); lean_inc(x_22); lean_dec(x_21); x_23 = lean_apply_2(x_22, lean_box(0), x_6); return x_23; } } } } LEAN_EXPORT lean_object* l_Array_sequenceMap_loop(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_Array_sequenceMap_loop___rarg___boxed), 6, 0); return x_4; } } LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; x_7 = l_Array_sequenceMap_loop___rarg(x_1, x_2, x_3, x_4, x_5, x_6); lean_dec(x_4); return x_7; } } LEAN_EXPORT lean_object* l_Array_sequenceMap___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_4 = lean_array_get_size(x_2); x_5 = lean_unsigned_to_nat(0u); x_6 = l_Array_empty___closed__1; x_7 = l_Array_sequenceMap_loop___rarg(x_1, x_2, x_3, x_4, x_5, x_6); lean_dec(x_4); return x_7; } } LEAN_EXPORT lean_object* l_Array_sequenceMap(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_Array_sequenceMap___rarg), 3, 0); return x_4; } } LEAN_EXPORT lean_object* l_liftM___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, lean_box(0), x_3); return x_4; } } LEAN_EXPORT lean_object* l_liftM(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_liftM___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_instMonadLiftT___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; x_5 = lean_apply_2(x_2, lean_box(0), x_4); x_6 = lean_apply_2(x_1, lean_box(0), x_5); return x_6; } } LEAN_EXPORT lean_object* l_instMonadLiftT(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_instMonadLiftT___rarg), 4, 0); return x_4; } } LEAN_EXPORT lean_object* l_instMonadLiftT__1___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_instMonadLiftT__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instMonadLiftT__1___rarg___boxed), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_instMonadLiftT__1___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_instMonadLiftT__1___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_instMonadFunctorT___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, lean_box(0), x_3); return x_4; } } LEAN_EXPORT lean_object* l_instMonadFunctorT___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; x_5 = lean_alloc_closure((void*)(l_instMonadFunctorT___rarg___lambda__1), 3, 1); lean_closure_set(x_5, 0, x_1); x_6 = lean_apply_3(x_2, lean_box(0), x_5, x_4); return x_6; } } LEAN_EXPORT lean_object* l_instMonadFunctorT___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; x_6 = lean_alloc_closure((void*)(l_instMonadFunctorT___rarg___lambda__2), 4, 2); lean_closure_set(x_6, 0, x_4); lean_closure_set(x_6, 1, x_2); x_7 = lean_apply_3(x_1, lean_box(0), x_6, x_5); return x_7; } } LEAN_EXPORT lean_object* l_instMonadFunctorT(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_instMonadFunctorT___rarg), 5, 0); return x_4; } } LEAN_EXPORT lean_object* l_monadFunctorRefl___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_apply_2(x_1, lean_box(0), x_2); return x_3; } } LEAN_EXPORT lean_object* l_monadFunctorRefl(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_monadFunctorRefl___rarg), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedExcept___rarg(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_2, 0, x_1); return x_2; } } LEAN_EXPORT lean_object* l_instInhabitedExcept(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instInhabitedExcept___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_throwThe___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_ctor_get(x_1, 0); lean_inc(x_4); lean_dec(x_1); x_5 = lean_apply_2(x_4, lean_box(0), x_3); return x_5; } } LEAN_EXPORT lean_object* l_throwThe(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_throwThe___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_tryCatchThe___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; x_5 = lean_ctor_get(x_1, 1); lean_inc(x_5); lean_dec(x_1); x_6 = lean_apply_3(x_5, lean_box(0), x_3, x_4); return x_6; } } LEAN_EXPORT lean_object* l_tryCatchThe(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_tryCatchThe___rarg), 4, 0); return x_3; } } LEAN_EXPORT lean_object* l_instMonadExcept___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_inc(x_1); x_2 = lean_alloc_closure((void*)(l_throwThe___rarg), 3, 1); lean_closure_set(x_2, 0, x_1); x_3 = lean_alloc_closure((void*)(l_tryCatchThe___rarg), 4, 1); lean_closure_set(x_3, 0, x_1); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_2); lean_ctor_set(x_4, 1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_instMonadExcept(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instMonadExcept___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_MonadExcept_orElse___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 1); lean_inc(x_5); lean_dec(x_1); x_6 = lean_alloc_closure((void*)(l_Monad_seqRight___default___rarg___lambda__1___boxed), 2, 1); lean_closure_set(x_6, 0, x_4); x_7 = lean_apply_3(x_5, lean_box(0), x_3, x_6); return x_7; } } LEAN_EXPORT lean_object* l_MonadExcept_orElse(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_MonadExcept_orElse___rarg), 4, 0); return x_3; } } LEAN_EXPORT lean_object* l_MonadExcept_instOrElse___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_MonadExcept_orElse___rarg), 4, 2); lean_closure_set(x_3, 0, x_1); lean_closure_set(x_3, 1, lean_box(0)); return x_3; } } LEAN_EXPORT lean_object* l_MonadExcept_instOrElse(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_MonadExcept_instOrElse___rarg), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_instInhabitedReaderT___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_instInhabitedReaderT(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_instInhabitedReaderT___rarg___boxed), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_instInhabitedReaderT___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_instInhabitedReaderT___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_run___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_apply_1(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_run(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_ReaderT_run___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadLiftReaderT___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadLiftReaderT(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_ReaderT_instMonadLiftReaderT___rarg___boxed), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadLiftReaderT___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_ReaderT_instMonadLiftReaderT___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); lean_dec(x_1); x_6 = lean_apply_2(x_5, lean_box(0), x_3); return x_6; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_2(x_1, x_3, x_2); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_inc(x_5); x_6 = lean_apply_1(x_3, x_5); x_7 = lean_alloc_closure((void*)(l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__2), 3, 2); lean_closure_set(x_7, 0, x_4); lean_closure_set(x_7, 1, x_5); x_8 = lean_ctor_get(x_1, 1); lean_inc(x_8); lean_dec(x_1); x_9 = lean_apply_3(x_8, lean_box(0), x_6, x_7); return x_9; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_inc(x_1); x_2 = lean_alloc_closure((void*)(l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__1___boxed), 4, 1); lean_closure_set(x_2, 0, x_1); x_3 = lean_alloc_closure((void*)(l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__3), 5, 1); lean_closure_set(x_3, 0, x_1); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_2); lean_ctor_set(x_4, 1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_ReaderT_instMonadExceptOfReaderT___rarg), 1, 0); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__1(x_1, x_2, x_3, x_4); lean_dec(x_4); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_read___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); lean_dec(x_1); x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = lean_apply_2(x_4, lean_box(0), x_2); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_read(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ReaderT_read___rarg), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_pure___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); lean_dec(x_1); x_6 = lean_ctor_get(x_5, 1); lean_inc(x_6); lean_dec(x_5); x_7 = lean_apply_2(x_6, lean_box(0), x_3); return x_7; } } LEAN_EXPORT lean_object* l_ReaderT_pure(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ReaderT_pure___rarg___boxed), 4, 0); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_pure___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_ReaderT_pure___rarg(x_1, x_2, x_3, x_4); lean_dec(x_4); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_bind___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 1); lean_inc(x_7); lean_dec(x_1); lean_inc(x_6); x_8 = lean_apply_1(x_4, x_6); x_9 = lean_alloc_closure((void*)(l_ReaderT_instMonadExceptOfReaderT___rarg___lambda__2), 3, 2); lean_closure_set(x_9, 0, x_5); lean_closure_set(x_9, 1, x_6); x_10 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_8, x_9); return x_10; } } LEAN_EXPORT lean_object* l_ReaderT_bind(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ReaderT_bind___rarg), 6, 0); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_map___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; x_7 = lean_ctor_get(x_1, 0); lean_inc(x_7); lean_dec(x_1); x_8 = lean_ctor_get(x_7, 0); lean_inc(x_8); lean_dec(x_7); x_9 = lean_ctor_get(x_8, 0); lean_inc(x_9); lean_dec(x_8); x_10 = lean_apply_1(x_5, x_6); x_11 = lean_apply_4(x_9, lean_box(0), lean_box(0), x_4, x_10); return x_11; } } LEAN_EXPORT lean_object* l_ReaderT_map(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ReaderT_map___rarg), 6, 0); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; x_7 = lean_alloc_closure((void*)(l_Function_const___rarg___boxed), 2, 1); lean_closure_set(x_7, 0, x_4); x_8 = lean_ctor_get(x_1, 0); lean_inc(x_8); lean_dec(x_1); x_9 = lean_ctor_get(x_8, 0); lean_inc(x_9); lean_dec(x_8); x_10 = lean_ctor_get(x_9, 0); lean_inc(x_10); lean_dec(x_9); x_11 = lean_apply_1(x_5, x_6); x_12 = lean_apply_4(x_10, lean_box(0), lean_box(0), x_7, x_11); return x_12; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); lean_dec(x_1); x_6 = lean_ctor_get(x_5, 0); lean_inc(x_6); lean_dec(x_5); x_7 = lean_ctor_get(x_6, 0); lean_inc(x_7); lean_dec(x_6); x_8 = lean_box(0); x_9 = lean_apply_2(x_2, x_8, x_3); x_10 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_4, x_9); return x_10; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 1); lean_inc(x_7); lean_inc(x_6); x_8 = lean_apply_1(x_4, x_6); x_9 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__2), 4, 3); lean_closure_set(x_9, 0, x_1); lean_closure_set(x_9, 1, x_5); lean_closure_set(x_9, 2, x_6); x_10 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_8, x_9); return x_10; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_1, 0); lean_inc(x_4); lean_dec(x_1); x_5 = lean_ctor_get(x_4, 1); lean_inc(x_5); lean_dec(x_4); x_6 = lean_apply_2(x_5, lean_box(0), x_2); return x_6; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; x_6 = lean_box(0); x_7 = lean_apply_2(x_1, x_6, x_2); x_8 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__4___boxed), 3, 2); lean_closure_set(x_8, 0, x_3); lean_closure_set(x_8, 1, x_5); x_9 = lean_apply_4(x_4, lean_box(0), lean_box(0), x_7, x_8); return x_9; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__6(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 1); lean_inc(x_7); lean_inc(x_6); x_8 = lean_apply_1(x_4, x_6); lean_inc(x_7); x_9 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__5), 5, 4); lean_closure_set(x_9, 0, x_5); lean_closure_set(x_9, 1, x_6); lean_closure_set(x_9, 2, x_1); lean_closure_set(x_9, 3, x_7); x_10 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_8, x_9); return x_10; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__7(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_box(0); x_5 = lean_apply_2(x_1, x_4, x_2); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__8(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_1, 1); lean_inc(x_7); lean_dec(x_1); lean_inc(x_6); x_8 = lean_apply_1(x_4, x_6); x_9 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__7___boxed), 3, 2); lean_closure_set(x_9, 0, x_5); lean_closure_set(x_9, 1, x_6); x_10 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_8, x_9); return x_10; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_inc(x_1); x_2 = lean_alloc_closure((void*)(l_ReaderT_map___rarg), 6, 1); lean_closure_set(x_2, 0, x_1); lean_inc(x_1); x_3 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__1), 6, 1); lean_closure_set(x_3, 0, x_1); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_2); lean_ctor_set(x_4, 1, x_3); lean_inc(x_1); x_5 = lean_alloc_closure((void*)(l_ReaderT_pure___rarg___boxed), 4, 1); lean_closure_set(x_5, 0, x_1); lean_inc(x_1); x_6 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__3), 6, 1); lean_closure_set(x_6, 0, x_1); lean_inc(x_1); x_7 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__6), 6, 1); lean_closure_set(x_7, 0, x_1); lean_inc(x_1); x_8 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg___lambda__8), 6, 1); lean_closure_set(x_8, 0, x_1); x_9 = lean_alloc_ctor(0, 5, 0); lean_ctor_set(x_9, 0, x_4); lean_ctor_set(x_9, 1, x_5); lean_ctor_set(x_9, 2, x_6); lean_ctor_set(x_9, 3, x_7); lean_ctor_set(x_9, 4, x_8); x_10 = lean_alloc_closure((void*)(l_ReaderT_bind___rarg), 6, 1); lean_closure_set(x_10, 0, x_1); x_11 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_11, 0, x_9); lean_ctor_set(x_11, 1, x_10); return x_11; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ReaderT_instMonadReaderT___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_ReaderT_instMonadReaderT___rarg___lambda__4(x_1, x_2, x_3); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__7___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_ReaderT_instMonadReaderT___rarg___lambda__7(x_1, x_2, x_3); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadFunctorReaderT___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_apply_1(x_2, x_3); x_5 = lean_apply_2(x_1, lean_box(0), x_4); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadFunctorReaderT(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_ReaderT_instMonadFunctorReaderT___rarg), 3, 0); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_instMonadFunctorReaderT___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_ReaderT_instMonadFunctorReaderT(x_1, x_2, x_3, x_4); lean_dec(x_3); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_adapt___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_apply_1(x_1, x_3); x_5 = lean_apply_1(x_2, x_4); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_adapt(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = lean_alloc_closure((void*)(l_ReaderT_adapt___rarg), 3, 0); return x_6; } } LEAN_EXPORT lean_object* l_ReaderT_adapt___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = l_ReaderT_adapt(x_1, x_2, x_3, x_4, x_5); lean_dec(x_4); return x_6; } } LEAN_EXPORT lean_object* l_readThe___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_readThe(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_readThe___rarg___boxed), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_readThe___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_readThe___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_instMonadReader___rarg(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_instMonadReader(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instMonadReader___rarg___boxed), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_instMonadReader___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_instMonadReader___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_instMonadReaderOf___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_apply_2(x_1, lean_box(0), x_2); return x_3; } } LEAN_EXPORT lean_object* l_instMonadReaderOf(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_instMonadReaderOf___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_instMonadReaderOfReaderT___rarg(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_ReaderT_read___rarg), 2, 1); lean_closure_set(x_2, 0, x_1); return x_2; } } LEAN_EXPORT lean_object* l_instMonadReaderOfReaderT(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instMonadReaderOfReaderT___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_withTheReader___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_apply_3(x_1, lean_box(0), x_3, x_4); return x_5; } } LEAN_EXPORT lean_object* l_withTheReader(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_withTheReader___rarg), 4, 0); return x_3; } } LEAN_EXPORT lean_object* l_instMonadWithReader___rarg(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_withTheReader___rarg), 4, 1); lean_closure_set(x_2, 0, x_1); return x_2; } } LEAN_EXPORT lean_object* l_instMonadWithReader(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instMonadWithReader___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_instMonadWithReaderOf___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_apply_3(x_1, lean_box(0), x_2, x_4); return x_5; } } LEAN_EXPORT lean_object* l_instMonadWithReaderOf___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; x_6 = lean_alloc_closure((void*)(l_instMonadWithReaderOf___rarg___lambda__1), 4, 2); lean_closure_set(x_6, 0, x_2); lean_closure_set(x_6, 1, x_4); x_7 = lean_apply_3(x_1, lean_box(0), x_6, x_5); return x_7; } } LEAN_EXPORT lean_object* l_instMonadWithReaderOf(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_instMonadWithReaderOf___rarg), 5, 0); return x_4; } } LEAN_EXPORT lean_object* l_instMonadWithReaderOfReaderT___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_apply_1(x_1, x_3); x_5 = lean_apply_1(x_2, x_4); return x_5; } } LEAN_EXPORT lean_object* l_instMonadWithReaderOfReaderT(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_instMonadWithReaderOfReaderT___rarg), 3, 0); return x_5; } } LEAN_EXPORT lean_object* l_instMonadWithReaderOfReaderT___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_instMonadWithReaderOfReaderT(x_1, x_2, x_3, x_4); lean_dec(x_3); return x_5; } } LEAN_EXPORT lean_object* l_getThe___rarg(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_ctor_get(x_1, 0); lean_inc(x_2); return x_2; } } LEAN_EXPORT lean_object* l_getThe(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_getThe___rarg___boxed), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_getThe___rarg___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_getThe___rarg(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_modifyThe___rarg___lambda__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_apply_1(x_1, x_2); x_4 = lean_box(0); x_5 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_5, 0, x_4); lean_ctor_set(x_5, 1, x_3); return x_5; } } LEAN_EXPORT lean_object* l_modifyThe___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_1, 2); lean_inc(x_3); lean_dec(x_1); x_4 = lean_alloc_closure((void*)(l_modifyThe___rarg___lambda__1), 2, 1); lean_closure_set(x_4, 0, x_2); x_5 = lean_apply_2(x_3, lean_box(0), x_4); return x_5; } } LEAN_EXPORT lean_object* l_modifyThe(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_modifyThe___rarg), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_modifyGetThe___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_ctor_get(x_1, 2); lean_inc(x_3); lean_dec(x_1); x_4 = lean_apply_2(x_3, lean_box(0), x_2); return x_4; } } LEAN_EXPORT lean_object* l_modifyGetThe(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_modifyGetThe___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_instMonadState___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_ctor_get(x_1, 2); lean_inc(x_4); lean_dec(x_1); x_5 = lean_apply_2(x_4, lean_box(0), x_3); return x_5; } } LEAN_EXPORT lean_object* l_instMonadState___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_2 = lean_ctor_get(x_1, 0); lean_inc(x_2); x_3 = lean_ctor_get(x_1, 1); lean_inc(x_3); x_4 = lean_alloc_closure((void*)(l_instMonadState___rarg___lambda__1), 3, 1); lean_closure_set(x_4, 0, x_1); x_5 = lean_alloc_ctor(0, 3, 0); lean_ctor_set(x_5, 0, x_2); lean_ctor_set(x_5, 1, x_3); lean_ctor_set(x_5, 2, x_4); return x_5; } } LEAN_EXPORT lean_object* l_instMonadState(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_instMonadState___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_modify___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_1, 2); lean_inc(x_3); lean_dec(x_1); x_4 = lean_alloc_closure((void*)(l_modifyThe___rarg___lambda__1), 2, 1); lean_closure_set(x_4, 0, x_2); x_5 = lean_apply_2(x_3, lean_box(0), x_4); return x_5; } } LEAN_EXPORT lean_object* l_modify(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_modify___rarg), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_getModify___rarg___lambda__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_inc(x_2); x_3 = lean_apply_1(x_1, x_2); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_2); lean_ctor_set(x_4, 1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_getModify___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_1, 2); lean_inc(x_4); lean_dec(x_1); x_5 = lean_alloc_closure((void*)(l_getModify___rarg___lambda__1), 2, 1); lean_closure_set(x_5, 0, x_3); x_6 = lean_apply_2(x_4, lean_box(0), x_5); return x_6; } } LEAN_EXPORT lean_object* l_getModify(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_getModify___rarg___boxed), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_getModify___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_getModify___rarg(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_instMonadStateOf___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_1, 1); lean_inc(x_4); lean_dec(x_1); x_5 = lean_apply_1(x_4, x_3); x_6 = lean_apply_2(x_2, lean_box(0), x_5); return x_6; } } LEAN_EXPORT lean_object* l_instMonadStateOf___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 2); lean_inc(x_5); lean_dec(x_1); x_6 = lean_apply_2(x_5, lean_box(0), x_4); x_7 = lean_apply_2(x_2, lean_box(0), x_6); return x_7; } } LEAN_EXPORT lean_object* l_instMonadStateOf___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_3 = lean_ctor_get(x_2, 0); lean_inc(x_3); lean_inc(x_1); x_4 = lean_apply_2(x_1, lean_box(0), x_3); lean_inc(x_1); lean_inc(x_2); x_5 = lean_alloc_closure((void*)(l_instMonadStateOf___rarg___lambda__1), 3, 2); lean_closure_set(x_5, 0, x_2); lean_closure_set(x_5, 1, x_1); x_6 = lean_alloc_closure((void*)(l_instMonadStateOf___rarg___lambda__2), 4, 2); lean_closure_set(x_6, 0, x_2); lean_closure_set(x_6, 1, x_1); x_7 = lean_alloc_ctor(0, 3, 0); lean_ctor_set(x_7, 0, x_4); lean_ctor_set(x_7, 1, x_5); lean_ctor_set(x_7, 2, x_6); return x_7; } } LEAN_EXPORT lean_object* l_instMonadStateOf(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_instMonadStateOf___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_instInhabitedResult___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_instInhabitedResult(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_instInhabitedResult___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_instInhabitedEStateM___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_instInhabitedEStateM(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_instInhabitedEStateM___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_pure___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_pure(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_pure___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_set___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_box(0); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_1); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_set(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_EStateM_set___rarg___boxed), 2, 0); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_set___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_EStateM_set___rarg(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_get___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_inc(x_1); x_2 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_2, 0, x_1); lean_ctor_set(x_2, 1, x_1); return x_2; } } LEAN_EXPORT lean_object* l_EStateM_get(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_EStateM_get___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_modifyGet___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_3 = lean_apply_1(x_1, x_2); x_4 = lean_ctor_get(x_3, 0); lean_inc(x_4); x_5 = lean_ctor_get(x_3, 1); lean_inc(x_5); lean_dec(x_3); x_6 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_6, 0, x_4); lean_ctor_set(x_6, 1, x_5); return x_6; } } LEAN_EXPORT lean_object* l_EStateM_modifyGet(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_modifyGet___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_throw___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_throw(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_throw___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_tryCatch___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = lean_ctor_get(x_1, 0); lean_inc(x_6); lean_inc(x_5); x_7 = lean_apply_1(x_6, x_5); x_8 = lean_apply_1(x_3, x_5); if (lean_obj_tag(x_8) == 0) { lean_dec(x_7); lean_dec(x_4); lean_dec(x_1); return x_8; } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; x_9 = lean_ctor_get(x_8, 0); lean_inc(x_9); x_10 = lean_ctor_get(x_8, 1); lean_inc(x_10); lean_dec(x_8); x_11 = lean_ctor_get(x_1, 1); lean_inc(x_11); lean_dec(x_1); x_12 = lean_apply_2(x_11, x_10, x_7); x_13 = lean_apply_2(x_4, x_9, x_12); return x_13; } } } LEAN_EXPORT lean_object* l_EStateM_tryCatch(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_tryCatch___rarg), 5, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_orElse___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); lean_inc(x_4); x_6 = lean_apply_1(x_5, x_4); x_7 = lean_apply_1(x_2, x_4); if (lean_obj_tag(x_7) == 0) { lean_dec(x_6); lean_dec(x_3); lean_dec(x_1); return x_7; } else { lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; x_8 = lean_ctor_get(x_7, 1); lean_inc(x_8); lean_dec(x_7); x_9 = lean_ctor_get(x_1, 1); lean_inc(x_9); lean_dec(x_1); x_10 = lean_apply_2(x_9, x_8, x_6); x_11 = lean_box(0); x_12 = lean_apply_2(x_3, x_11, x_10); return x_12; } } } LEAN_EXPORT lean_object* l_EStateM_orElse(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_EStateM_orElse___rarg), 4, 0); return x_5; } } LEAN_EXPORT lean_object* l_EStateM_adaptExcept___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_1(x_2, x_3); if (lean_obj_tag(x_4) == 0) { uint8_t x_5; lean_dec(x_1); x_5 = !lean_is_exclusive(x_4); if (x_5 == 0) { return x_4; } else { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = lean_ctor_get(x_4, 0); x_7 = lean_ctor_get(x_4, 1); lean_inc(x_7); lean_inc(x_6); lean_dec(x_4); x_8 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_8, 0, x_6); lean_ctor_set(x_8, 1, x_7); return x_8; } } else { uint8_t x_9; x_9 = !lean_is_exclusive(x_4); if (x_9 == 0) { lean_object* x_10; lean_object* x_11; x_10 = lean_ctor_get(x_4, 0); x_11 = lean_apply_1(x_1, x_10); lean_ctor_set(x_4, 0, x_11); return x_4; } else { lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; x_12 = lean_ctor_get(x_4, 0); x_13 = lean_ctor_get(x_4, 1); lean_inc(x_13); lean_inc(x_12); lean_dec(x_4); x_14 = lean_apply_1(x_1, x_12); x_15 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_15, 0, x_14); lean_ctor_set(x_15, 1, x_13); return x_15; } } } } LEAN_EXPORT lean_object* l_EStateM_adaptExcept(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_EStateM_adaptExcept___rarg), 3, 0); return x_5; } } LEAN_EXPORT lean_object* l_EStateM_bind___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_1(x_1, x_3); if (lean_obj_tag(x_4) == 0) { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_4, 0); lean_inc(x_5); x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_apply_2(x_2, x_5, x_6); return x_7; } else { uint8_t x_8; lean_dec(x_2); x_8 = !lean_is_exclusive(x_4); if (x_8 == 0) { return x_4; } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; x_9 = lean_ctor_get(x_4, 0); x_10 = lean_ctor_get(x_4, 1); lean_inc(x_10); lean_inc(x_9); lean_dec(x_4); x_11 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_11, 0, x_9); lean_ctor_set(x_11, 1, x_10); return x_11; } } } } LEAN_EXPORT lean_object* l_EStateM_bind(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_EStateM_bind___rarg), 3, 0); return x_5; } } LEAN_EXPORT lean_object* l_EStateM_map___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_1(x_2, x_3); if (lean_obj_tag(x_4) == 0) { uint8_t x_5; x_5 = !lean_is_exclusive(x_4); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; x_6 = lean_ctor_get(x_4, 0); x_7 = lean_apply_1(x_1, x_6); lean_ctor_set(x_4, 0, x_7); return x_4; } else { lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; x_8 = lean_ctor_get(x_4, 0); x_9 = lean_ctor_get(x_4, 1); lean_inc(x_9); lean_inc(x_8); lean_dec(x_4); x_10 = lean_apply_1(x_1, x_8); x_11 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_11, 0, x_10); lean_ctor_set(x_11, 1, x_9); return x_11; } } else { uint8_t x_12; lean_dec(x_1); x_12 = !lean_is_exclusive(x_4); if (x_12 == 0) { return x_4; } else { lean_object* x_13; lean_object* x_14; lean_object* x_15; x_13 = lean_ctor_get(x_4, 0); x_14 = lean_ctor_get(x_4, 1); lean_inc(x_14); lean_inc(x_13); lean_dec(x_4); x_15 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_15, 0, x_13); lean_ctor_set(x_15, 1, x_14); return x_15; } } } } LEAN_EXPORT lean_object* l_EStateM_map(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_EStateM_map___rarg), 3, 0); return x_5; } } LEAN_EXPORT lean_object* l_EStateM_seqRight___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_apply_1(x_1, x_3); if (lean_obj_tag(x_4) == 0) { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_4, 1); lean_inc(x_5); lean_dec(x_4); x_6 = lean_box(0); x_7 = lean_apply_2(x_2, x_6, x_5); return x_7; } else { uint8_t x_8; lean_dec(x_2); x_8 = !lean_is_exclusive(x_4); if (x_8 == 0) { return x_4; } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; x_9 = lean_ctor_get(x_4, 0); x_10 = lean_ctor_get(x_4, 1); lean_inc(x_10); lean_inc(x_9); lean_dec(x_4); x_11 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_11, 0, x_9); lean_ctor_set(x_11, 1, x_10); return x_11; } } } } LEAN_EXPORT lean_object* l_EStateM_seqRight(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_EStateM_seqRight___rarg), 3, 0); return x_5; } } LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = lean_apply_1(x_4, x_5); if (lean_obj_tag(x_6) == 0) { uint8_t x_7; x_7 = !lean_is_exclusive(x_6); if (x_7 == 0) { lean_object* x_8; x_8 = lean_ctor_get(x_6, 0); lean_dec(x_8); lean_ctor_set(x_6, 0, x_3); return x_6; } else { lean_object* x_9; lean_object* x_10; x_9 = lean_ctor_get(x_6, 1); lean_inc(x_9); lean_dec(x_6); x_10 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_10, 0, x_3); lean_ctor_set(x_10, 1, x_9); return x_10; } } else { uint8_t x_11; lean_dec(x_3); x_11 = !lean_is_exclusive(x_6); if (x_11 == 0) { return x_6; } else { lean_object* x_12; lean_object* x_13; lean_object* x_14; x_12 = lean_ctor_get(x_6, 0); x_13 = lean_ctor_get(x_6, 1); lean_inc(x_13); lean_inc(x_12); lean_dec(x_6); x_14 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_14, 0, x_12); lean_ctor_set(x_14, 1, x_13); return x_14; } } } } LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = lean_apply_1(x_3, x_5); if (lean_obj_tag(x_6) == 0) { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_6, 0); lean_inc(x_7); x_8 = lean_ctor_get(x_6, 1); lean_inc(x_8); lean_dec(x_6); x_9 = lean_box(0); x_10 = lean_apply_2(x_4, x_9, x_8); if (lean_obj_tag(x_10) == 0) { uint8_t x_11; x_11 = !lean_is_exclusive(x_10); if (x_11 == 0) { lean_object* x_12; lean_object* x_13; x_12 = lean_ctor_get(x_10, 0); x_13 = lean_apply_1(x_7, x_12); lean_ctor_set(x_10, 0, x_13); return x_10; } else { lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; x_14 = lean_ctor_get(x_10, 0); x_15 = lean_ctor_get(x_10, 1); lean_inc(x_15); lean_inc(x_14); lean_dec(x_10); x_16 = lean_apply_1(x_7, x_14); x_17 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_17, 0, x_16); lean_ctor_set(x_17, 1, x_15); return x_17; } } else { uint8_t x_18; lean_dec(x_7); x_18 = !lean_is_exclusive(x_10); if (x_18 == 0) { return x_10; } else { lean_object* x_19; lean_object* x_20; lean_object* x_21; x_19 = lean_ctor_get(x_10, 0); x_20 = lean_ctor_get(x_10, 1); lean_inc(x_20); lean_inc(x_19); lean_dec(x_10); x_21 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_21, 0, x_19); lean_ctor_set(x_21, 1, x_20); return x_21; } } } else { uint8_t x_22; lean_dec(x_4); x_22 = !lean_is_exclusive(x_6); if (x_22 == 0) { return x_6; } else { lean_object* x_23; lean_object* x_24; lean_object* x_25; x_23 = lean_ctor_get(x_6, 0); x_24 = lean_ctor_get(x_6, 1); lean_inc(x_24); lean_inc(x_23); lean_dec(x_6); x_25 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_25, 0, x_23); lean_ctor_set(x_25, 1, x_24); return x_25; } } } } LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = lean_apply_1(x_3, x_5); if (lean_obj_tag(x_6) == 0) { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_6, 0); lean_inc(x_7); x_8 = lean_ctor_get(x_6, 1); lean_inc(x_8); lean_dec(x_6); x_9 = lean_box(0); x_10 = lean_apply_2(x_4, x_9, x_8); if (lean_obj_tag(x_10) == 0) { uint8_t x_11; x_11 = !lean_is_exclusive(x_10); if (x_11 == 0) { lean_object* x_12; x_12 = lean_ctor_get(x_10, 0); lean_dec(x_12); lean_ctor_set(x_10, 0, x_7); return x_10; } else { lean_object* x_13; lean_object* x_14; x_13 = lean_ctor_get(x_10, 1); lean_inc(x_13); lean_dec(x_10); x_14 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_14, 0, x_7); lean_ctor_set(x_14, 1, x_13); return x_14; } } else { uint8_t x_15; lean_dec(x_7); x_15 = !lean_is_exclusive(x_10); if (x_15 == 0) { return x_10; } else { lean_object* x_16; lean_object* x_17; lean_object* x_18; x_16 = lean_ctor_get(x_10, 0); x_17 = lean_ctor_get(x_10, 1); lean_inc(x_17); lean_inc(x_16); lean_dec(x_10); x_18 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_18, 0, x_16); lean_ctor_set(x_18, 1, x_17); return x_18; } } } else { uint8_t x_19; lean_dec(x_4); x_19 = !lean_is_exclusive(x_6); if (x_19 == 0) { return x_6; } else { lean_object* x_20; lean_object* x_21; lean_object* x_22; x_20 = lean_ctor_get(x_6, 0); x_21 = lean_ctor_get(x_6, 1); lean_inc(x_21); lean_inc(x_20); lean_dec(x_6); x_22 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_22, 0, x_20); lean_ctor_set(x_22, 1, x_21); return x_22; } } } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_map), 4, 2); lean_closure_set(x_1, 0, lean_box(0)); lean_closure_set(x_1, 1, lean_box(0)); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_instMonadEStateM___lambda__1), 5, 0); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__3() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_EStateM_instMonadEStateM___closed__1; x_2 = l_EStateM_instMonadEStateM___closed__2; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__4() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_pure), 3, 2); lean_closure_set(x_1, 0, lean_box(0)); lean_closure_set(x_1, 1, lean_box(0)); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__5() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_seqRight), 4, 2); lean_closure_set(x_1, 0, lean_box(0)); lean_closure_set(x_1, 1, lean_box(0)); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__6() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_instMonadEStateM___lambda__2), 5, 0); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__7() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_instMonadEStateM___lambda__3), 5, 0); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__8() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l_EStateM_instMonadEStateM___closed__3; x_2 = l_EStateM_instMonadEStateM___closed__4; x_3 = l_EStateM_instMonadEStateM___closed__6; x_4 = l_EStateM_instMonadEStateM___closed__7; x_5 = l_EStateM_instMonadEStateM___closed__5; x_6 = lean_alloc_ctor(0, 5, 0); lean_ctor_set(x_6, 0, x_1); lean_ctor_set(x_6, 1, x_2); lean_ctor_set(x_6, 2, x_3); lean_ctor_set(x_6, 3, x_4); lean_ctor_set(x_6, 4, x_5); return x_6; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__9() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_bind), 4, 2); lean_closure_set(x_1, 0, lean_box(0)); lean_closure_set(x_1, 1, lean_box(0)); return x_1; } } static lean_object* _init_l_EStateM_instMonadEStateM___closed__10() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_EStateM_instMonadEStateM___closed__8; x_2 = l_EStateM_instMonadEStateM___closed__9; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_instMonadEStateM(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_EStateM_instMonadEStateM___closed__10; return x_3; } } LEAN_EXPORT lean_object* l_EStateM_instOrElseEStateM___rarg(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_EStateM_orElse___rarg), 4, 1); lean_closure_set(x_2, 0, x_1); return x_2; } } LEAN_EXPORT lean_object* l_EStateM_instOrElseEStateM(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_alloc_closure((void*)(l_EStateM_instOrElseEStateM___rarg), 1, 0); return x_5; } } static lean_object* _init_l_EStateM_instMonadStateOfEStateM___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_modifyGet), 3, 2); lean_closure_set(x_1, 0, lean_box(0)); lean_closure_set(x_1, 1, lean_box(0)); return x_1; } } static lean_object* _init_l_EStateM_instMonadStateOfEStateM___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_get___rarg), 1, 0); return x_1; } } static lean_object* _init_l_EStateM_instMonadStateOfEStateM___closed__3() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_set___rarg___boxed), 2, 0); return x_1; } } static lean_object* _init_l_EStateM_instMonadStateOfEStateM___closed__4() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; x_1 = l_EStateM_instMonadStateOfEStateM___closed__2; x_2 = l_EStateM_instMonadStateOfEStateM___closed__3; x_3 = l_EStateM_instMonadStateOfEStateM___closed__1; x_4 = lean_alloc_ctor(0, 3, 0); lean_ctor_set(x_4, 0, x_1); lean_ctor_set(x_4, 1, x_2); lean_ctor_set(x_4, 2, x_3); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_instMonadStateOfEStateM(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_EStateM_instMonadStateOfEStateM___closed__4; return x_3; } } static lean_object* _init_l_EStateM_instMonadExceptOfEStateM___rarg___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_throw), 3, 2); lean_closure_set(x_1, 0, lean_box(0)); lean_closure_set(x_1, 1, lean_box(0)); return x_1; } } LEAN_EXPORT lean_object* l_EStateM_instMonadExceptOfEStateM___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; x_2 = lean_alloc_closure((void*)(l_EStateM_tryCatch___rarg), 5, 1); lean_closure_set(x_2, 0, x_1); x_3 = l_EStateM_instMonadExceptOfEStateM___rarg___closed__1; x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_2); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_instMonadExceptOfEStateM(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_instMonadExceptOfEStateM___rarg), 1, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_run___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_apply_1(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_run(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_run___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_run_x27___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_apply_1(x_1, x_2); if (lean_obj_tag(x_3) == 0) { lean_object* x_4; lean_object* x_5; x_4 = lean_ctor_get(x_3, 0); lean_inc(x_4); lean_dec(x_3); x_5 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_5, 0, x_4); return x_5; } else { lean_object* x_6; lean_dec(x_3); x_6 = lean_box(0); return x_6; } } } LEAN_EXPORT lean_object* l_EStateM_run_x27(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_closure((void*)(l_EStateM_run_x27___rarg), 2, 0); return x_4; } } LEAN_EXPORT lean_object* l_EStateM_dummySave(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_box(0); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_dummySave___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_EStateM_dummySave(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_dummyRestore___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_EStateM_dummyRestore(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_EStateM_dummyRestore___rarg___boxed), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_EStateM_dummyRestore___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_EStateM_dummyRestore___rarg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_EStateM_nonBacktrackable___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_dummySave___boxed), 2, 1); lean_closure_set(x_1, 0, lean_box(0)); return x_1; } } static lean_object* _init_l_EStateM_nonBacktrackable___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_EStateM_dummyRestore___rarg___boxed), 2, 0); return x_1; } } static lean_object* _init_l_EStateM_nonBacktrackable___closed__3() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_EStateM_nonBacktrackable___closed__1; x_2 = l_EStateM_nonBacktrackable___closed__2; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_EStateM_nonBacktrackable(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_EStateM_nonBacktrackable___closed__3; return x_2; } } LEAN_EXPORT lean_object* l_UInt64_toUSize___boxed(lean_object* x_1) { _start: { uint64_t x_2; size_t x_3; lean_object* x_4; x_2 = lean_unbox_uint64(x_1); lean_dec(x_1); x_3 = lean_uint64_to_usize(x_2); x_4 = lean_box_usize(x_3); return x_4; } } LEAN_EXPORT lean_object* l_USize_toUInt64___boxed(lean_object* x_1) { _start: { size_t x_2; uint64_t x_3; lean_object* x_4; x_2 = lean_unbox_usize(x_1); lean_dec(x_1); x_3 = lean_usize_to_uint64(x_2); x_4 = lean_box_uint64(x_3); return x_4; } } LEAN_EXPORT lean_object* l_mixHash___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint64_t x_3; uint64_t x_4; uint64_t x_5; lean_object* x_6; x_3 = lean_unbox_uint64(x_1); lean_dec(x_1); x_4 = lean_unbox_uint64(x_2); lean_dec(x_2); x_5 = lean_uint64_mix_hash(x_3, x_4); x_6 = lean_box_uint64(x_5); return x_6; } } LEAN_EXPORT lean_object* l_String_hash___boxed(lean_object* x_1) { _start: { uint64_t x_2; lean_object* x_3; x_2 = lean_string_hash(x_1); lean_dec(x_1); x_3 = lean_box_uint64(x_2); return x_3; } } static lean_object* _init_l_instHashableString___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_String_hash___boxed), 1, 0); return x_1; } } static lean_object* _init_l_instHashableString() { _start: { lean_object* x_1; x_1 = l_instHashableString___closed__1; return x_1; } } static lean_object* _init_l_Lean_instInhabitedName() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } static uint64_t _init_l_Lean_Name_hash___closed__1() { _start: { lean_object* x_1; uint64_t x_2; x_1 = lean_unsigned_to_nat(1723u); x_2 = lean_uint64_of_nat(x_1); return x_2; } } LEAN_EXPORT uint64_t l_Lean_Name_hash(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 0) { uint64_t x_2; x_2 = l_Lean_Name_hash___closed__1; return x_2; } else { uint64_t x_3; x_3 = lean_ctor_get_uint64(x_1, sizeof(void*)*2); return x_3; } } } LEAN_EXPORT lean_object* l_Lean_Name_hash___boxed(lean_object* x_1) { _start: { uint64_t x_2; lean_object* x_3; x_2 = l_Lean_Name_hash(x_1); lean_dec(x_1); x_3 = lean_box_uint64(x_2); return x_3; } } static lean_object* _init_l_Lean_instHashableName___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Name_hash___boxed), 1, 0); return x_1; } } static lean_object* _init_l_Lean_instHashableName() { _start: { lean_object* x_1; x_1 = l_Lean_instHashableName___closed__1; return x_1; } } LEAN_EXPORT lean_object* lean_name_mk_string(lean_object* x_1, lean_object* x_2) { _start: { uint64_t x_3; uint64_t x_4; uint64_t x_5; lean_object* x_6; x_3 = l_Lean_Name_hash(x_1); x_4 = lean_string_hash(x_2); x_5 = lean_uint64_mix_hash(x_3, x_4); x_6 = lean_alloc_ctor(1, 2, 8); lean_ctor_set(x_6, 0, x_1); lean_ctor_set(x_6, 1, x_2); lean_ctor_set_uint64(x_6, sizeof(void*)*2, x_5); return x_6; } } static uint64_t _init_l_Lean_Name_mkNum___closed__1() { _start: { lean_object* x_1; uint64_t x_2; x_1 = lean_unsigned_to_nat(17u); x_2 = lean_uint64_of_nat(x_1); return x_2; } } LEAN_EXPORT lean_object* lean_name_mk_numeral(lean_object* x_1, lean_object* x_2) { _start: { uint64_t x_3; lean_object* x_4; uint8_t x_5; x_3 = l_Lean_Name_hash(x_1); x_4 = l_UInt64_size; x_5 = lean_nat_dec_lt(x_2, x_4); if (x_5 == 0) { uint64_t x_6; uint64_t x_7; lean_object* x_8; x_6 = l_Lean_Name_mkNum___closed__1; x_7 = lean_uint64_mix_hash(x_3, x_6); x_8 = lean_alloc_ctor(2, 2, 8); lean_ctor_set(x_8, 0, x_1); lean_ctor_set(x_8, 1, x_2); lean_ctor_set_uint64(x_8, sizeof(void*)*2, x_7); return x_8; } else { uint64_t x_9; uint64_t x_10; lean_object* x_11; x_9 = lean_uint64_of_nat(x_2); x_10 = lean_uint64_mix_hash(x_3, x_9); x_11 = lean_alloc_ctor(2, 2, 8); lean_ctor_set(x_11, 0, x_1); lean_ctor_set(x_11, 1, x_2); lean_ctor_set_uint64(x_11, sizeof(void*)*2, x_10); return x_11; } } } LEAN_EXPORT lean_object* l_Lean_Name_mkSimple(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; x_2 = lean_box(0); x_3 = lean_name_mk_string(x_2, x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Name_beq___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_name_eq(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } static lean_object* _init_l_Lean_Name_instBEqName___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Name_beq___boxed), 2, 0); return x_1; } } static lean_object* _init_l_Lean_Name_instBEqName() { _start: { lean_object* x_1; x_1 = l_Lean_Name_instBEqName___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_Lean_Name_append(lean_object* x_1, lean_object* x_2) { _start: { switch (lean_obj_tag(x_2)) { case 0: { lean_inc(x_1); return x_1; } case 1: { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_3 = lean_ctor_get(x_2, 0); lean_inc(x_3); x_4 = lean_ctor_get(x_2, 1); lean_inc(x_4); lean_dec(x_2); x_5 = l_Lean_Name_append(x_1, x_3); x_6 = lean_name_mk_string(x_5, x_4); return x_6; } default: { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_7 = lean_ctor_get(x_2, 0); lean_inc(x_7); x_8 = lean_ctor_get(x_2, 1); lean_inc(x_8); lean_dec(x_2); x_9 = l_Lean_Name_append(x_1, x_7); x_10 = lean_name_mk_numeral(x_9, x_8); return x_10; } } } } LEAN_EXPORT lean_object* l_Lean_Name_append___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Name_append(x_1, x_2); lean_dec(x_1); return x_3; } } static lean_object* _init_l_Lean_Name_instAppendName___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Name_append___boxed), 2, 0); return x_1; } } static lean_object* _init_l_Lean_Name_instAppendName() { _start: { lean_object* x_1; x_1 = l_Lean_Name_instAppendName___closed__1; return x_1; } } static lean_object* _init_l_Lean_instInhabitedSourceInfo() { _start: { lean_object* x_1; x_1 = lean_box(2); return x_1; } } LEAN_EXPORT lean_object* l_Lean_SourceInfo_getPos_x3f(lean_object* x_1, uint8_t x_2) { _start: { switch (lean_obj_tag(x_1)) { case 0: { lean_object* x_3; lean_object* x_4; x_3 = lean_ctor_get(x_1, 1); lean_inc(x_3); x_4 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_4, 0, x_3); return x_4; } case 1: { if (x_2 == 0) { lean_object* x_5; lean_object* x_6; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); x_6 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_6, 0, x_5); return x_6; } else { lean_object* x_7; x_7 = lean_box(0); return x_7; } } default: { lean_object* x_8; x_8 = lean_box(0); return x_8; } } } } LEAN_EXPORT lean_object* l_Lean_SourceInfo_getPos_x3f___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_unbox(x_2); lean_dec(x_2); x_4 = l_Lean_SourceInfo_getPos_x3f(x_1, x_3); lean_dec(x_1); return x_4; } } static lean_object* _init_l_Lean_instInhabitedSyntax() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } static lean_object* _init_l_Lean_choiceKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("choice"); return x_1; } } static lean_object* _init_l_Lean_choiceKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_choiceKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_choiceKind() { _start: { lean_object* x_1; x_1 = l_Lean_choiceKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_nullKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("null"); return x_1; } } static lean_object* _init_l_Lean_nullKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_nullKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_nullKind() { _start: { lean_object* x_1; x_1 = l_Lean_nullKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_groupKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("group"); return x_1; } } static lean_object* _init_l_Lean_groupKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_groupKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_groupKind() { _start: { lean_object* x_1; x_1 = l_Lean_groupKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_identKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("ident"); return x_1; } } static lean_object* _init_l_Lean_identKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_identKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_identKind() { _start: { lean_object* x_1; x_1 = l_Lean_identKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_strLitKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("str"); return x_1; } } static lean_object* _init_l_Lean_strLitKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_strLitKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_strLitKind() { _start: { lean_object* x_1; x_1 = l_Lean_strLitKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_charLitKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("char"); return x_1; } } static lean_object* _init_l_Lean_charLitKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_charLitKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_charLitKind() { _start: { lean_object* x_1; x_1 = l_Lean_charLitKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_numLitKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("num"); return x_1; } } static lean_object* _init_l_Lean_numLitKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_numLitKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_numLitKind() { _start: { lean_object* x_1; x_1 = l_Lean_numLitKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_scientificLitKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("scientific"); return x_1; } } static lean_object* _init_l_Lean_scientificLitKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_scientificLitKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_scientificLitKind() { _start: { lean_object* x_1; x_1 = l_Lean_scientificLitKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_nameLitKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("name"); return x_1; } } static lean_object* _init_l_Lean_nameLitKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_nameLitKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_nameLitKind() { _start: { lean_object* x_1; x_1 = l_Lean_nameLitKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_fieldIdxKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("fieldIdx"); return x_1; } } static lean_object* _init_l_Lean_fieldIdxKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_fieldIdxKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_fieldIdxKind() { _start: { lean_object* x_1; x_1 = l_Lean_fieldIdxKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_interpolatedStrLitKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("interpolatedStrLitKind"); return x_1; } } static lean_object* _init_l_Lean_interpolatedStrLitKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_interpolatedStrLitKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_interpolatedStrLitKind() { _start: { lean_object* x_1; x_1 = l_Lean_interpolatedStrLitKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_interpolatedStrKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("interpolatedStrKind"); return x_1; } } static lean_object* _init_l_Lean_interpolatedStrKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_interpolatedStrKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_interpolatedStrKind() { _start: { lean_object* x_1; x_1 = l_Lean_interpolatedStrKind___closed__2; return x_1; } } static lean_object* _init_l_Lean_Syntax_getKind___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("missing"); return x_1; } } static lean_object* _init_l_Lean_Syntax_getKind___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_Syntax_getKind___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getKind(lean_object* x_1) { _start: { switch (lean_obj_tag(x_1)) { case 0: { lean_object* x_2; x_2 = l_Lean_Syntax_getKind___closed__2; return x_2; } case 1: { lean_object* x_3; x_3 = lean_ctor_get(x_1, 1); lean_inc(x_3); lean_dec(x_1); return x_3; } case 2: { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_1, 1); lean_inc(x_4); lean_dec(x_1); x_5 = lean_box(0); x_6 = lean_name_mk_string(x_5, x_4); return x_6; } default: { lean_object* x_7; lean_dec(x_1); x_7 = l_Lean_identKind; return x_7; } } } } LEAN_EXPORT lean_object* l_Lean_Syntax_setKind(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 1) { uint8_t x_3; x_3 = !lean_is_exclusive(x_1); if (x_3 == 0) { lean_object* x_4; x_4 = lean_ctor_get(x_1, 1); lean_dec(x_4); lean_ctor_set(x_1, 1, x_2); return x_1; } else { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 0); x_6 = lean_ctor_get(x_1, 2); lean_inc(x_6); lean_inc(x_5); lean_dec(x_1); x_7 = lean_alloc_ctor(1, 3, 0); lean_ctor_set(x_7, 0, x_5); lean_ctor_set(x_7, 1, x_2); lean_ctor_set(x_7, 2, x_6); return x_7; } } else { lean_dec(x_2); return x_1; } } } LEAN_EXPORT uint8_t l_Lean_Syntax_isOfKind(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; uint8_t x_4; x_3 = l_Lean_Syntax_getKind(x_1); x_4 = lean_name_eq(x_3, x_2); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Syntax_isOfKind___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_Lean_Syntax_isOfKind(x_1, x_2); lean_dec(x_2); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getArg(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 1) { lean_object* x_3; lean_object* x_4; uint8_t x_5; x_3 = lean_ctor_get(x_1, 2); x_4 = lean_array_get_size(x_3); x_5 = lean_nat_dec_lt(x_2, x_4); lean_dec(x_4); if (x_5 == 0) { lean_object* x_6; x_6 = lean_box(0); return x_6; } else { lean_object* x_7; x_7 = lean_array_fget(x_3, x_2); return x_7; } } else { lean_object* x_8; x_8 = lean_box(0); return x_8; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getArg___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Syntax_getArg(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getOp(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Syntax_getArg(x_1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getOp___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Syntax_getOp(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getArgs(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 1) { lean_object* x_2; x_2 = lean_ctor_get(x_1, 2); lean_inc(x_2); return x_2; } else { lean_object* x_3; x_3 = l_Array_empty___closed__1; return x_3; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getArgs___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Syntax_getArgs(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getNumArgs(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 1) { lean_object* x_2; lean_object* x_3; x_2 = lean_ctor_get(x_1, 2); x_3 = lean_array_get_size(x_2); return x_3; } else { lean_object* x_4; x_4 = lean_unsigned_to_nat(0u); return x_4; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getNumArgs___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Syntax_getNumArgs(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT uint8_t l_Lean_Syntax_isMissing(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 0) { uint8_t x_2; x_2 = 1; return x_2; } else { uint8_t x_3; x_3 = 0; return x_3; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_isMissing___boxed(lean_object* x_1) { _start: { uint8_t x_2; lean_object* x_3; x_2 = l_Lean_Syntax_isMissing(x_1); lean_dec(x_1); x_3 = lean_box(x_2); return x_3; } } LEAN_EXPORT uint8_t l_Lean_Syntax_isNodeOf(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_inc(x_1); x_4 = l_Lean_Syntax_isOfKind(x_1, x_2); if (x_4 == 0) { uint8_t x_5; lean_dec(x_1); x_5 = 0; return x_5; } else { lean_object* x_6; uint8_t x_7; x_6 = l_Lean_Syntax_getNumArgs(x_1); lean_dec(x_1); x_7 = lean_nat_dec_eq(x_6, x_3); lean_dec(x_6); return x_7; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_isNodeOf___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = l_Lean_Syntax_isNodeOf(x_1, x_2, x_3); lean_dec(x_3); lean_dec(x_2); x_5 = lean_box(x_4); return x_5; } } LEAN_EXPORT uint8_t l_Lean_Syntax_isIdent(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 3) { uint8_t x_2; x_2 = 1; return x_2; } else { uint8_t x_3; x_3 = 0; return x_3; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_isIdent___boxed(lean_object* x_1) { _start: { uint8_t x_2; lean_object* x_3; x_2 = l_Lean_Syntax_isIdent(x_1); lean_dec(x_1); x_3 = lean_box(x_2); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getId(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 3) { lean_object* x_2; x_2 = lean_ctor_get(x_1, 2); lean_inc(x_2); return x_2; } else { lean_object* x_3; x_3 = lean_box(0); return x_3; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getId___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Syntax_getId(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT uint8_t l_Lean_Syntax_matchesNull(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; uint8_t x_4; x_3 = l_Lean_nullKind; x_4 = l_Lean_Syntax_isNodeOf(x_1, x_3, x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Syntax_matchesNull___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_Lean_Syntax_matchesNull(x_1, x_2); lean_dec(x_2); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT uint8_t l_Lean_Syntax_matchesIdent(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; x_3 = l_Lean_Syntax_isIdent(x_1); if (x_3 == 0) { uint8_t x_4; x_4 = 0; return x_4; } else { lean_object* x_5; uint8_t x_6; x_5 = l_Lean_Syntax_getId(x_1); x_6 = lean_name_eq(x_5, x_2); lean_dec(x_5); return x_6; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_matchesIdent___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = l_Lean_Syntax_matchesIdent(x_1, x_2); lean_dec(x_2); lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } } LEAN_EXPORT uint8_t l_Lean_Syntax_matchesLit(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { if (lean_obj_tag(x_1) == 1) { lean_object* x_4; lean_object* x_5; uint8_t x_6; x_4 = lean_ctor_get(x_1, 1); x_5 = lean_ctor_get(x_1, 2); x_6 = lean_name_eq(x_2, x_4); if (x_6 == 0) { uint8_t x_7; x_7 = 0; return x_7; } else { lean_object* x_8; lean_object* x_9; uint8_t x_10; x_8 = lean_array_get_size(x_5); x_9 = lean_unsigned_to_nat(0u); x_10 = lean_nat_dec_lt(x_9, x_8); lean_dec(x_8); if (x_10 == 0) { uint8_t x_11; x_11 = 0; return x_11; } else { lean_object* x_12; x_12 = lean_array_fget(x_5, x_9); if (lean_obj_tag(x_12) == 2) { lean_object* x_13; uint8_t x_14; x_13 = lean_ctor_get(x_12, 1); lean_inc(x_13); lean_dec(x_12); x_14 = lean_string_dec_eq(x_3, x_13); lean_dec(x_13); return x_14; } else { uint8_t x_15; lean_dec(x_12); x_15 = 0; return x_15; } } } } else { uint8_t x_16; x_16 = 0; return x_16; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_matchesLit___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = l_Lean_Syntax_matchesLit(x_1, x_2, x_3); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); x_5 = lean_box(x_4); return x_5; } } LEAN_EXPORT lean_object* l_Lean_Syntax_setArgs(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 1) { uint8_t x_3; x_3 = !lean_is_exclusive(x_1); if (x_3 == 0) { lean_object* x_4; x_4 = lean_ctor_get(x_1, 2); lean_dec(x_4); lean_ctor_set(x_1, 2, x_2); return x_1; } else { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 0); x_6 = lean_ctor_get(x_1, 1); lean_inc(x_6); lean_inc(x_5); lean_dec(x_1); x_7 = lean_alloc_ctor(1, 3, 0); lean_ctor_set(x_7, 0, x_5); lean_ctor_set(x_7, 1, x_6); lean_ctor_set(x_7, 2, x_2); return x_7; } } else { lean_dec(x_2); return x_1; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_setArg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { if (lean_obj_tag(x_1) == 1) { uint8_t x_4; x_4 = !lean_is_exclusive(x_1); if (x_4 == 0) { lean_object* x_5; lean_object* x_6; uint8_t x_7; x_5 = lean_ctor_get(x_1, 2); x_6 = lean_array_get_size(x_5); x_7 = lean_nat_dec_lt(x_2, x_6); lean_dec(x_6); if (x_7 == 0) { lean_dec(x_3); return x_1; } else { lean_object* x_8; x_8 = lean_array_fset(x_5, x_2, x_3); lean_ctor_set(x_1, 2, x_8); return x_1; } } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; uint8_t x_13; x_9 = lean_ctor_get(x_1, 0); x_10 = lean_ctor_get(x_1, 1); x_11 = lean_ctor_get(x_1, 2); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); lean_dec(x_1); x_12 = lean_array_get_size(x_11); x_13 = lean_nat_dec_lt(x_2, x_12); lean_dec(x_12); if (x_13 == 0) { lean_object* x_14; lean_dec(x_3); x_14 = lean_alloc_ctor(1, 3, 0); lean_ctor_set(x_14, 0, x_9); lean_ctor_set(x_14, 1, x_10); lean_ctor_set(x_14, 2, x_11); return x_14; } else { lean_object* x_15; lean_object* x_16; x_15 = lean_array_fset(x_11, x_2, x_3); x_16 = lean_alloc_ctor(1, 3, 0); lean_ctor_set(x_16, 0, x_9); lean_ctor_set(x_16, 1, x_10); lean_ctor_set(x_16, 2, x_15); return x_16; } } } else { lean_dec(x_3); return x_1; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_setArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Lean_Syntax_setArg(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f_loop(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; uint8_t x_4; x_3 = lean_array_get_size(x_1); x_4 = lean_nat_dec_lt(x_2, x_3); lean_dec(x_3); if (x_4 == 0) { lean_object* x_5; lean_dec(x_2); x_5 = lean_box(0); return x_5; } else { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = l_Lean_instInhabitedSyntax; x_7 = lean_array_get(x_6, x_1, x_2); x_8 = l_Lean_Syntax_getHeadInfo_x3f(x_7); lean_dec(x_7); if (lean_obj_tag(x_8) == 0) { lean_object* x_9; lean_object* x_10; x_9 = lean_unsigned_to_nat(1u); x_10 = lean_nat_add(x_2, x_9); lean_dec(x_2); x_2 = x_10; goto _start; } else { uint8_t x_12; lean_dec(x_2); x_12 = !lean_is_exclusive(x_8); if (x_12 == 0) { return x_8; } else { lean_object* x_13; lean_object* x_14; x_13 = lean_ctor_get(x_8, 0); lean_inc(x_13); lean_dec(x_8); x_14 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_14, 0, x_13); return x_14; } } } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f(lean_object* x_1) { _start: { switch (lean_obj_tag(x_1)) { case 0: { lean_object* x_2; x_2 = lean_box(0); return x_2; } case 1: { lean_object* x_3; x_3 = lean_ctor_get(x_1, 0); if (lean_obj_tag(x_3) == 2) { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_1, 2); x_5 = lean_unsigned_to_nat(0u); x_6 = l_Lean_Syntax_getHeadInfo_x3f_loop(x_4, x_5); return x_6; } else { lean_object* x_7; lean_inc(x_3); x_7 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_7, 0, x_3); return x_7; } } default: { lean_object* x_8; lean_object* x_9; x_8 = lean_ctor_get(x_1, 0); lean_inc(x_8); x_9 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_9, 0, x_8); return x_9; } } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f_loop___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Syntax_getHeadInfo_x3f_loop(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo_x3f___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Syntax_getHeadInfo_x3f(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Syntax_getHeadInfo_x3f(x_1); if (lean_obj_tag(x_2) == 0) { lean_object* x_3; x_3 = lean_box(2); return x_3; } else { lean_object* x_4; x_4 = lean_ctor_get(x_2, 0); lean_inc(x_4); lean_dec(x_2); return x_4; } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getHeadInfo___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Syntax_getHeadInfo(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getPos_x3f(lean_object* x_1, uint8_t x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = l_Lean_Syntax_getHeadInfo(x_1); x_4 = l_Lean_SourceInfo_getPos_x3f(x_3, x_2); lean_dec(x_3); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getPos_x3f___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_unbox(x_2); lean_dec(x_2); x_4 = l_Lean_Syntax_getPos_x3f(x_1, x_3); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f_loop(uint8_t x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; uint8_t x_5; x_4 = lean_array_get_size(x_2); x_5 = lean_nat_dec_lt(x_3, x_4); if (x_5 == 0) { lean_object* x_6; lean_dec(x_4); lean_dec(x_3); x_6 = lean_box(0); return x_6; } else { lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; x_7 = lean_nat_sub(x_4, x_3); lean_dec(x_4); x_8 = lean_unsigned_to_nat(1u); x_9 = lean_nat_sub(x_7, x_8); lean_dec(x_7); x_10 = l_Lean_instInhabitedSyntax; x_11 = lean_array_get(x_10, x_2, x_9); lean_dec(x_9); x_12 = l_Lean_Syntax_getTailPos_x3f(x_11, x_1); if (lean_obj_tag(x_12) == 0) { lean_object* x_13; x_13 = lean_nat_add(x_3, x_8); lean_dec(x_3); x_3 = x_13; goto _start; } else { uint8_t x_15; lean_dec(x_3); x_15 = !lean_is_exclusive(x_12); if (x_15 == 0) { return x_12; } else { lean_object* x_16; lean_object* x_17; x_16 = lean_ctor_get(x_12, 0); lean_inc(x_16); lean_dec(x_12); x_17 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_17, 0, x_16); return x_17; } } } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f(lean_object* x_1, uint8_t x_2) { _start: { switch (lean_obj_tag(x_1)) { case 0: { lean_object* x_3; x_3 = lean_box(0); return x_3; } case 1: { lean_object* x_4; x_4 = lean_ctor_get(x_1, 0); lean_inc(x_4); switch (lean_obj_tag(x_4)) { case 0: { lean_object* x_5; lean_object* x_6; lean_dec(x_1); x_5 = lean_ctor_get(x_4, 3); lean_inc(x_5); lean_dec(x_4); x_6 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_6, 0, x_5); return x_6; } case 1: { if (x_2 == 0) { lean_object* x_7; lean_object* x_8; lean_dec(x_1); x_7 = lean_ctor_get(x_4, 1); lean_inc(x_7); lean_dec(x_4); x_8 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_8, 0, x_7); return x_8; } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_dec(x_4); x_9 = lean_ctor_get(x_1, 2); lean_inc(x_9); lean_dec(x_1); x_10 = lean_unsigned_to_nat(0u); x_11 = l_Lean_Syntax_getTailPos_x3f_loop(x_2, x_9, x_10); lean_dec(x_9); return x_11; } } default: { lean_object* x_12; lean_object* x_13; lean_object* x_14; x_12 = lean_ctor_get(x_1, 2); lean_inc(x_12); lean_dec(x_1); x_13 = lean_unsigned_to_nat(0u); x_14 = l_Lean_Syntax_getTailPos_x3f_loop(x_2, x_12, x_13); lean_dec(x_12); return x_14; } } } default: { lean_object* x_15; x_15 = lean_ctor_get(x_1, 0); lean_inc(x_15); lean_dec(x_1); switch (lean_obj_tag(x_15)) { case 0: { lean_object* x_16; lean_object* x_17; x_16 = lean_ctor_get(x_15, 3); lean_inc(x_16); lean_dec(x_15); x_17 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_17, 0, x_16); return x_17; } case 1: { if (x_2 == 0) { lean_object* x_18; lean_object* x_19; x_18 = lean_ctor_get(x_15, 1); lean_inc(x_18); lean_dec(x_15); x_19 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_19, 0, x_18); return x_19; } else { lean_object* x_20; lean_dec(x_15); x_20 = lean_box(0); return x_20; } } default: { lean_object* x_21; x_21 = lean_box(0); return x_21; } } } } } } LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f_loop___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; x_4 = lean_unbox(x_1); lean_dec(x_1); x_5 = l_Lean_Syntax_getTailPos_x3f_loop(x_4, x_2, x_3); lean_dec(x_2); return x_5; } } LEAN_EXPORT lean_object* l_Lean_Syntax_getTailPos_x3f___boxed(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = lean_unbox(x_2); lean_dec(x_2); x_4 = l_Lean_Syntax_getTailPos_x3f(x_1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_Lean_SourceInfo_fromRef(lean_object* x_1) { _start: { uint8_t x_2; lean_object* x_3; lean_object* x_4; x_2 = 0; lean_inc(x_1); x_3 = l_Lean_Syntax_getTailPos_x3f(x_1, x_2); x_4 = l_Lean_Syntax_getPos_x3f(x_1, x_2); lean_dec(x_1); if (lean_obj_tag(x_4) == 0) { lean_object* x_5; lean_dec(x_3); x_5 = lean_box(2); return x_5; } else { if (lean_obj_tag(x_3) == 0) { lean_object* x_6; lean_dec(x_4); x_6 = lean_box(2); return x_6; } else { lean_object* x_7; lean_object* x_8; lean_object* x_9; x_7 = lean_ctor_get(x_4, 0); lean_inc(x_7); lean_dec(x_4); x_8 = lean_ctor_get(x_3, 0); lean_inc(x_8); lean_dec(x_3); x_9 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_9, 0, x_7); lean_ctor_set(x_9, 1, x_8); return x_9; } } } } LEAN_EXPORT lean_object* l_Lean_mkAtom(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; x_2 = lean_box(2); x_3 = lean_alloc_ctor(2, 2, 0); lean_ctor_set(x_3, 0, x_2); lean_ctor_set(x_3, 1, x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_mkAtomFrom(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = l_Lean_SourceInfo_fromRef(x_1); x_4 = lean_alloc_ctor(2, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_2); return x_4; } } static lean_object* _init_l_Lean_instInhabitedParserDescr___closed__1() { _start: { lean_object* x_1; lean_object* x_2; x_1 = l_instInhabitedSubstring___closed__1; x_2 = lean_alloc_ctor(5, 1, 0); lean_ctor_set(x_2, 0, x_1); return x_2; } } static lean_object* _init_l_Lean_instInhabitedParserDescr() { _start: { lean_object* x_1; x_1 = l_Lean_instInhabitedParserDescr___closed__1; return x_1; } } static lean_object* _init_l_Lean_reservedMacroScope() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(0u); return x_1; } } static lean_object* _init_l_Lean_firstFrontendMacroScope___closed__1() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_Lean_reservedMacroScope; x_2 = lean_unsigned_to_nat(1u); x_3 = lean_nat_add(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_firstFrontendMacroScope() { _start: { lean_object* x_1; x_1 = l_Lean_firstFrontendMacroScope___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_Lean_instMonadRef___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; x_5 = lean_ctor_get(x_1, 1); lean_inc(x_5); lean_dec(x_1); x_6 = lean_apply_3(x_5, lean_box(0), x_2, x_4); return x_6; } } LEAN_EXPORT lean_object* l_Lean_instMonadRef___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; x_6 = lean_alloc_closure((void*)(l_Lean_instMonadRef___rarg___lambda__1), 4, 2); lean_closure_set(x_6, 0, x_1); lean_closure_set(x_6, 1, x_4); x_7 = lean_apply_3(x_2, lean_box(0), x_6, x_5); return x_7; } } LEAN_EXPORT lean_object* l_Lean_instMonadRef___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_4 = lean_ctor_get(x_3, 0); lean_inc(x_4); x_5 = lean_apply_2(x_1, lean_box(0), x_4); x_6 = lean_alloc_closure((void*)(l_Lean_instMonadRef___rarg___lambda__2), 5, 2); lean_closure_set(x_6, 0, x_3); lean_closure_set(x_6, 1, x_2); x_7 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_7, 0, x_5); lean_ctor_set(x_7, 1, x_6); return x_7; } } LEAN_EXPORT lean_object* l_Lean_instMonadRef(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_Lean_instMonadRef___rarg), 3, 0); return x_3; } } LEAN_EXPORT lean_object* l_Lean_replaceRef(lean_object* x_1, lean_object* x_2) { _start: { uint8_t x_3; lean_object* x_4; x_3 = 0; x_4 = l_Lean_Syntax_getPos_x3f(x_1, x_3); if (lean_obj_tag(x_4) == 0) { lean_inc(x_2); return x_2; } else { lean_dec(x_4); lean_inc(x_1); return x_1; } } } LEAN_EXPORT lean_object* l_Lean_replaceRef___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_replaceRef(x_1, x_2); lean_dec(x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_withRef___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = l_Lean_replaceRef(x_1, x_4); x_6 = lean_ctor_get(x_2, 1); lean_inc(x_6); lean_dec(x_2); x_7 = lean_apply_3(x_6, lean_box(0), x_5, x_3); return x_7; } } LEAN_EXPORT lean_object* l_Lean_withRef___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; x_6 = lean_ctor_get(x_1, 1); lean_inc(x_6); lean_dec(x_1); x_7 = lean_ctor_get(x_2, 0); lean_inc(x_7); x_8 = lean_alloc_closure((void*)(l_Lean_withRef___rarg___lambda__1___boxed), 4, 3); lean_closure_set(x_8, 0, x_4); lean_closure_set(x_8, 1, x_2); lean_closure_set(x_8, 2, x_5); x_9 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_7, x_8); return x_9; } } LEAN_EXPORT lean_object* l_Lean_withRef(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_withRef___rarg), 5, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_withRef___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_Lean_withRef___rarg___lambda__1(x_1, x_2, x_3, x_4); lean_dec(x_4); lean_dec(x_1); return x_5; } } LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___rarg___lambda__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); lean_dec(x_1); x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = l_Lean_SourceInfo_fromRef(x_2); x_6 = lean_apply_2(x_4, lean_box(0), x_5); return x_6; } } LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_3 = lean_ctor_get(x_1, 1); lean_inc(x_3); x_4 = lean_ctor_get(x_2, 0); lean_inc(x_4); lean_dec(x_2); x_5 = lean_alloc_closure((void*)(l_Lean_MonadRef_mkInfoFromRefPos___rarg___lambda__1), 2, 1); lean_closure_set(x_5, 0, x_1); x_6 = lean_apply_4(x_3, lean_box(0), lean_box(0), x_4, x_5); return x_6; } } LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_MonadRef_mkInfoFromRefPos___rarg), 2, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_instMonadQuotation___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_ctor_get(x_1, 3); lean_inc(x_4); lean_dec(x_1); x_5 = lean_apply_2(x_4, lean_box(0), x_3); return x_5; } } LEAN_EXPORT lean_object* l_Lean_instMonadQuotation___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; x_5 = lean_alloc_closure((void*)(l_Lean_instMonadQuotation___rarg___lambda__1), 3, 1); lean_closure_set(x_5, 0, x_1); x_6 = lean_apply_3(x_2, lean_box(0), x_5, x_4); return x_6; } } LEAN_EXPORT lean_object* l_Lean_instMonadQuotation___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; x_4 = lean_ctor_get(x_3, 0); lean_inc(x_4); lean_inc(x_1); lean_inc(x_2); x_5 = l_Lean_instMonadRef___rarg(x_2, x_1, x_4); x_6 = lean_ctor_get(x_3, 1); lean_inc(x_6); lean_inc(x_2); x_7 = lean_apply_2(x_2, lean_box(0), x_6); x_8 = lean_ctor_get(x_3, 2); lean_inc(x_8); x_9 = lean_apply_2(x_2, lean_box(0), x_8); x_10 = lean_alloc_closure((void*)(l_Lean_instMonadQuotation___rarg___lambda__2), 4, 2); lean_closure_set(x_10, 0, x_3); lean_closure_set(x_10, 1, x_1); x_11 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_11, 0, x_5); lean_ctor_set(x_11, 1, x_7); lean_ctor_set(x_11, 2, x_9); lean_ctor_set(x_11, 3, x_10); return x_11; } } LEAN_EXPORT lean_object* l_Lean_instMonadQuotation(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_Lean_instMonadQuotation___rarg), 3, 0); return x_3; } } static lean_object* _init_l_Lean_Name_hasMacroScopes___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("_hyg"); return x_1; } } LEAN_EXPORT uint8_t l_Lean_Name_hasMacroScopes(lean_object* x_1) { _start: { switch (lean_obj_tag(x_1)) { case 0: { uint8_t x_2; x_2 = 0; return x_2; } case 1: { lean_object* x_3; lean_object* x_4; uint8_t x_5; x_3 = lean_ctor_get(x_1, 1); x_4 = l_Lean_Name_hasMacroScopes___closed__1; x_5 = lean_string_dec_eq(x_3, x_4); return x_5; } default: { lean_object* x_6; x_6 = lean_ctor_get(x_1, 0); x_1 = x_6; goto _start; } } } } LEAN_EXPORT lean_object* l_Lean_Name_hasMacroScopes___boxed(lean_object* x_1) { _start: { uint8_t x_2; lean_object* x_3; x_2 = l_Lean_Name_hasMacroScopes(x_1); lean_dec(x_1); x_3 = lean_box(x_2); return x_3; } } static lean_object* _init_l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("_@"); return x_1; } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_eraseMacroScopesAux(lean_object* x_1) { _start: { switch (lean_obj_tag(x_1)) { case 0: { lean_object* x_2; x_2 = lean_box(0); return x_2; } case 1: { lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; x_3 = lean_ctor_get(x_1, 0); x_4 = lean_ctor_get(x_1, 1); x_5 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1; x_6 = lean_string_dec_eq(x_4, x_5); if (x_6 == 0) { x_1 = x_3; goto _start; } else { lean_inc(x_3); return x_3; } } default: { lean_object* x_8; x_8 = lean_ctor_get(x_1, 0); x_1 = x_8; goto _start; } } } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux(x_1); lean_dec(x_1); return x_2; } } LEAN_EXPORT lean_object* lean_erase_macro_scopes(lean_object* x_1) { _start: { uint8_t x_2; x_2 = l_Lean_Name_hasMacroScopes(x_1); if (x_2 == 0) { return x_1; } else { lean_object* x_3; x_3 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux(x_1); lean_dec(x_1); return x_3; } } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_simpMacroScopesAux(lean_object* x_1) { _start: { if (lean_obj_tag(x_1) == 2) { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_2 = lean_ctor_get(x_1, 0); lean_inc(x_2); x_3 = lean_ctor_get(x_1, 1); lean_inc(x_3); lean_dec(x_1); x_4 = l___private_Init_Prelude_0__Lean_simpMacroScopesAux(x_2); x_5 = lean_name_mk_numeral(x_4, x_3); return x_5; } else { lean_object* x_6; x_6 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux(x_1); lean_dec(x_1); return x_6; } } } LEAN_EXPORT lean_object* lean_simp_macro_scopes(lean_object* x_1) { _start: { uint8_t x_2; x_2 = l_Lean_Name_hasMacroScopes(x_1); if (x_2 == 0) { return x_1; } else { lean_object* x_3; x_3 = l___private_Init_Prelude_0__Lean_simpMacroScopesAux(x_1); return x_3; } } } static lean_object* _init_l_Lean_instInhabitedMacroScopesView___closed__1() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = lean_box(0); x_3 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_3, 0, x_2); lean_ctor_set(x_3, 1, x_2); lean_ctor_set(x_3, 2, x_2); lean_ctor_set(x_3, 3, x_1); return x_3; } } static lean_object* _init_l_Lean_instInhabitedMacroScopesView() { _start: { lean_object* x_1; x_1 = l_Lean_instInhabitedMacroScopesView___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_List_foldl___at_Lean_MacroScopesView_review___spec__1(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_2) == 0) { return x_1; } else { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_ctor_get(x_2, 0); lean_inc(x_3); x_4 = lean_ctor_get(x_2, 1); lean_inc(x_4); lean_dec(x_2); x_5 = lean_name_mk_numeral(x_1, x_3); x_1 = x_5; x_2 = x_4; goto _start; } } } LEAN_EXPORT lean_object* l_Lean_MacroScopesView_review(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_ctor_get(x_1, 3); lean_inc(x_2); if (lean_obj_tag(x_2) == 0) { lean_object* x_3; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); lean_dec(x_1); return x_3; } else { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; x_4 = lean_ctor_get(x_1, 0); lean_inc(x_4); x_5 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1; x_6 = lean_name_mk_string(x_4, x_5); x_7 = lean_ctor_get(x_1, 1); lean_inc(x_7); x_8 = l_Lean_Name_append(x_6, x_7); lean_dec(x_6); x_9 = lean_ctor_get(x_1, 2); lean_inc(x_9); lean_dec(x_1); x_10 = l_Lean_Name_append(x_8, x_9); lean_dec(x_8); x_11 = l_Lean_Name_hasMacroScopes___closed__1; x_12 = lean_name_mk_string(x_10, x_11); x_13 = l_List_foldl___at_Lean_MacroScopesView_review___spec__1(x_12, x_2); return x_13; } } } LEAN_EXPORT lean_object* l_panic___at___private_Init_Prelude_0__Lean_assembleParts___spec__1(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; x_2 = l_Lean_instInhabitedName; x_3 = lean_panic_fn(x_2, x_1); return x_3; } } static lean_object* _init_l___private_Init_Prelude_0__Lean_assembleParts___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("Error: unreachable @ assembleParts"); return x_1; } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_assembleParts(lean_object* x_1, lean_object* x_2) { _start: { if (lean_obj_tag(x_1) == 0) { return x_2; } else { lean_object* x_3; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); switch (lean_obj_tag(x_3)) { case 0: { lean_object* x_4; lean_object* x_5; lean_dec(x_2); lean_dec(x_1); x_4 = l___private_Init_Prelude_0__Lean_assembleParts___closed__1; x_5 = l_panic___at___private_Init_Prelude_0__Lean_assembleParts___spec__1(x_4); return x_5; } case 1: { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = lean_ctor_get(x_1, 1); lean_inc(x_6); lean_dec(x_1); x_7 = lean_ctor_get(x_3, 1); lean_inc(x_7); lean_dec(x_3); x_8 = lean_name_mk_string(x_2, x_7); x_1 = x_6; x_2 = x_8; goto _start; } default: { lean_object* x_10; lean_object* x_11; lean_object* x_12; x_10 = lean_ctor_get(x_1, 1); lean_inc(x_10); lean_dec(x_1); x_11 = lean_ctor_get(x_3, 1); lean_inc(x_11); lean_dec(x_3); x_12 = lean_name_mk_numeral(x_2, x_11); x_1 = x_10; x_2 = x_12; goto _start; } } } } } LEAN_EXPORT lean_object* l_panic___at___private_Init_Prelude_0__Lean_extractImported___spec__1(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; x_2 = l_Lean_instInhabitedMacroScopesView; x_3 = lean_panic_fn(x_2, x_1); return x_3; } } static lean_object* _init_l___private_Init_Prelude_0__Lean_extractImported___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("Error: unreachable @ extractImported"); return x_1; } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_extractImported(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { switch (lean_obj_tag(x_3)) { case 0: { lean_object* x_5; lean_object* x_6; lean_dec(x_4); lean_dec(x_2); lean_dec(x_1); x_5 = l___private_Init_Prelude_0__Lean_extractImported___closed__1; x_6 = l_panic___at___private_Init_Prelude_0__Lean_extractImported___spec__1(x_5); return x_6; } case 1: { lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10; x_7 = lean_ctor_get(x_3, 0); lean_inc(x_7); x_8 = lean_ctor_get(x_3, 1); lean_inc(x_8); x_9 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1; x_10 = lean_string_dec_eq(x_8, x_9); lean_dec(x_8); if (x_10 == 0) { lean_object* x_11; x_11 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_11, 0, x_3); lean_ctor_set(x_11, 1, x_4); x_3 = x_7; x_4 = x_11; goto _start; } else { lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_dec(x_3); x_13 = lean_box(0); x_14 = l___private_Init_Prelude_0__Lean_assembleParts(x_4, x_13); x_15 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_15, 0, x_7); lean_ctor_set(x_15, 1, x_14); lean_ctor_set(x_15, 2, x_2); lean_ctor_set(x_15, 3, x_1); return x_15; } } default: { lean_object* x_16; lean_object* x_17; x_16 = lean_ctor_get(x_3, 0); lean_inc(x_16); x_17 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_17, 0, x_3); lean_ctor_set(x_17, 1, x_4); x_3 = x_16; x_4 = x_17; goto _start; } } } } static lean_object* _init_l___private_Init_Prelude_0__Lean_extractMainModule___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("Error: unreachable @ extractMainModule"); return x_1; } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_extractMainModule(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { switch (lean_obj_tag(x_2)) { case 0: { lean_object* x_4; lean_object* x_5; lean_dec(x_3); lean_dec(x_1); x_4 = l___private_Init_Prelude_0__Lean_extractMainModule___closed__1; x_5 = l_panic___at___private_Init_Prelude_0__Lean_extractImported___spec__1(x_4); return x_5; } case 1: { lean_object* x_6; lean_object* x_7; lean_object* x_8; uint8_t x_9; x_6 = lean_ctor_get(x_2, 0); lean_inc(x_6); x_7 = lean_ctor_get(x_2, 1); lean_inc(x_7); x_8 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1; x_9 = lean_string_dec_eq(x_7, x_8); lean_dec(x_7); if (x_9 == 0) { lean_object* x_10; x_10 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_10, 0, x_2); lean_ctor_set(x_10, 1, x_3); x_2 = x_6; x_3 = x_10; goto _start; } else { lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_dec(x_2); x_12 = lean_box(0); x_13 = l___private_Init_Prelude_0__Lean_assembleParts(x_3, x_12); x_14 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_14, 0, x_6); lean_ctor_set(x_14, 1, x_12); lean_ctor_set(x_14, 2, x_13); lean_ctor_set(x_14, 3, x_1); return x_14; } } default: { lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; x_15 = lean_box(0); x_16 = l___private_Init_Prelude_0__Lean_assembleParts(x_3, x_15); x_17 = lean_box(0); x_18 = l___private_Init_Prelude_0__Lean_extractImported(x_1, x_16, x_2, x_17); return x_18; } } } } static lean_object* _init_l___private_Init_Prelude_0__Lean_extractMacroScopesAux___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("Error: unreachable @ extractMacroScopesAux"); return x_1; } } LEAN_EXPORT lean_object* l___private_Init_Prelude_0__Lean_extractMacroScopesAux(lean_object* x_1, lean_object* x_2) { _start: { switch (lean_obj_tag(x_1)) { case 0: { lean_object* x_3; lean_object* x_4; lean_dec(x_2); x_3 = l___private_Init_Prelude_0__Lean_extractMacroScopesAux___closed__1; x_4 = l_panic___at___private_Init_Prelude_0__Lean_extractImported___spec__1(x_3); return x_4; } case 1: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); lean_dec(x_1); x_6 = lean_box(0); x_7 = l___private_Init_Prelude_0__Lean_extractMainModule(x_2, x_5, x_6); return x_7; } default: { lean_object* x_8; lean_object* x_9; lean_object* x_10; x_8 = lean_ctor_get(x_1, 0); lean_inc(x_8); x_9 = lean_ctor_get(x_1, 1); lean_inc(x_9); lean_dec(x_1); x_10 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_10, 0, x_9); lean_ctor_set(x_10, 1, x_2); x_1 = x_8; x_2 = x_10; goto _start; } } } } LEAN_EXPORT lean_object* l_Lean_extractMacroScopes(lean_object* x_1) { _start: { uint8_t x_2; x_2 = l_Lean_Name_hasMacroScopes(x_1); if (x_2 == 0) { lean_object* x_3; lean_object* x_4; lean_object* x_5; x_3 = lean_box(0); x_4 = lean_box(0); x_5 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_5, 0, x_1); lean_ctor_set(x_5, 1, x_4); lean_ctor_set(x_5, 2, x_4); lean_ctor_set(x_5, 3, x_3); return x_5; } else { lean_object* x_6; lean_object* x_7; x_6 = lean_box(0); x_7 = l___private_Init_Prelude_0__Lean_extractMacroScopesAux(x_1, x_6); return x_7; } } } LEAN_EXPORT lean_object* l_Lean_addMacroScope(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; x_4 = l_Lean_Name_hasMacroScopes(x_2); if (x_4 == 0) { lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_5 = l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1; x_6 = lean_name_mk_string(x_2, x_5); x_7 = l_Lean_Name_append(x_6, x_1); lean_dec(x_6); x_8 = l_Lean_Name_hasMacroScopes___closed__1; x_9 = lean_name_mk_string(x_7, x_8); x_10 = lean_name_mk_numeral(x_9, x_3); return x_10; } else { lean_object* x_11; uint8_t x_12; lean_inc(x_2); x_11 = l_Lean_extractMacroScopes(x_2); x_12 = !lean_is_exclusive(x_11); if (x_12 == 0) { lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; x_13 = lean_ctor_get(x_11, 0); x_14 = lean_ctor_get(x_11, 1); x_15 = lean_ctor_get(x_11, 2); x_16 = lean_ctor_get(x_11, 3); x_17 = lean_name_eq(x_15, x_1); if (x_17 == 0) { lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_dec(x_2); x_18 = l_Lean_Name_append(x_14, x_15); lean_dec(x_14); x_19 = l_List_foldl___at_Lean_MacroScopesView_review___spec__1(x_18, x_16); x_20 = lean_box(0); x_21 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_21, 0, x_3); lean_ctor_set(x_21, 1, x_20); lean_ctor_set(x_11, 3, x_21); lean_ctor_set(x_11, 2, x_1); lean_ctor_set(x_11, 1, x_19); x_22 = l_Lean_MacroScopesView_review(x_11); return x_22; } else { lean_object* x_23; lean_free_object(x_11); lean_dec(x_16); lean_dec(x_15); lean_dec(x_14); lean_dec(x_13); lean_dec(x_1); x_23 = lean_name_mk_numeral(x_2, x_3); return x_23; } } else { lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; uint8_t x_28; x_24 = lean_ctor_get(x_11, 0); x_25 = lean_ctor_get(x_11, 1); x_26 = lean_ctor_get(x_11, 2); x_27 = lean_ctor_get(x_11, 3); lean_inc(x_27); lean_inc(x_26); lean_inc(x_25); lean_inc(x_24); lean_dec(x_11); x_28 = lean_name_eq(x_26, x_1); if (x_28 == 0) { lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_dec(x_2); x_29 = l_Lean_Name_append(x_25, x_26); lean_dec(x_25); x_30 = l_List_foldl___at_Lean_MacroScopesView_review___spec__1(x_29, x_27); x_31 = lean_box(0); x_32 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_32, 0, x_3); lean_ctor_set(x_32, 1, x_31); x_33 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_33, 0, x_24); lean_ctor_set(x_33, 1, x_30); lean_ctor_set(x_33, 2, x_1); lean_ctor_set(x_33, 3, x_32); x_34 = l_Lean_MacroScopesView_review(x_33); return x_34; } else { lean_object* x_35; lean_dec(x_27); lean_dec(x_26); lean_dec(x_25); lean_dec(x_24); lean_dec(x_1); x_35 = lean_name_mk_numeral(x_2, x_3); return x_35; } } } } } LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_5 = lean_ctor_get(x_1, 0); lean_inc(x_5); lean_dec(x_1); x_6 = lean_ctor_get(x_5, 1); lean_inc(x_6); lean_dec(x_5); x_7 = l_Lean_addMacroScope(x_2, x_3, x_4); x_8 = lean_apply_2(x_6, lean_box(0), x_7); return x_8; } } LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = lean_ctor_get(x_1, 1); lean_inc(x_6); lean_dec(x_1); x_7 = lean_alloc_closure((void*)(l_Lean_MonadQuotation_addMacroScope___rarg___lambda__1), 4, 3); lean_closure_set(x_7, 0, x_2); lean_closure_set(x_7, 1, x_5); lean_closure_set(x_7, 2, x_3); x_8 = lean_apply_4(x_4, lean_box(0), lean_box(0), x_6, x_7); return x_8; } } LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_4 = lean_ctor_get(x_2, 1); lean_inc(x_4); x_5 = lean_ctor_get(x_1, 2); lean_inc(x_5); lean_inc(x_4); x_6 = lean_alloc_closure((void*)(l_Lean_MonadQuotation_addMacroScope___rarg___lambda__2), 5, 4); lean_closure_set(x_6, 0, x_1); lean_closure_set(x_6, 1, x_2); lean_closure_set(x_6, 2, x_3); lean_closure_set(x_6, 3, x_4); x_7 = lean_apply_4(x_4, lean_box(0), lean_box(0), x_5, x_6); return x_7; } } LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_MonadQuotation_addMacroScope___rarg), 3, 0); return x_2; } } static lean_object* _init_l_Lean_defaultMaxRecDepth() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(512u); return x_1; } } static lean_object* _init_l_Lean_maxRecDepthErrorMessage___closed__1() { _start: { lean_object* x_1; x_1 = lean_mk_string("maximum recursion depth has been reached (use `set_option maxRecDepth <num>` to increase limit)"); return x_1; } } static lean_object* _init_l_Lean_maxRecDepthErrorMessage() { _start: { lean_object* x_1; x_1 = l_Lean_maxRecDepthErrorMessage___closed__1; return x_1; } } static lean_object* _init_l___private_Init_Prelude_0__Lean_Macro_MethodsRefPointed() { _start: { return lean_box(0); } } static lean_object* _init_l_Lean_Macro_Context_currRecDepth___default() { _start: { lean_object* x_1; x_1 = lean_unsigned_to_nat(0u); return x_1; } } static lean_object* _init_l_Lean_Macro_Context_maxRecDepth___default() { _start: { lean_object* x_1; x_1 = l_Lean_defaultMaxRecDepth; return x_1; } } static lean_object* _init_l_Lean_Macro_State_traceMsgs___default() { _start: { lean_object* x_1; x_1 = lean_box(0); return x_1; } } static lean_object* _init_l_Lean_Macro_instInhabitedState___closed__1() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_2); lean_ctor_set(x_3, 1, x_1); return x_3; } } static lean_object* _init_l_Lean_Macro_instInhabitedState() { _start: { lean_object* x_1; x_1 = l_Lean_Macro_instInhabitedState___closed__1; return x_1; } } LEAN_EXPORT lean_object* l_ReaderT_read___at_Lean_Macro_instMonadRefMacroM___spec__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_bind___at_Lean_Macro_instMonadRefMacroM___spec__2___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_inc(x_3); x_5 = lean_apply_2(x_1, x_3, x_4); if (lean_obj_tag(x_5) == 0) { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = lean_ctor_get(x_5, 0); lean_inc(x_6); x_7 = lean_ctor_get(x_5, 1); lean_inc(x_7); lean_dec(x_5); x_8 = lean_apply_3(x_2, x_6, x_3, x_7); return x_8; } else { uint8_t x_9; lean_dec(x_3); lean_dec(x_2); x_9 = !lean_is_exclusive(x_5); if (x_9 == 0) { return x_5; } else { lean_object* x_10; lean_object* x_11; lean_object* x_12; x_10 = lean_ctor_get(x_5, 0); x_11 = lean_ctor_get(x_5, 1); lean_inc(x_11); lean_inc(x_10); lean_dec(x_5); x_12 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_12, 0, x_10); lean_ctor_set(x_12, 1, x_11); return x_12; } } } } LEAN_EXPORT lean_object* l_ReaderT_bind___at_Lean_Macro_instMonadRefMacroM___spec__2(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Macro_instMonadRefMacroM___spec__2___rarg), 4, 0); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_ctor_get(x_1, 5); lean_inc(x_4); x_5 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_5, 0, x_4); lean_ctor_set(x_5, 1, x_3); return x_5; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { uint8_t x_6; x_6 = !lean_is_exclusive(x_4); if (x_6 == 0) { lean_object* x_7; lean_object* x_8; x_7 = lean_ctor_get(x_4, 5); lean_dec(x_7); lean_ctor_set(x_4, 5, x_2); x_8 = lean_apply_2(x_3, x_4, x_5); return x_8; } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; x_9 = lean_ctor_get(x_4, 0); x_10 = lean_ctor_get(x_4, 1); x_11 = lean_ctor_get(x_4, 2); x_12 = lean_ctor_get(x_4, 3); x_13 = lean_ctor_get(x_4, 4); lean_inc(x_13); lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); lean_dec(x_4); x_14 = lean_alloc_ctor(0, 6, 0); lean_ctor_set(x_14, 0, x_9); lean_ctor_set(x_14, 1, x_10); lean_ctor_set(x_14, 2, x_11); lean_ctor_set(x_14, 3, x_12); lean_ctor_set(x_14, 4, x_13); lean_ctor_set(x_14, 5, x_2); x_15 = lean_apply_2(x_3, x_14, x_5); return x_15; } } } static lean_object* _init_l_Lean_Macro_instMonadRefMacroM___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_ReaderT_read___at_Lean_Macro_instMonadRefMacroM___spec__1), 2, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instMonadRefMacroM___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instMonadRefMacroM___lambda__1___boxed), 3, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instMonadRefMacroM___closed__3() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instMonadRefMacroM___lambda__2), 5, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instMonadRefMacroM() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_Macro_instMonadRefMacroM___closed__1; x_2 = l_Lean_Macro_instMonadRefMacroM___closed__2; x_3 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Macro_instMonadRefMacroM___spec__2___rarg), 4, 2); lean_closure_set(x_3, 0, x_1); lean_closure_set(x_3, 1, x_2); x_4 = l_Lean_Macro_instMonadRefMacroM___closed__3; x_5 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_5, 0, x_3); lean_ctor_set(x_5, 1, x_4); return x_5; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadRefMacroM___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Lean_Macro_instMonadRefMacroM___lambda__1(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_addMacroScope(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_4 = lean_ctor_get(x_2, 1); lean_inc(x_4); x_5 = lean_ctor_get(x_2, 2); lean_inc(x_5); lean_dec(x_2); x_6 = l_Lean_addMacroScope(x_4, x_1, x_5); x_7 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_7, 0, x_6); lean_ctor_set(x_7, 1, x_3); return x_7; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwUnsupported___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; x_2 = lean_box(1); x_3 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_3, 0, x_2); lean_ctor_set(x_3, 1, x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwUnsupported(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_closure((void*)(l_Lean_Macro_throwUnsupported___rarg), 1, 0); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwUnsupported___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Macro_throwUnsupported(x_1, x_2); lean_dec(x_2); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwError___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_2, 5); lean_inc(x_4); x_5 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_5, 0, x_4); lean_ctor_set(x_5, 1, x_1); x_6 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_6, 0, x_5); lean_ctor_set(x_6, 1, x_3); return x_6; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwError(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_Macro_throwError___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwError___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Lean_Macro_throwError___rarg(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwErrorAt___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { uint8_t x_5; x_5 = !lean_is_exclusive(x_3); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; lean_object* x_8; x_6 = lean_ctor_get(x_3, 5); x_7 = l_Lean_replaceRef(x_1, x_6); lean_dec(x_6); lean_ctor_set(x_3, 5, x_7); x_8 = l_Lean_Macro_throwError___rarg(x_2, x_3, x_4); lean_dec(x_3); return x_8; } else { lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; x_9 = lean_ctor_get(x_3, 0); x_10 = lean_ctor_get(x_3, 1); x_11 = lean_ctor_get(x_3, 2); x_12 = lean_ctor_get(x_3, 3); x_13 = lean_ctor_get(x_3, 4); x_14 = lean_ctor_get(x_3, 5); lean_inc(x_14); lean_inc(x_13); lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); lean_dec(x_3); x_15 = l_Lean_replaceRef(x_1, x_14); lean_dec(x_14); x_16 = lean_alloc_ctor(0, 6, 0); lean_ctor_set(x_16, 0, x_9); lean_ctor_set(x_16, 1, x_10); lean_ctor_set(x_16, 2, x_11); lean_ctor_set(x_16, 3, x_12); lean_ctor_set(x_16, 4, x_13); lean_ctor_set(x_16, 5, x_15); x_17 = l_Lean_Macro_throwError___rarg(x_2, x_16, x_4); lean_dec(x_16); return x_17; } } } LEAN_EXPORT lean_object* l_Lean_Macro_throwErrorAt(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_Macro_throwErrorAt___rarg___boxed), 4, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Macro_throwErrorAt___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_Lean_Macro_throwErrorAt___rarg(x_1, x_2, x_3, x_4); lean_dec(x_1); return x_5; } } LEAN_EXPORT lean_object* l_Lean_Macro_withFreshMacroScope___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; x_4 = !lean_is_exclusive(x_3); if (x_4 == 0) { lean_object* x_5; lean_object* x_6; lean_object* x_7; uint8_t x_8; x_5 = lean_ctor_get(x_3, 0); x_6 = lean_unsigned_to_nat(1u); x_7 = lean_nat_add(x_5, x_6); lean_ctor_set(x_3, 0, x_7); x_8 = !lean_is_exclusive(x_2); if (x_8 == 0) { lean_object* x_9; lean_object* x_10; x_9 = lean_ctor_get(x_2, 2); lean_dec(x_9); lean_ctor_set(x_2, 2, x_5); x_10 = lean_apply_2(x_1, x_2, x_3); return x_10; } else { lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; x_11 = lean_ctor_get(x_2, 0); x_12 = lean_ctor_get(x_2, 1); x_13 = lean_ctor_get(x_2, 3); x_14 = lean_ctor_get(x_2, 4); x_15 = lean_ctor_get(x_2, 5); lean_inc(x_15); lean_inc(x_14); lean_inc(x_13); lean_inc(x_12); lean_inc(x_11); lean_dec(x_2); x_16 = lean_alloc_ctor(0, 6, 0); lean_ctor_set(x_16, 0, x_11); lean_ctor_set(x_16, 1, x_12); lean_ctor_set(x_16, 2, x_5); lean_ctor_set(x_16, 3, x_13); lean_ctor_set(x_16, 4, x_14); lean_ctor_set(x_16, 5, x_15); x_17 = lean_apply_2(x_1, x_16, x_3); return x_17; } } else { lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; x_18 = lean_ctor_get(x_3, 0); x_19 = lean_ctor_get(x_3, 1); lean_inc(x_19); lean_inc(x_18); lean_dec(x_3); x_20 = lean_unsigned_to_nat(1u); x_21 = lean_nat_add(x_18, x_20); x_22 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_22, 0, x_21); lean_ctor_set(x_22, 1, x_19); x_23 = lean_ctor_get(x_2, 0); lean_inc(x_23); x_24 = lean_ctor_get(x_2, 1); lean_inc(x_24); x_25 = lean_ctor_get(x_2, 3); lean_inc(x_25); x_26 = lean_ctor_get(x_2, 4); lean_inc(x_26); x_27 = lean_ctor_get(x_2, 5); lean_inc(x_27); if (lean_is_exclusive(x_2)) { lean_ctor_release(x_2, 0); lean_ctor_release(x_2, 1); lean_ctor_release(x_2, 2); lean_ctor_release(x_2, 3); lean_ctor_release(x_2, 4); lean_ctor_release(x_2, 5); x_28 = x_2; } else { lean_dec_ref(x_2); x_28 = lean_box(0); } if (lean_is_scalar(x_28)) { x_29 = lean_alloc_ctor(0, 6, 0); } else { x_29 = x_28; } lean_ctor_set(x_29, 0, x_23); lean_ctor_set(x_29, 1, x_24); lean_ctor_set(x_29, 2, x_18); lean_ctor_set(x_29, 3, x_25); lean_ctor_set(x_29, 4, x_26); lean_ctor_set(x_29, 5, x_27); x_30 = lean_apply_2(x_1, x_29, x_22); return x_30; } } } LEAN_EXPORT lean_object* l_Lean_Macro_withFreshMacroScope(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_Macro_withFreshMacroScope___rarg), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Macro_withIncRecDepth___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { uint8_t x_5; x_5 = !lean_is_exclusive(x_3); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12; x_6 = lean_ctor_get(x_3, 0); x_7 = lean_ctor_get(x_3, 1); x_8 = lean_ctor_get(x_3, 2); x_9 = lean_ctor_get(x_3, 3); x_10 = lean_ctor_get(x_3, 4); x_11 = lean_ctor_get(x_3, 5); x_12 = lean_nat_dec_eq(x_9, x_10); if (x_12 == 0) { lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_dec(x_1); x_13 = lean_unsigned_to_nat(1u); x_14 = lean_nat_add(x_9, x_13); lean_dec(x_9); lean_ctor_set(x_3, 3, x_14); x_15 = lean_apply_2(x_2, x_3, x_4); return x_15; } else { lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_free_object(x_3); lean_dec(x_11); lean_dec(x_10); lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); lean_dec(x_6); lean_dec(x_2); x_16 = l_Lean_maxRecDepthErrorMessage; x_17 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_17, 0, x_1); lean_ctor_set(x_17, 1, x_16); x_18 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_18, 0, x_17); lean_ctor_set(x_18, 1, x_4); return x_18; } } else { lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; uint8_t x_25; x_19 = lean_ctor_get(x_3, 0); x_20 = lean_ctor_get(x_3, 1); x_21 = lean_ctor_get(x_3, 2); x_22 = lean_ctor_get(x_3, 3); x_23 = lean_ctor_get(x_3, 4); x_24 = lean_ctor_get(x_3, 5); lean_inc(x_24); lean_inc(x_23); lean_inc(x_22); lean_inc(x_21); lean_inc(x_20); lean_inc(x_19); lean_dec(x_3); x_25 = lean_nat_dec_eq(x_22, x_23); if (x_25 == 0) { lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_dec(x_1); x_26 = lean_unsigned_to_nat(1u); x_27 = lean_nat_add(x_22, x_26); lean_dec(x_22); x_28 = lean_alloc_ctor(0, 6, 0); lean_ctor_set(x_28, 0, x_19); lean_ctor_set(x_28, 1, x_20); lean_ctor_set(x_28, 2, x_21); lean_ctor_set(x_28, 3, x_27); lean_ctor_set(x_28, 4, x_23); lean_ctor_set(x_28, 5, x_24); x_29 = lean_apply_2(x_2, x_28, x_4); return x_29; } else { lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_dec(x_24); lean_dec(x_23); lean_dec(x_22); lean_dec(x_21); lean_dec(x_20); lean_dec(x_19); lean_dec(x_2); x_30 = l_Lean_maxRecDepthErrorMessage; x_31 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_31, 0, x_1); lean_ctor_set(x_31, 1, x_30); x_32 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_32, 0, x_31); lean_ctor_set(x_32, 1, x_4); return x_32; } } } } LEAN_EXPORT lean_object* l_Lean_Macro_withIncRecDepth(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_Lean_Macro_withIncRecDepth___rarg), 4, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_ctor_get(x_1, 2); lean_inc(x_3); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__2(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_ctor_get(x_1, 1); lean_inc(x_3); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { uint8_t x_5; x_5 = !lean_is_exclusive(x_4); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; lean_object* x_8; uint8_t x_9; x_6 = lean_ctor_get(x_4, 0); x_7 = lean_unsigned_to_nat(1u); x_8 = lean_nat_add(x_6, x_7); lean_ctor_set(x_4, 0, x_8); x_9 = !lean_is_exclusive(x_3); if (x_9 == 0) { lean_object* x_10; lean_object* x_11; x_10 = lean_ctor_get(x_3, 2); lean_dec(x_10); lean_ctor_set(x_3, 2, x_6); x_11 = lean_apply_2(x_2, x_3, x_4); return x_11; } else { lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; x_12 = lean_ctor_get(x_3, 0); x_13 = lean_ctor_get(x_3, 1); x_14 = lean_ctor_get(x_3, 3); x_15 = lean_ctor_get(x_3, 4); x_16 = lean_ctor_get(x_3, 5); lean_inc(x_16); lean_inc(x_15); lean_inc(x_14); lean_inc(x_13); lean_inc(x_12); lean_dec(x_3); x_17 = lean_alloc_ctor(0, 6, 0); lean_ctor_set(x_17, 0, x_12); lean_ctor_set(x_17, 1, x_13); lean_ctor_set(x_17, 2, x_6); lean_ctor_set(x_17, 3, x_14); lean_ctor_set(x_17, 4, x_15); lean_ctor_set(x_17, 5, x_16); x_18 = lean_apply_2(x_2, x_17, x_4); return x_18; } } else { lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; x_19 = lean_ctor_get(x_4, 0); x_20 = lean_ctor_get(x_4, 1); lean_inc(x_20); lean_inc(x_19); lean_dec(x_4); x_21 = lean_unsigned_to_nat(1u); x_22 = lean_nat_add(x_19, x_21); x_23 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_23, 0, x_22); lean_ctor_set(x_23, 1, x_20); x_24 = lean_ctor_get(x_3, 0); lean_inc(x_24); x_25 = lean_ctor_get(x_3, 1); lean_inc(x_25); x_26 = lean_ctor_get(x_3, 3); lean_inc(x_26); x_27 = lean_ctor_get(x_3, 4); lean_inc(x_27); x_28 = lean_ctor_get(x_3, 5); lean_inc(x_28); if (lean_is_exclusive(x_3)) { lean_ctor_release(x_3, 0); lean_ctor_release(x_3, 1); lean_ctor_release(x_3, 2); lean_ctor_release(x_3, 3); lean_ctor_release(x_3, 4); lean_ctor_release(x_3, 5); x_29 = x_3; } else { lean_dec_ref(x_3); x_29 = lean_box(0); } if (lean_is_scalar(x_29)) { x_30 = lean_alloc_ctor(0, 6, 0); } else { x_30 = x_29; } lean_ctor_set(x_30, 0, x_24); lean_ctor_set(x_30, 1, x_25); lean_ctor_set(x_30, 2, x_19); lean_ctor_set(x_30, 3, x_26); lean_ctor_set(x_30, 4, x_27); lean_ctor_set(x_30, 5, x_28); x_31 = lean_apply_2(x_2, x_30, x_23); return x_31; } } } static lean_object* _init_l_Lean_Macro_instMonadQuotationMacroM___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instMonadQuotationMacroM___lambda__1___boxed), 2, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instMonadQuotationMacroM___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instMonadQuotationMacroM___lambda__2___boxed), 2, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instMonadQuotationMacroM___closed__3() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instMonadQuotationMacroM___lambda__3), 4, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instMonadQuotationMacroM___closed__4() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_Macro_instMonadRefMacroM; x_2 = l_Lean_Macro_instMonadQuotationMacroM___closed__1; x_3 = l_Lean_Macro_instMonadQuotationMacroM___closed__2; x_4 = l_Lean_Macro_instMonadQuotationMacroM___closed__3; x_5 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_5, 0, x_1); lean_ctor_set(x_5, 1, x_2); lean_ctor_set(x_5, 2, x_3); lean_ctor_set(x_5, 3, x_4); return x_5; } } static lean_object* _init_l_Lean_Macro_instMonadQuotationMacroM() { _start: { lean_object* x_1; x_1 = l_Lean_Macro_instMonadQuotationMacroM___closed__4; return x_1; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__1___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Macro_instMonadQuotationMacroM___lambda__1(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_instMonadQuotationMacroM___lambda__2___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Macro_instMonadQuotationMacroM___lambda__2(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_box(0); x_5 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_5, 0, x_4); lean_ctor_set(x_5, 1, x_3); return x_5; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__2(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_box(0); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { uint8_t x_4; lean_object* x_5; lean_object* x_6; x_4 = 0; x_5 = lean_box(x_4); x_6 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_6, 0, x_5); lean_ctor_set(x_6, 1, x_3); return x_6; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; x_4 = lean_box(0); x_5 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_5, 0, x_4); lean_ctor_set(x_5, 1, x_3); return x_5; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethods___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instInhabitedMethods___lambda__1___boxed), 3, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethods___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instInhabitedMethods___lambda__2___boxed), 2, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethods___closed__3() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instInhabitedMethods___lambda__3___boxed), 3, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethods___closed__4() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_Macro_instInhabitedMethods___lambda__4___boxed), 3, 0); return x_1; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethods___closed__5() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_Macro_instInhabitedMethods___closed__1; x_2 = l_Lean_Macro_instInhabitedMethods___closed__2; x_3 = l_Lean_Macro_instInhabitedMethods___closed__3; x_4 = l_Lean_Macro_instInhabitedMethods___closed__4; x_5 = lean_alloc_ctor(0, 5, 0); lean_ctor_set(x_5, 0, x_1); lean_ctor_set(x_5, 1, x_2); lean_ctor_set(x_5, 2, x_3); lean_ctor_set(x_5, 3, x_1); lean_ctor_set(x_5, 4, x_4); return x_5; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethods() { _start: { lean_object* x_1; x_1 = l_Lean_Macro_instInhabitedMethods___closed__5; return x_1; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Lean_Macro_instInhabitedMethods___lambda__1(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__2___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Macro_instInhabitedMethods___lambda__2(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Lean_Macro_instInhabitedMethods___lambda__3(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_instInhabitedMethods___lambda__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_Lean_Macro_instInhabitedMethods___lambda__4(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_mkMethodsImp(lean_object* x_1) { _start: { lean_inc(x_1); return x_1; } } LEAN_EXPORT lean_object* l_Lean_Macro_mkMethodsImp___boxed(lean_object* x_1) { _start: { lean_object* x_2; x_2 = l_Lean_Macro_mkMethodsImp(x_1); lean_dec(x_1); return x_2; } } static lean_object* _init_l_Lean_Macro_instInhabitedMethodsRef() { _start: { lean_object* x_1; x_1 = l_Lean_Macro_instInhabitedMethods___closed__5; return x_1; } } LEAN_EXPORT lean_object* l_Lean_Macro_getMethodsImp(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; x_3 = lean_ctor_get(x_1, 0); lean_inc(x_3); x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_3); lean_ctor_set(x_4, 1, x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_Macro_getMethodsImp___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = l_Lean_Macro_getMethodsImp(x_1, x_2); lean_dec(x_1); return x_3; } } LEAN_EXPORT lean_object* l_Lean_Macro_expandMacro_x3f(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_4 = l_Lean_Macro_getMethodsImp(x_2, x_3); x_5 = lean_ctor_get(x_4, 0); lean_inc(x_5); x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_ctor_get(x_5, 0); lean_inc(x_7); lean_dec(x_5); x_8 = lean_apply_3(x_7, x_1, x_2, x_6); return x_8; } } LEAN_EXPORT lean_object* l_Lean_Macro_hasDecl(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_4 = l_Lean_Macro_getMethodsImp(x_2, x_3); x_5 = lean_ctor_get(x_4, 0); lean_inc(x_5); x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_ctor_get(x_5, 2); lean_inc(x_7); lean_dec(x_5); x_8 = lean_apply_3(x_7, x_1, x_2, x_6); return x_8; } } LEAN_EXPORT lean_object* l_Lean_Macro_getCurrNamespace(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_3 = l_Lean_Macro_getMethodsImp(x_1, x_2); x_4 = lean_ctor_get(x_3, 0); lean_inc(x_4); x_5 = lean_ctor_get(x_3, 1); lean_inc(x_5); lean_dec(x_3); x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_apply_2(x_6, x_1, x_5); return x_7; } } LEAN_EXPORT lean_object* l_Lean_Macro_resolveNamespace_x3f(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_4 = l_Lean_Macro_getMethodsImp(x_2, x_3); x_5 = lean_ctor_get(x_4, 0); lean_inc(x_5); x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_ctor_get(x_5, 3); lean_inc(x_7); lean_dec(x_5); x_8 = lean_apply_3(x_7, x_1, x_2, x_6); return x_8; } } LEAN_EXPORT lean_object* l_Lean_Macro_resolveGlobalName(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; x_4 = l_Lean_Macro_getMethodsImp(x_2, x_3); x_5 = lean_ctor_get(x_4, 0); lean_inc(x_5); x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_ctor_get(x_5, 4); lean_inc(x_7); lean_dec(x_5); x_8 = lean_apply_3(x_7, x_1, x_2, x_6); return x_8; } } LEAN_EXPORT lean_object* l_Lean_Macro_trace(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { uint8_t x_5; x_5 = !lean_is_exclusive(x_4); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_6 = lean_ctor_get(x_4, 1); x_7 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_7, 0, x_1); lean_ctor_set(x_7, 1, x_2); x_8 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_8, 0, x_7); lean_ctor_set(x_8, 1, x_6); lean_ctor_set(x_4, 1, x_8); x_9 = lean_box(0); x_10 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_10, 0, x_9); lean_ctor_set(x_10, 1, x_4); return x_10; } else { lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; x_11 = lean_ctor_get(x_4, 0); x_12 = lean_ctor_get(x_4, 1); lean_inc(x_12); lean_inc(x_11); lean_dec(x_4); x_13 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_13, 0, x_1); lean_ctor_set(x_13, 1, x_2); x_14 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_14, 0, x_13); lean_ctor_set(x_14, 1, x_12); x_15 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_15, 0, x_11); lean_ctor_set(x_15, 1, x_14); x_16 = lean_box(0); x_17 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_17, 0, x_16); lean_ctor_set(x_17, 1, x_15); return x_17; } } } LEAN_EXPORT lean_object* l_Lean_Macro_trace___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = l_Lean_Macro_trace(x_1, x_2, x_3, x_4); lean_dec(x_3); return x_5; } } LEAN_EXPORT lean_object* l_ReaderT_read___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } LEAN_EXPORT lean_object* l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_4, 0, x_1); lean_ctor_set(x_4, 1, x_3); return x_4; } } LEAN_EXPORT lean_object* l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2(lean_object* x_1) { _start: { lean_object* x_2; x_2 = lean_alloc_closure((void*)(l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg___boxed), 3, 0); return x_2; } } LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = lean_apply_2(x_3, x_2, x_5); return x_6; } } LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; x_5 = lean_apply_2(x_2, x_3, x_4); return x_5; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__1() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_ReaderT_read___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__1), 2, 0); return x_1; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__2() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__1___boxed), 5, 0); return x_1; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__3() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__1; x_2 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__2; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); return x_3; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__4() { _start: { lean_object* x_1; x_1 = lean_mk_string("_fakeMod"); return x_1; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__5() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); x_2 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__4; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__6() { _start: { lean_object* x_1; x_1 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__2), 4, 0); return x_1; } } static lean_object* _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; x_1 = lean_unsigned_to_nat(0u); x_2 = lean_alloc_closure((void*)(l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg___boxed), 3, 1); lean_closure_set(x_2, 0, x_1); x_3 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__5; x_4 = lean_alloc_closure((void*)(l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg___boxed), 3, 1); lean_closure_set(x_4, 0, x_3); x_5 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__3; x_6 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__6; x_7 = lean_alloc_ctor(0, 4, 0); lean_ctor_set(x_7, 0, x_5); lean_ctor_set(x_7, 1, x_2); lean_ctor_set(x_7, 2, x_4); lean_ctor_set(x_7, 3, x_6); return x_7; } } LEAN_EXPORT lean_object* l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; x_4 = l_ReaderT_pure___at_Lean_PrettyPrinter_instMonadQuotationUnexpandM___spec__2___rarg(x_1, x_2, x_3); lean_dec(x_2); return x_4; } } LEAN_EXPORT lean_object* l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { lean_object* x_6; x_6 = l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___lambda__1(x_1, x_2, x_3, x_4, x_5); lean_dec(x_4); return x_6; } } static bool _G_initialized = false; LEAN_EXPORT lean_object* initialize_Init_Prelude(uint8_t builtin, lean_object* w) { lean_object * res; if (_G_initialized) return lean_io_result_mk_ok(lean_box(0)); _G_initialized = true; l_Unit_unit = _init_l_Unit_unit(); lean_mark_persistent(l_Unit_unit); l_instInhabitedSort = _init_l_instInhabitedSort(); l_instInhabitedBool = _init_l_instInhabitedBool(); l_instInhabitedNonemptyType = _init_l_instInhabitedNonemptyType(); l_instInhabitedNat = _init_l_instInhabitedNat(); lean_mark_persistent(l_instInhabitedNat); l_instAddNat___closed__1 = _init_l_instAddNat___closed__1(); lean_mark_persistent(l_instAddNat___closed__1); l_instAddNat = _init_l_instAddNat(); lean_mark_persistent(l_instAddNat); l_instMulNat___closed__1 = _init_l_instMulNat___closed__1(); lean_mark_persistent(l_instMulNat___closed__1); l_instMulNat = _init_l_instMulNat(); lean_mark_persistent(l_instMulNat); l_instPowNat___closed__1 = _init_l_instPowNat___closed__1(); lean_mark_persistent(l_instPowNat___closed__1); l_instPowNat = _init_l_instPowNat(); lean_mark_persistent(l_instPowNat); l_instBEqNat___closed__1 = _init_l_instBEqNat___closed__1(); lean_mark_persistent(l_instBEqNat___closed__1); l_instBEqNat = _init_l_instBEqNat(); lean_mark_persistent(l_instBEqNat); l_instLENat = _init_l_instLENat(); lean_mark_persistent(l_instLENat); l_instLTNat = _init_l_instLTNat(); lean_mark_persistent(l_instLTNat); l_instSubNat___closed__1 = _init_l_instSubNat___closed__1(); lean_mark_persistent(l_instSubNat___closed__1); l_instSubNat = _init_l_instSubNat(); lean_mark_persistent(l_instSubNat); l_System_Platform_numBits___closed__1 = _init_l_System_Platform_numBits___closed__1(); lean_mark_persistent(l_System_Platform_numBits___closed__1); l_System_Platform_numBits = _init_l_System_Platform_numBits(); lean_mark_persistent(l_System_Platform_numBits); l_UInt8_size = _init_l_UInt8_size(); lean_mark_persistent(l_UInt8_size); l_instInhabitedUInt8___closed__1 = _init_l_instInhabitedUInt8___closed__1(); l_instInhabitedUInt8 = _init_l_instInhabitedUInt8(); l_UInt16_size = _init_l_UInt16_size(); lean_mark_persistent(l_UInt16_size); l_instInhabitedUInt16___closed__1 = _init_l_instInhabitedUInt16___closed__1(); l_instInhabitedUInt16 = _init_l_instInhabitedUInt16(); l_UInt32_size = _init_l_UInt32_size(); lean_mark_persistent(l_UInt32_size); l_instInhabitedUInt32___closed__1 = _init_l_instInhabitedUInt32___closed__1(); l_instInhabitedUInt32 = _init_l_instInhabitedUInt32(); l_instLTUInt32 = _init_l_instLTUInt32(); lean_mark_persistent(l_instLTUInt32); l_instLEUInt32 = _init_l_instLEUInt32(); lean_mark_persistent(l_instLEUInt32); l_UInt64_size___closed__1 = _init_l_UInt64_size___closed__1(); lean_mark_persistent(l_UInt64_size___closed__1); l_UInt64_size = _init_l_UInt64_size(); lean_mark_persistent(l_UInt64_size); l_instInhabitedUInt64___closed__1 = _init_l_instInhabitedUInt64___closed__1(); l_instInhabitedUInt64 = _init_l_instInhabitedUInt64(); l_USize_size___closed__1 = _init_l_USize_size___closed__1(); lean_mark_persistent(l_USize_size___closed__1); l_USize_size = _init_l_USize_size(); lean_mark_persistent(l_USize_size); l_instInhabitedUSize___closed__1 = _init_l_instInhabitedUSize___closed__1(); l_instInhabitedUSize = _init_l_instInhabitedUSize(); l_Char_ofNat___closed__1 = _init_l_Char_ofNat___closed__1(); lean_mark_persistent(l_Char_ofNat___closed__1); l_Char_utf8Size___closed__1 = _init_l_Char_utf8Size___closed__1(); l_Char_utf8Size___closed__2 = _init_l_Char_utf8Size___closed__2(); l_Char_utf8Size___closed__3 = _init_l_Char_utf8Size___closed__3(); l_Char_utf8Size___closed__4 = _init_l_Char_utf8Size___closed__4(); l_Char_utf8Size___closed__5 = _init_l_Char_utf8Size___closed__5(); l_Char_utf8Size___closed__6 = _init_l_Char_utf8Size___closed__6(); l_Char_utf8Size___closed__7 = _init_l_Char_utf8Size___closed__7(); l_String_Pos_byteIdx___default = _init_l_String_Pos_byteIdx___default(); lean_mark_persistent(l_String_Pos_byteIdx___default); l_instInhabitedPos = _init_l_instInhabitedPos(); lean_mark_persistent(l_instInhabitedPos); l_instInhabitedSubstring___closed__1 = _init_l_instInhabitedSubstring___closed__1(); lean_mark_persistent(l_instInhabitedSubstring___closed__1); l_instInhabitedSubstring___closed__2 = _init_l_instInhabitedSubstring___closed__2(); lean_mark_persistent(l_instInhabitedSubstring___closed__2); l_instInhabitedSubstring = _init_l_instInhabitedSubstring(); lean_mark_persistent(l_instInhabitedSubstring); l_instLEPos = _init_l_instLEPos(); lean_mark_persistent(l_instLEPos); l_instLTPos = _init_l_instLTPos(); lean_mark_persistent(l_instLTPos); l_Array_empty___closed__1 = _init_l_Array_empty___closed__1(); lean_mark_persistent(l_Array_empty___closed__1); l_Applicative_seqLeft___default___rarg___closed__1 = _init_l_Applicative_seqLeft___default___rarg___closed__1(); lean_mark_persistent(l_Applicative_seqLeft___default___rarg___closed__1); l_Applicative_seqRight___default___rarg___closed__1 = _init_l_Applicative_seqRight___default___rarg___closed__1(); lean_mark_persistent(l_Applicative_seqRight___default___rarg___closed__1); l_Applicative_seqRight___default___rarg___closed__2 = _init_l_Applicative_seqRight___default___rarg___closed__2(); lean_mark_persistent(l_Applicative_seqRight___default___rarg___closed__2); l_EStateM_instMonadEStateM___closed__1 = _init_l_EStateM_instMonadEStateM___closed__1(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__1); l_EStateM_instMonadEStateM___closed__2 = _init_l_EStateM_instMonadEStateM___closed__2(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__2); l_EStateM_instMonadEStateM___closed__3 = _init_l_EStateM_instMonadEStateM___closed__3(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__3); l_EStateM_instMonadEStateM___closed__4 = _init_l_EStateM_instMonadEStateM___closed__4(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__4); l_EStateM_instMonadEStateM___closed__5 = _init_l_EStateM_instMonadEStateM___closed__5(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__5); l_EStateM_instMonadEStateM___closed__6 = _init_l_EStateM_instMonadEStateM___closed__6(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__6); l_EStateM_instMonadEStateM___closed__7 = _init_l_EStateM_instMonadEStateM___closed__7(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__7); l_EStateM_instMonadEStateM___closed__8 = _init_l_EStateM_instMonadEStateM___closed__8(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__8); l_EStateM_instMonadEStateM___closed__9 = _init_l_EStateM_instMonadEStateM___closed__9(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__9); l_EStateM_instMonadEStateM___closed__10 = _init_l_EStateM_instMonadEStateM___closed__10(); lean_mark_persistent(l_EStateM_instMonadEStateM___closed__10); l_EStateM_instMonadStateOfEStateM___closed__1 = _init_l_EStateM_instMonadStateOfEStateM___closed__1(); lean_mark_persistent(l_EStateM_instMonadStateOfEStateM___closed__1); l_EStateM_instMonadStateOfEStateM___closed__2 = _init_l_EStateM_instMonadStateOfEStateM___closed__2(); lean_mark_persistent(l_EStateM_instMonadStateOfEStateM___closed__2); l_EStateM_instMonadStateOfEStateM___closed__3 = _init_l_EStateM_instMonadStateOfEStateM___closed__3(); lean_mark_persistent(l_EStateM_instMonadStateOfEStateM___closed__3); l_EStateM_instMonadStateOfEStateM___closed__4 = _init_l_EStateM_instMonadStateOfEStateM___closed__4(); lean_mark_persistent(l_EStateM_instMonadStateOfEStateM___closed__4); l_EStateM_instMonadExceptOfEStateM___rarg___closed__1 = _init_l_EStateM_instMonadExceptOfEStateM___rarg___closed__1(); lean_mark_persistent(l_EStateM_instMonadExceptOfEStateM___rarg___closed__1); l_EStateM_nonBacktrackable___closed__1 = _init_l_EStateM_nonBacktrackable___closed__1(); lean_mark_persistent(l_EStateM_nonBacktrackable___closed__1); l_EStateM_nonBacktrackable___closed__2 = _init_l_EStateM_nonBacktrackable___closed__2(); lean_mark_persistent(l_EStateM_nonBacktrackable___closed__2); l_EStateM_nonBacktrackable___closed__3 = _init_l_EStateM_nonBacktrackable___closed__3(); lean_mark_persistent(l_EStateM_nonBacktrackable___closed__3); l_instHashableString___closed__1 = _init_l_instHashableString___closed__1(); lean_mark_persistent(l_instHashableString___closed__1); l_instHashableString = _init_l_instHashableString(); lean_mark_persistent(l_instHashableString); l_Lean_instInhabitedName = _init_l_Lean_instInhabitedName(); lean_mark_persistent(l_Lean_instInhabitedName); l_Lean_Name_hash___closed__1 = _init_l_Lean_Name_hash___closed__1(); l_Lean_instHashableName___closed__1 = _init_l_Lean_instHashableName___closed__1(); lean_mark_persistent(l_Lean_instHashableName___closed__1); l_Lean_instHashableName = _init_l_Lean_instHashableName(); lean_mark_persistent(l_Lean_instHashableName); l_Lean_Name_mkNum___closed__1 = _init_l_Lean_Name_mkNum___closed__1(); l_Lean_Name_instBEqName___closed__1 = _init_l_Lean_Name_instBEqName___closed__1(); lean_mark_persistent(l_Lean_Name_instBEqName___closed__1); l_Lean_Name_instBEqName = _init_l_Lean_Name_instBEqName(); lean_mark_persistent(l_Lean_Name_instBEqName); l_Lean_Name_instAppendName___closed__1 = _init_l_Lean_Name_instAppendName___closed__1(); lean_mark_persistent(l_Lean_Name_instAppendName___closed__1); l_Lean_Name_instAppendName = _init_l_Lean_Name_instAppendName(); lean_mark_persistent(l_Lean_Name_instAppendName); l_Lean_instInhabitedSourceInfo = _init_l_Lean_instInhabitedSourceInfo(); lean_mark_persistent(l_Lean_instInhabitedSourceInfo); l_Lean_instInhabitedSyntax = _init_l_Lean_instInhabitedSyntax(); lean_mark_persistent(l_Lean_instInhabitedSyntax); l_Lean_choiceKind___closed__1 = _init_l_Lean_choiceKind___closed__1(); lean_mark_persistent(l_Lean_choiceKind___closed__1); l_Lean_choiceKind___closed__2 = _init_l_Lean_choiceKind___closed__2(); lean_mark_persistent(l_Lean_choiceKind___closed__2); l_Lean_choiceKind = _init_l_Lean_choiceKind(); lean_mark_persistent(l_Lean_choiceKind); l_Lean_nullKind___closed__1 = _init_l_Lean_nullKind___closed__1(); lean_mark_persistent(l_Lean_nullKind___closed__1); l_Lean_nullKind___closed__2 = _init_l_Lean_nullKind___closed__2(); lean_mark_persistent(l_Lean_nullKind___closed__2); l_Lean_nullKind = _init_l_Lean_nullKind(); lean_mark_persistent(l_Lean_nullKind); l_Lean_groupKind___closed__1 = _init_l_Lean_groupKind___closed__1(); lean_mark_persistent(l_Lean_groupKind___closed__1); l_Lean_groupKind___closed__2 = _init_l_Lean_groupKind___closed__2(); lean_mark_persistent(l_Lean_groupKind___closed__2); l_Lean_groupKind = _init_l_Lean_groupKind(); lean_mark_persistent(l_Lean_groupKind); l_Lean_identKind___closed__1 = _init_l_Lean_identKind___closed__1(); lean_mark_persistent(l_Lean_identKind___closed__1); l_Lean_identKind___closed__2 = _init_l_Lean_identKind___closed__2(); lean_mark_persistent(l_Lean_identKind___closed__2); l_Lean_identKind = _init_l_Lean_identKind(); lean_mark_persistent(l_Lean_identKind); l_Lean_strLitKind___closed__1 = _init_l_Lean_strLitKind___closed__1(); lean_mark_persistent(l_Lean_strLitKind___closed__1); l_Lean_strLitKind___closed__2 = _init_l_Lean_strLitKind___closed__2(); lean_mark_persistent(l_Lean_strLitKind___closed__2); l_Lean_strLitKind = _init_l_Lean_strLitKind(); lean_mark_persistent(l_Lean_strLitKind); l_Lean_charLitKind___closed__1 = _init_l_Lean_charLitKind___closed__1(); lean_mark_persistent(l_Lean_charLitKind___closed__1); l_Lean_charLitKind___closed__2 = _init_l_Lean_charLitKind___closed__2(); lean_mark_persistent(l_Lean_charLitKind___closed__2); l_Lean_charLitKind = _init_l_Lean_charLitKind(); lean_mark_persistent(l_Lean_charLitKind); l_Lean_numLitKind___closed__1 = _init_l_Lean_numLitKind___closed__1(); lean_mark_persistent(l_Lean_numLitKind___closed__1); l_Lean_numLitKind___closed__2 = _init_l_Lean_numLitKind___closed__2(); lean_mark_persistent(l_Lean_numLitKind___closed__2); l_Lean_numLitKind = _init_l_Lean_numLitKind(); lean_mark_persistent(l_Lean_numLitKind); l_Lean_scientificLitKind___closed__1 = _init_l_Lean_scientificLitKind___closed__1(); lean_mark_persistent(l_Lean_scientificLitKind___closed__1); l_Lean_scientificLitKind___closed__2 = _init_l_Lean_scientificLitKind___closed__2(); lean_mark_persistent(l_Lean_scientificLitKind___closed__2); l_Lean_scientificLitKind = _init_l_Lean_scientificLitKind(); lean_mark_persistent(l_Lean_scientificLitKind); l_Lean_nameLitKind___closed__1 = _init_l_Lean_nameLitKind___closed__1(); lean_mark_persistent(l_Lean_nameLitKind___closed__1); l_Lean_nameLitKind___closed__2 = _init_l_Lean_nameLitKind___closed__2(); lean_mark_persistent(l_Lean_nameLitKind___closed__2); l_Lean_nameLitKind = _init_l_Lean_nameLitKind(); lean_mark_persistent(l_Lean_nameLitKind); l_Lean_fieldIdxKind___closed__1 = _init_l_Lean_fieldIdxKind___closed__1(); lean_mark_persistent(l_Lean_fieldIdxKind___closed__1); l_Lean_fieldIdxKind___closed__2 = _init_l_Lean_fieldIdxKind___closed__2(); lean_mark_persistent(l_Lean_fieldIdxKind___closed__2); l_Lean_fieldIdxKind = _init_l_Lean_fieldIdxKind(); lean_mark_persistent(l_Lean_fieldIdxKind); l_Lean_interpolatedStrLitKind___closed__1 = _init_l_Lean_interpolatedStrLitKind___closed__1(); lean_mark_persistent(l_Lean_interpolatedStrLitKind___closed__1); l_Lean_interpolatedStrLitKind___closed__2 = _init_l_Lean_interpolatedStrLitKind___closed__2(); lean_mark_persistent(l_Lean_interpolatedStrLitKind___closed__2); l_Lean_interpolatedStrLitKind = _init_l_Lean_interpolatedStrLitKind(); lean_mark_persistent(l_Lean_interpolatedStrLitKind); l_Lean_interpolatedStrKind___closed__1 = _init_l_Lean_interpolatedStrKind___closed__1(); lean_mark_persistent(l_Lean_interpolatedStrKind___closed__1); l_Lean_interpolatedStrKind___closed__2 = _init_l_Lean_interpolatedStrKind___closed__2(); lean_mark_persistent(l_Lean_interpolatedStrKind___closed__2); l_Lean_interpolatedStrKind = _init_l_Lean_interpolatedStrKind(); lean_mark_persistent(l_Lean_interpolatedStrKind); l_Lean_Syntax_getKind___closed__1 = _init_l_Lean_Syntax_getKind___closed__1(); lean_mark_persistent(l_Lean_Syntax_getKind___closed__1); l_Lean_Syntax_getKind___closed__2 = _init_l_Lean_Syntax_getKind___closed__2(); lean_mark_persistent(l_Lean_Syntax_getKind___closed__2); l_Lean_instInhabitedParserDescr___closed__1 = _init_l_Lean_instInhabitedParserDescr___closed__1(); lean_mark_persistent(l_Lean_instInhabitedParserDescr___closed__1); l_Lean_instInhabitedParserDescr = _init_l_Lean_instInhabitedParserDescr(); lean_mark_persistent(l_Lean_instInhabitedParserDescr); l_Lean_reservedMacroScope = _init_l_Lean_reservedMacroScope(); lean_mark_persistent(l_Lean_reservedMacroScope); l_Lean_firstFrontendMacroScope___closed__1 = _init_l_Lean_firstFrontendMacroScope___closed__1(); lean_mark_persistent(l_Lean_firstFrontendMacroScope___closed__1); l_Lean_firstFrontendMacroScope = _init_l_Lean_firstFrontendMacroScope(); lean_mark_persistent(l_Lean_firstFrontendMacroScope); l_Lean_Name_hasMacroScopes___closed__1 = _init_l_Lean_Name_hasMacroScopes___closed__1(); lean_mark_persistent(l_Lean_Name_hasMacroScopes___closed__1); l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1 = _init_l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1(); lean_mark_persistent(l___private_Init_Prelude_0__Lean_eraseMacroScopesAux___closed__1); l_Lean_instInhabitedMacroScopesView___closed__1 = _init_l_Lean_instInhabitedMacroScopesView___closed__1(); lean_mark_persistent(l_Lean_instInhabitedMacroScopesView___closed__1); l_Lean_instInhabitedMacroScopesView = _init_l_Lean_instInhabitedMacroScopesView(); lean_mark_persistent(l_Lean_instInhabitedMacroScopesView); l___private_Init_Prelude_0__Lean_assembleParts___closed__1 = _init_l___private_Init_Prelude_0__Lean_assembleParts___closed__1(); lean_mark_persistent(l___private_Init_Prelude_0__Lean_assembleParts___closed__1); l___private_Init_Prelude_0__Lean_extractImported___closed__1 = _init_l___private_Init_Prelude_0__Lean_extractImported___closed__1(); lean_mark_persistent(l___private_Init_Prelude_0__Lean_extractImported___closed__1); l___private_Init_Prelude_0__Lean_extractMainModule___closed__1 = _init_l___private_Init_Prelude_0__Lean_extractMainModule___closed__1(); lean_mark_persistent(l___private_Init_Prelude_0__Lean_extractMainModule___closed__1); l___private_Init_Prelude_0__Lean_extractMacroScopesAux___closed__1 = _init_l___private_Init_Prelude_0__Lean_extractMacroScopesAux___closed__1(); lean_mark_persistent(l___private_Init_Prelude_0__Lean_extractMacroScopesAux___closed__1); l_Lean_defaultMaxRecDepth = _init_l_Lean_defaultMaxRecDepth(); lean_mark_persistent(l_Lean_defaultMaxRecDepth); l_Lean_maxRecDepthErrorMessage___closed__1 = _init_l_Lean_maxRecDepthErrorMessage___closed__1(); lean_mark_persistent(l_Lean_maxRecDepthErrorMessage___closed__1); l_Lean_maxRecDepthErrorMessage = _init_l_Lean_maxRecDepthErrorMessage(); lean_mark_persistent(l_Lean_maxRecDepthErrorMessage); l___private_Init_Prelude_0__Lean_Macro_MethodsRefPointed = _init_l___private_Init_Prelude_0__Lean_Macro_MethodsRefPointed(); l_Lean_Macro_Context_currRecDepth___default = _init_l_Lean_Macro_Context_currRecDepth___default(); lean_mark_persistent(l_Lean_Macro_Context_currRecDepth___default); l_Lean_Macro_Context_maxRecDepth___default = _init_l_Lean_Macro_Context_maxRecDepth___default(); lean_mark_persistent(l_Lean_Macro_Context_maxRecDepth___default); l_Lean_Macro_State_traceMsgs___default = _init_l_Lean_Macro_State_traceMsgs___default(); lean_mark_persistent(l_Lean_Macro_State_traceMsgs___default); l_Lean_Macro_instInhabitedState___closed__1 = _init_l_Lean_Macro_instInhabitedState___closed__1(); lean_mark_persistent(l_Lean_Macro_instInhabitedState___closed__1); l_Lean_Macro_instInhabitedState = _init_l_Lean_Macro_instInhabitedState(); lean_mark_persistent(l_Lean_Macro_instInhabitedState); l_Lean_Macro_instMonadRefMacroM___closed__1 = _init_l_Lean_Macro_instMonadRefMacroM___closed__1(); lean_mark_persistent(l_Lean_Macro_instMonadRefMacroM___closed__1); l_Lean_Macro_instMonadRefMacroM___closed__2 = _init_l_Lean_Macro_instMonadRefMacroM___closed__2(); lean_mark_persistent(l_Lean_Macro_instMonadRefMacroM___closed__2); l_Lean_Macro_instMonadRefMacroM___closed__3 = _init_l_Lean_Macro_instMonadRefMacroM___closed__3(); lean_mark_persistent(l_Lean_Macro_instMonadRefMacroM___closed__3); l_Lean_Macro_instMonadRefMacroM = _init_l_Lean_Macro_instMonadRefMacroM(); lean_mark_persistent(l_Lean_Macro_instMonadRefMacroM); l_Lean_Macro_instMonadQuotationMacroM___closed__1 = _init_l_Lean_Macro_instMonadQuotationMacroM___closed__1(); lean_mark_persistent(l_Lean_Macro_instMonadQuotationMacroM___closed__1); l_Lean_Macro_instMonadQuotationMacroM___closed__2 = _init_l_Lean_Macro_instMonadQuotationMacroM___closed__2(); lean_mark_persistent(l_Lean_Macro_instMonadQuotationMacroM___closed__2); l_Lean_Macro_instMonadQuotationMacroM___closed__3 = _init_l_Lean_Macro_instMonadQuotationMacroM___closed__3(); lean_mark_persistent(l_Lean_Macro_instMonadQuotationMacroM___closed__3); l_Lean_Macro_instMonadQuotationMacroM___closed__4 = _init_l_Lean_Macro_instMonadQuotationMacroM___closed__4(); lean_mark_persistent(l_Lean_Macro_instMonadQuotationMacroM___closed__4); l_Lean_Macro_instMonadQuotationMacroM = _init_l_Lean_Macro_instMonadQuotationMacroM(); lean_mark_persistent(l_Lean_Macro_instMonadQuotationMacroM); l_Lean_Macro_instInhabitedMethods___closed__1 = _init_l_Lean_Macro_instInhabitedMethods___closed__1(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethods___closed__1); l_Lean_Macro_instInhabitedMethods___closed__2 = _init_l_Lean_Macro_instInhabitedMethods___closed__2(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethods___closed__2); l_Lean_Macro_instInhabitedMethods___closed__3 = _init_l_Lean_Macro_instInhabitedMethods___closed__3(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethods___closed__3); l_Lean_Macro_instInhabitedMethods___closed__4 = _init_l_Lean_Macro_instInhabitedMethods___closed__4(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethods___closed__4); l_Lean_Macro_instInhabitedMethods___closed__5 = _init_l_Lean_Macro_instInhabitedMethods___closed__5(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethods___closed__5); l_Lean_Macro_instInhabitedMethods = _init_l_Lean_Macro_instInhabitedMethods(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethods); l_Lean_Macro_instInhabitedMethodsRef = _init_l_Lean_Macro_instInhabitedMethodsRef(); lean_mark_persistent(l_Lean_Macro_instInhabitedMethodsRef); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__1 = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__1(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__1); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__2 = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__2(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__2); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__3 = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__3(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__3); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__4 = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__4(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__4); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__5 = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__5(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__5); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__6 = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__6(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM___closed__6); l_Lean_PrettyPrinter_instMonadQuotationUnexpandM = _init_l_Lean_PrettyPrinter_instMonadQuotationUnexpandM(); lean_mark_persistent(l_Lean_PrettyPrinter_instMonadQuotationUnexpandM); return lean_io_result_mk_ok(lean_box(0)); } #ifdef __cplusplus } #endif
567044.c
/* OpenGL loader generated by glad 0.1.34 on Thu Dec 16 18:40:45 2021. Language/Generator: C/C++ Specification: gl APIs: gl=4.6 Profile: core Extensions: Loader: True Local files: False Omit khrplatform: False Reproducible: False Commandline: --profile="core" --api="gl=4.6" --generator="c" --spec="gl" --extensions="" Online: https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.6 */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <glad/glad.h> static void* get_proc(const char *namez); #if defined(_WIN32) || defined(__CYGWIN__) #ifndef _WINDOWS_ #undef APIENTRY #endif #include <windows.h> static HMODULE libGL; typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; #ifdef _MSC_VER #ifdef __has_include #if __has_include(<winapifamily.h>) #define HAVE_WINAPIFAMILY 1 #endif #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ #define HAVE_WINAPIFAMILY 1 #endif #endif #ifdef HAVE_WINAPIFAMILY #include <winapifamily.h> #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) #define IS_UWP 1 #endif #endif static int open_gl(void) { #ifndef IS_UWP libGL = LoadLibraryW(L"opengl32.dll"); if(libGL != NULL) { void (* tmp)(void); tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress"); gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp; return gladGetProcAddressPtr != NULL; } #endif return 0; } static void close_gl(void) { if(libGL != NULL) { FreeLibrary((HMODULE) libGL); libGL = NULL; } } #else #include <dlfcn.h> static void* libGL; #if !defined(__APPLE__) && !defined(__HAIKU__) typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*); static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; #endif static int open_gl(void) { #ifdef __APPLE__ static const char *NAMES[] = { "../Frameworks/OpenGL.framework/OpenGL", "/Library/Frameworks/OpenGL.framework/OpenGL", "/System/Library/Frameworks/OpenGL.framework/OpenGL", "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL" }; #else static const char *NAMES[] = {"libGL.so.1", "libGL.so"}; #endif unsigned int index = 0; for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) { libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL); if(libGL != NULL) { #if defined(__APPLE__) || defined(__HAIKU__) return 1; #else gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL, "glXGetProcAddressARB"); return gladGetProcAddressPtr != NULL; #endif } } return 0; } static void close_gl(void) { if(libGL != NULL) { dlclose(libGL); libGL = NULL; } } #endif static void* get_proc(const char *namez) { void* result = NULL; if(libGL == NULL) return NULL; #if !defined(__APPLE__) && !defined(__HAIKU__) if(gladGetProcAddressPtr != NULL) { result = gladGetProcAddressPtr(namez); } #endif if(result == NULL) { #if defined(_WIN32) || defined(__CYGWIN__) result = (void*)GetProcAddress((HMODULE) libGL, namez); #else result = dlsym(libGL, namez); #endif } return result; } int gladLoadGL(void) { int status = 0; if(open_gl()) { status = gladLoadGLLoader(&get_proc); close_gl(); } return status; } struct gladGLversionStruct GLVersion = { 0, 0 }; #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) #define _GLAD_IS_SOME_NEW_VERSION 1 #endif static int max_loaded_major; static int max_loaded_minor; static const char *exts = NULL; static int num_exts_i = 0; static char **exts_i = NULL; static int get_exts(void) { #ifdef _GLAD_IS_SOME_NEW_VERSION if(max_loaded_major < 3) { #endif exts = (const char *)glGetString(GL_EXTENSIONS); #ifdef _GLAD_IS_SOME_NEW_VERSION } else { unsigned int index; num_exts_i = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); if (num_exts_i > 0) { exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i)); } if (exts_i == NULL) { return 0; } for(index = 0; index < (unsigned)num_exts_i; index++) { const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index); size_t len = strlen(gl_str_tmp); char *local_str = (char*)malloc((len+1) * sizeof(char)); if(local_str != NULL) { memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char)); } exts_i[index] = local_str; } } #endif return 1; } static void free_exts(void) { if (exts_i != NULL) { int index; for(index = 0; index < num_exts_i; index++) { free((char *)exts_i[index]); } free((void *)exts_i); exts_i = NULL; } } static int has_ext(const char *ext) { #ifdef _GLAD_IS_SOME_NEW_VERSION if(max_loaded_major < 3) { #endif const char *extensions; const char *loc; const char *terminator; extensions = exts; if(extensions == NULL || ext == NULL) { return 0; } while(1) { loc = strstr(extensions, ext); if(loc == NULL) { return 0; } terminator = loc + strlen(ext); if((loc == extensions || *(loc - 1) == ' ') && (*terminator == ' ' || *terminator == '\0')) { return 1; } extensions = terminator; } #ifdef _GLAD_IS_SOME_NEW_VERSION } else { int index; if(exts_i == NULL) return 0; for(index = 0; index < num_exts_i; index++) { const char *e = exts_i[index]; if(exts_i[index] != NULL && strcmp(e, ext) == 0) { return 1; } } } #endif return 0; } int GLAD_GL_VERSION_1_0 = 0; int GLAD_GL_VERSION_1_1 = 0; int GLAD_GL_VERSION_1_2 = 0; int GLAD_GL_VERSION_1_3 = 0; int GLAD_GL_VERSION_1_4 = 0; int GLAD_GL_VERSION_1_5 = 0; int GLAD_GL_VERSION_2_0 = 0; int GLAD_GL_VERSION_2_1 = 0; int GLAD_GL_VERSION_3_0 = 0; int GLAD_GL_VERSION_3_1 = 0; int GLAD_GL_VERSION_3_2 = 0; int GLAD_GL_VERSION_3_3 = 0; int GLAD_GL_VERSION_4_0 = 0; int GLAD_GL_VERSION_4_1 = 0; int GLAD_GL_VERSION_4_2 = 0; int GLAD_GL_VERSION_4_3 = 0; int GLAD_GL_VERSION_4_4 = 0; int GLAD_GL_VERSION_4_5 = 0; int GLAD_GL_VERSION_4_6 = 0; PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram = NULL; PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL; PFNGLATTACHSHADERPROC glad_glAttachShader = NULL; PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL; PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL; PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed = NULL; PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL; PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL; PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL; PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL; PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL; PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase = NULL; PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange = NULL; PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL; PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL; PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL; PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture = NULL; PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures = NULL; PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline = NULL; PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL; PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL; PFNGLBINDSAMPLERSPROC glad_glBindSamplers = NULL; PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL; PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit = NULL; PFNGLBINDTEXTURESPROC glad_glBindTextures = NULL; PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback = NULL; PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL; PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer = NULL; PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers = NULL; PFNGLBLENDCOLORPROC glad_glBlendColor = NULL; PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL; PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL; PFNGLBLENDEQUATIONSEPARATEIPROC glad_glBlendEquationSeparatei = NULL; PFNGLBLENDEQUATIONIPROC glad_glBlendEquationi = NULL; PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL; PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL; PFNGLBLENDFUNCSEPARATEIPROC glad_glBlendFuncSeparatei = NULL; PFNGLBLENDFUNCIPROC glad_glBlendFunci = NULL; PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL; PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer = NULL; PFNGLBUFFERDATAPROC glad_glBufferData = NULL; PFNGLBUFFERSTORAGEPROC glad_glBufferStorage = NULL; PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL; PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL; PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus = NULL; PFNGLCLAMPCOLORPROC glad_glClampColor = NULL; PFNGLCLEARPROC glad_glClear = NULL; PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData = NULL; PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData = NULL; PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL; PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL; PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL; PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL; PFNGLCLEARCOLORPROC glad_glClearColor = NULL; PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL; PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL; PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData = NULL; PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData = NULL; PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi = NULL; PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv = NULL; PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv = NULL; PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv = NULL; PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL; PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage = NULL; PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage = NULL; PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL; PFNGLCLIPCONTROLPROC glad_glClipControl = NULL; PFNGLCOLORMASKPROC glad_glColorMask = NULL; PFNGLCOLORMASKIPROC glad_glColorMaski = NULL; PFNGLCOLORP3UIPROC glad_glColorP3ui = NULL; PFNGLCOLORP3UIVPROC glad_glColorP3uiv = NULL; PFNGLCOLORP4UIPROC glad_glColorP4ui = NULL; PFNGLCOLORP4UIVPROC glad_glColorP4uiv = NULL; PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL; PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL; PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL; PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D = NULL; PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL; PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData = NULL; PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData = NULL; PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL; PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL; PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL; PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL; PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL; PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D = NULL; PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D = NULL; PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D = NULL; PFNGLCREATEBUFFERSPROC glad_glCreateBuffers = NULL; PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers = NULL; PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL; PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines = NULL; PFNGLCREATEQUERIESPROC glad_glCreateQueries = NULL; PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers = NULL; PFNGLCREATESAMPLERSPROC glad_glCreateSamplers = NULL; PFNGLCREATESHADERPROC glad_glCreateShader = NULL; PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv = NULL; PFNGLCREATETEXTURESPROC glad_glCreateTextures = NULL; PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks = NULL; PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays = NULL; PFNGLCULLFACEPROC glad_glCullFace = NULL; PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback = NULL; PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl = NULL; PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert = NULL; PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL; PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL; PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL; PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines = NULL; PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL; PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL; PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL; PFNGLDELETESHADERPROC glad_glDeleteShader = NULL; PFNGLDELETESYNCPROC glad_glDeleteSync = NULL; PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL; PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks = NULL; PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL; PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL; PFNGLDEPTHMASKPROC glad_glDepthMask = NULL; PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL; PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv = NULL; PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed = NULL; PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL; PFNGLDETACHSHADERPROC glad_glDetachShader = NULL; PFNGLDISABLEPROC glad_glDisable = NULL; PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib = NULL; PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL; PFNGLDISABLEIPROC glad_glDisablei = NULL; PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute = NULL; PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect = NULL; PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL; PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect = NULL; PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL; PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance = NULL; PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL; PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL; PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL; PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL; PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect = NULL; PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL; PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance = NULL; PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL; PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance = NULL; PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL; PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL; PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback = NULL; PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced = NULL; PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream = NULL; PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced = NULL; PFNGLENABLEPROC glad_glEnable = NULL; PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib = NULL; PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL; PFNGLENABLEIPROC glad_glEnablei = NULL; PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL; PFNGLENDQUERYPROC glad_glEndQuery = NULL; PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed = NULL; PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL; PFNGLFENCESYNCPROC glad_glFenceSync = NULL; PFNGLFINISHPROC glad_glFinish = NULL; PFNGLFLUSHPROC glad_glFlush = NULL; PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL; PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange = NULL; PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri = NULL; PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL; PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL; PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL; PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL; PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL; PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL; PFNGLFRONTFACEPROC glad_glFrontFace = NULL; PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL; PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL; PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines = NULL; PFNGLGENQUERIESPROC glad_glGenQueries = NULL; PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL; PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL; PFNGLGENTEXTURESPROC glad_glGenTextures = NULL; PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks = NULL; PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL; PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL; PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap = NULL; PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv = NULL; PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL; PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName = NULL; PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName = NULL; PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv = NULL; PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL; PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL; PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL; PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL; PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL; PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL; PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL; PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL; PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL; PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL; PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL; PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL; PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL; PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL; PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage = NULL; PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage = NULL; PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog = NULL; PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v = NULL; PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL; PFNGLGETERRORPROC glad_glGetError = NULL; PFNGLGETFLOATI_VPROC glad_glGetFloati_v = NULL; PFNGLGETFLOATVPROC glad_glGetFloatv = NULL; PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL; PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL; PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL; PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv = NULL; PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus = NULL; PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL; PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL; PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL; PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL; PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v = NULL; PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ = NULL; PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL; PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v = NULL; PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv = NULL; PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv = NULL; PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData = NULL; PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv = NULL; PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv = NULL; PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv = NULL; PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel = NULL; PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel = NULL; PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL; PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary = NULL; PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL; PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv = NULL; PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog = NULL; PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv = NULL; PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex = NULL; PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation = NULL; PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex = NULL; PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName = NULL; PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv = NULL; PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv = NULL; PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL; PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v = NULL; PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv = NULL; PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v = NULL; PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv = NULL; PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv = NULL; PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL; PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL; PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL; PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL; PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL; PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL; PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL; PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL; PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL; PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL; PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL; PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL; PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL; PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL; PFNGLGETSTRINGPROC glad_glGetString = NULL; PFNGLGETSTRINGIPROC glad_glGetStringi = NULL; PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex = NULL; PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation = NULL; PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL; PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL; PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL; PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL; PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL; PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL; PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL; PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL; PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage = NULL; PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv = NULL; PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv = NULL; PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv = NULL; PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv = NULL; PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv = NULL; PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv = NULL; PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage = NULL; PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL; PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v = NULL; PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v = NULL; PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv = NULL; PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL; PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL; PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL; PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv = NULL; PFNGLGETUNIFORMDVPROC glad_glGetUniformdv = NULL; PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL; PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL; PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL; PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv = NULL; PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv = NULL; PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv = NULL; PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL; PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL; PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv = NULL; PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL; PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL; PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL; PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL; PFNGLGETNCOLORTABLEPROC glad_glGetnColorTable = NULL; PFNGLGETNCOMPRESSEDTEXIMAGEPROC glad_glGetnCompressedTexImage = NULL; PFNGLGETNCONVOLUTIONFILTERPROC glad_glGetnConvolutionFilter = NULL; PFNGLGETNHISTOGRAMPROC glad_glGetnHistogram = NULL; PFNGLGETNMAPDVPROC glad_glGetnMapdv = NULL; PFNGLGETNMAPFVPROC glad_glGetnMapfv = NULL; PFNGLGETNMAPIVPROC glad_glGetnMapiv = NULL; PFNGLGETNMINMAXPROC glad_glGetnMinmax = NULL; PFNGLGETNPIXELMAPFVPROC glad_glGetnPixelMapfv = NULL; PFNGLGETNPIXELMAPUIVPROC glad_glGetnPixelMapuiv = NULL; PFNGLGETNPIXELMAPUSVPROC glad_glGetnPixelMapusv = NULL; PFNGLGETNPOLYGONSTIPPLEPROC glad_glGetnPolygonStipple = NULL; PFNGLGETNSEPARABLEFILTERPROC glad_glGetnSeparableFilter = NULL; PFNGLGETNTEXIMAGEPROC glad_glGetnTexImage = NULL; PFNGLGETNUNIFORMDVPROC glad_glGetnUniformdv = NULL; PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv = NULL; PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv = NULL; PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv = NULL; PFNGLHINTPROC glad_glHint = NULL; PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData = NULL; PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData = NULL; PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer = NULL; PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData = NULL; PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData = NULL; PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer = NULL; PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage = NULL; PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage = NULL; PFNGLISBUFFERPROC glad_glIsBuffer = NULL; PFNGLISENABLEDPROC glad_glIsEnabled = NULL; PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL; PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL; PFNGLISPROGRAMPROC glad_glIsProgram = NULL; PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline = NULL; PFNGLISQUERYPROC glad_glIsQuery = NULL; PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL; PFNGLISSAMPLERPROC glad_glIsSampler = NULL; PFNGLISSHADERPROC glad_glIsShader = NULL; PFNGLISSYNCPROC glad_glIsSync = NULL; PFNGLISTEXTUREPROC glad_glIsTexture = NULL; PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback = NULL; PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL; PFNGLLINEWIDTHPROC glad_glLineWidth = NULL; PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL; PFNGLLOGICOPPROC glad_glLogicOp = NULL; PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL; PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL; PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer = NULL; PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange = NULL; PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier = NULL; PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion = NULL; PFNGLMINSAMPLESHADINGPROC glad_glMinSampleShading = NULL; PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL; PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect = NULL; PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC glad_glMultiDrawArraysIndirectCount = NULL; PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL; PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC glad_glMultiDrawElementsIndirectCount = NULL; PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui = NULL; PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv = NULL; PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui = NULL; PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv = NULL; PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui = NULL; PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv = NULL; PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui = NULL; PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv = NULL; PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData = NULL; PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage = NULL; PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData = NULL; PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer = NULL; PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers = NULL; PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri = NULL; PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer = NULL; PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer = NULL; PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture = NULL; PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample = NULL; PFNGLNORMALP3UIPROC glad_glNormalP3ui = NULL; PFNGLNORMALP3UIVPROC glad_glNormalP3uiv = NULL; PFNGLOBJECTLABELPROC glad_glObjectLabel = NULL; PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel = NULL; PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv = NULL; PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri = NULL; PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback = NULL; PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL; PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL; PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL; PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL; PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL; PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL; PFNGLPOINTSIZEPROC glad_glPointSize = NULL; PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL; PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL; PFNGLPOLYGONOFFSETCLAMPPROC glad_glPolygonOffsetClamp = NULL; PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup = NULL; PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL; PFNGLPROGRAMBINARYPROC glad_glProgramBinary = NULL; PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri = NULL; PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d = NULL; PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv = NULL; PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f = NULL; PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv = NULL; PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i = NULL; PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv = NULL; PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui = NULL; PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv = NULL; PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d = NULL; PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv = NULL; PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f = NULL; PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv = NULL; PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i = NULL; PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv = NULL; PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui = NULL; PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv = NULL; PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d = NULL; PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv = NULL; PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f = NULL; PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv = NULL; PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i = NULL; PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv = NULL; PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui = NULL; PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv = NULL; PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d = NULL; PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv = NULL; PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f = NULL; PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv = NULL; PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i = NULL; PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv = NULL; PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui = NULL; PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv = NULL; PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv = NULL; PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv = NULL; PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv = NULL; PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv = NULL; PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv = NULL; PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv = NULL; PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL; PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup = NULL; PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL; PFNGLREADBUFFERPROC glad_glReadBuffer = NULL; PFNGLREADPIXELSPROC glad_glReadPixels = NULL; PFNGLREADNPIXELSPROC glad_glReadnPixels = NULL; PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL; PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL; PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL; PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback = NULL; PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL; PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL; PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL; PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL; PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL; PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL; PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL; PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL; PFNGLSCISSORPROC glad_glScissor = NULL; PFNGLSCISSORARRAYVPROC glad_glScissorArrayv = NULL; PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed = NULL; PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv = NULL; PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui = NULL; PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv = NULL; PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL; PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL; PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding = NULL; PFNGLSPECIALIZESHADERPROC glad_glSpecializeShader = NULL; PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL; PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL; PFNGLSTENCILMASKPROC glad_glStencilMask = NULL; PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL; PFNGLSTENCILOPPROC glad_glStencilOp = NULL; PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL; PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL; PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange = NULL; PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui = NULL; PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv = NULL; PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui = NULL; PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv = NULL; PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui = NULL; PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv = NULL; PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui = NULL; PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv = NULL; PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL; PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL; PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL; PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL; PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL; PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL; PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL; PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL; PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL; PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL; PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL; PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D = NULL; PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D = NULL; PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample = NULL; PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D = NULL; PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample = NULL; PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL; PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL; PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL; PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier = NULL; PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer = NULL; PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange = NULL; PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv = NULL; PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv = NULL; PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf = NULL; PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv = NULL; PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri = NULL; PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv = NULL; PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D = NULL; PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D = NULL; PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample = NULL; PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D = NULL; PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample = NULL; PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D = NULL; PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D = NULL; PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D = NULL; PFNGLTEXTUREVIEWPROC glad_glTextureView = NULL; PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase = NULL; PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange = NULL; PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL; PFNGLUNIFORM1DPROC glad_glUniform1d = NULL; PFNGLUNIFORM1DVPROC glad_glUniform1dv = NULL; PFNGLUNIFORM1FPROC glad_glUniform1f = NULL; PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL; PFNGLUNIFORM1IPROC glad_glUniform1i = NULL; PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL; PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL; PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL; PFNGLUNIFORM2DPROC glad_glUniform2d = NULL; PFNGLUNIFORM2DVPROC glad_glUniform2dv = NULL; PFNGLUNIFORM2FPROC glad_glUniform2f = NULL; PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL; PFNGLUNIFORM2IPROC glad_glUniform2i = NULL; PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL; PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL; PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL; PFNGLUNIFORM3DPROC glad_glUniform3d = NULL; PFNGLUNIFORM3DVPROC glad_glUniform3dv = NULL; PFNGLUNIFORM3FPROC glad_glUniform3f = NULL; PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL; PFNGLUNIFORM3IPROC glad_glUniform3i = NULL; PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL; PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL; PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL; PFNGLUNIFORM4DPROC glad_glUniform4d = NULL; PFNGLUNIFORM4DVPROC glad_glUniform4dv = NULL; PFNGLUNIFORM4FPROC glad_glUniform4f = NULL; PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL; PFNGLUNIFORM4IPROC glad_glUniform4i = NULL; PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL; PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL; PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL; PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL; PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv = NULL; PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL; PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv = NULL; PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL; PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv = NULL; PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL; PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv = NULL; PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL; PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv = NULL; PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL; PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv = NULL; PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL; PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv = NULL; PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL; PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv = NULL; PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL; PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv = NULL; PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL; PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv = NULL; PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL; PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer = NULL; PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL; PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages = NULL; PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL; PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline = NULL; PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding = NULL; PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat = NULL; PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat = NULL; PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat = NULL; PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor = NULL; PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer = NULL; PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer = NULL; PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers = NULL; PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL; PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL; PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL; PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL; PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL; PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL; PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL; PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL; PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL; PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL; PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL; PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL; PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL; PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL; PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL; PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL; PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL; PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL; PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL; PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL; PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL; PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL; PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL; PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL; PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL; PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL; PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL; PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL; PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL; PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL; PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL; PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL; PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL; PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL; PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL; PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL; PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding = NULL; PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL; PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat = NULL; PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL; PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL; PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL; PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL; PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL; PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL; PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL; PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL; PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL; PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL; PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL; PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL; PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL; PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL; PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL; PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL; PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL; PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL; PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL; PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL; PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat = NULL; PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL; PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d = NULL; PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv = NULL; PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d = NULL; PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv = NULL; PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d = NULL; PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv = NULL; PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d = NULL; PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv = NULL; PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat = NULL; PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer = NULL; PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL; PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL; PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL; PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL; PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL; PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL; PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL; PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL; PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL; PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor = NULL; PFNGLVERTEXP2UIPROC glad_glVertexP2ui = NULL; PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv = NULL; PFNGLVERTEXP3UIPROC glad_glVertexP3ui = NULL; PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv = NULL; PFNGLVERTEXP4UIPROC glad_glVertexP4ui = NULL; PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv = NULL; PFNGLVIEWPORTPROC glad_glViewport = NULL; PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv = NULL; PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf = NULL; PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv = NULL; PFNGLWAITSYNCPROC glad_glWaitSync = NULL; static void load_GL_VERSION_1_0(GLADloadproc load) { if(!GLAD_GL_VERSION_1_0) return; glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); glad_glHint = (PFNGLHINTPROC)load("glHint"); glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); glad_glClear = (PFNGLCLEARPROC)load("glClear"); glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); } static void load_GL_VERSION_1_1(GLADloadproc load) { if(!GLAD_GL_VERSION_1_1) return; glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); } static void load_GL_VERSION_1_2(GLADloadproc load) { if(!GLAD_GL_VERSION_1_2) return; glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); } static void load_GL_VERSION_1_3(GLADloadproc load) { if(!GLAD_GL_VERSION_1_3) return; glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); } static void load_GL_VERSION_1_4(GLADloadproc load) { if(!GLAD_GL_VERSION_1_4) return; glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); } static void load_GL_VERSION_1_5(GLADloadproc load) { if(!GLAD_GL_VERSION_1_5) return; glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); } static void load_GL_VERSION_2_0(GLADloadproc load) { if(!GLAD_GL_VERSION_2_0) return; glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); } static void load_GL_VERSION_2_1(GLADloadproc load) { if(!GLAD_GL_VERSION_2_1) return; glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); } static void load_GL_VERSION_3_0(GLADloadproc load) { if(!GLAD_GL_VERSION_3_0) return; glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); } static void load_GL_VERSION_3_1(GLADloadproc load) { if(!GLAD_GL_VERSION_3_1) return; glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); } static void load_GL_VERSION_3_2(GLADloadproc load) { if(!GLAD_GL_VERSION_3_2) return; glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); } static void load_GL_VERSION_3_3(GLADloadproc load) { if(!GLAD_GL_VERSION_3_3) return; glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); } static void load_GL_VERSION_4_0(GLADloadproc load) { if(!GLAD_GL_VERSION_4_0) return; glad_glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)load("glMinSampleShading"); glad_glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)load("glBlendEquationi"); glad_glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)load("glBlendEquationSeparatei"); glad_glBlendFunci = (PFNGLBLENDFUNCIPROC)load("glBlendFunci"); glad_glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)load("glBlendFuncSeparatei"); glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect"); glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect"); glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d"); glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d"); glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d"); glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d"); glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv"); glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv"); glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv"); glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv"); glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv"); glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv"); glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv"); glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv"); glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv"); glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv"); glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv"); glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv"); glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv"); glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv"); glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation"); glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex"); glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv"); glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName"); glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName"); glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv"); glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv"); glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv"); glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri"); glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv"); glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback"); glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks"); glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks"); glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback"); glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback"); glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback"); glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback"); glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream"); glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed"); glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed"); glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv"); } static void load_GL_VERSION_4_1(GLADloadproc load) { if(!GLAD_GL_VERSION_4_1) return; glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary"); glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary"); glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages"); glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram"); glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv"); glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline"); glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines"); glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines"); glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline"); glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv"); glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i"); glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv"); glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f"); glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv"); glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d"); glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv"); glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui"); glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv"); glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i"); glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv"); glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f"); glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv"); glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d"); glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv"); glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui"); glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv"); glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i"); glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv"); glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f"); glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv"); glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d"); glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv"); glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui"); glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv"); glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i"); glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv"); glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f"); glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv"); glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d"); glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv"); glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui"); glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv"); glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv"); glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv"); glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv"); glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv"); glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv"); glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv"); glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv"); glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv"); glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv"); glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv"); glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv"); glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv"); glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv"); glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv"); glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv"); glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv"); glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv"); glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv"); glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline"); glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog"); glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d"); glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d"); glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d"); glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d"); glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv"); glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv"); glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv"); glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv"); glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer"); glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv"); glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv"); glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf"); glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv"); glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv"); glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed"); glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv"); glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv"); glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed"); glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v"); glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v"); } static void load_GL_VERSION_4_2(GLADloadproc load) { if(!GLAD_GL_VERSION_4_2) return; glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance"); glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance"); glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance"); glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ"); glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv"); glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture"); glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier"); glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D"); glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D"); glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D"); glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced"); glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced"); } static void load_GL_VERSION_4_3(GLADloadproc load) { if(!GLAD_GL_VERSION_4_3) return; glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData"); glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData"); glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute"); glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect"); glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData"); glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri"); glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv"); glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v"); glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage"); glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage"); glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData"); glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData"); glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer"); glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer"); glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect"); glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect"); glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv"); glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex"); glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName"); glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv"); glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation"); glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex"); glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding"); glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange"); glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample"); glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample"); glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView"); glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); } static void load_GL_VERSION_4_4(GLADloadproc load) { if(!GLAD_GL_VERSION_4_4) return; glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); glad_glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)load("glClearTexImage"); glad_glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)load("glClearTexSubImage"); glad_glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)load("glBindBuffersBase"); glad_glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)load("glBindBuffersRange"); glad_glBindTextures = (PFNGLBINDTEXTURESPROC)load("glBindTextures"); glad_glBindSamplers = (PFNGLBINDSAMPLERSPROC)load("glBindSamplers"); glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures"); glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers"); } static void load_GL_VERSION_4_5(GLADloadproc load) { if(!GLAD_GL_VERSION_4_5) return; glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl"); glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks"); glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase"); glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange"); glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv"); glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v"); glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v"); glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers"); glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage"); glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData"); glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData"); glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData"); glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData"); glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData"); glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer"); glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange"); glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer"); glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange"); glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv"); glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v"); glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv"); glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData"); glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers"); glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer"); glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri"); glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture"); glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer"); glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer"); glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers"); glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer"); glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData"); glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData"); glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv"); glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv"); glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv"); glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi"); glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer"); glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus"); glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv"); glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv"); glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers"); glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage"); glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample"); glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv"); glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures"); glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer"); glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange"); glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D"); glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D"); glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D"); glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample"); glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample"); glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D"); glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D"); glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D"); glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D"); glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D"); glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D"); glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D"); glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D"); glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D"); glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf"); glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv"); glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri"); glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv"); glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv"); glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv"); glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap"); glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit"); glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage"); glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage"); glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv"); glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv"); glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv"); glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv"); glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv"); glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv"); glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays"); glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib"); glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib"); glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer"); glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer"); glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers"); glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding"); glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat"); glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat"); glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat"); glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor"); glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv"); glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv"); glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv"); glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers"); glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines"); glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries"); glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v"); glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv"); glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v"); glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv"); glad_glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)load("glMemoryBarrierByRegion"); glad_glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)load("glGetTextureSubImage"); glad_glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)load("glGetCompressedTextureSubImage"); glad_glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)load("glGetGraphicsResetStatus"); glad_glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)load("glGetnCompressedTexImage"); glad_glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)load("glGetnTexImage"); glad_glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)load("glGetnUniformdv"); glad_glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)load("glGetnUniformfv"); glad_glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)load("glGetnUniformiv"); glad_glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)load("glGetnUniformuiv"); glad_glReadnPixels = (PFNGLREADNPIXELSPROC)load("glReadnPixels"); glad_glGetnMapdv = (PFNGLGETNMAPDVPROC)load("glGetnMapdv"); glad_glGetnMapfv = (PFNGLGETNMAPFVPROC)load("glGetnMapfv"); glad_glGetnMapiv = (PFNGLGETNMAPIVPROC)load("glGetnMapiv"); glad_glGetnPixelMapfv = (PFNGLGETNPIXELMAPFVPROC)load("glGetnPixelMapfv"); glad_glGetnPixelMapuiv = (PFNGLGETNPIXELMAPUIVPROC)load("glGetnPixelMapuiv"); glad_glGetnPixelMapusv = (PFNGLGETNPIXELMAPUSVPROC)load("glGetnPixelMapusv"); glad_glGetnPolygonStipple = (PFNGLGETNPOLYGONSTIPPLEPROC)load("glGetnPolygonStipple"); glad_glGetnColorTable = (PFNGLGETNCOLORTABLEPROC)load("glGetnColorTable"); glad_glGetnConvolutionFilter = (PFNGLGETNCONVOLUTIONFILTERPROC)load("glGetnConvolutionFilter"); glad_glGetnSeparableFilter = (PFNGLGETNSEPARABLEFILTERPROC)load("glGetnSeparableFilter"); glad_glGetnHistogram = (PFNGLGETNHISTOGRAMPROC)load("glGetnHistogram"); glad_glGetnMinmax = (PFNGLGETNMINMAXPROC)load("glGetnMinmax"); glad_glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)load("glTextureBarrier"); } static void load_GL_VERSION_4_6(GLADloadproc load) { if(!GLAD_GL_VERSION_4_6) return; glad_glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)load("glSpecializeShader"); glad_glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)load("glMultiDrawArraysIndirectCount"); glad_glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)load("glMultiDrawElementsIndirectCount"); glad_glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)load("glPolygonOffsetClamp"); } static int find_extensionsGL(void) { if (!get_exts()) return 0; (void)&has_ext; free_exts(); return 1; } static void find_coreGL(void) { /* Thank you @elmindreda * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 * https://github.com/glfw/glfw/blob/master/src/context.c#L36 */ int i, major, minor; const char* version; const char* prefixes[] = { "OpenGL ES-CM ", "OpenGL ES-CL ", "OpenGL ES ", NULL }; version = (const char*) glGetString(GL_VERSION); if (!version) return; for (i = 0; prefixes[i]; i++) { const size_t length = strlen(prefixes[i]); if (strncmp(version, prefixes[i], length) == 0) { version += length; break; } } /* PR #18 */ #ifdef _MSC_VER sscanf_s(version, "%d.%d", &major, &minor); #else sscanf(version, "%d.%d", &major, &minor); #endif GLVersion.major = major; GLVersion.minor = minor; max_loaded_major = major; max_loaded_minor = minor; GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; GLAD_GL_VERSION_4_0 = (major == 4 && minor >= 0) || major > 4; GLAD_GL_VERSION_4_1 = (major == 4 && minor >= 1) || major > 4; GLAD_GL_VERSION_4_2 = (major == 4 && minor >= 2) || major > 4; GLAD_GL_VERSION_4_3 = (major == 4 && minor >= 3) || major > 4; GLAD_GL_VERSION_4_4 = (major == 4 && minor >= 4) || major > 4; GLAD_GL_VERSION_4_5 = (major == 4 && minor >= 5) || major > 4; GLAD_GL_VERSION_4_6 = (major == 4 && minor >= 6) || major > 4; if (GLVersion.major > 4 || (GLVersion.major >= 4 && GLVersion.minor >= 6)) { max_loaded_major = 4; max_loaded_minor = 6; } } int gladLoadGLLoader(GLADloadproc load) { GLVersion.major = 0; GLVersion.minor = 0; glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); if(glGetString == NULL) return 0; if(glGetString(GL_VERSION) == NULL) return 0; find_coreGL(); load_GL_VERSION_1_0(load); load_GL_VERSION_1_1(load); load_GL_VERSION_1_2(load); load_GL_VERSION_1_3(load); load_GL_VERSION_1_4(load); load_GL_VERSION_1_5(load); load_GL_VERSION_2_0(load); load_GL_VERSION_2_1(load); load_GL_VERSION_3_0(load); load_GL_VERSION_3_1(load); load_GL_VERSION_3_2(load); load_GL_VERSION_3_3(load); load_GL_VERSION_4_0(load); load_GL_VERSION_4_1(load); load_GL_VERSION_4_2(load); load_GL_VERSION_4_3(load); load_GL_VERSION_4_4(load); load_GL_VERSION_4_5(load); load_GL_VERSION_4_6(load); if (!find_extensionsGL()) return 0; return GLVersion.major != 0 || GLVersion.minor != 0; }
727216.c
/* $NetBSD: rasops24.c,v 1.16 2001/11/15 09:48:14 lukem Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Andrew Doran. * * 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 acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h> __KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.16 2001/11/15 09:48:14 lukem Exp $"); #include "opt_rasops.h" #include <sys/param.h> #include <sys/systm.h> #include <sys/time.h> #include <machine/endian.h> #include <machine/bswap.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> static void rasops24_erasecols __P((void *, int, int, int, long)); static void rasops24_eraserows __P((void *, int, int, long)); static void rasops24_putchar __P((void *, int, int, u_int, long attr)); #ifndef RASOPS_SMALL static void rasops24_putchar8 __P((void *, int, int, u_int, long attr)); static void rasops24_putchar12 __P((void *, int, int, u_int, long attr)); static void rasops24_putchar16 __P((void *, int, int, u_int, long attr)); static void rasops24_makestamp __P((struct rasops_info *, long)); #endif /* * 4x1 stamp for optimized character blitting */ static int32_t stamp[64]; static long stamp_attr; static int stamp_mutex; /* XXX see note in readme */ /* * XXX this confuses the hell out of gcc2 (not egcs) which always insists * that the shift count is negative. * * offset = STAMP_SHIFT(fontbits, nibble #) & STAMP_MASK * destination int32_t[0] = STAMP_READ(offset) * destination int32_t[1] = STAMP_READ(offset + 4) * destination int32_t[2] = STAMP_READ(offset + 8) */ #define STAMP_SHIFT(fb,n) ((n*4-4) >= 0 ? (fb)>>(n*4-4):(fb)<<-(n*4-4)) #define STAMP_MASK (0xf << 4) #define STAMP_READ(o) (*(int32_t *)((caddr_t)stamp + (o))) /* * Initialize rasops_info struct for this colordepth. */ void rasops24_init(ri) struct rasops_info *ri; { switch (ri->ri_font->fontwidth) { #ifndef RASOPS_SMALL case 8: ri->ri_ops.putchar = rasops24_putchar8; break; case 12: ri->ri_ops.putchar = rasops24_putchar12; break; case 16: ri->ri_ops.putchar = rasops24_putchar16; break; #endif default: ri->ri_ops.putchar = rasops24_putchar; break; } if (ri->ri_rnum == 0) { ri->ri_rnum = 8; ri->ri_rpos = 0; ri->ri_gnum = 8; ri->ri_gpos = 8; ri->ri_bnum = 8; ri->ri_bpos = 16; } ri->ri_ops.erasecols = rasops24_erasecols; ri->ri_ops.eraserows = rasops24_eraserows; } /* * Put a single character. This is the generic version. * XXX this bites - we should use masks. */ static void rasops24_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; u_int uc; long attr; { int fb, width, height, cnt, clr[2]; struct rasops_info *ri; u_char *dp, *rp, *fr; ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) return; if ((unsigned)col >= (unsigned)ri->ri_cols) return; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; height = ri->ri_font->fontheight; width = ri->ri_font->fontwidth; clr[1] = ri->ri_devcmap[((u_int)attr >> 24) & 0xf]; clr[0] = ri->ri_devcmap[((u_int)attr >> 16) & 0xf]; if (uc == ' ') { u_char c = clr[0]; while (height--) { dp = rp; rp += ri->ri_stride; for (cnt = width; cnt; cnt--) { *dp++ = c >> 16; *dp++ = c >> 8; *dp++ = c; } } } else { uc -= ri->ri_font->firstchar; fr = (u_char *)ri->ri_font->data + uc * ri->ri_fontscale; while (height--) { dp = rp; fb = fr[3] | (fr[2] << 8) | (fr[1] << 16) | (fr[0] << 24); fr += ri->ri_font->stride; rp += ri->ri_stride; for (cnt = width; cnt; cnt--, fb <<= 1) { if ((fb >> 31) & 1) { *dp++ = clr[1] >> 16; *dp++ = clr[1] >> 8; *dp++ = clr[1]; } else { *dp++ = clr[0] >> 16; *dp++ = clr[0] >> 8; *dp++ = clr[0]; } } } } /* Do underline */ if ((attr & 1) != 0) { u_char c = clr[1]; rp -= ri->ri_stride << 1; while (width--) { *rp++ = c >> 16; *rp++ = c >> 8; *rp++ = c; } } } #ifndef RASOPS_SMALL /* * Recompute the blitting stamp. */ static void rasops24_makestamp(ri, attr) struct rasops_info *ri; long attr; { u_int fg, bg, c1, c2, c3, c4; int i; fg = ri->ri_devcmap[((u_int)attr >> 24) & 0xf] & 0xffffff; bg = ri->ri_devcmap[((u_int)attr >> 16) & 0xf] & 0xffffff; stamp_attr = attr; for (i = 0; i < 64; i += 4) { #if BYTE_ORDER == LITTLE_ENDIAN c1 = (i & 32 ? fg : bg); c2 = (i & 16 ? fg : bg); c3 = (i & 8 ? fg : bg); c4 = (i & 4 ? fg : bg); #else c1 = (i & 8 ? fg : bg); c2 = (i & 4 ? fg : bg); c3 = (i & 16 ? fg : bg); c4 = (i & 32 ? fg : bg); #endif stamp[i+0] = (c1 << 8) | (c2 >> 16); stamp[i+1] = (c2 << 16) | (c3 >> 8); stamp[i+2] = (c3 << 24) | c4; #if BYTE_ORDER == LITTLE_ENDIAN if ((ri->ri_flg & RI_BSWAP) == 0) { #else if ((ri->ri_flg & RI_BSWAP) != 0) { #endif stamp[i+0] = bswap32(stamp[i+0]); stamp[i+1] = bswap32(stamp[i+1]); stamp[i+2] = bswap32(stamp[i+2]); } } } /* * Put a single character. This is for 8-pixel wide fonts. */ static void rasops24_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; u_int uc; long attr; { struct rasops_info *ri; int height, so, fs; int32_t *rp; u_char *fr; /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; rasops24_putchar(cookie, row, col, uc, attr); return; } ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; return; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; return; } #endif /* Recompute stamp? */ if (attr != stamp_attr) rasops24_makestamp(ri, attr); rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); height = ri->ri_font->fontheight; if (uc == (u_int)-1) { int32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = c; DELTA(rp, ri->ri_stride, int32_t *); } } else { uc -= ri->ri_font->firstchar; fr = (u_char *)ri->ri_font->data + uc*ri->ri_fontscale; fs = ri->ri_font->stride; while (height--) { so = STAMP_SHIFT(fr[0], 1) & STAMP_MASK; rp[0] = STAMP_READ(so); rp[1] = STAMP_READ(so + 4); rp[2] = STAMP_READ(so + 8); so = STAMP_SHIFT(fr[0], 0) & STAMP_MASK; rp[3] = STAMP_READ(so); rp[4] = STAMP_READ(so + 4); rp[5] = STAMP_READ(so + 8); fr += fs; DELTA(rp, ri->ri_stride, int32_t *); } } /* Do underline */ if ((attr & 1) != 0) { int32_t c = STAMP_READ(52); DELTA(rp, -(ri->ri_stride << 1), int32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = c; } stamp_mutex--; } /* * Put a single character. This is for 12-pixel wide fonts. */ static void rasops24_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; u_int uc; long attr; { struct rasops_info *ri; int height, so, fs; int32_t *rp; u_char *fr; /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; rasops24_putchar(cookie, row, col, uc, attr); return; } ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; return; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; return; } #endif /* Recompute stamp? */ if (attr != stamp_attr) rasops24_makestamp(ri, attr); rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); height = ri->ri_font->fontheight; if (uc == (u_int)-1) { int32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = c; DELTA(rp, ri->ri_stride, int32_t *); } } else { uc -= ri->ri_font->firstchar; fr = (u_char *)ri->ri_font->data + uc*ri->ri_fontscale; fs = ri->ri_font->stride; while (height--) { so = STAMP_SHIFT(fr[0], 1) & STAMP_MASK; rp[0] = STAMP_READ(so); rp[1] = STAMP_READ(so + 4); rp[2] = STAMP_READ(so + 8); so = STAMP_SHIFT(fr[0], 0) & STAMP_MASK; rp[3] = STAMP_READ(so); rp[4] = STAMP_READ(so + 4); rp[5] = STAMP_READ(so + 8); so = STAMP_SHIFT(fr[1], 1) & STAMP_MASK; rp[6] = STAMP_READ(so); rp[7] = STAMP_READ(so + 4); rp[8] = STAMP_READ(so + 8); fr += fs; DELTA(rp, ri->ri_stride, int32_t *); } } /* Do underline */ if ((attr & 1) != 0) { int32_t c = STAMP_READ(52); DELTA(rp, -(ri->ri_stride << 1), int32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = c; } stamp_mutex--; } /* * Put a single character. This is for 16-pixel wide fonts. */ static void rasops24_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; u_int uc; long attr; { struct rasops_info *ri; int height, so, fs; int32_t *rp; u_char *fr; /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; rasops24_putchar(cookie, row, col, uc, attr); return; } ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; return; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; return; } #endif /* Recompute stamp? */ if (attr != stamp_attr) rasops24_makestamp(ri, attr); rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); height = ri->ri_font->fontheight; if (uc == (u_int)-1) { int32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = rp[9] = rp[10] = rp[11] = c; DELTA(rp, ri->ri_stride, int32_t *); } } else { uc -= ri->ri_font->firstchar; fr = (u_char *)ri->ri_font->data + uc*ri->ri_fontscale; fs = ri->ri_font->stride; while (height--) { so = STAMP_SHIFT(fr[0], 1) & STAMP_MASK; rp[0] = STAMP_READ(so); rp[1] = STAMP_READ(so + 4); rp[2] = STAMP_READ(so + 8); so = STAMP_SHIFT(fr[0], 0) & STAMP_MASK; rp[3] = STAMP_READ(so); rp[4] = STAMP_READ(so + 4); rp[5] = STAMP_READ(so + 8); so = STAMP_SHIFT(fr[1], 1) & STAMP_MASK; rp[6] = STAMP_READ(so); rp[7] = STAMP_READ(so + 4); rp[8] = STAMP_READ(so + 8); so = STAMP_SHIFT(fr[1], 0) & STAMP_MASK; rp[9] = STAMP_READ(so); rp[10] = STAMP_READ(so + 4); rp[11] = STAMP_READ(so + 8); DELTA(rp, ri->ri_stride, int32_t *); fr += fs; } } /* Do underline */ if ((attr & 1) != 0) { int32_t c = STAMP_READ(52); DELTA(rp, -(ri->ri_stride << 1), int32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = rp[9] = rp[10] = rp[11] = c; } stamp_mutex--; } #endif /* !RASOPS_SMALL */ /* * Erase rows. This is nice and easy due to alignment. */ static void rasops24_eraserows(cookie, row, num, attr) void *cookie; int row, num; long attr; { int n9, n3, n1, cnt, stride, delta; u_int32_t *dp, clr, stamp[3]; struct rasops_info *ri; /* * If the color is gray, we can cheat and use the generic routines * (which are faster, hopefully) since the r,g,b values are the same. */ if ((attr & 4) != 0) { rasops_eraserows(cookie, row, num, attr); return; } ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING if (row < 0) { num += row; row = 0; } if ((row + num) > ri->ri_rows) num = ri->ri_rows - row; if (num <= 0) return; #endif clr = ri->ri_devcmap[(attr >> 16) & 0xf] & 0xffffff; stamp[0] = (clr << 8) | (clr >> 16); stamp[1] = (clr << 16) | (clr >> 8); stamp[2] = (clr << 24) | clr; #if BYTE_ORDER == LITTLE_ENDIAN if ((ri->ri_flg & RI_BSWAP) == 0) { #else if ((ri->ri_flg & RI_BSWAP) != 0) { #endif stamp[0] = bswap32(stamp[0]); stamp[1] = bswap32(stamp[1]); stamp[2] = bswap32(stamp[2]); } /* * XXX the wsdisplay_emulops interface seems a little deficient in * that there is no way to clear the *entire* screen. We provide a * workaround here: if the entire console area is being cleared, and * the RI_FULLCLEAR flag is set, clear the entire display. */ if (num == ri->ri_rows && (ri->ri_flg & RI_FULLCLEAR) != 0) { stride = ri->ri_stride; num = ri->ri_height; dp = (int32_t *)ri->ri_origbits; delta = 0; } else { stride = ri->ri_emustride; num *= ri->ri_font->fontheight; dp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale); delta = ri->ri_delta; } n9 = stride / 36; cnt = (n9 << 5) + (n9 << 2); /* (32*n9) + (4*n9) */ n3 = (stride - cnt) / 12; cnt += (n3 << 3) + (n3 << 2); /* (8*n3) + (4*n3) */ n1 = (stride - cnt) >> 2; while (num--) { for (cnt = n9; cnt; cnt--) { dp[0] = stamp[0]; dp[1] = stamp[1]; dp[2] = stamp[2]; dp[3] = stamp[0]; dp[4] = stamp[1]; dp[5] = stamp[2]; dp[6] = stamp[0]; dp[7] = stamp[1]; dp[8] = stamp[2]; dp += 9; } for (cnt = n3; cnt; cnt--) { dp[0] = stamp[0]; dp[1] = stamp[1]; dp[2] = stamp[2]; dp += 3; } for (cnt = 0; cnt < n1; cnt++) *dp++ = stamp[cnt]; DELTA(dp, delta, int32_t *); } } /* * Erase columns. */ static void rasops24_erasecols(cookie, row, col, num, attr) void *cookie; int row, col, num; long attr; { int n12, n4, height, cnt, slop, clr, stamp[3]; struct rasops_info *ri; int32_t *dp, *rp; u_char *dbp; /* * If the color is gray, we can cheat and use the generic routines * (which are faster, hopefully) since the r,g,b values are the same. */ if ((attr & 4) != 0) { rasops_erasecols(cookie, row, col, num, attr); return; } ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) return; if (col < 0) { num += col; col = 0; } if ((col + num) > ri->ri_cols) num = ri->ri_cols - col; if (num <= 0) return; #endif rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); num *= ri->ri_font->fontwidth; height = ri->ri_font->fontheight; clr = ri->ri_devcmap[(attr >> 16) & 0xf] & 0xffffff; stamp[0] = (clr << 8) | (clr >> 16); stamp[1] = (clr << 16) | (clr >> 8); stamp[2] = (clr << 24) | clr; #if BYTE_ORDER == LITTLE_ENDIAN if ((ri->ri_flg & RI_BSWAP) == 0) { #else if ((ri->ri_flg & RI_BSWAP) != 0) { #endif stamp[0] = bswap32(stamp[0]); stamp[1] = bswap32(stamp[1]); stamp[2] = bswap32(stamp[2]); } /* * The current byte offset mod 4 tells us the number of 24-bit pels * we need to write for alignment to 32-bits. Once we're aligned on * a 32-bit boundary, we're also aligned on a 4 pixel boundary, so * the stamp does not need to be rotated. The following shows the * layout of 4 pels in a 3 word region and illustrates this: * * aaab bbcc cddd */ slop = (int)rp & 3; num -= slop; n12 = num / 12; num -= (n12 << 3) + (n12 << 2); n4 = num >> 2; num &= 3; while (height--) { dbp = (u_char *)rp; DELTA(rp, ri->ri_stride, int32_t *); /* Align to 4 bytes */ /* XXX handle with masks, bring under control of RI_BSWAP */ for (cnt = slop; cnt; cnt--) { *dbp++ = (clr >> 16); *dbp++ = (clr >> 8); *dbp++ = clr; } dp = (int32_t *)dbp; /* 12 pels per loop */ for (cnt = n12; cnt; cnt--) { dp[0] = stamp[0]; dp[1] = stamp[1]; dp[2] = stamp[2]; dp[3] = stamp[0]; dp[4] = stamp[1]; dp[5] = stamp[2]; dp[6] = stamp[0]; dp[7] = stamp[1]; dp[8] = stamp[2]; dp += 9; } /* 4 pels per loop */ for (cnt = n4; cnt; cnt--) { dp[0] = stamp[0]; dp[1] = stamp[1]; dp[2] = stamp[2]; dp += 3; } /* Trailing slop */ /* XXX handle with masks, bring under control of RI_BSWAP */ dbp = (u_char *)dp; for (cnt = num; cnt; cnt--) { *dbp++ = (clr >> 16); *dbp++ = (clr >> 8); *dbp++ = clr; } } }
289181.c
// Auto-generated file. Do not edit! // Template: src/qs8-vmulc/neon.c.in // Generator: tools/xngen // // Copyright 2021 Google LLC // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <assert.h> #include <arm_neon.h> #include <xnnpack/intrinsics-polyfill.h> #include <xnnpack/vadd.h> void xnn_qs8_vmulc_minmax_fp32_ukernel__neonv8_ld128_x16( size_t n, const int8_t* input_a, const int8_t* input_b, int8_t* output, const union xnn_qs8_mul_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN { #if XNN_ARCH_ARM64 const int8x16_t va_zero_point = vld1q_dup_s8(params->fp32_neonv8.a_zero_point); #else const int8x8_t va_zero_point = vld1_dup_s8(params->fp32_neonv8.a_zero_point); #endif const float32x4_t vscale = vld1q_dup_f32(&params->fp32_neonv8.scale); const int16x8_t voutput_zero_point = vld1q_dup_s16(&params->fp32_neonv8.output_zero_point); const int8x16_t voutput_min = vld1q_dup_s8(&params->fp32_neonv8.output_min); const int8x16_t voutput_max = vld1q_dup_s8(&params->fp32_neonv8.output_max); const int8x8_t vb = vld1_dup_s8(input_b); const int8x8_t vb_zero_point = vld1_dup_s8(params->fp32_neonv8.b_zero_point); const int16x8_t vxb = vsubl_s8(vb, vb_zero_point); for (; n >= 16 * sizeof(int8_t); n -= 16 * sizeof(int8_t)) { const int8x16_t va0123456789ABCDEF = vld1q_s8(input_a); input_a += 16; #if XNN_ARCH_ARM64 const int16x8_t vxa01234567 = vsubl_s8(vget_low_s8(va0123456789ABCDEF), vget_low_s8(va_zero_point)); const int16x8_t vxa89ABCDEF = vsubl_high_s8(va0123456789ABCDEF, va_zero_point); #else // !XNN_ARCH_ARM64 const int16x8_t vxa01234567 = vsubl_s8(vget_low_s8(va0123456789ABCDEF), va_zero_point); const int16x8_t vxa89ABCDEF = vsubl_s8(vget_high_s8(va0123456789ABCDEF), va_zero_point); #endif // XNN_ARCH_ARM64 int32x4_t vacc0123 = vmull_s16(vget_low_s16(vxa01234567), vget_low_s16(vxb)); int32x4_t vacc4567 = vmull_s16(vget_high_s16(vxa01234567), vget_high_s16(vxb)); int32x4_t vacc89AB = vmull_s16(vget_low_s16(vxa89ABCDEF), vget_low_s16(vxb)); int32x4_t vaccCDEF = vmull_s16(vget_high_s16(vxa89ABCDEF), vget_high_s16(vxb)); float32x4_t vfpacc0123 = vcvtq_f32_s32(vacc0123); float32x4_t vfpacc4567 = vcvtq_f32_s32(vacc4567); float32x4_t vfpacc89AB = vcvtq_f32_s32(vacc89AB); float32x4_t vfpaccCDEF = vcvtq_f32_s32(vaccCDEF); vfpacc0123 = vmulq_f32(vfpacc0123, vscale); vfpacc4567 = vmulq_f32(vfpacc4567, vscale); vfpacc89AB = vmulq_f32(vfpacc89AB, vscale); vfpaccCDEF = vmulq_f32(vfpaccCDEF, vscale); vacc0123 = vcvtnq_s32_f32(vfpacc0123); vacc4567 = vcvtnq_s32_f32(vfpacc4567); vacc89AB = vcvtnq_s32_f32(vfpacc89AB); vaccCDEF = vcvtnq_s32_f32(vfpaccCDEF); #if XNN_ARCH_ARM64 const int16x8_t vacc01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567), voutput_zero_point); const int16x8_t vacc89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc89AB), vaccCDEF), voutput_zero_point); int8x16_t vout0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc01234567), vacc89ABCDEF); #else const int16x8_t vacc01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567)), voutput_zero_point); const int16x8_t vacc89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc89AB), vqmovn_s32(vaccCDEF)), voutput_zero_point); int8x16_t vout0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc01234567), vqmovn_s16(vacc89ABCDEF)); #endif vout0123456789ABCDEF = vmaxq_s8(vout0123456789ABCDEF, voutput_min); vout0123456789ABCDEF = vminq_s8(vout0123456789ABCDEF, voutput_max); vst1q_s8(output, vout0123456789ABCDEF); output += 16; } if XNN_UNLIKELY(n != 0) { do { const int8x8_t va01234567 = vld1_s8(input_a); input_a += 8; #if XNN_ARCH_ARM64 const int16x8_t vxa01234567 = vsubl_s8(va01234567, vget_low_s8(va_zero_point)); #else // !XNN_ARCH_ARM64 const int16x8_t vxa01234567 = vsubl_s8(va01234567, va_zero_point); #endif // XNN_ARCH_ARM64 int32x4_t vacc0123 = vmull_s16(vget_low_s16(vxa01234567), vget_low_s16(vxb)); int32x4_t vacc4567 = vmull_s16(vget_high_s16(vxa01234567), vget_high_s16(vxb)); float32x4_t vfpacc0123 = vcvtq_f32_s32(vacc0123); float32x4_t vfpacc4567 = vcvtq_f32_s32(vacc4567); vfpacc0123 = vmulq_f32(vfpacc0123, vscale); vfpacc4567 = vmulq_f32(vfpacc4567, vscale); vacc0123 = vcvtnq_s32_f32(vfpacc0123); vacc4567 = vcvtnq_s32_f32(vfpacc4567); #if XNN_ARCH_ARM64 const int16x8_t vacc01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567), voutput_zero_point); int8x8_t vout01234567 = vqmovn_s16(vacc01234567); #else const int16x8_t vacc01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567)), voutput_zero_point); int8x8_t vout01234567 = vqmovn_s16(vacc01234567); #endif vout01234567 = vmax_s8(vout01234567, vget_low_s8(voutput_min)); vout01234567 = vmin_s8(vout01234567, vget_low_s8(voutput_max)); if XNN_LIKELY(n >= (8 * sizeof(int8_t))) { vst1_s8(output, vout01234567); output += 8; n -= 8 * sizeof(int8_t); } else { if (n & (4 * sizeof(int8_t))) { vst1_lane_u32(__builtin_assume_aligned(output, 1), vreinterpret_u32_s8(vout01234567), 0); output += 4; vout01234567 = vext_s8(vout01234567, vout01234567, 4); } if (n & (2 * sizeof(int8_t))) { vst1_lane_u16(__builtin_assume_aligned(output, 1), vreinterpret_u16_s8(vout01234567), 0); output += 2; vout01234567 = vext_s8(vout01234567, vout01234567, 2); } if (n & (1 * sizeof(int8_t))) { vst1_lane_s8(output, vout01234567, 0); } n = 0; } } while (n != 0); } }
700550.c
/* * * Copyright 2015 Rockchip Electronics Co. LTD * * 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 MODULE_TAG "dummy_dec_api" #include <string.h> #include "mpp_log.h" #include "mpp_mem.h" #include "mpp_common.h" #include "dummy_dec_api.h" #define DUMMY_DEC_FRAME_WIDTH 1280 #define DUMMY_DEC_FRAME_HEIGHT 720 #define DUMMY_DEC_FRAME_NEW_WIDTH 1920 #define DUMMY_DEC_FRAME_NEW_HEIGHT 1088 #define DUMMY_DEC_FRAME_SIZE SZ_1M #define DUMMY_DEC_FRAME_COUNT 16 #define DUMMY_DEC_REF_COUNT 2 typedef struct DummyDec_t { MppBufSlots frame_slots; MppBufSlots packet_slots; RK_S32 task_count; void *stream; size_t stream_size; MppPacket task_pkt; RK_S64 task_pts; RK_U32 task_eos; RK_U32 slots_inited; RK_U32 frame_count; RK_S32 prev_index; RK_S32 slot_index[DUMMY_DEC_REF_COUNT]; } DummyDec; MPP_RET dummy_dec_init(void *dec, ParserCfg *cfg) { DummyDec *p; RK_S32 i; void *stream; size_t stream_size = SZ_512K; MppPacket task_pkt; if (NULL == dec) { mpp_err_f("found NULL intput dec %p cfg %p\n", dec, cfg); return MPP_ERR_NULL_PTR; } stream = mpp_malloc_size(void, stream_size); if (NULL == stream) { mpp_err_f("failed to malloc stream buffer size %d\n", stream_size); return MPP_ERR_MALLOC; } mpp_packet_init(&task_pkt, stream, stream_size); if (NULL == task_pkt) { mpp_err_f("failed to create mpp_packet for task\n"); return MPP_ERR_UNKNOW; } p = (DummyDec *)dec; p->frame_slots = cfg->frame_slots; p->packet_slots = cfg->packet_slots; p->task_count = 2; p->stream = stream; p->stream_size = stream_size; p->task_pkt = task_pkt; for (i = 0; i < DUMMY_DEC_REF_COUNT; i++) { p->slot_index[i] = -1; } return MPP_OK; } MPP_RET dummy_dec_deinit(void *dec) { DummyDec *p; if (NULL == dec) { mpp_err_f("found NULL intput\n"); return MPP_ERR_NULL_PTR; } p = (DummyDec *)dec; if (p->task_pkt) mpp_packet_deinit(&p->task_pkt); if (p->stream) mpp_free(p->stream); return MPP_OK; } MPP_RET dummy_dec_reset(void *dec) { if (NULL == dec) { mpp_err_f("found NULL intput\n"); return MPP_ERR_NULL_PTR; } return MPP_OK; } MPP_RET dummy_dec_flush(void *dec) { if (NULL == dec) { mpp_err_f("found NULL intput\n"); return MPP_ERR_NULL_PTR; } return MPP_OK; } MPP_RET dummy_dec_control(void *dec, MpiCmd cmd_type, void *param) { if (NULL == dec) { mpp_err_f("found NULL intput\n"); return MPP_ERR_NULL_PTR; } (void)cmd_type; (void)param; return MPP_OK; } MPP_RET dummy_dec_prepare(void *dec, MppPacket pkt, HalDecTask *task) { DummyDec *p; RK_U8 *data; size_t length; if (NULL == dec) { mpp_err_f("found NULL intput\n"); return MPP_ERR_NULL_PTR; } p = (DummyDec *)dec; /********************************************************************* * do packet prepare here * including connet nals into a big buffer, setup packet for task copy * pts/eos record *********************************************************************/ p->task_pts = mpp_packet_get_pts(pkt); p->task_eos = mpp_packet_get_eos(pkt); // set pos to indicate that buffer is done data = mpp_packet_get_data(pkt); length = mpp_packet_get_length(pkt); if (length > p->stream_size) { p->stream = mpp_realloc(p->stream, RK_U8, length); mpp_packet_set_data(p->task_pkt, p->stream); p->stream_size = length; } if (p->stream) { memcpy(p->stream, data, length); mpp_packet_set_length(p->task_pkt, length); } else { mpp_err("failed to found task buffer for hardware\n"); return MPP_ERR_UNKNOW; } mpp_packet_set_pos(pkt, data + length); /* * this step will enable the task and goto parse stage */ task->input_packet = p->task_pkt; task->flags.eos = p->task_eos; task->valid = 1; return MPP_OK; } MPP_RET dummy_dec_parse(void *dec, HalDecTask *task) { DummyDec *p; RK_S32 output; MppFrame frame = NULL; RK_U32 frame_count; MppBufSlots slots; RK_S32 i; RK_U32 width, height; if (NULL == dec) { mpp_err_f("found NULL intput\n"); return MPP_ERR_NULL_PTR; } p = (DummyDec *)dec; slots = p->frame_slots; frame_count = p->frame_count; width = DUMMY_DEC_FRAME_WIDTH; height = DUMMY_DEC_FRAME_HEIGHT; mpp_frame_init(&frame); if (!p->slots_inited) { mpp_buf_slot_setup(slots, DUMMY_DEC_FRAME_COUNT); p->slots_inited = 1; } else if (frame_count >= 2) { // do info change test width = DUMMY_DEC_FRAME_NEW_WIDTH; height = DUMMY_DEC_FRAME_NEW_HEIGHT; } mpp_frame_set_width(frame, width); mpp_frame_set_height(frame, height); mpp_frame_set_hor_stride(frame, MPP_ALIGN(width, 16)); mpp_frame_set_ver_stride(frame, MPP_ALIGN(height, 16)); if (task->prev_status) { /* * if previous task has error happened mark the previous frame to be error */ mpp_err("previous task error found\n"); } /* * set slots information * 1. output index MUST be set * 2. get unused index for output if needed * 3. set output index as hal_input * 4. set frame information to output index * 5. if one frame can be display, it SHOULD be enqueued to display queue */ mpp_buf_slot_get_unused(slots, &output); mpp_buf_slot_set_flag(slots, output, SLOT_HAL_OUTPUT); task->output = output; mpp_frame_set_pts(frame, p->task_pts); mpp_buf_slot_set_prop(slots, output, SLOT_FRAME, frame); mpp_frame_deinit(&frame); mpp_assert(NULL == frame); /* * setup output task * 1. valid flag MUST be set if need hardware to run once * 2. set output slot index * 3. set reference slot index */ memset(&task->refer, -1, sizeof(task->refer)); for (i = 0; i < DUMMY_DEC_REF_COUNT; i++) { RK_S32 index = p->slot_index[i]; if (index >= 0) { task->refer[i] = index; mpp_buf_slot_set_flag(slots, index, SLOT_HAL_INPUT); mpp_buf_slot_set_flag(slots, index, SLOT_CODEC_USE); } } /* * update dpb status assuming that hw has decoded the frame */ mpp_buf_slot_set_flag(slots, output, SLOT_QUEUE_USE); mpp_buf_slot_enqueue(slots, output, QUEUE_DISPLAY); // add new reference buffer if (p->task_eos) { for (i = 0; i < DUMMY_DEC_REF_COUNT; i++) { mpp_buf_slot_clr_flag(slots, p->slot_index[i], SLOT_CODEC_USE); p->slot_index[i] = -1; } } else { // clear unreference buffer RK_U32 replace_index = frame_count & 1; if (p->slot_index[replace_index] >= 0) mpp_buf_slot_clr_flag(slots, p->slot_index[replace_index], SLOT_CODEC_USE); p->slot_index[replace_index] = output; mpp_buf_slot_set_flag(slots, output, SLOT_CODEC_USE); } p->frame_count = ++frame_count; return MPP_OK; } MPP_RET dummy_dec_callback(void *dec, void *err_info) { (void)dec; (void)err_info; return MPP_OK; } const ParserApi dummy_dec_parser = { .name = "dummy_dec_parser", .coding = MPP_VIDEO_CodingUnused, .ctx_size = sizeof(DummyDec), .flag = 0, .init = dummy_dec_init, .deinit = dummy_dec_deinit, .prepare = dummy_dec_prepare, .parse = dummy_dec_parse, .reset = dummy_dec_reset, .flush = dummy_dec_flush, .control = dummy_dec_control, .callback = dummy_dec_callback, };
121568.c
#include "pch-c.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include "codegen/il2cpp-codegen-metadata.h" IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END extern const Il2CppMethodSpec g_Il2CppMethodSpecTable[]; const Il2CppMethodSpec g_Il2CppMethodSpecTable[3481] = { { 333, -1, 1 } /* System.Void System.ThrowHelper::IfNullAndNullsAreIllegalThenThrow<System.Object>(System.Object,System.ExceptionArgument) */, { 337, -1, 1 } /* System.Collections.ObjectModel.ReadOnlyCollection`1<T> System.Array::AsReadOnly<System.Object>(T[]) */, { 338, -1, 1 } /* System.Void System.Array::Resize<System.Object>(T[]&,System.Int32) */, { 357, -1, 10 } /* TOutput[] System.Array::ConvertAll<System.Object,System.Object>(TInput[],System.Converter`2<TInput,TOutput>) */, { 361, -1, 1 } /* System.Void System.Array::ForEach<System.Object>(T[],System.Action`1<T>) */, { 376, -1, 1 } /* System.Int32 System.Array::BinarySearch<System.Object>(T[],T) */, { 377, -1, 1 } /* System.Int32 System.Array::BinarySearch<System.Object>(T[],T,System.Collections.Generic.IComparer`1<T>) */, { 378, -1, 1 } /* System.Int32 System.Array::BinarySearch<System.Object>(T[],System.Int32,System.Int32,T) */, { 379, -1, 1 } /* System.Int32 System.Array::BinarySearch<System.Object>(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 383, -1, 1 } /* System.Int32 System.Array::IndexOf<System.Object>(T[],T) */, { 384, -1, 1 } /* System.Int32 System.Array::IndexOf<System.Object>(T[],T,System.Int32) */, { 385, -1, 1 } /* System.Int32 System.Array::IndexOf<System.Object>(T[],T,System.Int32,System.Int32) */, { 389, -1, 1 } /* System.Int32 System.Array::LastIndexOf<System.Object>(T[],T) */, { 390, -1, 1 } /* System.Int32 System.Array::LastIndexOf<System.Object>(T[],T,System.Int32) */, { 391, -1, 1 } /* System.Int32 System.Array::LastIndexOf<System.Object>(T[],T,System.Int32,System.Int32) */, { 394, -1, 1 } /* System.Void System.Array::Reverse<System.Object>(T[]) */, { 395, -1, 1 } /* System.Void System.Array::Reverse<System.Object>(T[],System.Int32,System.Int32) */, { 408, -1, 1 } /* System.Void System.Array::Sort<System.Object>(T[]) */, { 409, -1, 1 } /* System.Void System.Array::Sort<System.Object>(T[],System.Int32,System.Int32) */, { 410, -1, 1 } /* System.Void System.Array::Sort<System.Object>(T[],System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 1 } /* System.Void System.Array::Sort<System.Object>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 412, -1, 1 } /* System.Void System.Array::Sort<System.Object>(T[],System.Comparison`1<T>) */, { 413, -1, 10 } /* System.Void System.Array::Sort<System.Object,System.Object>(TKey[],TValue[]) */, { 414, -1, 10 } /* System.Void System.Array::Sort<System.Object,System.Object>(TKey[],TValue[],System.Int32,System.Int32) */, { 415, -1, 10 } /* System.Void System.Array::Sort<System.Object,System.Object>(TKey[],TValue[],System.Collections.Generic.IComparer`1<TKey>) */, { 416, -1, 10 } /* System.Void System.Array::Sort<System.Object,System.Object>(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 417, -1, 1 } /* System.Boolean System.Array::Exists<System.Object>(T[],System.Predicate`1<T>) */, { 418, -1, 1 } /* System.Void System.Array::Fill<System.Object>(T[],T) */, { 419, -1, 1 } /* System.Void System.Array::Fill<System.Object>(T[],T,System.Int32,System.Int32) */, { 420, -1, 1 } /* T System.Array::Find<System.Object>(T[],System.Predicate`1<T>) */, { 421, -1, 1 } /* T[] System.Array::FindAll<System.Object>(T[],System.Predicate`1<T>) */, { 422, -1, 1 } /* System.Int32 System.Array::FindIndex<System.Object>(T[],System.Predicate`1<T>) */, { 423, -1, 1 } /* System.Int32 System.Array::FindIndex<System.Object>(T[],System.Int32,System.Predicate`1<T>) */, { 424, -1, 1 } /* System.Int32 System.Array::FindIndex<System.Object>(T[],System.Int32,System.Int32,System.Predicate`1<T>) */, { 425, -1, 1 } /* T System.Array::FindLast<System.Object>(T[],System.Predicate`1<T>) */, { 426, -1, 1 } /* System.Int32 System.Array::FindLastIndex<System.Object>(T[],System.Predicate`1<T>) */, { 427, -1, 1 } /* System.Int32 System.Array::FindLastIndex<System.Object>(T[],System.Int32,System.Predicate`1<T>) */, { 428, -1, 1 } /* System.Int32 System.Array::FindLastIndex<System.Object>(T[],System.Int32,System.Int32,System.Predicate`1<T>) */, { 429, -1, 1 } /* System.Boolean System.Array::TrueForAll<System.Object>(T[],System.Predicate`1<T>) */, { 434, -1, 1 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Object>() */, { 436, -1, 1 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Object>(T) */, { 437, -1, 1 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Object>(T) */, { 438, -1, 1 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Object>(T) */, { 439, -1, 1 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Object>(T[],System.Int32) */, { 440, -1, 1 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Object>(System.Int32) */, { 442, -1, 1 } /* System.Void System.Array::InternalArray__Insert<System.Object>(System.Int32,T) */, { 444, -1, 1 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Object>(T) */, { 445, -1, 1 } /* T System.Array::InternalArray__get_Item<System.Object>(System.Int32) */, { 446, -1, 1 } /* System.Void System.Array::InternalArray__set_Item<System.Object>(System.Int32,T) */, { 447, -1, 1 } /* System.Void System.Array::GetGenericValueImpl<System.Object>(System.Int32,T&) */, { 448, -1, 1 } /* System.Void System.Array::SetGenericValueImpl<System.Object>(System.Int32,T&) */, { 482, -1, 1 } /* T[] System.Array::Empty<System.Object>() */, { 484, -1, 1 } /* System.Int32 System.Array::IndexOfImpl<System.Object>(T[],T,System.Int32,System.Int32) */, { 485, -1, 1 } /* System.Int32 System.Array::LastIndexOfImpl<System.Object>(T[],T,System.Int32,System.Int32) */, { 487, -1, 1 } /* T System.Array::UnsafeLoad<System.Object>(T[],System.Int32) */, { 488, -1, 1 } /* System.Void System.Array::UnsafeStore<System.Object>(T[],System.Int32,T) */, { 489, -1, 10 } /* R System.Array::UnsafeMov<System.Object,System.Object>(S) */, { 497, 1, -1 } /* T System.Array/InternalEnumerator`1<System.Object>::get_Current() */, { 498, 1, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Object>::System.Collections.IEnumerator.get_Current() */, { 494, 1, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Object>::.ctor(System.Array) */, { 495, 1, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Object>::Dispose() */, { 496, 1, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Object>::MoveNext() */, { 501, 1, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Object>::get_Current() */, { 502, 1, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Object>::System.Collections.IEnumerator.get_Current() */, { 499, 1, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Object>::Dispose() */, { 500, 1, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Object>::MoveNext() */, { 503, 1, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Object>::.ctor() */, { 504, 1, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Object>::.cctor() */, { 526, -1, 10 } /* System.Tuple`2<T1,T2> System.Tuple::Create<System.Object,System.Object>(T1,T2) */, { 529, 10, -1 } /* T1 System.Tuple`2<System.Object,System.Object>::get_Item1() */, { 530, 10, -1 } /* T2 System.Tuple`2<System.Object,System.Object>::get_Item2() */, { 531, 10, -1 } /* System.Void System.Tuple`2<System.Object,System.Object>::.ctor(T1,T2) */, { 532, 10, -1 } /* System.Boolean System.Tuple`2<System.Object,System.Object>::Equals(System.Object) */, { 533, 10, -1 } /* System.Boolean System.Tuple`2<System.Object,System.Object>::System.Collections.IStructuralEquatable.Equals(System.Object,System.Collections.IEqualityComparer) */, { 534, 10, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Object>::System.IComparable.CompareTo(System.Object) */, { 535, 10, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Object>::System.Collections.IStructuralComparable.CompareTo(System.Object,System.Collections.IComparer) */, { 536, 10, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Object>::GetHashCode() */, { 537, 10, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Object>::System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer) */, { 538, 10, -1 } /* System.String System.Tuple`2<System.Object,System.Object>::ToString() */, { 539, 10, -1 } /* System.String System.Tuple`2<System.Object,System.Object>::System.ITupleInternal.ToString(System.Text.StringBuilder) */, { 540, 287, -1 } /* T1 System.Tuple`3<System.Object,System.Object,System.Object>::get_Item1() */, { 541, 287, -1 } /* T2 System.Tuple`3<System.Object,System.Object,System.Object>::get_Item2() */, { 542, 287, -1 } /* T3 System.Tuple`3<System.Object,System.Object,System.Object>::get_Item3() */, { 543, 287, -1 } /* System.Void System.Tuple`3<System.Object,System.Object,System.Object>::.ctor(T1,T2,T3) */, { 544, 287, -1 } /* System.Boolean System.Tuple`3<System.Object,System.Object,System.Object>::Equals(System.Object) */, { 545, 287, -1 } /* System.Boolean System.Tuple`3<System.Object,System.Object,System.Object>::System.Collections.IStructuralEquatable.Equals(System.Object,System.Collections.IEqualityComparer) */, { 546, 287, -1 } /* System.Int32 System.Tuple`3<System.Object,System.Object,System.Object>::System.IComparable.CompareTo(System.Object) */, { 547, 287, -1 } /* System.Int32 System.Tuple`3<System.Object,System.Object,System.Object>::System.Collections.IStructuralComparable.CompareTo(System.Object,System.Collections.IComparer) */, { 548, 287, -1 } /* System.Int32 System.Tuple`3<System.Object,System.Object,System.Object>::GetHashCode() */, { 549, 287, -1 } /* System.Int32 System.Tuple`3<System.Object,System.Object,System.Object>::System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer) */, { 550, 287, -1 } /* System.String System.Tuple`3<System.Object,System.Object,System.Object>::ToString() */, { 551, 287, -1 } /* System.String System.Tuple`3<System.Object,System.Object,System.Object>::System.ITupleInternal.ToString(System.Text.StringBuilder) */, { 552, 288, -1 } /* T1 System.Tuple`4<System.Object,System.Object,System.Object,System.Object>::get_Item1() */, { 553, 288, -1 } /* T2 System.Tuple`4<System.Object,System.Object,System.Object,System.Object>::get_Item2() */, { 554, 288, -1 } /* T3 System.Tuple`4<System.Object,System.Object,System.Object,System.Object>::get_Item3() */, { 555, 288, -1 } /* T4 System.Tuple`4<System.Object,System.Object,System.Object,System.Object>::get_Item4() */, { 605, 1, -1 } /* System.Void System.Action`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 606, 1, -1 } /* System.Void System.Action`1<System.Object>::Invoke(T) */, { 607, 1, -1 } /* System.IAsyncResult System.Action`1<System.Object>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 608, 1, -1 } /* System.Void System.Action`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 613, 10, -1 } /* System.Void System.Action`2<System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 614, 10, -1 } /* System.Void System.Action`2<System.Object,System.Object>::Invoke(T1,T2) */, { 615, 10, -1 } /* System.IAsyncResult System.Action`2<System.Object,System.Object>::BeginInvoke(T1,T2,System.AsyncCallback,System.Object) */, { 616, 10, -1 } /* System.Void System.Action`2<System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 617, 287, -1 } /* System.Void System.Action`3<System.Object,System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 618, 287, -1 } /* System.Void System.Action`3<System.Object,System.Object,System.Object>::Invoke(T1,T2,T3) */, { 619, 287, -1 } /* System.IAsyncResult System.Action`3<System.Object,System.Object,System.Object>::BeginInvoke(T1,T2,T3,System.AsyncCallback,System.Object) */, { 620, 287, -1 } /* System.Void System.Action`3<System.Object,System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 621, 1, -1 } /* System.Void System.Func`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 622, 1, -1 } /* TResult System.Func`1<System.Object>::Invoke() */, { 623, 1, -1 } /* System.IAsyncResult System.Func`1<System.Object>::BeginInvoke(System.AsyncCallback,System.Object) */, { 624, 1, -1 } /* TResult System.Func`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 625, 10, -1 } /* System.Void System.Func`2<System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 626, 10, -1 } /* TResult System.Func`2<System.Object,System.Object>::Invoke(T) */, { 627, 10, -1 } /* System.IAsyncResult System.Func`2<System.Object,System.Object>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 628, 10, -1 } /* TResult System.Func`2<System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 629, 288, -1 } /* System.Void System.Func`4<System.Object,System.Object,System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 630, 288, -1 } /* TResult System.Func`4<System.Object,System.Object,System.Object,System.Object>::Invoke(T1,T2,T3) */, { 631, 288, -1 } /* System.IAsyncResult System.Func`4<System.Object,System.Object,System.Object,System.Object>::BeginInvoke(T1,T2,T3,System.AsyncCallback,System.Object) */, { 632, 288, -1 } /* TResult System.Func`4<System.Object,System.Object,System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 633, 1, -1 } /* System.Void System.Comparison`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 634, 1, -1 } /* System.Int32 System.Comparison`1<System.Object>::Invoke(T,T) */, { 635, 1, -1 } /* System.IAsyncResult System.Comparison`1<System.Object>::BeginInvoke(T,T,System.AsyncCallback,System.Object) */, { 636, 1, -1 } /* System.Int32 System.Comparison`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 637, 10, -1 } /* System.Void System.Converter`2<System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 638, 10, -1 } /* TOutput System.Converter`2<System.Object,System.Object>::Invoke(TInput) */, { 639, 10, -1 } /* System.IAsyncResult System.Converter`2<System.Object,System.Object>::BeginInvoke(TInput,System.AsyncCallback,System.Object) */, { 640, 10, -1 } /* TOutput System.Converter`2<System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 641, 1, -1 } /* System.Void System.Predicate`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 642, 1, -1 } /* System.Boolean System.Predicate`1<System.Object>::Invoke(T) */, { 643, 1, -1 } /* System.IAsyncResult System.Predicate`1<System.Object>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 644, 1, -1 } /* System.Boolean System.Predicate`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 1352, 1, -1 } /* System.Void System.EventHandler`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 1353, 1, -1 } /* System.Void System.EventHandler`1<System.Object>::Invoke(System.Object,TEventArgs) */, { 1354, 1, -1 } /* System.IAsyncResult System.EventHandler`1<System.Object>::BeginInvoke(System.Object,TEventArgs,System.AsyncCallback,System.Object) */, { 1355, 1, -1 } /* System.Void System.EventHandler`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 1542, 1, -1 } /* System.Int32 System.IComparable`1<System.Object>::CompareTo(T) */, { 1562, 1, -1 } /* System.Boolean System.IEquatable`1<System.Object>::Equals(T) */, { 1927, 1, -1 } /* T System.RuntimeType/ListBuilder`1<System.Object>::get_Item(System.Int32) */, { 1930, 1, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Object>::get_Count() */, { 1926, 1, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Object>::.ctor(System.Int32) */, { 1928, 1, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Object>::ToArray() */, { 1929, 1, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Object>::CopyTo(System.Object[],System.Int32) */, { 1931, 1, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Object>::Add(T) */, { 2759, 1, -1 } /* System.Void System.EmptyArray`1<System.Object>::.cctor() */, { 3780, -1, 1 } /* T System.Reflection.CustomAttributeExtensions::GetCustomAttribute<System.Object>(System.Reflection.Assembly) */, { 3982, -1, 1 } /* T[] System.Reflection.CustomAttributeData::UnboxValues<System.Object>(System.Object[]) */, { 4252, -1, 10 } /* System.Object System.Reflection.MonoProperty::GetterAdapterFrame<System.Object,System.Object>(System.Reflection.MonoProperty/Getter`2<T,R>,System.Object) */, { 4253, -1, 1 } /* System.Object System.Reflection.MonoProperty::StaticGetterAdapterFrame<System.Object>(System.Reflection.MonoProperty/StaticGetter`1<R>,System.Object) */, { 4266, 10, -1 } /* System.Void System.Reflection.MonoProperty/Getter`2<System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 4267, 10, -1 } /* R System.Reflection.MonoProperty/Getter`2<System.Object,System.Object>::Invoke(T) */, { 4268, 10, -1 } /* System.IAsyncResult System.Reflection.MonoProperty/Getter`2<System.Object,System.Object>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 4269, 10, -1 } /* R System.Reflection.MonoProperty/Getter`2<System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 4270, 1, -1 } /* System.Void System.Reflection.MonoProperty/StaticGetter`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 4271, 1, -1 } /* R System.Reflection.MonoProperty/StaticGetter`1<System.Object>::Invoke() */, { 4272, 1, -1 } /* System.IAsyncResult System.Reflection.MonoProperty/StaticGetter`1<System.Object>::BeginInvoke(System.AsyncCallback,System.Object) */, { 4273, 1, -1 } /* R System.Reflection.MonoProperty/StaticGetter`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 4569, 1, -1 } /* TSource System.IO.Iterator`1<System.Object>::get_Current() */, { 4575, 1, -1 } /* System.Object System.IO.Iterator`1<System.Object>::System.Collections.IEnumerator.get_Current() */, { 4568, 1, -1 } /* System.Void System.IO.Iterator`1<System.Object>::.ctor() */, { 4570, 1, -1 } /* System.IO.Iterator`1<TSource> System.IO.Iterator`1<System.Object>::Clone() */, { 4571, 1, -1 } /* System.Void System.IO.Iterator`1<System.Object>::Dispose() */, { 4572, 1, -1 } /* System.Void System.IO.Iterator`1<System.Object>::Dispose(System.Boolean) */, { 4573, 1, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.IO.Iterator`1<System.Object>::GetEnumerator() */, { 4574, 1, -1 } /* System.Boolean System.IO.Iterator`1<System.Object>::MoveNext() */, { 4576, 1, -1 } /* System.Collections.IEnumerator System.IO.Iterator`1<System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 4577, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::.ctor(System.String,System.String,System.String,System.IO.SearchOption,System.IO.SearchResultHandler`1<TSource>,System.Boolean) */, { 4578, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::CommonInit() */, { 4579, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::.ctor(System.String,System.String,System.String,System.String,System.IO.SearchOption,System.IO.SearchResultHandler`1<TSource>,System.Boolean) */, { 4580, 1, -1 } /* System.IO.Iterator`1<TSource> System.IO.FileSystemEnumerableIterator`1<System.Object>::Clone() */, { 4581, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::Dispose(System.Boolean) */, { 4582, 1, -1 } /* System.Boolean System.IO.FileSystemEnumerableIterator`1<System.Object>::MoveNext() */, { 4583, 1, -1 } /* System.IO.SearchResult System.IO.FileSystemEnumerableIterator`1<System.Object>::CreateSearchResult(System.IO.Directory/SearchData,Microsoft.Win32.Win32Native/WIN32_FIND_DATA) */, { 4584, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::HandleError(System.Int32,System.String) */, { 4585, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::AddSearchableDirsToStack(System.IO.Directory/SearchData) */, { 4586, 1, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.Object>::DoDemand(System.String) */, { 4587, 1, -1 } /* System.String System.IO.FileSystemEnumerableIterator`1<System.Object>::NormalizeSearchPattern(System.String) */, { 4588, 1, -1 } /* System.String System.IO.FileSystemEnumerableIterator`1<System.Object>::GetNormalizedSearchCriteria(System.String,System.String) */, { 4589, 1, -1 } /* System.String System.IO.FileSystemEnumerableIterator`1<System.Object>::GetFullSearchString(System.String,System.String) */, { 4590, 1, -1 } /* System.Boolean System.IO.SearchResultHandler`1<System.Object>::IsResultIncluded(System.IO.SearchResult) */, { 4591, 1, -1 } /* TSource System.IO.SearchResultHandler`1<System.Object>::CreateObject(System.IO.SearchResult) */, { 4592, 1, -1 } /* System.Void System.IO.SearchResultHandler`1<System.Object>::.ctor() */, { 5628, 1, -1 } /* System.Threading.SparselyPopulatedArrayFragment`1<T> System.Threading.SparselyPopulatedArray`1<System.Object>::get_Tail() */, { 5627, 1, -1 } /* System.Void System.Threading.SparselyPopulatedArray`1<System.Object>::.ctor(System.Int32) */, { 5629, 1, -1 } /* System.Threading.SparselyPopulatedArrayAddInfo`1<T> System.Threading.SparselyPopulatedArray`1<System.Object>::Add(T) */, { 5631, 1, -1 } /* System.Threading.SparselyPopulatedArrayFragment`1<T> System.Threading.SparselyPopulatedArrayAddInfo`1<System.Object>::get_Source() */, { 5632, 1, -1 } /* System.Int32 System.Threading.SparselyPopulatedArrayAddInfo`1<System.Object>::get_Index() */, { 5630, 1, -1 } /* System.Void System.Threading.SparselyPopulatedArrayAddInfo`1<System.Object>::.ctor(System.Threading.SparselyPopulatedArrayFragment`1<T>,System.Int32) */, { 5635, 1, -1 } /* T System.Threading.SparselyPopulatedArrayFragment`1<System.Object>::get_Item(System.Int32) */, { 5636, 1, -1 } /* System.Int32 System.Threading.SparselyPopulatedArrayFragment`1<System.Object>::get_Length() */, { 5637, 1, -1 } /* System.Threading.SparselyPopulatedArrayFragment`1<T> System.Threading.SparselyPopulatedArrayFragment`1<System.Object>::get_Prev() */, { 5633, 1, -1 } /* System.Void System.Threading.SparselyPopulatedArrayFragment`1<System.Object>::.ctor(System.Int32) */, { 5634, 1, -1 } /* System.Void System.Threading.SparselyPopulatedArrayFragment`1<System.Object>::.ctor(System.Int32,System.Threading.SparselyPopulatedArrayFragment`1<T>) */, { 5638, 1, -1 } /* T System.Threading.SparselyPopulatedArrayFragment`1<System.Object>::SafeAtomicRemove(System.Int32,T) */, { 5639, -1, 1 } /* T System.Threading.LazyInitializer::EnsureInitialized<System.Object>(T&,System.Func`1<T>) */, { 5640, -1, 1 } /* T System.Threading.LazyInitializer::EnsureInitializedCore<System.Object>(T&,System.Func`1<T>) */, { 5904, 1, -1 } /* T[] System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Object>::get_Current() */, { 5903, 1, -1 } /* System.Void System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Object>::.ctor(System.Int32) */, { 5905, 1, -1 } /* System.Int32 System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Object>::Add(T) */, { 5906, 1, -1 } /* System.Void System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Object>::Remove(T) */, { 5986, -1, 1 } /* T System.Threading.Interlocked::CompareExchange<System.Object>(T&,T,T) */, { 5990, -1, 1 } /* T System.Threading.Interlocked::Exchange<System.Object>(T&,T) */, { 6032, -1, 1 } /* T System.Threading.Volatile::Read<System.Object>(T&) */, { 6033, -1, 1 } /* System.Void System.Threading.Volatile::Write<System.Object>(T&,T) */, { 6046, 1, -1 } /* TResult System.Threading.Tasks.Task`1<System.Object>::get_Result() */, { 6047, 1, -1 } /* TResult System.Threading.Tasks.Task`1<System.Object>::get_ResultOnSuccess() */, { 6040, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::.ctor() */, { 6041, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::.ctor(TResult) */, { 6042, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::.ctor(System.Boolean,TResult,System.Threading.Tasks.TaskCreationOptions,System.Threading.CancellationToken) */, { 6043, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::.ctor(System.Func`2<System.Object,TResult>,System.Object,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions) */, { 6044, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::.ctor(System.Delegate,System.Object,System.Threading.Tasks.Task,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.InternalTaskOptions,System.Threading.Tasks.TaskScheduler) */, { 6045, 1, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Object>::TrySetResult(TResult) */, { 6048, 1, -1 } /* TResult System.Threading.Tasks.Task`1<System.Object>::GetResultCore(System.Boolean) */, { 6049, 1, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Object>::TrySetException(System.Object) */, { 6050, 1, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Object>::TrySetCanceled(System.Threading.CancellationToken) */, { 6051, 1, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Object>::TrySetCanceled(System.Threading.CancellationToken,System.Object) */, { 6052, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::InnerInvoke() */, { 6053, 1, -1 } /* System.Runtime.CompilerServices.TaskAwaiter`1<TResult> System.Threading.Tasks.Task`1<System.Object>::GetAwaiter() */, { 6054, 1, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult> System.Threading.Tasks.Task`1<System.Object>::ConfigureAwait(System.Boolean) */, { 6055, 1, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Object>::.cctor() */, { 6056, 1, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Object>::.cctor() */, { 6057, 1, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Object>::.ctor() */, { 6058, 1, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task`1/<>c<System.Object>::<.cctor>b__64_0(System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>) */, { 6059, 1, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Object>::.ctor() */, { 6060, 1, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Object>::.ctor(System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.TaskContinuationOptions,System.Threading.Tasks.TaskScheduler) */, { 6061, 1, -1 } /* System.Void System.Threading.Tasks.Shared`1<System.Object>::.ctor(T) */, { 6170, -1, 1 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task::FromCancellation<System.Object>(System.Threading.CancellationToken) */, { 7798, 1, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::get_Task() */, { 7794, 1, -1 } /* System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::Create() */, { 7795, 1, 1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::Start<System.Object>(TStateMachine&) */, { 7796, 1, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine) */, { 7797, 1, 10 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::AwaitUnsafeOnCompleted<System.Object,System.Object>(TAwaiter&,TStateMachine&) */, { 7799, 1, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::SetResult(TResult) */, { 7800, 1, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::SetException(System.Exception) */, { 7801, 1, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::GetTaskForResult(TResult) */, { 7802, 1, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Object>::.cctor() */, { 7804, -1, 1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskCache::CreateCacheableTask<System.Object>(TResult) */, { 7842, 1, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Object>::.ctor(System.Threading.Tasks.Task`1<TResult>) */, { 7843, 1, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Object>::UnsafeOnCompleted(System.Action) */, { 7844, 1, -1 } /* TResult System.Runtime.CompilerServices.TaskAwaiter`1<System.Object>::GetResult() */, { 7845, 1, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Object>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7846, 1, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult> System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Object>::GetAwaiter() */, { 7848, 1, -1 } /* System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Object>::get_IsCompleted() */, { 7847, 1, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Object>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7849, 1, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Object>::UnsafeOnCompleted(System.Action) */, { 7850, 1, -1 } /* TResult System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Object>::GetResult() */, { 7875, -1, 1 } /* T System.Runtime.CompilerServices.JitHelpers::UnsafeCast<System.Object>(System.Object) */, { 7878, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::.ctor() */, { 7879, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::Finalize() */, { 7880, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::RehashWithoutResize() */, { 7881, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::RecomputeSize() */, { 7882, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::Rehash() */, { 7883, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::Add(TKey,TValue) */, { 7884, 10, -1 } /* System.Boolean System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::Remove(TKey) */, { 7885, 10, -1 } /* System.Boolean System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::TryGetValue(TKey,TValue&) */, { 7886, 10, -1 } /* TValue System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Object>::GetValue(TKey,System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<TKey,TValue>) */, { 7887, 10, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 7888, 10, -1 } /* TValue System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<System.Object,System.Object>::Invoke(TKey) */, { 7889, 10, -1 } /* System.IAsyncResult System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<System.Object,System.Object>::BeginInvoke(TKey,System.AsyncCallback,System.Object) */, { 7890, 10, -1 } /* TValue System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 7976, -1, 1 } /* System.Void System.Runtime.InteropServices.Marshal::StructureToPtr<System.Object>(T,System.IntPtr,System.Boolean) */, { 7978, -1, 1 } /* System.IntPtr System.Runtime.InteropServices.Marshal::GetFunctionPointerForDelegate<System.Object>(TDelegate) */, { 8232, 1, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::get_Count() */, { 8233, 1, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::get_Item(System.Int32) */, { 8238, 1, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8239, 1, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.IList<T>.get_Item(System.Int32) */, { 8240, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.IList<T>.set_Item(System.Int32,T) */, { 8248, 1, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.get_IsReadOnly() */, { 8249, 1, -1 } /* System.Object System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.get_Item(System.Int32) */, { 8250, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8231, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::.ctor(System.Collections.Generic.IList`1<T>) */, { 8234, 1, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::Contains(T) */, { 8235, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::CopyTo(T[],System.Int32) */, { 8236, 1, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::GetEnumerator() */, { 8237, 1, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::IndexOf(T) */, { 8241, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.ICollection<T>.Add(T) */, { 8242, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.ICollection<T>.Clear() */, { 8243, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.IList<T>.Insert(System.Int32,T) */, { 8244, 1, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.ICollection<T>.Remove(T) */, { 8245, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.Generic.IList<T>.RemoveAt(System.Int32) */, { 8246, 1, -1 } /* System.Collections.IEnumerator System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 8247, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8251, 1, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.Add(System.Object) */, { 8252, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.Clear() */, { 8253, 1, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::IsCompatibleObject(System.Object) */, { 8254, 1, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.Contains(System.Object) */, { 8255, 1, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.IndexOf(System.Object) */, { 8256, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8257, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.Remove(System.Object) */, { 8258, 1, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Object>::System.Collections.IList.RemoveAt(System.Int32) */, { 8277, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::set_Item(TKey,TValue) */, { 8279, 10, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::get_Count() */, { 8285, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.get_IsReadOnly() */, { 8290, 10, -1 } /* System.Object System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.IDictionary.get_Item(System.Object) */, { 8291, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.IDictionary.set_Item(System.Object,System.Object) */, { 8296, 10, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::get_DefaultConcurrencyLevel() */, { 8262, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::IsValueWriteAtomic() */, { 8263, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::.ctor() */, { 8264, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::.ctor(System.Int32,System.Int32,System.Boolean,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8265, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::TryAdd(TKey,TValue) */, { 8266, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::ContainsKey(TKey) */, { 8267, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::TryRemoveInternal(TKey,TValue&,System.Boolean,TValue) */, { 8268, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::TryGetValue(TKey,TValue&) */, { 8269, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::TryGetValueInternal(TKey,System.Int32,TValue&) */, { 8270, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::Clear() */, { 8271, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8272, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::CopyToPairs(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8273, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::CopyToEntries(System.Collections.DictionaryEntry[],System.Int32) */, { 8274, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::CopyToObjects(System.Object[],System.Int32) */, { 8275, 10, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::GetEnumerator() */, { 8276, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::TryAddInternal(TKey,System.Int32,TValue,System.Boolean,System.Boolean,TValue&) */, { 8278, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::ThrowKeyNullException() */, { 8280, 10, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::GetCountInternal() */, { 8281, 10, -1 } /* TValue System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::GetOrAdd(TKey,System.Func`2<TKey,TValue>) */, { 8282, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.Generic.IDictionary<TKey,TValue>.Add(TKey,TValue) */, { 8283, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8284, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8286, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8287, 10, -1 } /* System.Collections.IEnumerator System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 8288, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.IDictionary.Contains(System.Object) */, { 8289, 10, -1 } /* System.Collections.IDictionaryEnumerator System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.IDictionary.GetEnumerator() */, { 8292, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8293, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::GrowTable(System.Collections.Concurrent.ConcurrentDictionary`2/Tables<TKey,TValue>) */, { 8294, 10, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::GetBucket(System.Int32,System.Int32) */, { 8295, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::GetBucketAndLockNo(System.Int32,System.Int32&,System.Int32&,System.Int32,System.Int32) */, { 8297, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::AcquireAllLocks(System.Int32&) */, { 8298, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::AcquireLocks(System.Int32,System.Int32,System.Int32&) */, { 8299, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::ReleaseLocks(System.Int32,System.Int32) */, { 8300, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Object,System.Object>::.cctor() */, { 8301, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/Tables<System.Object,System.Object>::.ctor(System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>[],System.Object[],System.Int32[]) */, { 8302, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/Node<System.Object,System.Object>::.ctor(TKey,TValue,System.Int32,System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>) */, { 8304, 10, -1 } /* System.Collections.DictionaryEntry System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<System.Object,System.Object>::get_Entry() */, { 8305, 10, -1 } /* System.Object System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<System.Object,System.Object>::get_Key() */, { 8306, 10, -1 } /* System.Object System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<System.Object,System.Object>::get_Value() */, { 8307, 10, -1 } /* System.Object System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<System.Object,System.Object>::get_Current() */, { 8303, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<System.Object,System.Object>::.ctor(System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>) */, { 8308, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<System.Object,System.Object>::MoveNext() */, { 8312, 10, -1 } /* System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Concurrent.ConcurrentDictionary`2/<GetEnumerator>d__32<System.Object,System.Object>::System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>>.get_Current() */, { 8313, 10, -1 } /* System.Object System.Collections.Concurrent.ConcurrentDictionary`2/<GetEnumerator>d__32<System.Object,System.Object>::System.Collections.IEnumerator.get_Current() */, { 8309, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/<GetEnumerator>d__32<System.Object,System.Object>::.ctor(System.Int32) */, { 8310, 10, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/<GetEnumerator>d__32<System.Object,System.Object>::System.IDisposable.Dispose() */, { 8311, 10, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2/<GetEnumerator>d__32<System.Object,System.Object>::MoveNext() */, { 8314, -1, 10 } /* TValue System.Collections.Generic.CollectionExtensions::GetValueOrDefault<System.Object,System.Object>(System.Collections.Generic.IReadOnlyDictionary`2<TKey,TValue>,TKey) */, { 8315, -1, 10 } /* TValue System.Collections.Generic.CollectionExtensions::GetValueOrDefault<System.Object,System.Object>(System.Collections.Generic.IReadOnlyDictionary`2<TKey,TValue>,TKey,TValue) */, { 8318, 10, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>::get_Key() */, { 8319, 10, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>::get_Value() */, { 8317, 10, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>::.ctor(TKey,TValue) */, { 8320, 10, -1 } /* System.String System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>::ToString() */, { 8323, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8324, 1, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Object>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8325, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 1, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Object>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8327, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8328, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::Swap(T[],System.Int32,System.Int32) */, { 8329, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8330, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 1, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Object>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8333, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8334, 1, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Object>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8335, 10, -1 } /* System.Collections.Generic.ArraySortHelper`2<TKey,TValue> System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::get_Default() */, { 8336, 10, -1 } /* System.Collections.Generic.ArraySortHelper`2<TKey,TValue> System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::CreateArraySortHelper() */, { 8337, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::Sort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8338, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::SwapIfGreaterWithItems(TKey[],TValue[],System.Collections.Generic.IComparer`1<TKey>,System.Int32,System.Int32) */, { 8339, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::Swap(TKey[],TValue[],System.Int32,System.Int32) */, { 8340, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::IntrospectiveSort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8341, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::IntroSort(TKey[],TValue[],System.Int32,System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8342, 10, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::PickPivotAndPartition(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8343, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::Heapsort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8344, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::DownHeap(TKey[],TValue[],System.Int32,System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8345, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::InsertionSort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8346, 10, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.Object,System.Object>::.ctor() */, { 8352, 10, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Object,System.Object>::get_Count() */, { 8353, 10, -1 } /* TValue System.Collections.Generic.Dictionary`2<System.Object,System.Object>::get_Item(TKey) */, { 8354, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::set_Item(TKey,TValue) */, { 8373, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.get_IsReadOnly() */, { 8377, 10, -1 } /* System.Object System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.IDictionary.get_Item(System.Object) */, { 8378, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.IDictionary.set_Item(System.Object,System.Object) */, { 8347, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::.ctor() */, { 8348, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::.ctor(System.Int32) */, { 8349, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::.ctor(System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8350, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::.ctor(System.Int32,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8351, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8355, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::Add(TKey,TValue) */, { 8356, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8357, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8358, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8359, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::Clear() */, { 8360, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::ContainsKey(TKey) */, { 8361, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8362, 10, -1 } /* System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue> System.Collections.Generic.Dictionary`2<System.Object,System.Object>::GetEnumerator() */, { 8363, 10, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator() */, { 8364, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8365, 10, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Object,System.Object>::FindEntry(TKey) */, { 8366, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::Initialize(System.Int32) */, { 8367, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::TryInsert(TKey,TValue,System.Collections.Generic.InsertionBehavior) */, { 8368, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::OnDeserialization(System.Object) */, { 8369, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::Resize() */, { 8370, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::Resize(System.Int32,System.Boolean) */, { 8371, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::Remove(TKey) */, { 8372, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::TryGetValue(TKey,TValue&) */, { 8374, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8375, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8376, 10, -1 } /* System.Collections.IEnumerator System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 8379, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::IsCompatibleKey(System.Object) */, { 8380, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.IDictionary.Contains(System.Object) */, { 8381, 10, -1 } /* System.Collections.IDictionaryEnumerator System.Collections.Generic.Dictionary`2<System.Object,System.Object>::System.Collections.IDictionary.GetEnumerator() */, { 8384, 10, -1 } /* System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::get_Current() */, { 8386, 10, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::System.Collections.IEnumerator.get_Current() */, { 8387, 10, -1 } /* System.Collections.DictionaryEntry System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::System.Collections.IDictionaryEnumerator.get_Entry() */, { 8388, 10, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::System.Collections.IDictionaryEnumerator.get_Key() */, { 8389, 10, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::System.Collections.IDictionaryEnumerator.get_Value() */, { 8382, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::.ctor(System.Collections.Generic.Dictionary`2<TKey,TValue>,System.Int32) */, { 8383, 10, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::MoveNext() */, { 8385, 10, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Object>::Dispose() */, { 8399, 1, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.Object>::get_Default() */, { 8400, 1, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.Object>::CreateComparer() */, { 8401, 1, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<System.Object>::Compare(T,T) */, { 8402, 1, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<System.Object>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8403, 1, -1 } /* System.Void System.Collections.Generic.Comparer`1<System.Object>::.ctor() */, { 8404, 1, -1 } /* System.Int32 System.Collections.Generic.GenericComparer`1<System.Object>::Compare(T,T) */, { 8405, 1, -1 } /* System.Boolean System.Collections.Generic.GenericComparer`1<System.Object>::Equals(System.Object) */, { 8406, 1, -1 } /* System.Int32 System.Collections.Generic.GenericComparer`1<System.Object>::GetHashCode() */, { 8407, 1, -1 } /* System.Void System.Collections.Generic.GenericComparer`1<System.Object>::.ctor() */, { 8412, 1, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.Object>::Compare(T,T) */, { 8413, 1, -1 } /* System.Boolean System.Collections.Generic.ObjectComparer`1<System.Object>::Equals(System.Object) */, { 8414, 1, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.Object>::GetHashCode() */, { 8415, 1, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<System.Object>::.ctor() */, { 8416, 1, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Object>::get_Default() */, { 8417, 1, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Object>::CreateComparer() */, { 8418, 1, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Object>::Equals(T,T) */, { 8419, 1, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Object>::GetHashCode(T) */, { 8420, 1, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Object>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 1, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Object>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 1, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Object>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 1, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Object>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8424, 1, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.Object>::.ctor() */, { 8425, 1, -1 } /* System.Boolean System.Collections.Generic.GenericEqualityComparer`1<System.Object>::Equals(T,T) */, { 8426, 1, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Object>::GetHashCode(T) */, { 8427, 1, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Object>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8428, 1, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Object>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8429, 1, -1 } /* System.Boolean System.Collections.Generic.GenericEqualityComparer`1<System.Object>::Equals(System.Object) */, { 8430, 1, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Object>::GetHashCode() */, { 8431, 1, -1 } /* System.Void System.Collections.Generic.GenericEqualityComparer`1<System.Object>::.ctor() */, { 8439, 1, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::Equals(T,T) */, { 8440, 1, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::GetHashCode(T) */, { 8441, 1, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 1, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 1, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::Equals(System.Object) */, { 8444, 1, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::GetHashCode() */, { 8445, 1, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<System.Object>::.ctor() */, { 8477, 1, -1 } /* System.Int32 System.Collections.Generic.ICollection`1<System.Object>::get_Count() */, { 8478, 1, -1 } /* System.Boolean System.Collections.Generic.ICollection`1<System.Object>::get_IsReadOnly() */, { 8479, 1, -1 } /* System.Void System.Collections.Generic.ICollection`1<System.Object>::Add(T) */, { 8480, 1, -1 } /* System.Void System.Collections.Generic.ICollection`1<System.Object>::Clear() */, { 8481, 1, -1 } /* System.Boolean System.Collections.Generic.ICollection`1<System.Object>::Contains(T) */, { 8482, 1, -1 } /* System.Void System.Collections.Generic.ICollection`1<System.Object>::CopyTo(T[],System.Int32) */, { 8483, 1, -1 } /* System.Boolean System.Collections.Generic.ICollection`1<System.Object>::Remove(T) */, { 8484, 1, -1 } /* System.Int32 System.Collections.Generic.IComparer`1<System.Object>::Compare(T,T) */, { 8485, 10, -1 } /* System.Void System.Collections.Generic.IDictionary`2<System.Object,System.Object>::Add(TKey,TValue) */, { 8486, 1, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.IEnumerable`1<System.Object>::GetEnumerator() */, { 8487, 1, -1 } /* T System.Collections.Generic.IEnumerator`1<System.Object>::get_Current() */, { 8488, 1, -1 } /* System.Boolean System.Collections.Generic.IEqualityComparer`1<System.Object>::Equals(T,T) */, { 8489, 1, -1 } /* System.Int32 System.Collections.Generic.IEqualityComparer`1<System.Object>::GetHashCode(T) */, { 8490, 1, -1 } /* T System.Collections.Generic.IList`1<System.Object>::get_Item(System.Int32) */, { 8491, 1, -1 } /* System.Void System.Collections.Generic.IList`1<System.Object>::set_Item(System.Int32,T) */, { 8492, 1, -1 } /* System.Int32 System.Collections.Generic.IList`1<System.Object>::IndexOf(T) */, { 8493, 1, -1 } /* System.Void System.Collections.Generic.IList`1<System.Object>::Insert(System.Int32,T) */, { 8494, 1, -1 } /* System.Void System.Collections.Generic.IList`1<System.Object>::RemoveAt(System.Int32) */, { 8495, 1, -1 } /* System.Int32 System.Collections.Generic.IReadOnlyCollection`1<System.Object>::get_Count() */, { 8496, 10, -1 } /* System.Boolean System.Collections.Generic.IReadOnlyDictionary`2<System.Object,System.Object>::TryGetValue(TKey,TValue&) */, { 8497, 1, -1 } /* T System.Collections.Generic.IReadOnlyList`1<System.Object>::get_Item(System.Int32) */, { 8504, 1, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Object>::get_Capacity() */, { 8505, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::set_Capacity(System.Int32) */, { 8506, 1, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Object>::get_Count() */, { 8507, 1, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Object>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8508, 1, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Object>::System.Collections.IList.get_IsReadOnly() */, { 8509, 1, -1 } /* T System.Collections.Generic.List`1<System.Object>::get_Item(System.Int32) */, { 8510, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::set_Item(System.Int32,T) */, { 8512, 1, -1 } /* System.Object System.Collections.Generic.List`1<System.Object>::System.Collections.IList.get_Item(System.Int32) */, { 8513, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8501, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::.ctor() */, { 8502, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::.ctor(System.Int32) */, { 8503, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8511, 1, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Object>::IsCompatibleObject(System.Object) */, { 8514, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Add(T) */, { 8515, 1, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Object>::System.Collections.IList.Add(System.Object) */, { 8516, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 8517, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Clear() */, { 8518, 1, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Object>::Contains(T) */, { 8519, 1, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Object>::System.Collections.IList.Contains(System.Object) */, { 8520, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::CopyTo(T[]) */, { 8521, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8522, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::CopyTo(T[],System.Int32) */, { 8523, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::EnsureCapacity(System.Int32) */, { 8524, 1, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Object>::GetEnumerator() */, { 8525, 1, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.List`1<System.Object>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 8526, 1, -1 } /* System.Collections.IEnumerator System.Collections.Generic.List`1<System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 8527, 1, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Object>::IndexOf(T) */, { 8528, 1, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Object>::System.Collections.IList.IndexOf(System.Object) */, { 8529, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Insert(System.Int32,T) */, { 8530, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8531, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::InsertRange(System.Int32,System.Collections.Generic.IEnumerable`1<T>) */, { 8532, 1, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Object>::Remove(T) */, { 8533, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::System.Collections.IList.Remove(System.Object) */, { 8534, 1, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Object>::RemoveAll(System.Predicate`1<T>) */, { 8535, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::RemoveAt(System.Int32) */, { 8536, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Reverse() */, { 8537, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Reverse(System.Int32,System.Int32) */, { 8538, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Sort(System.Collections.Generic.IComparer`1<T>) */, { 8539, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8540, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::Sort(System.Comparison`1<T>) */, { 8541, 1, -1 } /* T[] System.Collections.Generic.List`1<System.Object>::ToArray() */, { 8542, 1, -1 } /* System.Void System.Collections.Generic.List`1<System.Object>::.cctor() */, { 8547, 1, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Object>::get_Current() */, { 8548, 1, -1 } /* System.Object System.Collections.Generic.List`1/Enumerator<System.Object>::System.Collections.IEnumerator.get_Current() */, { 8543, 1, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Object>::.ctor(System.Collections.Generic.List`1<T>) */, { 8544, 1, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Object>::Dispose() */, { 8545, 1, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Object>::MoveNext() */, { 8546, 1, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Object>::MoveNextRare() */, { 8587, -1, 1 } /* System.Boolean System.Diagnostics.Contracts.Contract::ForAll<System.Object>(System.Collections.Generic.IEnumerable`1<T>,System.Predicate`1<T>) */, { 8979, -1, 1 } /* System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable::Where<System.Object>(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8980, -1, 1 } /* System.Func`2<TSource,System.Boolean> System.Linq.Enumerable::CombinePredicates<System.Object>(System.Func`2<TSource,System.Boolean>,System.Func`2<TSource,System.Boolean>) */, { 8981, -1, 1 } /* TSource System.Linq.Enumerable::SingleOrDefault<System.Object>(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8982, -1, 1 } /* System.Boolean System.Linq.Enumerable::Any<System.Object>(System.Collections.Generic.IEnumerable`1<TSource>) */, { 8983, -1, 1 } /* System.Boolean System.Linq.Enumerable::Any<System.Object>(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8985, 1, -1 } /* TSource System.Linq.Enumerable/Iterator`1<System.Object>::get_Current() */, { 8991, 1, -1 } /* System.Object System.Linq.Enumerable/Iterator`1<System.Object>::System.Collections.IEnumerator.get_Current() */, { 8984, 1, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<System.Object>::.ctor() */, { 8986, 1, -1 } /* System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/Iterator`1<System.Object>::Clone() */, { 8987, 1, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<System.Object>::Dispose() */, { 8988, 1, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/Iterator`1<System.Object>::GetEnumerator() */, { 8989, 1, -1 } /* System.Boolean System.Linq.Enumerable/Iterator`1<System.Object>::MoveNext() */, { 8990, 1, -1 } /* System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/Iterator`1<System.Object>::Where(System.Func`2<TSource,System.Boolean>) */, { 8992, 1, -1 } /* System.Collections.IEnumerator System.Linq.Enumerable/Iterator`1<System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 8993, 1, -1 } /* System.Void System.Linq.Enumerable/WhereEnumerableIterator`1<System.Object>::.ctor(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8994, 1, -1 } /* System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/WhereEnumerableIterator`1<System.Object>::Clone() */, { 8995, 1, -1 } /* System.Void System.Linq.Enumerable/WhereEnumerableIterator`1<System.Object>::Dispose() */, { 8996, 1, -1 } /* System.Boolean System.Linq.Enumerable/WhereEnumerableIterator`1<System.Object>::MoveNext() */, { 8997, 1, -1 } /* System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/WhereEnumerableIterator`1<System.Object>::Where(System.Func`2<TSource,System.Boolean>) */, { 8998, 1, -1 } /* System.Void System.Linq.Enumerable/WhereArrayIterator`1<System.Object>::.ctor(TSource[],System.Func`2<TSource,System.Boolean>) */, { 8999, 1, -1 } /* System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/WhereArrayIterator`1<System.Object>::Clone() */, { 9000, 1, -1 } /* System.Boolean System.Linq.Enumerable/WhereArrayIterator`1<System.Object>::MoveNext() */, { 9001, 1, -1 } /* System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/WhereArrayIterator`1<System.Object>::Where(System.Func`2<TSource,System.Boolean>) */, { 9002, 1, -1 } /* System.Void System.Linq.Enumerable/WhereListIterator`1<System.Object>::.ctor(System.Collections.Generic.List`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 9003, 1, -1 } /* System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/WhereListIterator`1<System.Object>::Clone() */, { 9004, 1, -1 } /* System.Boolean System.Linq.Enumerable/WhereListIterator`1<System.Object>::MoveNext() */, { 9005, 1, -1 } /* System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/WhereListIterator`1<System.Object>::Where(System.Func`2<TSource,System.Boolean>) */, { 9006, 1, -1 } /* System.Void System.Linq.Enumerable/<>c__DisplayClass6_0`1<System.Object>::.ctor() */, { 9007, 1, -1 } /* System.Boolean System.Linq.Enumerable/<>c__DisplayClass6_0`1<System.Object>::<CombinePredicates>b__0(TSource) */, { 9083, -1, 1 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<System.Object>(System.Void*,System.Int32) */, { 9084, -1, 1 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<System.Object>(System.Void*,System.Int32,T) */, { 9452, -1, 1 } /* T UnityEngine.AttributeHelperEngine::GetCustomAttributeOfType<System.Object>(System.Type) */, { 9512, -1, 1 } /* T UnityEngine.ScriptableObject::CreateInstance<System.Object>() */, { 9622, -1, 1 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<System.Object>(System.Object) */, { 9631, 1, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Object>::add_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9632, 1, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Object>::remove_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9633, 1, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Object>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9634, 1, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Object>::.ctor(UnityEngine.Events.UnityAction`1<T1>) */, { 9635, 1, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Object>::Invoke(System.Object[]) */, { 9636, 1, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Object>::Invoke(T1) */, { 9637, 1, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`1<System.Object>::Find(System.Object,System.Reflection.MethodInfo) */, { 9638, 10, -1 } /* System.Void UnityEngine.Events.InvokableCall`2<System.Object,System.Object>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9639, 10, -1 } /* System.Void UnityEngine.Events.InvokableCall`2<System.Object,System.Object>::Invoke(System.Object[]) */, { 9640, 10, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`2<System.Object,System.Object>::Find(System.Object,System.Reflection.MethodInfo) */, { 9641, 287, -1 } /* System.Void UnityEngine.Events.InvokableCall`3<System.Object,System.Object,System.Object>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9642, 287, -1 } /* System.Void UnityEngine.Events.InvokableCall`3<System.Object,System.Object,System.Object>::Invoke(System.Object[]) */, { 9643, 287, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`3<System.Object,System.Object,System.Object>::Find(System.Object,System.Reflection.MethodInfo) */, { 9644, 288, -1 } /* System.Void UnityEngine.Events.InvokableCall`4<System.Object,System.Object,System.Object,System.Object>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9645, 288, -1 } /* System.Void UnityEngine.Events.InvokableCall`4<System.Object,System.Object,System.Object,System.Object>::Invoke(System.Object[]) */, { 9646, 288, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`4<System.Object,System.Object,System.Object,System.Object>::Find(System.Object,System.Reflection.MethodInfo) */, { 9647, 1, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Object>::.ctor(UnityEngine.Object,System.Reflection.MethodInfo,T) */, { 9648, 1, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Object>::Invoke(System.Object[]) */, { 9649, 1, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Object>::Invoke(T) */, { 9690, 1, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Object>::.ctor(System.Object,System.IntPtr) */, { 9691, 1, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Object>::Invoke(T0) */, { 9692, 1, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`1<System.Object>::BeginInvoke(T0,System.AsyncCallback,System.Object) */, { 9693, 1, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Object>::EndInvoke(System.IAsyncResult) */, { 9694, 1, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Object>::.ctor() */, { 9695, 1, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Object>::AddListener(UnityEngine.Events.UnityAction`1<T0>) */, { 9696, 1, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Object>::RemoveListener(UnityEngine.Events.UnityAction`1<T0>) */, { 9697, 1, -1 } /* System.Reflection.MethodInfo UnityEngine.Events.UnityEvent`1<System.Object>::FindMethod_Impl(System.String,System.Type) */, { 9698, 1, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`1<System.Object>::GetDelegate(System.Object,System.Reflection.MethodInfo) */, { 9699, 1, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`1<System.Object>::GetDelegate(UnityEngine.Events.UnityAction`1<T0>) */, { 9700, 1, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Object>::Invoke(T0) */, { 9701, 10, -1 } /* System.Void UnityEngine.Events.UnityAction`2<System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 9702, 10, -1 } /* System.Void UnityEngine.Events.UnityAction`2<System.Object,System.Object>::Invoke(T0,T1) */, { 9703, 10, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`2<System.Object,System.Object>::BeginInvoke(T0,T1,System.AsyncCallback,System.Object) */, { 9704, 10, -1 } /* System.Void UnityEngine.Events.UnityAction`2<System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 9705, 10, -1 } /* System.Void UnityEngine.Events.UnityEvent`2<System.Object,System.Object>::.ctor() */, { 9706, 10, -1 } /* System.Reflection.MethodInfo UnityEngine.Events.UnityEvent`2<System.Object,System.Object>::FindMethod_Impl(System.String,System.Type) */, { 9707, 10, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`2<System.Object,System.Object>::GetDelegate(System.Object,System.Reflection.MethodInfo) */, { 9708, 287, -1 } /* System.Void UnityEngine.Events.UnityAction`3<System.Object,System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 9709, 287, -1 } /* System.Void UnityEngine.Events.UnityAction`3<System.Object,System.Object,System.Object>::Invoke(T0,T1,T2) */, { 9710, 287, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`3<System.Object,System.Object,System.Object>::BeginInvoke(T0,T1,T2,System.AsyncCallback,System.Object) */, { 9711, 287, -1 } /* System.Void UnityEngine.Events.UnityAction`3<System.Object,System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 9712, 287, -1 } /* System.Void UnityEngine.Events.UnityEvent`3<System.Object,System.Object,System.Object>::.ctor() */, { 9713, 287, -1 } /* System.Reflection.MethodInfo UnityEngine.Events.UnityEvent`3<System.Object,System.Object,System.Object>::FindMethod_Impl(System.String,System.Type) */, { 9714, 287, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`3<System.Object,System.Object,System.Object>::GetDelegate(System.Object,System.Reflection.MethodInfo) */, { 9715, 288, -1 } /* System.Void UnityEngine.Events.UnityAction`4<System.Object,System.Object,System.Object,System.Object>::.ctor(System.Object,System.IntPtr) */, { 9716, 288, -1 } /* System.Void UnityEngine.Events.UnityAction`4<System.Object,System.Object,System.Object,System.Object>::Invoke(T0,T1,T2,T3) */, { 9717, 288, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`4<System.Object,System.Object,System.Object,System.Object>::BeginInvoke(T0,T1,T2,T3,System.AsyncCallback,System.Object) */, { 9718, 288, -1 } /* System.Void UnityEngine.Events.UnityAction`4<System.Object,System.Object,System.Object,System.Object>::EndInvoke(System.IAsyncResult) */, { 9719, 288, -1 } /* System.Void UnityEngine.Events.UnityEvent`4<System.Object,System.Object,System.Object,System.Object>::.ctor() */, { 9720, 288, -1 } /* System.Reflection.MethodInfo UnityEngine.Events.UnityEvent`4<System.Object,System.Object,System.Object,System.Object>::FindMethod_Impl(System.String,System.Type) */, { 9721, 288, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`4<System.Object,System.Object,System.Object,System.Object>::GetDelegate(System.Object,System.Reflection.MethodInfo) */, { 8231, 40, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Exception>::.ctor(System.Collections.Generic.IList`1<T>) */, { 8503, 40, -1 } /* System.Void System.Collections.Generic.List`1<System.Exception>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8503, 41, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8232, 40, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Exception>::get_Count() */, { 8235, 40, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Exception>::CopyTo(T[],System.Int32) */, { 8501, 40, -1 } /* System.Void System.Collections.Generic.List`1<System.Exception>::.ctor() */, { 8501, 272, -1 } /* System.Void System.Collections.Generic.List`1<System.AggregateException>::.ctor() */, { 8514, 272, -1 } /* System.Void System.Collections.Generic.List`1<System.AggregateException>::Add(T) */, { 8509, 272, -1 } /* T System.Collections.Generic.List`1<System.AggregateException>::get_Item(System.Int32) */, { 8514, 40, -1 } /* System.Void System.Collections.Generic.List`1<System.Exception>::Add(T) */, { 8506, 272, -1 } /* System.Int32 System.Collections.Generic.List`1<System.AggregateException>::get_Count() */, { 8233, 40, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Exception>::get_Item(System.Int32) */, { 8347, 74, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Object>::.ctor() */, { 8360, 74, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Object>::ContainsKey(TKey) */, { 8354, 74, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Object>::set_Item(TKey,TValue) */, { 8371, 74, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Object>::Remove(TKey) */, { 7804, -1, 0 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskCache::CreateCacheableTask<System.Int32>(TResult) */, { 7804, -1, 5 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskCache::CreateCacheableTask<System.Boolean>(TResult) */, { 8372, 125, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Type,System.Runtime.Serialization.Formatters.Binary.TypeInformation>::TryGetValue(TKey,TValue&) */, { 8355, 125, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Type,System.Runtime.Serialization.Formatters.Binary.TypeInformation>::Add(TKey,TValue) */, { 8347, 125, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Type,System.Runtime.Serialization.Formatters.Binary.TypeInformation>::.ctor() */, { 8424, 44, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.Byte>::.ctor() */, { 5631, 99, -1 } /* System.Threading.SparselyPopulatedArrayFragment`1<T> System.Threading.SparselyPopulatedArrayAddInfo`1<System.Threading.CancellationCallbackInfo>::get_Source() */, { 5632, 99, -1 } /* System.Int32 System.Threading.SparselyPopulatedArrayAddInfo`1<System.Threading.CancellationCallbackInfo>::get_Index() */, { 5638, 99, -1 } /* T System.Threading.SparselyPopulatedArrayFragment`1<System.Threading.CancellationCallbackInfo>::SafeAtomicRemove(System.Int32,T) */, { 5627, 99, -1 } /* System.Void System.Threading.SparselyPopulatedArray`1<System.Threading.CancellationCallbackInfo>::.ctor(System.Int32) */, { 5629, 99, -1 } /* System.Threading.SparselyPopulatedArrayAddInfo`1<T> System.Threading.SparselyPopulatedArray`1<System.Threading.CancellationCallbackInfo>::Add(T) */, { 5628, 99, -1 } /* System.Threading.SparselyPopulatedArrayFragment`1<T> System.Threading.SparselyPopulatedArray`1<System.Threading.CancellationCallbackInfo>::get_Tail() */, { 5636, 99, -1 } /* System.Int32 System.Threading.SparselyPopulatedArrayFragment`1<System.Threading.CancellationCallbackInfo>::get_Length() */, { 5635, 99, -1 } /* T System.Threading.SparselyPopulatedArrayFragment`1<System.Threading.CancellationCallbackInfo>::get_Item(System.Int32) */, { 5637, 99, -1 } /* System.Threading.SparselyPopulatedArrayFragment`1<T> System.Threading.SparselyPopulatedArrayFragment`1<System.Threading.CancellationCallbackInfo>::get_Prev() */, { 8349, 95, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,Mono.Globalization.Unicode.SimpleCollator>::.ctor(System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8372, 95, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,Mono.Globalization.Unicode.SimpleCollator>::TryGetValue(TKey,TValue&) */, { 8354, 95, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,Mono.Globalization.Unicode.SimpleCollator>::set_Item(TKey,TValue) */, { 482, -1, 12 } /* T[] System.Array::Empty<System.String>() */, { 8541, 126, -1 } /* T[] System.Collections.Generic.List`1<System.Runtime.Remoting.Contexts.IContextProperty>::ToArray() */, { 8524, 126, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Runtime.Remoting.Contexts.IContextProperty>::GetEnumerator() */, { 8547, 126, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Runtime.Remoting.Contexts.IContextProperty>::get_Current() */, { 8545, 126, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Runtime.Remoting.Contexts.IContextProperty>::MoveNext() */, { 8544, 126, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Runtime.Remoting.Contexts.IContextProperty>::Dispose() */, { 8501, 126, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.Remoting.Contexts.IContextProperty>::.ctor() */, { 8514, 126, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.Remoting.Contexts.IContextProperty>::Add(T) */, { 8506, 126, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Runtime.Remoting.Contexts.IContextProperty>::get_Count() */, { 8509, 126, -1 } /* T System.Collections.Generic.List`1<System.Runtime.Remoting.Contexts.IContextProperty>::get_Item(System.Int32) */, { 606, 4, -1 } /* System.Void System.Action`1<System.Threading.Tasks.Task>::Invoke(T) */, { 614, 93, -1 } /* System.Void System.Action`2<System.Threading.Tasks.Task,System.Object>::Invoke(T1,T2) */, { 8347, 97, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Globalization.CultureInfo>::.ctor() */, { 8347, 98, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Globalization.CultureInfo>::.ctor() */, { 8354, 97, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Globalization.CultureInfo>::set_Item(TKey,TValue) */, { 8354, 98, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Globalization.CultureInfo>::set_Item(TKey,TValue) */, { 8372, 97, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Globalization.CultureInfo>::TryGetValue(TKey,TValue&) */, { 8372, 98, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Globalization.CultureInfo>::TryGetValue(TKey,TValue&) */, { 2824, 0, -1 } /* System.Boolean System.Nullable`1<System.Int32>::get_HasValue() */, { 2825, 0, -1 } /* T System.Nullable`1<System.Int32>::get_Value() */, { 3982, -1, 84 } /* T[] System.Reflection.CustomAttributeData::UnboxValues<System.Reflection.CustomAttributeTypedArgument>(System.Object[]) */, { 337, -1, 84 } /* System.Collections.ObjectModel.ReadOnlyCollection`1<T> System.Array::AsReadOnly<System.Reflection.CustomAttributeTypedArgument>(T[]) */, { 3982, -1, 85 } /* T[] System.Reflection.CustomAttributeData::UnboxValues<System.Reflection.CustomAttributeNamedArgument>(System.Object[]) */, { 337, -1, 85 } /* System.Collections.ObjectModel.ReadOnlyCollection`1<T> System.Array::AsReadOnly<System.Reflection.CustomAttributeNamedArgument>(T[]) */, { 8231, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::.ctor(System.Collections.Generic.IList`1<T>) */, { 8347, 96, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.String>::.ctor() */, { 8355, 96, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.String>::Add(TKey,TValue) */, { 8372, 96, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.String>::TryGetValue(TKey,TValue&) */, { 8501, 12, -1 } /* System.Void System.Collections.Generic.List`1<System.String>::.ctor() */, { 8518, 12, -1 } /* System.Boolean System.Collections.Generic.List`1<System.String>::Contains(T) */, { 8514, 12, -1 } /* System.Void System.Collections.Generic.List`1<System.String>::Add(T) */, { 8506, 12, -1 } /* System.Int32 System.Collections.Generic.List`1<System.String>::get_Count() */, { 8509, 12, -1 } /* T System.Collections.Generic.List`1<System.String>::get_Item(System.Int32) */, { 641, 48, -1 } /* System.Void System.Predicate`1<System.Type>::.ctor(System.Object,System.IntPtr) */, { 8587, -1, 48 } /* System.Boolean System.Diagnostics.Contracts.Contract::ForAll<System.Type>(System.Collections.Generic.IEnumerable`1<T>,System.Predicate`1<T>) */, { 7878, 133, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Runtime.Serialization.SerializationInfo>::.ctor() */, { 8503, 12, -1 } /* System.Void System.Collections.Generic.List`1<System.String>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8541, 12, -1 } /* T[] System.Collections.Generic.List`1<System.String>::ToArray() */, { 8399, 72, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.UInt64>::get_Default() */, { 415, -1, 289 } /* System.Void System.Array::Sort<System.UInt64,System.String>(TKey[],TValue[],System.Collections.Generic.IComparer`1<TKey>) */, { 8524, 107, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Threading.IAsyncLocal>::GetEnumerator() */, { 8547, 107, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Threading.IAsyncLocal>::get_Current() */, { 8372, 106, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Threading.IAsyncLocal,System.Object>::TryGetValue(TKey,TValue&) */, { 8545, 107, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Threading.IAsyncLocal>::MoveNext() */, { 8544, 107, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Threading.IAsyncLocal>::Dispose() */, { 4577, 12, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<System.String>::.ctor(System.String,System.String,System.String,System.IO.SearchOption,System.IO.SearchResultHandler`1<TSource>,System.Boolean) */, { 8263, 122, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.Runtime.Serialization.MemberHolder,System.Reflection.MemberInfo[]>::.ctor() */, { 8501, 274, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.Serialization.SerializationFieldInfo>::.ctor() */, { 8514, 274, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.Serialization.SerializationFieldInfo>::Add(T) */, { 8506, 274, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Runtime.Serialization.SerializationFieldInfo>::get_Count() */, { 625, 122, -1 } /* System.Void System.Func`2<System.Runtime.Serialization.MemberHolder,System.Reflection.MemberInfo[]>::.ctor(System.Object,System.IntPtr) */, { 8281, 122, -1 } /* TValue System.Collections.Concurrent.ConcurrentDictionary`2<System.Runtime.Serialization.MemberHolder,System.Reflection.MemberInfo[]>::GetOrAdd(TKey,System.Func`2<TKey,TValue>) */, { 7883, 133, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Runtime.Serialization.SerializationInfo>::Add(TKey,TValue) */, { 7885, 133, -1 } /* System.Boolean System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Runtime.Serialization.SerializationInfo>::TryGetValue(TKey,TValue&) */, { 7884, 133, -1 } /* System.Boolean System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Runtime.Serialization.SerializationInfo>::Remove(TKey) */, { 8424, 12, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.String>::.ctor() */, { 8354, 96, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.String>::set_Item(TKey,TValue) */, { 8352, 96, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.String,System.String>::get_Count() */, { 8362, 96, -1 } /* System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue> System.Collections.Generic.Dictionary`2<System.String,System.String>::GetEnumerator() */, { 8384, 96, -1 } /* System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator<System.String,System.String>::get_Current() */, { 8319, 96, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.String,System.String>::get_Value() */, { 8383, 96, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.String,System.String>::MoveNext() */, { 8385, 96, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.String,System.String>::Dispose() */, { 8514, 42, -1 } /* System.Void System.Collections.Generic.List`1<System.LocalDataStore>::Add(T) */, { 8532, 42, -1 } /* System.Boolean System.Collections.Generic.List`1<System.LocalDataStore>::Remove(T) */, { 8355, 43, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.LocalDataStoreSlot>::Add(TKey,TValue) */, { 8314, -1, 43 } /* TValue System.Collections.Generic.CollectionExtensions::GetValueOrDefault<System.String,System.LocalDataStoreSlot>(System.Collections.Generic.IReadOnlyDictionary`2<TKey,TValue>,TKey) */, { 8371, 43, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.LocalDataStoreSlot>::Remove(TKey) */, { 8509, 42, -1 } /* T System.Collections.Generic.List`1<System.LocalDataStore>::get_Item(System.Int32) */, { 8506, 42, -1 } /* System.Int32 System.Collections.Generic.List`1<System.LocalDataStore>::get_Count() */, { 8501, 42, -1 } /* System.Void System.Collections.Generic.List`1<System.LocalDataStore>::.ctor() */, { 8347, 43, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.LocalDataStoreSlot>::.ctor() */, { 8501, 13, -1 } /* System.Void System.Collections.Generic.List`1<Mono.Globalization.Unicode.Contraction>::.ctor() */, { 8501, 14, -1 } /* System.Void System.Collections.Generic.List`1<Mono.Globalization.Unicode.Level2Map>::.ctor() */, { 8514, 13, -1 } /* System.Void System.Collections.Generic.List`1<Mono.Globalization.Unicode.Contraction>::Add(T) */, { 8514, 14, -1 } /* System.Void System.Collections.Generic.List`1<Mono.Globalization.Unicode.Level2Map>::Add(T) */, { 8538, 13, -1 } /* System.Void System.Collections.Generic.List`1<Mono.Globalization.Unicode.Contraction>::Sort(System.Collections.Generic.IComparer`1<T>) */, { 633, 14, -1 } /* System.Void System.Comparison`1<Mono.Globalization.Unicode.Level2Map>::.ctor(System.Object,System.IntPtr) */, { 8540, 14, -1 } /* System.Void System.Collections.Generic.List`1<Mono.Globalization.Unicode.Level2Map>::Sort(System.Comparison`1<T>) */, { 8541, 13, -1 } /* T[] System.Collections.Generic.List`1<Mono.Globalization.Unicode.Contraction>::ToArray() */, { 8541, 14, -1 } /* T[] System.Collections.Generic.List`1<Mono.Globalization.Unicode.Level2Map>::ToArray() */, { 3780, -1, 290 } /* T System.Reflection.CustomAttributeExtensions::GetCustomAttribute<System.Resources.NeutralResourcesLanguageAttribute>(System.Reflection.Assembly) */, { 8502, 275, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.Module>::.ctor(System.Int32) */, { 8514, 275, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.Module>::Add(T) */, { 8541, 275, -1 } /* T[] System.Collections.Generic.List`1<System.Reflection.Module>::ToArray() */, { 8348, 276, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Type,System.MonoCustomAttrs/AttributeInfo>::.ctor(System.Int32) */, { 8372, 276, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Type,System.MonoCustomAttrs/AttributeInfo>::TryGetValue(TKey,TValue&) */, { 8355, 276, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Type,System.MonoCustomAttrs/AttributeInfo>::Add(TKey,TValue) */, { 337, -1, 58 } /* System.Collections.ObjectModel.ReadOnlyCollection`1<T> System.Array::AsReadOnly<System.Reflection.CustomAttributeData>(T[]) */, { 8347, 76, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Type,System.AttributeUsageAttribute>::.ctor() */, { 8372, 76, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Type,System.AttributeUsageAttribute>::TryGetValue(TKey,TValue&) */, { 8354, 76, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Type,System.AttributeUsageAttribute>::set_Item(TKey,TValue) */, { 389, -1, 291 } /* System.Int32 System.Array::LastIndexOf<System.Delegate>(T[],T) */, { 8268, 74, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<System.String,System.Object>::TryGetValue(TKey,TValue&) */, { 8277, 74, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.String,System.Object>::set_Item(TKey,TValue) */, { 8263, 74, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<System.String,System.Object>::.ctor() */, { 338, -1, 45 } /* System.Void System.Array::Resize<System.Char>(T[]&,System.Int32) */, { 7887, 108, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<System.Object,System.Threading.OSSpecificSynchronizationContext>::.ctor(System.Object,System.IntPtr) */, { 7886, 108, -1 } /* TValue System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Threading.OSSpecificSynchronizationContext>::GetValue(TKey,System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<TKey,TValue>) */, { 7978, -1, 292 } /* System.IntPtr System.Runtime.InteropServices.Marshal::GetFunctionPointerForDelegate<System.Threading.OSSpecificSynchronizationContext/InvocationEntryDelegate>(TDelegate) */, { 7878, 108, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Object,System.Threading.OSSpecificSynchronizationContext>::.ctor() */, { 625, 68, -1 } /* System.Void System.Func`2<System.Reflection.AssemblyName,System.Reflection.Assembly>::.ctor(System.Object,System.IntPtr) */, { 629, 69, -1 } /* System.Void System.Func`4<System.Reflection.Assembly,System.String,System.Boolean,System.Type>::.ctor(System.Object,System.IntPtr) */, { 482, -1, 45 } /* T[] System.Array::Empty<System.Char>() */, { 8502, 48, -1 } /* System.Void System.Collections.Generic.List`1<System.Type>::.ctor(System.Int32) */, { 8509, 48, -1 } /* T System.Collections.Generic.List`1<System.Type>::get_Item(System.Int32) */, { 8347, 82, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>::.ctor() */, { 8349, 83, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>::.ctor(System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8372, 83, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>::TryGetValue(TKey,TValue&) */, { 8354, 83, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>::set_Item(TKey,TValue) */, { 8355, 83, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>::Add(TKey,TValue) */, { 1926, 53, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.MethodInfo>::.ctor(System.Int32) */, { 1931, 53, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.MethodInfo>::Add(T) */, { 1926, 54, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.ConstructorInfo>::.ctor(System.Int32) */, { 1931, 54, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.ConstructorInfo>::Add(T) */, { 1926, 55, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.PropertyInfo>::.ctor(System.Int32) */, { 1931, 55, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.PropertyInfo>::Add(T) */, { 1926, 56, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.EventInfo>::.ctor(System.Int32) */, { 1931, 56, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.EventInfo>::Add(T) */, { 1926, 57, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.FieldInfo>::.ctor(System.Int32) */, { 1931, 57, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.FieldInfo>::Add(T) */, { 1926, 48, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Type>::.ctor(System.Int32) */, { 1931, 48, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Type>::Add(T) */, { 1928, 53, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Reflection.MethodInfo>::ToArray() */, { 1928, 54, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Reflection.ConstructorInfo>::ToArray() */, { 1928, 57, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Reflection.FieldInfo>::ToArray() */, { 1930, 53, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Reflection.MethodInfo>::get_Count() */, { 1927, 53, -1 } /* T System.RuntimeType/ListBuilder`1<System.Reflection.MethodInfo>::get_Item(System.Int32) */, { 1930, 54, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Reflection.ConstructorInfo>::get_Count() */, { 1927, 54, -1 } /* T System.RuntimeType/ListBuilder`1<System.Reflection.ConstructorInfo>::get_Item(System.Int32) */, { 1930, 55, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Reflection.PropertyInfo>::get_Count() */, { 1927, 55, -1 } /* T System.RuntimeType/ListBuilder`1<System.Reflection.PropertyInfo>::get_Item(System.Int32) */, { 1928, 55, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Reflection.PropertyInfo>::ToArray() */, { 1928, 56, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Reflection.EventInfo>::ToArray() */, { 1930, 56, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Reflection.EventInfo>::get_Count() */, { 1930, 57, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Reflection.FieldInfo>::get_Count() */, { 1928, 48, -1 } /* T[] System.RuntimeType/ListBuilder`1<System.Type>::ToArray() */, { 1930, 48, -1 } /* System.Int32 System.RuntimeType/ListBuilder`1<System.Type>::get_Count() */, { 1929, 53, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.MethodInfo>::CopyTo(System.Object[],System.Int32) */, { 1929, 54, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.ConstructorInfo>::CopyTo(System.Object[],System.Int32) */, { 1929, 55, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.PropertyInfo>::CopyTo(System.Object[],System.Int32) */, { 1929, 56, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.EventInfo>::CopyTo(System.Object[],System.Int32) */, { 1929, 57, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Reflection.FieldInfo>::CopyTo(System.Object[],System.Int32) */, { 1929, 48, -1 } /* System.Void System.RuntimeType/ListBuilder`1<System.Type>::CopyTo(System.Object[],System.Int32) */, { 376, -1, 72 } /* System.Int32 System.Array::BinarySearch<System.UInt64>(T[],T) */, { 383, -1, 12 } /* System.Int32 System.Array::IndexOf<System.String>(T[],T) */, { 8502, 53, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodInfo>::.ctor(System.Int32) */, { 8514, 53, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodInfo>::Add(T) */, { 8506, 53, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Reflection.MethodInfo>::get_Count() */, { 8520, 53, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodInfo>::CopyTo(T[]) */, { 8502, 279, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodBase>::.ctor(System.Int32) */, { 8514, 279, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodBase>::Add(T) */, { 8506, 279, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Reflection.MethodBase>::get_Count() */, { 8520, 279, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodBase>::CopyTo(T[]) */, { 1353, 123, -1 } /* System.Void System.EventHandler`1<System.Runtime.Serialization.SafeSerializationEventArgs>::Invoke(System.Object,TEventArgs) */, { 6053, 5, -1 } /* System.Runtime.CompilerServices.TaskAwaiter`1<TResult> System.Threading.Tasks.Task`1<System.Boolean>::GetAwaiter() */, { 7844, 5, -1 } /* TResult System.Runtime.CompilerServices.TaskAwaiter`1<System.Boolean>::GetResult() */, { 6170, -1, 5 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task::FromCancellation<System.Boolean>(System.Threading.CancellationToken) */, { 7794, 5, -1 } /* System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::Create() */, { 7795, 5, 293 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::Start<System.Threading.SemaphoreSlim/<WaitUntilCountOrTimeoutAsync>d__31>(!!0&) */, { 7798, 5, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::get_Task() */, { 6042, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::.ctor(System.Boolean,TResult,System.Threading.Tasks.TaskCreationOptions,System.Threading.CancellationToken) */, { 8501, 53, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodInfo>::.ctor() */, { 8536, 53, -1 } /* System.Void System.Collections.Generic.List`1<System.Reflection.MethodInfo>::Reverse() */, { 8524, 53, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Reflection.MethodInfo>::GetEnumerator() */, { 8547, 53, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodInfo>::get_Current() */, { 8545, 53, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodInfo>::MoveNext() */, { 8544, 53, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodInfo>::Dispose() */, { 8347, 124, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::.ctor() */, { 8360, 124, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Int32>::ContainsKey(TKey) */, { 8355, 124, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(TKey,TValue) */, { 8372, 124, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Int32>::TryGetValue(TKey,TValue&) */, { 395, -1, 44 } /* System.Void System.Array::Reverse<System.Byte>(T[],System.Int32,System.Int32) */, { 8501, 280, -1 } /* System.Void System.Collections.Generic.List`1<System.Diagnostics.StackFrame>::.ctor() */, { 8514, 280, -1 } /* System.Void System.Collections.Generic.List`1<System.Diagnostics.StackFrame>::Add(T) */, { 8541, 280, -1 } /* T[] System.Collections.Generic.List`1<System.Diagnostics.StackFrame>::ToArray() */, { 621, 92, -1 } /* System.Void System.Func`1<System.Threading.SemaphoreSlim>::.ctor(System.Object,System.IntPtr) */, { 5639, -1, 92 } /* T System.Threading.LazyInitializer::EnsureInitialized<System.Threading.SemaphoreSlim>(T&,System.Func`1<T>) */, { 625, 9, -1 } /* System.Void System.Func`2<System.Object,System.Int32>::.ctor(System.Object,System.IntPtr) */, { 6053, 0, -1 } /* System.Runtime.CompilerServices.TaskAwaiter`1<TResult> System.Threading.Tasks.Task`1<System.Int32>::GetAwaiter() */, { 7844, 0, -1 } /* TResult System.Runtime.CompilerServices.TaskAwaiter`1<System.Int32>::GetResult() */, { 613, 93, -1 } /* System.Void System.Action`2<System.Threading.Tasks.Task,System.Object>::.ctor(System.Object,System.IntPtr) */, { 526, -1, 282 } /* System.Tuple`2<T1,T2> System.Tuple::Create<System.IO.Stream,System.IO.Stream/ReadWriteTask>(T1,T2) */, { 4592, 12, -1 } /* System.Void System.IO.SearchResultHandler`1<System.String>::.ctor() */, { 8354, 117, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Threading.Tasks.Task>::set_Item(TKey,TValue) */, { 8371, 117, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Threading.Tasks.Task>::Remove(TKey) */, { 543, 281, -1 } /* System.Void System.Tuple`3<System.Threading.Tasks.Task,System.Threading.Tasks.Task,System.Threading.Tasks.TaskContinuation>::.ctor(T1,T2,T3) */, { 6061, 100, -1 } /* System.Void System.Threading.Tasks.Shared`1<System.Threading.CancellationTokenRegistration>::.ctor(T) */, { 540, 281, -1 } /* T1 System.Tuple`3<System.Threading.Tasks.Task,System.Threading.Tasks.Task,System.Threading.Tasks.TaskContinuation>::get_Item1() */, { 541, 281, -1 } /* T2 System.Tuple`3<System.Threading.Tasks.Task,System.Threading.Tasks.Task,System.Threading.Tasks.TaskContinuation>::get_Item2() */, { 542, 281, -1 } /* T3 System.Tuple`3<System.Threading.Tasks.Task,System.Threading.Tasks.Task,System.Threading.Tasks.TaskContinuation>::get_Item3() */, { 5639, -1, 118 } /* T System.Threading.LazyInitializer::EnsureInitialized<System.Threading.Tasks.Task/ContingentProperties>(T&,System.Func`1<T>) */, { 8231, 41, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::.ctor(System.Collections.Generic.IList`1<T>) */, { 8534, 4, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Threading.Tasks.Task>::RemoveAll(System.Predicate`1<T>) */, { 8501, 4, -1 } /* System.Void System.Collections.Generic.List`1<System.Threading.Tasks.Task>::.ctor() */, { 8514, 4, -1 } /* System.Void System.Collections.Generic.List`1<System.Threading.Tasks.Task>::Add(T) */, { 8524, 4, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Threading.Tasks.Task>::GetEnumerator() */, { 8547, 4, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Threading.Tasks.Task>::get_Current() */, { 8545, 4, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Threading.Tasks.Task>::MoveNext() */, { 8544, 4, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Threading.Tasks.Task>::Dispose() */, { 8347, 117, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Threading.Tasks.Task>::.ctor() */, { 621, 118, -1 } /* System.Void System.Func`1<System.Threading.Tasks.Task/ContingentProperties>::.ctor(System.Object,System.IntPtr) */, { 641, 4, -1 } /* System.Void System.Predicate`1<System.Threading.Tasks.Task>::.ctor(System.Object,System.IntPtr) */, { 8232, 41, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::get_Count() */, { 8233, 41, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::get_Item(System.Int32) */, { 8524, 41, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::GetEnumerator() */, { 8547, 41, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::get_Current() */, { 8236, 40, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.ObjectModel.ReadOnlyCollection`1<System.Exception>::GetEnumerator() */, { 8545, 41, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::MoveNext() */, { 8544, 41, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::Dispose() */, { 8502, 41, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::.ctor(System.Int32) */, { 8514, 41, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::Add(T) */, { 8516, 41, -1 } /* System.Void System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 8509, 41, -1 } /* T System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::get_Item(System.Int32) */, { 8506, 41, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Runtime.ExceptionServices.ExceptionDispatchInfo>::get_Count() */, { 7878, 120, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Threading.Tasks.TaskScheduler,System.Object>::.ctor() */, { 7883, 120, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Threading.Tasks.TaskScheduler,System.Object>::Add(TKey,TValue) */, { 1353, 121, -1 } /* System.Void System.EventHandler`1<System.Threading.Tasks.UnobservedTaskExceptionEventArgs>::Invoke(System.Object,TEventArgs) */, { 2824, 5, -1 } /* System.Boolean System.Nullable`1<System.Boolean>::get_HasValue() */, { 2823, 5, -1 } /* System.Void System.Nullable`1<System.Boolean>::.ctor(T) */, { 2825, 5, -1 } /* T System.Nullable`1<System.Boolean>::get_Value() */, { 625, 94, -1 } /* System.Void System.Func`2<System.Object,System.String>::.ctor(System.Object,System.IntPtr) */, { 5904, 110, -1 } /* T[] System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Threading.ThreadPoolWorkQueue/WorkStealingQueue>::get_Current() */, { 5903, 110, -1 } /* System.Void System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Threading.ThreadPoolWorkQueue/WorkStealingQueue>::.ctor(System.Int32) */, { 5905, 110, -1 } /* System.Int32 System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Threading.ThreadPoolWorkQueue/WorkStealingQueue>::Add(T) */, { 5906, 110, -1 } /* System.Void System.Threading.ThreadPoolWorkQueue/SparseArray`1<System.Threading.ThreadPoolWorkQueue/WorkStealingQueue>::Remove(T) */, { 8501, 62, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::.ctor() */, { 8514, 62, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::Add(T) */, { 8506, 62, -1 } /* System.Int32 System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::get_Count() */, { 8516, 62, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 633, 62, -1 } /* System.Void System.Comparison`1<System.TimeZoneInfo/AdjustmentRule>::.ctor(System.Object,System.IntPtr) */, { 8540, 62, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::Sort(System.Comparison`1<T>) */, { 8541, 62, -1 } /* T[] System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::ToArray() */, { 8236, 63, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.ObjectModel.ReadOnlyCollection`1<System.TimeZoneInfo>::GetEnumerator() */, { 8501, 63, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo>::.ctor() */, { 8514, 63, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo>::Add(T) */, { 8506, 63, -1 } /* System.Int32 System.Collections.Generic.List`1<System.TimeZoneInfo>::get_Count() */, { 8516, 63, -1 } /* System.Void System.Collections.Generic.List`1<System.TimeZoneInfo>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 8231, 63, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.TimeZoneInfo>::.ctor(System.Collections.Generic.IList`1<T>) */, { 8532, 62, -1 } /* System.Boolean System.Collections.Generic.List`1<System.TimeZoneInfo/AdjustmentRule>::Remove(T) */, { 8352, 65, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Int32,System.TimeType>::get_Count() */, { 8353, 65, -1 } /* TValue System.Collections.Generic.Dictionary`2<System.Int32,System.TimeType>::get_Item(TKey) */, { 8509, 66, -1 } /* T System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>>::get_Item(System.Int32) */, { 8318, 3, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>::get_Key() */, { 8319, 3, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>::get_Value() */, { 8506, 66, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>>::get_Count() */, { 8347, 64, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.String>::.ctor() */, { 8355, 64, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.String>::Add(TKey,TValue) */, { 8348, 65, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.TimeType>::.ctor(System.Int32) */, { 8353, 64, -1 } /* TValue System.Collections.Generic.Dictionary`2<System.Int32,System.String>::get_Item(TKey) */, { 8355, 65, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.TimeType>::Add(TKey,TValue) */, { 8502, 66, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>>::.ctor(System.Int32) */, { 8317, 3, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>::.ctor(TKey,TValue) */, { 8514, 66, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.TimeType>>::Add(T) */, { 8524, 79, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.TypeIdentifier>::GetEnumerator() */, { 8547, 79, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.TypeIdentifier>::get_Current() */, { 8545, 79, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.TypeIdentifier>::MoveNext() */, { 8544, 79, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.TypeIdentifier>::Dispose() */, { 8509, 80, -1 } /* T System.Collections.Generic.List`1<System.TypeSpec>::get_Item(System.Int32) */, { 8506, 80, -1 } /* System.Int32 System.Collections.Generic.List`1<System.TypeSpec>::get_Count() */, { 8524, 81, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.ModifierSpec>::GetEnumerator() */, { 8547, 81, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.ModifierSpec>::get_Current() */, { 8545, 81, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.ModifierSpec>::MoveNext() */, { 8544, 81, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.ModifierSpec>::Dispose() */, { 626, 68, -1 } /* TResult System.Func`2<System.Reflection.AssemblyName,System.Reflection.Assembly>::Invoke(T) */, { 630, 69, -1 } /* TResult System.Func`4<System.Reflection.Assembly,System.String,System.Boolean,System.Type>::Invoke(T1,T2,T3) */, { 8501, 79, -1 } /* System.Void System.Collections.Generic.List`1<System.TypeIdentifier>::.ctor() */, { 8514, 79, -1 } /* System.Void System.Collections.Generic.List`1<System.TypeIdentifier>::Add(T) */, { 8501, 81, -1 } /* System.Void System.Collections.Generic.List`1<System.ModifierSpec>::.ctor() */, { 8514, 81, -1 } /* System.Void System.Collections.Generic.List`1<System.ModifierSpec>::Add(T) */, { 8501, 80, -1 } /* System.Void System.Collections.Generic.List`1<System.TypeSpec>::.ctor() */, { 8514, 80, -1 } /* System.Void System.Collections.Generic.List`1<System.TypeSpec>::Add(T) */, { 8501, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::.ctor() */, { 8514, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Add(T) */, { 8541, 0, -1 } /* T[] System.Collections.Generic.List`1<System.Int32>::ToArray() */, { 6054, 4, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult> System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>::ConfigureAwait(System.Boolean) */, { 7846, 4, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult> System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Threading.Tasks.Task>::GetAwaiter() */, { 7848, 4, -1 } /* System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.Task>::get_IsCompleted() */, { 7797, 5, 294 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.Task>,System.Threading.SemaphoreSlim/<WaitUntilCountOrTimeoutAsync>d__31>(!!0&,!!1&) */, { 7850, 4, -1 } /* TResult System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.Task>::GetResult() */, { 6054, 5, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult> System.Threading.Tasks.Task`1<System.Boolean>::ConfigureAwait(System.Boolean) */, { 7846, 5, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult> System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Boolean>::GetAwaiter() */, { 7848, 5, -1 } /* System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Boolean>::get_IsCompleted() */, { 7797, 5, 295 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Boolean>,System.Threading.SemaphoreSlim/<WaitUntilCountOrTimeoutAsync>d__31>(!!0&,!!1&) */, { 7850, 5, -1 } /* TResult System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Boolean>::GetResult() */, { 7800, 5, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::SetException(System.Exception) */, { 7799, 5, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::SetResult(TResult) */, { 7796, 5, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine) */, { 6040, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::.ctor() */, { 6045, 5, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Boolean>::TrySetResult(TResult) */, { 8517, 12, -1 } /* System.Void System.Collections.Generic.List`1<System.String>::Clear() */, { 529, 282, -1 } /* T1 System.Tuple`2<System.IO.Stream,System.IO.Stream/ReadWriteTask>::get_Item1() */, { 530, 282, -1 } /* T2 System.Tuple`2<System.IO.Stream,System.IO.Stream/ReadWriteTask>::get_Item2() */, { 6043, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::.ctor(System.Func`2<System.Object,TResult>,System.Object,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions) */, { 621, 91, -1 } /* System.Void System.Func`1<System.Threading.ManualResetEvent>::.ctor(System.Object,System.IntPtr) */, { 5639, -1, 91 } /* T System.Threading.LazyInitializer::EnsureInitialized<System.Threading.ManualResetEvent>(T&,System.Func`1<T>) */, { 6040, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::.ctor() */, { 6050, 119, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::TrySetCanceled(System.Threading.CancellationToken) */, { 6045, 119, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::TrySetResult(TResult) */, { 6040, 4, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>::.ctor() */, { 6045, 4, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>::TrySetResult(TResult) */, { 552, 283, -1 } /* T1 System.Tuple`4<System.IO.TextReader,System.Char[],System.Int32,System.Int32>::get_Item1() */, { 553, 283, -1 } /* T2 System.Tuple`4<System.IO.TextReader,System.Char[],System.Int32,System.Int32>::get_Item2() */, { 554, 283, -1 } /* T3 System.Tuple`4<System.IO.TextReader,System.Char[],System.Int32,System.Int32>::get_Item3() */, { 555, 283, -1 } /* T4 System.Tuple`4<System.IO.TextReader,System.Char[],System.Int32,System.Int32>::get_Item4() */, { 529, 284, -1 } /* T1 System.Tuple`2<System.IO.TextWriter,System.Char>::get_Item1() */, { 530, 284, -1 } /* T2 System.Tuple`2<System.IO.TextWriter,System.Char>::get_Item2() */, { 529, 285, -1 } /* T1 System.Tuple`2<System.IO.TextWriter,System.String>::get_Item1() */, { 530, 285, -1 } /* T2 System.Tuple`2<System.IO.TextWriter,System.String>::get_Item2() */, { 552, 286, -1 } /* T1 System.Tuple`4<System.IO.TextWriter,System.Char[],System.Int32,System.Int32>::get_Item1() */, { 553, 286, -1 } /* T2 System.Tuple`4<System.IO.TextWriter,System.Char[],System.Int32,System.Int32>::get_Item2() */, { 554, 286, -1 } /* T3 System.Tuple`4<System.IO.TextWriter,System.Char[],System.Int32,System.Int32>::get_Item3() */, { 555, 286, -1 } /* T4 System.Tuple`4<System.IO.TextWriter,System.Char[],System.Int32,System.Int32>::get_Item4() */, { 8502, 111, -1 } /* System.Void System.Collections.Generic.List`1<System.Threading.Timer>::.ctor(System.Int32) */, { 8514, 111, -1 } /* System.Void System.Collections.Generic.List`1<System.Threading.Timer>::Add(T) */, { 8506, 111, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Threading.Timer>::get_Count() */, { 8509, 111, -1 } /* T System.Collections.Generic.List`1<System.Threading.Timer>::get_Item(System.Int32) */, { 8517, 111, -1 } /* System.Void System.Collections.Generic.List`1<System.Threading.Timer>::Clear() */, { 8504, 111, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Threading.Timer>::get_Capacity() */, { 8505, 111, -1 } /* System.Void System.Collections.Generic.List`1<System.Threading.Timer>::set_Capacity(System.Int32) */, { 394, -1, 44 } /* System.Void System.Array::Reverse<System.Byte>(!!0[]) */, { 8318, 181, -1 } /* !0 System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>::get_Key() */, { 8319, 181, -1 } /* !1 System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>::get_Value() */, { 8317, 181, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>::.ctor(!0,!1) */, { 8348, 180, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.UriParser>::.ctor(System.Int32) */, { 8354, 180, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.UriParser>::set_Item(!0,!1) */, { 8372, 180, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.UriParser>::TryGetValue(!0,!1&) */, { 8352, 180, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.String,System.UriParser>::get_Count() */, { 8372, 64, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.String>::TryGetValue(!0,!1&) */, { 622, 5, -1 } /* !0 System.Func`1<System.Boolean>::Invoke() */, { 606, 5, -1 } /* System.Void System.Action`1<System.Boolean>::Invoke(!0) */, { 606, 12, -1 } /* System.Void System.Action`1<System.String>::Invoke(!0) */, { 606, 216, -1 } /* System.Void System.Action`1<UnityEngine.AsyncOperation>::Invoke(!0) */, { 8501, 48, -1 } /* System.Void System.Collections.Generic.List`1<System.Type>::.ctor() */, { 8514, 48, -1 } /* System.Void System.Collections.Generic.List`1<System.Type>::Add(!0) */, { 8541, 48, -1 } /* !0[] System.Collections.Generic.List`1<System.Type>::ToArray() */, { 9452, -1, 296 } /* T UnityEngine.AttributeHelperEngine::GetCustomAttributeOfType<UnityEngine.DefaultExecutionOrder>(System.Type) */, { 9081, -1, 238 } /* Unity.Collections.NativeArray`1<T> Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility::ConvertExistingDataToNativeArray<UnityEngine.Plane>(System.Void*,System.Int32,Unity.Collections.Allocator) */, { 9081, -1, 239 } /* Unity.Collections.NativeArray`1<T> Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility::ConvertExistingDataToNativeArray<UnityEngine.Rendering.BatchVisibility>(System.Void*,System.Int32,Unity.Collections.Allocator) */, { 9081, -1, 0 } /* Unity.Collections.NativeArray`1<T> Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility::ConvertExistingDataToNativeArray<System.Int32>(System.Void*,System.Int32,Unity.Collections.Allocator) */, { 8509, 208, -1 } /* !0 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Item(System.Int32) */, { 8506, 208, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Count() */, { 8501, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor() */, { 8514, 229, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::Add(!0) */, { 8501, 229, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::.ctor() */, { 8509, 229, -1 } /* !0 System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::get_Item(System.Int32) */, { 8506, 229, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::get_Count() */, { 641, 229, -1 } /* System.Void System.Predicate`1<UnityEngine.Events.BaseInvokableCall>::.ctor(System.Object,System.IntPtr) */, { 8534, 229, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::RemoveAll(System.Predicate`1<!0>) */, { 8517, 229, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::Clear() */, { 8516, 229, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Events.BaseInvokableCall>::AddRange(System.Collections.Generic.IEnumerable`1<!0>) */, { 9081, -1, 245 } /* Unity.Collections.NativeArray`1<T> Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility::ConvertExistingDataToNativeArray<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Void*,System.Int32,Unity.Collections.Allocator) */, { 606, 222, -1 } /* System.Void System.Action`1<UnityEngine.Profiling.Memory.Experimental.MetaData>::Invoke(!0) */, { 614, 220, -1 } /* System.Void System.Action`2<System.String,System.Boolean>::Invoke(!0,!1) */, { 9081, -1, 44 } /* Unity.Collections.NativeArray`1<T> Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility::ConvertExistingDataToNativeArray<System.Byte>(System.Void*,System.Int32,Unity.Collections.Allocator) */, { 618, 221, -1 } /* System.Void System.Action`3<System.String,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture>::Invoke(!0,!1,!2) */, { 9647, 60, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Single>::.ctor(UnityEngine.Object,System.Reflection.MethodInfo,T) */, { 9647, 0, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Int32>::.ctor(UnityEngine.Object,System.Reflection.MethodInfo,T) */, { 9647, 12, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.String>::.ctor(UnityEngine.Object,System.Reflection.MethodInfo,T) */, { 9647, 5, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Boolean>::.ctor(UnityEngine.Object,System.Reflection.MethodInfo,T) */, { 8501, 228, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Events.PersistentCall>::.ctor() */, { 8524, 228, -1 } /* System.Collections.Generic.List`1/Enumerator<!0> System.Collections.Generic.List`1<UnityEngine.Events.PersistentCall>::GetEnumerator() */, { 8547, 228, -1 } /* !0 System.Collections.Generic.List`1/Enumerator<UnityEngine.Events.PersistentCall>::get_Current() */, { 8545, 228, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<UnityEngine.Events.PersistentCall>::MoveNext() */, { 8544, 228, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<UnityEngine.Events.PersistentCall>::Dispose() */, { 9512, -1, 297 } /* T UnityEngine.ScriptableObject::CreateInstance<UnityEngine.Networking.PlayerConnection.PlayerConnection>() */, { 625, 278, -1 } /* System.Void System.Func`2<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers,System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 8983, -1, 235 } /* System.Boolean System.Linq.Enumerable::Any<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>(System.Collections.Generic.IEnumerable`1<!!0>,System.Func`2<!!0,System.Boolean>) */, { 9695, 234, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::AddListener(UnityEngine.Events.UnityAction`1<T0>) */, { 8524, 0, -1 } /* System.Collections.Generic.List`1/Enumerator<!0> System.Collections.Generic.List`1<System.Int32>::GetEnumerator() */, { 8547, 0, -1 } /* !0 System.Collections.Generic.List`1/Enumerator<System.Int32>::get_Current() */, { 9691, 0, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Int32>::Invoke(T0) */, { 8545, 0, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Int32>::MoveNext() */, { 8544, 0, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Int32>::Dispose() */, { 9695, 0, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Int32>::AddListener(UnityEngine.Events.UnityAction`1<T0>) */, { 9696, 0, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Int32>::RemoveListener(UnityEngine.Events.UnityAction`1<T0>) */, { 9690, 234, -1 } /* System.Void UnityEngine.Events.UnityAction`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::.ctor(System.Object,System.IntPtr) */, { 9700, 0, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Int32>::Invoke(T0) */, { 8532, 0, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Int32>::Remove(!0) */, { 8979, -1, 235 } /* System.Collections.Generic.IEnumerable`1<!!0> System.Linq.Enumerable::Where<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>(System.Collections.Generic.IEnumerable`1<!!0>,System.Func`2<!!0,System.Boolean>) */, { 8982, -1, 235 } /* System.Boolean System.Linq.Enumerable::Any<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>(System.Collections.Generic.IEnumerable`1<!!0>) */, { 9700, 234, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::Invoke(T0) */, { 8981, -1, 235 } /* !!0 System.Linq.Enumerable::SingleOrDefault<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>(System.Collections.Generic.IEnumerable`1<!!0>,System.Func`2<!!0,System.Boolean>) */, { 8514, 235, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>::Add(!0) */, { 9696, 234, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::RemoveListener(UnityEngine.Events.UnityAction`1<T0>) */, { 8532, 235, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>::Remove(!0) */, { 8501, 235, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>::.ctor() */, { 614, 204, -1 } /* System.Void System.Action`2<UnityEngine.ReflectionProbe,UnityEngine.ReflectionProbe/ReflectionProbeEvent>::Invoke(!0,!1) */, { 606, 205, -1 } /* System.Void System.Action`1<UnityEngine.Cubemap>::Invoke(!0) */, { 338, -1, 298 } /* System.Void System.Array::Resize<UnityEngine.Camera>(!!0[]&,System.Int32) */, { 9702, 231, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.LoadSceneMode>::Invoke(T0,T1) */, { 9691, 232, -1 } /* System.Void UnityEngine.Events.UnityAction`1<UnityEngine.SceneManagement.Scene>::Invoke(T0) */, { 9702, 233, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.Scene>::Invoke(T0,T1) */, { 605, 6, -1 } /* System.Void System.Action`1<UnityEngine.U2D.SpriteAtlas>::.ctor(System.Object,System.IntPtr) */, { 614, 219, -1 } /* System.Void System.Action`2<System.String,System.Action`1<UnityEngine.U2D.SpriteAtlas>>::Invoke(!0,!1) */, { 606, 6, -1 } /* System.Void System.Action`1<UnityEngine.U2D.SpriteAtlas>::Invoke(!0) */, { 8318, 217, -1 } /* !0 System.Collections.Generic.KeyValuePair`2<System.Byte[],System.Text.Encoding>::get_Key() */, { 8319, 217, -1 } /* !1 System.Collections.Generic.KeyValuePair`2<System.Byte[],System.Text.Encoding>::get_Value() */, { 8502, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor(System.Int32) */, { 8514, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Add(!0) */, { 8516, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::AddRange(System.Collections.Generic.IEnumerable`1<!0>) */, { 8517, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Clear() */, { 8509, 218, -1 } /* !0 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Item(System.Int32) */, { 8532, 218, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Remove(!0) */, { 8506, 218, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Count() */, { 9694, 0, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<System.Int32>::.ctor() */, { 9694, 234, -1 } /* System.Void UnityEngine.Events.UnityEvent`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::.ctor() */, { 8317, 217, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.Byte[],System.Text.Encoding>::.ctor(!0,!1) */, { 606, 252, -1 } /* System.Void System.Action`1<UnityEngine.SocialPlatforms.IAchievementDescription[]>::Invoke(!0) */, { 614, 251, -1 } /* System.Void System.Action`2<System.Boolean,System.String>::Invoke(!0,!1) */, { 606, 253, -1 } /* System.Void System.Action`1<UnityEngine.SocialPlatforms.IAchievement[]>::Invoke(!0) */, { 606, 254, -1 } /* System.Void System.Action`1<UnityEngine.SocialPlatforms.IScore[]>::Invoke(!0) */, { 613, 251, -1 } /* System.Void System.Action`2<System.Boolean,System.String>::.ctor(System.Object,System.IntPtr) */, { 8514, 256, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.SocialPlatforms.GameCenter.GcLeaderboard>::Add(!0) */, { 8524, 256, -1 } /* System.Collections.Generic.List`1/Enumerator<!0> System.Collections.Generic.List`1<UnityEngine.SocialPlatforms.GameCenter.GcLeaderboard>::GetEnumerator() */, { 8547, 256, -1 } /* !0 System.Collections.Generic.List`1/Enumerator<UnityEngine.SocialPlatforms.GameCenter.GcLeaderboard>::get_Current() */, { 8545, 256, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<UnityEngine.SocialPlatforms.GameCenter.GcLeaderboard>::MoveNext() */, { 8544, 256, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<UnityEngine.SocialPlatforms.GameCenter.GcLeaderboard>::Dispose() */, { 606, 255, -1 } /* System.Void System.Action`1<UnityEngine.SocialPlatforms.IUserProfile[]>::Invoke(!0) */, { 8501, 256, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.SocialPlatforms.GameCenter.GcLeaderboard>::.ctor() */, { 379, -1, 72 } /* System.Int32 System.Array::BinarySearch<System.UInt64>(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 385, -1, 0 } /* System.Int32 System.Array::IndexOf<System.Int32>(T[],T,System.Int32,System.Int32) */, { 385, -1, 208 } /* System.Int32 System.Array::IndexOf<UnityEngine.BeforeRenderHelper/OrderBlock>(T[],T,System.Int32,System.Int32) */, { 385, -1, 218 } /* System.Int32 System.Array::IndexOf<UnityEngine.UnitySynchronizationContext/WorkRequest>(T[],T,System.Int32,System.Int32) */, { 385, -1, 299 } /* System.Int32 System.Array::IndexOf<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T[],T,System.Int32,System.Int32) */, { 484, -1, 0 } /* System.Int32 System.Array::IndexOfImpl<System.Int32>(T[],T,System.Int32,System.Int32) */, { 484, -1, 208 } /* System.Int32 System.Array::IndexOfImpl<UnityEngine.BeforeRenderHelper/OrderBlock>(T[],T,System.Int32,System.Int32) */, { 484, -1, 218 } /* System.Int32 System.Array::IndexOfImpl<UnityEngine.UnitySynchronizationContext/WorkRequest>(T[],T,System.Int32,System.Int32) */, { 484, -1, 299 } /* System.Int32 System.Array::IndexOfImpl<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T[],T,System.Int32,System.Int32) */, { 436, -1, 239 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.Rendering.BatchVisibility>(T) */, { 436, -1, 5 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Boolean>(T) */, { 436, -1, 44 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Byte>(T) */, { 436, -1, 100 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Threading.CancellationTokenRegistration>(T) */, { 436, -1, 45 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Char>(T) */, { 436, -1, 300 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.ContactPoint>(T) */, { 436, -1, 85 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Reflection.CustomAttributeNamedArgument>(T) */, { 436, -1, 84 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Reflection.CustomAttributeTypedArgument>(T) */, { 436, -1, 46 } /* System.Void System.Array::InternalArray__ICollection_Add<System.DateTime>(T) */, { 436, -1, 47 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Decimal>(T) */, { 436, -1, 301 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.DictionaryEntry>(T) */, { 436, -1, 49 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Double>(T) */, { 436, -1, 302 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Runtime.CompilerServices.Ephemeron>(T) */, { 436, -1, 303 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(T) */, { 436, -1, 304 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(T) */, { 436, -1, 51 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Int16>(T) */, { 436, -1, 0 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Int32>(T) */, { 436, -1, 305 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Int32Enum>(T) */, { 436, -1, 52 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Int64>(T) */, { 436, -1, 306 } /* System.Void System.Array::InternalArray__ICollection_Add<System.IntPtr>(T) */, { 436, -1, 307 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Globalization.InternalCodePageDataItem>(T) */, { 436, -1, 308 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Globalization.InternalEncodingDataItem>(T) */, { 436, -1, 309 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.Keyframe>(T) */, { 436, -1, 245 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(T) */, { 436, -1, 273 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Reflection.ParameterModifier>(T) */, { 436, -1, 238 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.Plane>(T) */, { 436, -1, 241 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.Playables.PlayableBinding>(T) */, { 436, -1, 310 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.LowLevel.PlayerLoopSystem>(T) */, { 436, -1, 311 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.RaycastHit>(T) */, { 436, -1, 312 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Resources.ResourceLocator>(T) */, { 436, -1, 59 } /* System.Void System.Array::InternalArray__ICollection_Add<System.SByte>(T) */, { 436, -1, 60 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Single>(T) */, { 436, -1, 61 } /* System.Void System.Array::InternalArray__ICollection_Add<System.TimeSpan>(T) */, { 436, -1, 70 } /* System.Void System.Array::InternalArray__ICollection_Add<System.UInt16>(T) */, { 436, -1, 71 } /* System.Void System.Array::InternalArray__ICollection_Add<System.UInt32>(T) */, { 436, -1, 72 } /* System.Void System.Array::InternalArray__ICollection_Add<System.UInt64>(T) */, { 436, -1, 208 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.BeforeRenderHelper/OrderBlock>(T) */, { 436, -1, 313 } /* System.Void System.Array::InternalArray__ICollection_Add<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(T) */, { 436, -1, 314 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Hashtable/bucket>(T) */, { 436, -1, 315 } /* System.Void System.Array::InternalArray__ICollection_Add<System.ParameterizedStrings/FormatParam>(T) */, { 436, -1, 316 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.SendMouseEvents/HitInfo>(T) */, { 436, -1, 218 } /* System.Void System.Array::InternalArray__ICollection_Add<UnityEngine.UnitySynchronizationContext/WorkRequest>(T) */, { 436, -1, 317 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(T) */, { 436, -1, 318 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(T) */, { 436, -1, 319 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(T) */, { 436, -1, 320 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(T) */, { 436, -1, 299 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T) */, { 436, -1, 321 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(T) */, { 436, -1, 322 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(T) */, { 436, -1, 323 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(T) */, { 436, -1, 324 } /* System.Void System.Array::InternalArray__ICollection_Add<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(T) */, { 438, -1, 239 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.Rendering.BatchVisibility>(T) */, { 438, -1, 5 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Boolean>(T) */, { 438, -1, 44 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Byte>(T) */, { 438, -1, 100 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Threading.CancellationTokenRegistration>(T) */, { 438, -1, 45 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Char>(T) */, { 438, -1, 300 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.ContactPoint>(T) */, { 438, -1, 85 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Reflection.CustomAttributeNamedArgument>(T) */, { 438, -1, 84 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Reflection.CustomAttributeTypedArgument>(T) */, { 438, -1, 46 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.DateTime>(T) */, { 438, -1, 47 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Decimal>(T) */, { 438, -1, 301 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.DictionaryEntry>(T) */, { 438, -1, 49 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Double>(T) */, { 438, -1, 302 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Runtime.CompilerServices.Ephemeron>(T) */, { 438, -1, 303 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(T) */, { 438, -1, 304 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(T) */, { 438, -1, 51 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Int16>(T) */, { 438, -1, 0 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Int32>(T) */, { 438, -1, 305 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Int32Enum>(T) */, { 438, -1, 52 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Int64>(T) */, { 438, -1, 306 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.IntPtr>(T) */, { 438, -1, 307 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Globalization.InternalCodePageDataItem>(T) */, { 438, -1, 308 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Globalization.InternalEncodingDataItem>(T) */, { 438, -1, 309 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.Keyframe>(T) */, { 438, -1, 245 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(T) */, { 438, -1, 273 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Reflection.ParameterModifier>(T) */, { 438, -1, 238 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.Plane>(T) */, { 438, -1, 241 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.Playables.PlayableBinding>(T) */, { 438, -1, 310 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.LowLevel.PlayerLoopSystem>(T) */, { 438, -1, 311 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.RaycastHit>(T) */, { 438, -1, 312 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Resources.ResourceLocator>(T) */, { 438, -1, 59 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.SByte>(T) */, { 438, -1, 60 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Single>(T) */, { 438, -1, 61 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.TimeSpan>(T) */, { 438, -1, 70 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.UInt16>(T) */, { 438, -1, 71 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.UInt32>(T) */, { 438, -1, 72 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.UInt64>(T) */, { 438, -1, 208 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.BeforeRenderHelper/OrderBlock>(T) */, { 438, -1, 313 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(T) */, { 438, -1, 314 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Hashtable/bucket>(T) */, { 438, -1, 315 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.ParameterizedStrings/FormatParam>(T) */, { 438, -1, 316 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.SendMouseEvents/HitInfo>(T) */, { 438, -1, 218 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<UnityEngine.UnitySynchronizationContext/WorkRequest>(T) */, { 438, -1, 317 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(T) */, { 438, -1, 318 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(T) */, { 438, -1, 319 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(T) */, { 438, -1, 320 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(T) */, { 438, -1, 299 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T) */, { 438, -1, 321 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(T) */, { 438, -1, 322 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(T) */, { 438, -1, 323 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(T) */, { 438, -1, 324 } /* System.Boolean System.Array::InternalArray__ICollection_Contains<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(T) */, { 439, -1, 239 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.Rendering.BatchVisibility>(T[],System.Int32) */, { 439, -1, 5 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Boolean>(T[],System.Int32) */, { 439, -1, 44 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Byte>(T[],System.Int32) */, { 439, -1, 100 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Threading.CancellationTokenRegistration>(T[],System.Int32) */, { 439, -1, 45 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Char>(T[],System.Int32) */, { 439, -1, 300 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.ContactPoint>(T[],System.Int32) */, { 439, -1, 85 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Reflection.CustomAttributeNamedArgument>(T[],System.Int32) */, { 439, -1, 84 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Reflection.CustomAttributeTypedArgument>(T[],System.Int32) */, { 439, -1, 46 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.DateTime>(T[],System.Int32) */, { 439, -1, 47 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Decimal>(T[],System.Int32) */, { 439, -1, 301 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.DictionaryEntry>(T[],System.Int32) */, { 439, -1, 49 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Double>(T[],System.Int32) */, { 439, -1, 302 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Runtime.CompilerServices.Ephemeron>(T[],System.Int32) */, { 439, -1, 303 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(T[],System.Int32) */, { 439, -1, 304 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(T[],System.Int32) */, { 439, -1, 51 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Int16>(T[],System.Int32) */, { 439, -1, 0 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Int32>(T[],System.Int32) */, { 439, -1, 305 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Int32Enum>(T[],System.Int32) */, { 439, -1, 52 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Int64>(T[],System.Int32) */, { 439, -1, 306 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.IntPtr>(T[],System.Int32) */, { 439, -1, 307 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Globalization.InternalCodePageDataItem>(T[],System.Int32) */, { 439, -1, 308 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Globalization.InternalEncodingDataItem>(T[],System.Int32) */, { 439, -1, 309 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.Keyframe>(T[],System.Int32) */, { 439, -1, 245 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(T[],System.Int32) */, { 439, -1, 273 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Reflection.ParameterModifier>(T[],System.Int32) */, { 439, -1, 238 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.Plane>(T[],System.Int32) */, { 439, -1, 241 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.Playables.PlayableBinding>(T[],System.Int32) */, { 439, -1, 310 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.LowLevel.PlayerLoopSystem>(T[],System.Int32) */, { 439, -1, 311 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.RaycastHit>(T[],System.Int32) */, { 439, -1, 312 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Resources.ResourceLocator>(T[],System.Int32) */, { 439, -1, 59 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.SByte>(T[],System.Int32) */, { 439, -1, 60 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Single>(T[],System.Int32) */, { 439, -1, 61 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.TimeSpan>(T[],System.Int32) */, { 439, -1, 70 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.UInt16>(T[],System.Int32) */, { 439, -1, 71 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.UInt32>(T[],System.Int32) */, { 439, -1, 72 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.UInt64>(T[],System.Int32) */, { 439, -1, 208 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.BeforeRenderHelper/OrderBlock>(T[],System.Int32) */, { 439, -1, 313 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(T[],System.Int32) */, { 439, -1, 314 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Hashtable/bucket>(T[],System.Int32) */, { 439, -1, 315 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.ParameterizedStrings/FormatParam>(T[],System.Int32) */, { 439, -1, 316 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.SendMouseEvents/HitInfo>(T[],System.Int32) */, { 439, -1, 218 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<UnityEngine.UnitySynchronizationContext/WorkRequest>(T[],System.Int32) */, { 439, -1, 317 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(T[],System.Int32) */, { 439, -1, 318 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(T[],System.Int32) */, { 439, -1, 319 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(T[],System.Int32) */, { 439, -1, 320 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(T[],System.Int32) */, { 439, -1, 299 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T[],System.Int32) */, { 439, -1, 321 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(T[],System.Int32) */, { 439, -1, 322 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(T[],System.Int32) */, { 439, -1, 323 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(T[],System.Int32) */, { 439, -1, 324 } /* System.Void System.Array::InternalArray__ICollection_CopyTo<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(T[],System.Int32) */, { 437, -1, 239 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.Rendering.BatchVisibility>(T) */, { 437, -1, 5 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Boolean>(T) */, { 437, -1, 44 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Byte>(T) */, { 437, -1, 100 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Threading.CancellationTokenRegistration>(T) */, { 437, -1, 45 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Char>(T) */, { 437, -1, 300 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.ContactPoint>(T) */, { 437, -1, 85 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Reflection.CustomAttributeNamedArgument>(T) */, { 437, -1, 84 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Reflection.CustomAttributeTypedArgument>(T) */, { 437, -1, 46 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.DateTime>(T) */, { 437, -1, 47 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Decimal>(T) */, { 437, -1, 301 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.DictionaryEntry>(T) */, { 437, -1, 49 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Double>(T) */, { 437, -1, 302 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Runtime.CompilerServices.Ephemeron>(T) */, { 437, -1, 303 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(T) */, { 437, -1, 304 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(T) */, { 437, -1, 51 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Int16>(T) */, { 437, -1, 0 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Int32>(T) */, { 437, -1, 305 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Int32Enum>(T) */, { 437, -1, 52 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Int64>(T) */, { 437, -1, 306 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.IntPtr>(T) */, { 437, -1, 307 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Globalization.InternalCodePageDataItem>(T) */, { 437, -1, 308 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Globalization.InternalEncodingDataItem>(T) */, { 437, -1, 309 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.Keyframe>(T) */, { 437, -1, 245 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(T) */, { 437, -1, 273 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Reflection.ParameterModifier>(T) */, { 437, -1, 238 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.Plane>(T) */, { 437, -1, 241 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.Playables.PlayableBinding>(T) */, { 437, -1, 310 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.LowLevel.PlayerLoopSystem>(T) */, { 437, -1, 311 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.RaycastHit>(T) */, { 437, -1, 312 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Resources.ResourceLocator>(T) */, { 437, -1, 59 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.SByte>(T) */, { 437, -1, 60 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Single>(T) */, { 437, -1, 61 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.TimeSpan>(T) */, { 437, -1, 70 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.UInt16>(T) */, { 437, -1, 71 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.UInt32>(T) */, { 437, -1, 72 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.UInt64>(T) */, { 437, -1, 208 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.BeforeRenderHelper/OrderBlock>(T) */, { 437, -1, 313 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(T) */, { 437, -1, 314 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Hashtable/bucket>(T) */, { 437, -1, 315 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.ParameterizedStrings/FormatParam>(T) */, { 437, -1, 316 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.SendMouseEvents/HitInfo>(T) */, { 437, -1, 218 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<UnityEngine.UnitySynchronizationContext/WorkRequest>(T) */, { 437, -1, 317 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(T) */, { 437, -1, 318 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(T) */, { 437, -1, 319 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(T) */, { 437, -1, 320 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(T) */, { 437, -1, 299 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T) */, { 437, -1, 321 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(T) */, { 437, -1, 322 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(T) */, { 437, -1, 323 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(T) */, { 437, -1, 324 } /* System.Boolean System.Array::InternalArray__ICollection_Remove<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(T) */, { 434, -1, 239 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.Rendering.BatchVisibility>() */, { 434, -1, 5 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Boolean>() */, { 434, -1, 44 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Byte>() */, { 434, -1, 100 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Threading.CancellationTokenRegistration>() */, { 434, -1, 45 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Char>() */, { 434, -1, 300 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.ContactPoint>() */, { 434, -1, 85 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Reflection.CustomAttributeNamedArgument>() */, { 434, -1, 84 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Reflection.CustomAttributeTypedArgument>() */, { 434, -1, 46 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.DateTime>() */, { 434, -1, 47 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Decimal>() */, { 434, -1, 301 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.DictionaryEntry>() */, { 434, -1, 49 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Double>() */, { 434, -1, 302 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Runtime.CompilerServices.Ephemeron>() */, { 434, -1, 303 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>() */, { 434, -1, 304 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>() */, { 434, -1, 51 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Int16>() */, { 434, -1, 0 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Int32>() */, { 434, -1, 305 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Int32Enum>() */, { 434, -1, 52 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Int64>() */, { 434, -1, 306 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.IntPtr>() */, { 434, -1, 307 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Globalization.InternalCodePageDataItem>() */, { 434, -1, 308 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Globalization.InternalEncodingDataItem>() */, { 434, -1, 309 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.Keyframe>() */, { 434, -1, 245 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.Experimental.GlobalIllumination.LightDataGI>() */, { 434, -1, 273 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Reflection.ParameterModifier>() */, { 434, -1, 238 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.Plane>() */, { 434, -1, 241 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.Playables.PlayableBinding>() */, { 434, -1, 310 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.LowLevel.PlayerLoopSystem>() */, { 434, -1, 311 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.RaycastHit>() */, { 434, -1, 312 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Resources.ResourceLocator>() */, { 434, -1, 59 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.SByte>() */, { 434, -1, 60 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Single>() */, { 434, -1, 61 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.TimeSpan>() */, { 434, -1, 70 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.UInt16>() */, { 434, -1, 71 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.UInt32>() */, { 434, -1, 72 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.UInt64>() */, { 434, -1, 208 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.BeforeRenderHelper/OrderBlock>() */, { 434, -1, 313 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<Mono.Globalization.Unicode.CodePointIndexer/TableRange>() */, { 434, -1, 314 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Hashtable/bucket>() */, { 434, -1, 315 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.ParameterizedStrings/FormatParam>() */, { 434, -1, 316 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.SendMouseEvents/HitInfo>() */, { 434, -1, 218 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>() */, { 434, -1, 317 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>() */, { 434, -1, 318 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>() */, { 434, -1, 319 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>() */, { 434, -1, 320 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>() */, { 434, -1, 299 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>() */, { 434, -1, 321 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>() */, { 434, -1, 322 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>() */, { 434, -1, 323 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>() */, { 434, -1, 324 } /* System.Collections.Generic.IEnumerator`1<T> System.Array::InternalArray__IEnumerable_GetEnumerator<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>() */, { 440, -1, 239 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.Rendering.BatchVisibility>(System.Int32) */, { 440, -1, 5 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Boolean>(System.Int32) */, { 440, -1, 44 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Byte>(System.Int32) */, { 440, -1, 100 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Threading.CancellationTokenRegistration>(System.Int32) */, { 440, -1, 45 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Char>(System.Int32) */, { 440, -1, 300 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.ContactPoint>(System.Int32) */, { 440, -1, 85 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Reflection.CustomAttributeNamedArgument>(System.Int32) */, { 440, -1, 84 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Reflection.CustomAttributeTypedArgument>(System.Int32) */, { 440, -1, 46 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.DateTime>(System.Int32) */, { 440, -1, 47 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Decimal>(System.Int32) */, { 440, -1, 301 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.DictionaryEntry>(System.Int32) */, { 440, -1, 49 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Double>(System.Int32) */, { 440, -1, 302 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Runtime.CompilerServices.Ephemeron>(System.Int32) */, { 440, -1, 303 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(System.Int32) */, { 440, -1, 304 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(System.Int32) */, { 440, -1, 51 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Int16>(System.Int32) */, { 440, -1, 0 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Int32>(System.Int32) */, { 440, -1, 305 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Int32Enum>(System.Int32) */, { 440, -1, 52 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Int64>(System.Int32) */, { 440, -1, 306 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.IntPtr>(System.Int32) */, { 440, -1, 307 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Globalization.InternalCodePageDataItem>(System.Int32) */, { 440, -1, 308 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Globalization.InternalEncodingDataItem>(System.Int32) */, { 440, -1, 309 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.Keyframe>(System.Int32) */, { 440, -1, 245 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Int32) */, { 440, -1, 273 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Reflection.ParameterModifier>(System.Int32) */, { 440, -1, 238 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.Plane>(System.Int32) */, { 440, -1, 241 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.Playables.PlayableBinding>(System.Int32) */, { 440, -1, 310 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.LowLevel.PlayerLoopSystem>(System.Int32) */, { 440, -1, 311 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.RaycastHit>(System.Int32) */, { 440, -1, 312 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Resources.ResourceLocator>(System.Int32) */, { 440, -1, 59 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.SByte>(System.Int32) */, { 440, -1, 60 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Single>(System.Int32) */, { 440, -1, 61 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.TimeSpan>(System.Int32) */, { 440, -1, 70 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.UInt16>(System.Int32) */, { 440, -1, 71 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.UInt32>(System.Int32) */, { 440, -1, 72 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.UInt64>(System.Int32) */, { 440, -1, 208 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.BeforeRenderHelper/OrderBlock>(System.Int32) */, { 440, -1, 313 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(System.Int32) */, { 440, -1, 314 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Hashtable/bucket>(System.Int32) */, { 440, -1, 315 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.ParameterizedStrings/FormatParam>(System.Int32) */, { 440, -1, 316 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.SendMouseEvents/HitInfo>(System.Int32) */, { 440, -1, 218 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<UnityEngine.UnitySynchronizationContext/WorkRequest>(System.Int32) */, { 440, -1, 317 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(System.Int32) */, { 440, -1, 318 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(System.Int32) */, { 440, -1, 319 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(System.Int32) */, { 440, -1, 320 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(System.Int32) */, { 440, -1, 299 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(System.Int32) */, { 440, -1, 321 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(System.Int32) */, { 440, -1, 322 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(System.Int32) */, { 440, -1, 323 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(System.Int32) */, { 440, -1, 324 } /* T System.Array::InternalArray__IReadOnlyList_get_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(System.Int32) */, { 444, -1, 239 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.Rendering.BatchVisibility>(T) */, { 444, -1, 5 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Boolean>(T) */, { 444, -1, 44 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Byte>(T) */, { 444, -1, 100 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Threading.CancellationTokenRegistration>(T) */, { 444, -1, 45 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Char>(T) */, { 444, -1, 300 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.ContactPoint>(T) */, { 444, -1, 85 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Reflection.CustomAttributeNamedArgument>(T) */, { 444, -1, 84 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Reflection.CustomAttributeTypedArgument>(T) */, { 444, -1, 46 } /* System.Int32 System.Array::InternalArray__IndexOf<System.DateTime>(T) */, { 444, -1, 47 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Decimal>(T) */, { 444, -1, 301 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.DictionaryEntry>(T) */, { 444, -1, 49 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Double>(T) */, { 444, -1, 302 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Runtime.CompilerServices.Ephemeron>(T) */, { 444, -1, 303 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(T) */, { 444, -1, 304 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(T) */, { 444, -1, 51 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Int16>(T) */, { 444, -1, 0 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Int32>(T) */, { 444, -1, 305 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Int32Enum>(T) */, { 444, -1, 52 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Int64>(T) */, { 444, -1, 306 } /* System.Int32 System.Array::InternalArray__IndexOf<System.IntPtr>(T) */, { 444, -1, 307 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Globalization.InternalCodePageDataItem>(T) */, { 444, -1, 308 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Globalization.InternalEncodingDataItem>(T) */, { 444, -1, 309 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.Keyframe>(T) */, { 444, -1, 245 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(T) */, { 444, -1, 273 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Reflection.ParameterModifier>(T) */, { 444, -1, 238 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.Plane>(T) */, { 444, -1, 241 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.Playables.PlayableBinding>(T) */, { 444, -1, 310 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.LowLevel.PlayerLoopSystem>(T) */, { 444, -1, 311 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.RaycastHit>(T) */, { 444, -1, 312 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Resources.ResourceLocator>(T) */, { 444, -1, 59 } /* System.Int32 System.Array::InternalArray__IndexOf<System.SByte>(T) */, { 444, -1, 60 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Single>(T) */, { 444, -1, 61 } /* System.Int32 System.Array::InternalArray__IndexOf<System.TimeSpan>(T) */, { 444, -1, 70 } /* System.Int32 System.Array::InternalArray__IndexOf<System.UInt16>(T) */, { 444, -1, 71 } /* System.Int32 System.Array::InternalArray__IndexOf<System.UInt32>(T) */, { 444, -1, 72 } /* System.Int32 System.Array::InternalArray__IndexOf<System.UInt64>(T) */, { 444, -1, 208 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.BeforeRenderHelper/OrderBlock>(T) */, { 444, -1, 313 } /* System.Int32 System.Array::InternalArray__IndexOf<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(T) */, { 444, -1, 314 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Hashtable/bucket>(T) */, { 444, -1, 315 } /* System.Int32 System.Array::InternalArray__IndexOf<System.ParameterizedStrings/FormatParam>(T) */, { 444, -1, 316 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.SendMouseEvents/HitInfo>(T) */, { 444, -1, 218 } /* System.Int32 System.Array::InternalArray__IndexOf<UnityEngine.UnitySynchronizationContext/WorkRequest>(T) */, { 444, -1, 317 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(T) */, { 444, -1, 318 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(T) */, { 444, -1, 319 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(T) */, { 444, -1, 320 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(T) */, { 444, -1, 299 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T) */, { 444, -1, 321 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(T) */, { 444, -1, 322 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(T) */, { 444, -1, 323 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(T) */, { 444, -1, 324 } /* System.Int32 System.Array::InternalArray__IndexOf<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(T) */, { 442, -1, 239 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.Rendering.BatchVisibility>(System.Int32,T) */, { 442, -1, 5 } /* System.Void System.Array::InternalArray__Insert<System.Boolean>(System.Int32,T) */, { 442, -1, 44 } /* System.Void System.Array::InternalArray__Insert<System.Byte>(System.Int32,T) */, { 442, -1, 100 } /* System.Void System.Array::InternalArray__Insert<System.Threading.CancellationTokenRegistration>(System.Int32,T) */, { 442, -1, 45 } /* System.Void System.Array::InternalArray__Insert<System.Char>(System.Int32,T) */, { 442, -1, 300 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.ContactPoint>(System.Int32,T) */, { 442, -1, 85 } /* System.Void System.Array::InternalArray__Insert<System.Reflection.CustomAttributeNamedArgument>(System.Int32,T) */, { 442, -1, 84 } /* System.Void System.Array::InternalArray__Insert<System.Reflection.CustomAttributeTypedArgument>(System.Int32,T) */, { 442, -1, 46 } /* System.Void System.Array::InternalArray__Insert<System.DateTime>(System.Int32,T) */, { 442, -1, 47 } /* System.Void System.Array::InternalArray__Insert<System.Decimal>(System.Int32,T) */, { 442, -1, 301 } /* System.Void System.Array::InternalArray__Insert<System.Collections.DictionaryEntry>(System.Int32,T) */, { 442, -1, 49 } /* System.Void System.Array::InternalArray__Insert<System.Double>(System.Int32,T) */, { 442, -1, 302 } /* System.Void System.Array::InternalArray__Insert<System.Runtime.CompilerServices.Ephemeron>(System.Int32,T) */, { 442, -1, 303 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(System.Int32,T) */, { 442, -1, 304 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(System.Int32,T) */, { 442, -1, 51 } /* System.Void System.Array::InternalArray__Insert<System.Int16>(System.Int32,T) */, { 442, -1, 0 } /* System.Void System.Array::InternalArray__Insert<System.Int32>(System.Int32,T) */, { 442, -1, 305 } /* System.Void System.Array::InternalArray__Insert<System.Int32Enum>(System.Int32,T) */, { 442, -1, 52 } /* System.Void System.Array::InternalArray__Insert<System.Int64>(System.Int32,T) */, { 442, -1, 306 } /* System.Void System.Array::InternalArray__Insert<System.IntPtr>(System.Int32,T) */, { 442, -1, 307 } /* System.Void System.Array::InternalArray__Insert<System.Globalization.InternalCodePageDataItem>(System.Int32,T) */, { 442, -1, 308 } /* System.Void System.Array::InternalArray__Insert<System.Globalization.InternalEncodingDataItem>(System.Int32,T) */, { 442, -1, 309 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.Keyframe>(System.Int32,T) */, { 442, -1, 245 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Int32,T) */, { 442, -1, 273 } /* System.Void System.Array::InternalArray__Insert<System.Reflection.ParameterModifier>(System.Int32,T) */, { 442, -1, 238 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.Plane>(System.Int32,T) */, { 442, -1, 241 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.Playables.PlayableBinding>(System.Int32,T) */, { 442, -1, 310 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.LowLevel.PlayerLoopSystem>(System.Int32,T) */, { 442, -1, 311 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.RaycastHit>(System.Int32,T) */, { 442, -1, 312 } /* System.Void System.Array::InternalArray__Insert<System.Resources.ResourceLocator>(System.Int32,T) */, { 442, -1, 59 } /* System.Void System.Array::InternalArray__Insert<System.SByte>(System.Int32,T) */, { 442, -1, 60 } /* System.Void System.Array::InternalArray__Insert<System.Single>(System.Int32,T) */, { 442, -1, 61 } /* System.Void System.Array::InternalArray__Insert<System.TimeSpan>(System.Int32,T) */, { 442, -1, 70 } /* System.Void System.Array::InternalArray__Insert<System.UInt16>(System.Int32,T) */, { 442, -1, 71 } /* System.Void System.Array::InternalArray__Insert<System.UInt32>(System.Int32,T) */, { 442, -1, 72 } /* System.Void System.Array::InternalArray__Insert<System.UInt64>(System.Int32,T) */, { 442, -1, 208 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.BeforeRenderHelper/OrderBlock>(System.Int32,T) */, { 442, -1, 313 } /* System.Void System.Array::InternalArray__Insert<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(System.Int32,T) */, { 442, -1, 314 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Hashtable/bucket>(System.Int32,T) */, { 442, -1, 315 } /* System.Void System.Array::InternalArray__Insert<System.ParameterizedStrings/FormatParam>(System.Int32,T) */, { 442, -1, 316 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.SendMouseEvents/HitInfo>(System.Int32,T) */, { 442, -1, 218 } /* System.Void System.Array::InternalArray__Insert<UnityEngine.UnitySynchronizationContext/WorkRequest>(System.Int32,T) */, { 442, -1, 317 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(System.Int32,T) */, { 442, -1, 318 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(System.Int32,T) */, { 442, -1, 319 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(System.Int32,T) */, { 442, -1, 320 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(System.Int32,T) */, { 442, -1, 299 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(System.Int32,T) */, { 442, -1, 321 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(System.Int32,T) */, { 442, -1, 322 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(System.Int32,T) */, { 442, -1, 323 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(System.Int32,T) */, { 442, -1, 324 } /* System.Void System.Array::InternalArray__Insert<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(System.Int32,T) */, { 445, -1, 239 } /* T System.Array::InternalArray__get_Item<UnityEngine.Rendering.BatchVisibility>(System.Int32) */, { 445, -1, 5 } /* T System.Array::InternalArray__get_Item<System.Boolean>(System.Int32) */, { 445, -1, 44 } /* T System.Array::InternalArray__get_Item<System.Byte>(System.Int32) */, { 445, -1, 100 } /* T System.Array::InternalArray__get_Item<System.Threading.CancellationTokenRegistration>(System.Int32) */, { 445, -1, 45 } /* T System.Array::InternalArray__get_Item<System.Char>(System.Int32) */, { 445, -1, 300 } /* T System.Array::InternalArray__get_Item<UnityEngine.ContactPoint>(System.Int32) */, { 445, -1, 85 } /* T System.Array::InternalArray__get_Item<System.Reflection.CustomAttributeNamedArgument>(System.Int32) */, { 445, -1, 84 } /* T System.Array::InternalArray__get_Item<System.Reflection.CustomAttributeTypedArgument>(System.Int32) */, { 445, -1, 46 } /* T System.Array::InternalArray__get_Item<System.DateTime>(System.Int32) */, { 445, -1, 47 } /* T System.Array::InternalArray__get_Item<System.Decimal>(System.Int32) */, { 445, -1, 301 } /* T System.Array::InternalArray__get_Item<System.Collections.DictionaryEntry>(System.Int32) */, { 445, -1, 49 } /* T System.Array::InternalArray__get_Item<System.Double>(System.Int32) */, { 445, -1, 302 } /* T System.Array::InternalArray__get_Item<System.Runtime.CompilerServices.Ephemeron>(System.Int32) */, { 445, -1, 303 } /* T System.Array::InternalArray__get_Item<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(System.Int32) */, { 445, -1, 304 } /* T System.Array::InternalArray__get_Item<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(System.Int32) */, { 445, -1, 51 } /* T System.Array::InternalArray__get_Item<System.Int16>(System.Int32) */, { 445, -1, 0 } /* T System.Array::InternalArray__get_Item<System.Int32>(System.Int32) */, { 445, -1, 305 } /* T System.Array::InternalArray__get_Item<System.Int32Enum>(System.Int32) */, { 445, -1, 52 } /* T System.Array::InternalArray__get_Item<System.Int64>(System.Int32) */, { 445, -1, 306 } /* T System.Array::InternalArray__get_Item<System.IntPtr>(System.Int32) */, { 445, -1, 307 } /* T System.Array::InternalArray__get_Item<System.Globalization.InternalCodePageDataItem>(System.Int32) */, { 445, -1, 308 } /* T System.Array::InternalArray__get_Item<System.Globalization.InternalEncodingDataItem>(System.Int32) */, { 445, -1, 309 } /* T System.Array::InternalArray__get_Item<UnityEngine.Keyframe>(System.Int32) */, { 445, -1, 245 } /* T System.Array::InternalArray__get_Item<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Int32) */, { 445, -1, 273 } /* T System.Array::InternalArray__get_Item<System.Reflection.ParameterModifier>(System.Int32) */, { 445, -1, 238 } /* T System.Array::InternalArray__get_Item<UnityEngine.Plane>(System.Int32) */, { 445, -1, 241 } /* T System.Array::InternalArray__get_Item<UnityEngine.Playables.PlayableBinding>(System.Int32) */, { 445, -1, 310 } /* T System.Array::InternalArray__get_Item<UnityEngine.LowLevel.PlayerLoopSystem>(System.Int32) */, { 445, -1, 311 } /* T System.Array::InternalArray__get_Item<UnityEngine.RaycastHit>(System.Int32) */, { 445, -1, 312 } /* T System.Array::InternalArray__get_Item<System.Resources.ResourceLocator>(System.Int32) */, { 445, -1, 59 } /* T System.Array::InternalArray__get_Item<System.SByte>(System.Int32) */, { 445, -1, 60 } /* T System.Array::InternalArray__get_Item<System.Single>(System.Int32) */, { 445, -1, 61 } /* T System.Array::InternalArray__get_Item<System.TimeSpan>(System.Int32) */, { 445, -1, 70 } /* T System.Array::InternalArray__get_Item<System.UInt16>(System.Int32) */, { 445, -1, 71 } /* T System.Array::InternalArray__get_Item<System.UInt32>(System.Int32) */, { 445, -1, 72 } /* T System.Array::InternalArray__get_Item<System.UInt64>(System.Int32) */, { 445, -1, 208 } /* T System.Array::InternalArray__get_Item<UnityEngine.BeforeRenderHelper/OrderBlock>(System.Int32) */, { 445, -1, 313 } /* T System.Array::InternalArray__get_Item<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(System.Int32) */, { 445, -1, 314 } /* T System.Array::InternalArray__get_Item<System.Collections.Hashtable/bucket>(System.Int32) */, { 445, -1, 315 } /* T System.Array::InternalArray__get_Item<System.ParameterizedStrings/FormatParam>(System.Int32) */, { 445, -1, 316 } /* T System.Array::InternalArray__get_Item<UnityEngine.SendMouseEvents/HitInfo>(System.Int32) */, { 445, -1, 218 } /* T System.Array::InternalArray__get_Item<UnityEngine.UnitySynchronizationContext/WorkRequest>(System.Int32) */, { 445, -1, 317 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(System.Int32) */, { 445, -1, 318 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(System.Int32) */, { 445, -1, 319 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(System.Int32) */, { 445, -1, 320 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(System.Int32) */, { 445, -1, 299 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(System.Int32) */, { 445, -1, 321 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(System.Int32) */, { 445, -1, 322 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(System.Int32) */, { 445, -1, 323 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(System.Int32) */, { 445, -1, 324 } /* T System.Array::InternalArray__get_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(System.Int32) */, { 446, -1, 239 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.Rendering.BatchVisibility>(System.Int32,T) */, { 446, -1, 5 } /* System.Void System.Array::InternalArray__set_Item<System.Boolean>(System.Int32,T) */, { 446, -1, 44 } /* System.Void System.Array::InternalArray__set_Item<System.Byte>(System.Int32,T) */, { 446, -1, 100 } /* System.Void System.Array::InternalArray__set_Item<System.Threading.CancellationTokenRegistration>(System.Int32,T) */, { 446, -1, 45 } /* System.Void System.Array::InternalArray__set_Item<System.Char>(System.Int32,T) */, { 446, -1, 300 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.ContactPoint>(System.Int32,T) */, { 446, -1, 85 } /* System.Void System.Array::InternalArray__set_Item<System.Reflection.CustomAttributeNamedArgument>(System.Int32,T) */, { 446, -1, 84 } /* System.Void System.Array::InternalArray__set_Item<System.Reflection.CustomAttributeTypedArgument>(System.Int32,T) */, { 446, -1, 46 } /* System.Void System.Array::InternalArray__set_Item<System.DateTime>(System.Int32,T) */, { 446, -1, 47 } /* System.Void System.Array::InternalArray__set_Item<System.Decimal>(System.Int32,T) */, { 446, -1, 301 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.DictionaryEntry>(System.Int32,T) */, { 446, -1, 49 } /* System.Void System.Array::InternalArray__set_Item<System.Double>(System.Int32,T) */, { 446, -1, 302 } /* System.Void System.Array::InternalArray__set_Item<System.Runtime.CompilerServices.Ephemeron>(System.Int32,T) */, { 446, -1, 303 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>(System.Int32,T) */, { 446, -1, 304 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>(System.Int32,T) */, { 446, -1, 51 } /* System.Void System.Array::InternalArray__set_Item<System.Int16>(System.Int32,T) */, { 446, -1, 0 } /* System.Void System.Array::InternalArray__set_Item<System.Int32>(System.Int32,T) */, { 446, -1, 305 } /* System.Void System.Array::InternalArray__set_Item<System.Int32Enum>(System.Int32,T) */, { 446, -1, 52 } /* System.Void System.Array::InternalArray__set_Item<System.Int64>(System.Int32,T) */, { 446, -1, 306 } /* System.Void System.Array::InternalArray__set_Item<System.IntPtr>(System.Int32,T) */, { 446, -1, 307 } /* System.Void System.Array::InternalArray__set_Item<System.Globalization.InternalCodePageDataItem>(System.Int32,T) */, { 446, -1, 308 } /* System.Void System.Array::InternalArray__set_Item<System.Globalization.InternalEncodingDataItem>(System.Int32,T) */, { 446, -1, 309 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.Keyframe>(System.Int32,T) */, { 446, -1, 245 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Int32,T) */, { 446, -1, 273 } /* System.Void System.Array::InternalArray__set_Item<System.Reflection.ParameterModifier>(System.Int32,T) */, { 446, -1, 238 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.Plane>(System.Int32,T) */, { 446, -1, 241 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.Playables.PlayableBinding>(System.Int32,T) */, { 446, -1, 310 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.LowLevel.PlayerLoopSystem>(System.Int32,T) */, { 446, -1, 311 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.RaycastHit>(System.Int32,T) */, { 446, -1, 312 } /* System.Void System.Array::InternalArray__set_Item<System.Resources.ResourceLocator>(System.Int32,T) */, { 446, -1, 59 } /* System.Void System.Array::InternalArray__set_Item<System.SByte>(System.Int32,T) */, { 446, -1, 60 } /* System.Void System.Array::InternalArray__set_Item<System.Single>(System.Int32,T) */, { 446, -1, 61 } /* System.Void System.Array::InternalArray__set_Item<System.TimeSpan>(System.Int32,T) */, { 446, -1, 70 } /* System.Void System.Array::InternalArray__set_Item<System.UInt16>(System.Int32,T) */, { 446, -1, 71 } /* System.Void System.Array::InternalArray__set_Item<System.UInt32>(System.Int32,T) */, { 446, -1, 72 } /* System.Void System.Array::InternalArray__set_Item<System.UInt64>(System.Int32,T) */, { 446, -1, 208 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.BeforeRenderHelper/OrderBlock>(System.Int32,T) */, { 446, -1, 313 } /* System.Void System.Array::InternalArray__set_Item<Mono.Globalization.Unicode.CodePointIndexer/TableRange>(System.Int32,T) */, { 446, -1, 314 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Hashtable/bucket>(System.Int32,T) */, { 446, -1, 315 } /* System.Void System.Array::InternalArray__set_Item<System.ParameterizedStrings/FormatParam>(System.Int32,T) */, { 446, -1, 316 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.SendMouseEvents/HitInfo>(System.Int32,T) */, { 446, -1, 218 } /* System.Void System.Array::InternalArray__set_Item<UnityEngine.UnitySynchronizationContext/WorkRequest>(System.Int32,T) */, { 446, -1, 317 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>(System.Int32,T) */, { 446, -1, 318 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>(System.Int32,T) */, { 446, -1, 319 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>(System.Int32,T) */, { 446, -1, 320 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>(System.Int32,T) */, { 446, -1, 299 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(System.Int32,T) */, { 446, -1, 321 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>(System.Int32,T) */, { 446, -1, 322 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>(System.Int32,T) */, { 446, -1, 323 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>(System.Int32,T) */, { 446, -1, 324 } /* System.Void System.Array::InternalArray__set_Item<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>(System.Int32,T) */, { 395, -1, 0 } /* System.Void System.Array::Reverse<System.Int32>(T[],System.Int32,System.Int32) */, { 395, -1, 208 } /* System.Void System.Array::Reverse<UnityEngine.BeforeRenderHelper/OrderBlock>(T[],System.Int32,System.Int32) */, { 395, -1, 218 } /* System.Void System.Array::Reverse<UnityEngine.UnitySynchronizationContext/WorkRequest>(T[],System.Int32,System.Int32) */, { 395, -1, 299 } /* System.Void System.Array::Reverse<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T[],System.Int32,System.Int32) */, { 415, -1, 325 } /* System.Void System.Array::Sort<System.UInt64,System.Object>(TKey[],TValue[],System.Collections.Generic.IComparer`1<TKey>) */, { 411, -1, 0 } /* System.Void System.Array::Sort<System.Int32>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 72 } /* System.Void System.Array::Sort<System.UInt64>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 208 } /* System.Void System.Array::Sort<UnityEngine.BeforeRenderHelper/OrderBlock>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 218 } /* System.Void System.Array::Sort<UnityEngine.UnitySynchronizationContext/WorkRequest>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 299 } /* System.Void System.Array::Sort<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 416, -1, 325 } /* System.Void System.Array::Sort<System.UInt64,System.Object>(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 487, -1, 0 } /* T System.Array::UnsafeLoad<System.Int32>(T[],System.Int32) */, { 487, -1, 208 } /* T System.Array::UnsafeLoad<UnityEngine.BeforeRenderHelper/OrderBlock>(T[],System.Int32) */, { 487, -1, 218 } /* T System.Array::UnsafeLoad<UnityEngine.UnitySynchronizationContext/WorkRequest>(T[],System.Int32) */, { 487, -1, 299 } /* T System.Array::UnsafeLoad<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(T[],System.Int32) */, { 9622, -1, 5 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<System.Boolean>(System.Object) */, { 9622, -1, 0 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<System.Int32>(System.Object) */, { 9622, -1, 60 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<System.Single>(System.Object) */, { 333, -1, 0 } /* System.Void System.ThrowHelper::IfNullAndNullsAreIllegalThenThrow<System.Int32>(System.Object,System.ExceptionArgument) */, { 333, -1, 208 } /* System.Void System.ThrowHelper::IfNullAndNullsAreIllegalThenThrow<UnityEngine.BeforeRenderHelper/OrderBlock>(System.Object,System.ExceptionArgument) */, { 333, -1, 218 } /* System.Void System.ThrowHelper::IfNullAndNullsAreIllegalThenThrow<UnityEngine.UnitySynchronizationContext/WorkRequest>(System.Object,System.ExceptionArgument) */, { 333, -1, 299 } /* System.Void System.ThrowHelper::IfNullAndNullsAreIllegalThenThrow<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>(System.Object,System.ExceptionArgument) */, { 9083, -1, 239 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<UnityEngine.Rendering.BatchVisibility>(System.Void*,System.Int32) */, { 9083, -1, 44 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<System.Byte>(System.Void*,System.Int32) */, { 9083, -1, 0 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<System.Int32>(System.Void*,System.Int32) */, { 9083, -1, 245 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Void*,System.Int32) */, { 9083, -1, 238 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<UnityEngine.Plane>(System.Void*,System.Int32) */, { 9084, -1, 239 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<UnityEngine.Rendering.BatchVisibility>(System.Void*,System.Int32,T) */, { 9084, -1, 44 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<System.Byte>(System.Void*,System.Int32,T) */, { 9084, -1, 0 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<System.Int32>(System.Void*,System.Int32,T) */, { 9084, -1, 245 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<UnityEngine.Experimental.GlobalIllumination.LightDataGI>(System.Void*,System.Int32,T) */, { 9084, -1, 238 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<UnityEngine.Plane>(System.Void*,System.Int32,T) */, { 7797, 5, 326 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Object>,System.Threading.SemaphoreSlim/<WaitUntilCountOrTimeoutAsync>d__31>(TAwaiter&,TStateMachine&) */, { 6056, 5, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Boolean>::.cctor() */, { 6057, 5, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Boolean>::.ctor() */, { 6058, 5, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task`1/<>c<System.Boolean>::<.cctor>b__64_0(System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>) */, { 6046, 4, -1 } /* TResult System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>::get_Result() */, { 6056, 0, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Int32>::.cctor() */, { 6057, 0, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Int32>::.ctor() */, { 6058, 0, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task`1/<>c<System.Int32>::<.cctor>b__64_0(System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>) */, { 6056, 119, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Threading.Tasks.VoidTaskResult>::.cctor() */, { 6057, 119, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<System.Threading.Tasks.VoidTaskResult>::.ctor() */, { 6058, 119, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task`1/<>c<System.Threading.Tasks.VoidTaskResult>::<.cctor>b__64_0(System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>) */, { 605, 5, -1 } /* System.Void System.Action`1<System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 607, 5, -1 } /* System.IAsyncResult System.Action`1<System.Boolean>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 608, 5, -1 } /* System.Void System.Action`1<System.Boolean>::EndInvoke(System.IAsyncResult) */, { 613, 327, -1 } /* System.Void System.Action`2<System.Boolean,System.Object>::.ctor(System.Object,System.IntPtr) */, { 614, 327, -1 } /* System.Void System.Action`2<System.Boolean,System.Object>::Invoke(T1,T2) */, { 615, 327, -1 } /* System.IAsyncResult System.Action`2<System.Boolean,System.Object>::BeginInvoke(T1,T2,System.AsyncCallback,System.Object) */, { 616, 327, -1 } /* System.Void System.Action`2<System.Boolean,System.Object>::EndInvoke(System.IAsyncResult) */, { 613, 328, -1 } /* System.Void System.Action`2<System.Object,System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 614, 328, -1 } /* System.Void System.Action`2<System.Object,System.Boolean>::Invoke(T1,T2) */, { 615, 328, -1 } /* System.IAsyncResult System.Action`2<System.Object,System.Boolean>::BeginInvoke(T1,T2,System.AsyncCallback,System.Object) */, { 616, 328, -1 } /* System.Void System.Action`2<System.Object,System.Boolean>::EndInvoke(System.IAsyncResult) */, { 613, 329, -1 } /* System.Void System.Action`2<System.Object,System.Int32Enum>::.ctor(System.Object,System.IntPtr) */, { 614, 329, -1 } /* System.Void System.Action`2<System.Object,System.Int32Enum>::Invoke(T1,T2) */, { 615, 329, -1 } /* System.IAsyncResult System.Action`2<System.Object,System.Int32Enum>::BeginInvoke(T1,T2,System.AsyncCallback,System.Object) */, { 616, 329, -1 } /* System.Void System.Action`2<System.Object,System.Int32Enum>::EndInvoke(System.IAsyncResult) */, { 617, 330, -1 } /* System.Void System.Action`3<System.Object,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture>::.ctor(System.Object,System.IntPtr) */, { 618, 330, -1 } /* System.Void System.Action`3<System.Object,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture>::Invoke(T1,T2,T3) */, { 619, 330, -1 } /* System.IAsyncResult System.Action`3<System.Object,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture>::BeginInvoke(T1,T2,T3,System.AsyncCallback,System.Object) */, { 620, 330, -1 } /* System.Void System.Action`3<System.Object,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture>::EndInvoke(System.IAsyncResult) */, { 8323, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8324, 0, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Int32>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8325, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 0, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Int32>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8327, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8328, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::Swap(T[],System.Int32,System.Int32) */, { 8329, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8330, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 0, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Int32>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8333, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8334, 0, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Int32>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8323, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8324, 72, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.UInt64>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8325, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 72, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.UInt64>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8327, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8328, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::Swap(T[],System.Int32,System.Int32) */, { 8329, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8330, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 72, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.UInt64>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8333, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8334, 72, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.UInt64>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8323, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8324, 208, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8325, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 208, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8327, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8328, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Swap(T[],System.Int32,System.Int32) */, { 8329, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8330, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 208, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8333, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8334, 208, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.BeforeRenderHelper/OrderBlock>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8323, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8324, 218, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8325, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 218, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8327, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8328, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Swap(T[],System.Int32,System.Int32) */, { 8329, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8330, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 218, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8333, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8334, 218, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8323, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8324, 299, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8325, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 299, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8327, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8328, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Swap(T[],System.Int32,System.Int32) */, { 8329, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8330, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 299, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8333, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8334, 299, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8335, 325, -1 } /* System.Collections.Generic.ArraySortHelper`2<TKey,TValue> System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::get_Default() */, { 8336, 325, -1 } /* System.Collections.Generic.ArraySortHelper`2<TKey,TValue> System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::CreateArraySortHelper() */, { 8337, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::Sort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8338, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::SwapIfGreaterWithItems(TKey[],TValue[],System.Collections.Generic.IComparer`1<TKey>,System.Int32,System.Int32) */, { 8339, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::Swap(TKey[],TValue[],System.Int32,System.Int32) */, { 8340, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::IntrospectiveSort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8341, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::IntroSort(TKey[],TValue[],System.Int32,System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8342, 325, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::PickPivotAndPartition(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8343, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::Heapsort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8344, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::DownHeap(TKey[],TValue[],System.Int32,System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8345, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::InsertionSort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8346, 325, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<System.UInt64,System.Object>::.ctor() */, { 7801, 5, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::GetTaskForResult(TResult) */, { 7802, 5, -1 } /* System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Boolean>::.cctor() */, { 9648, 5, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Boolean>::Invoke(System.Object[]) */, { 9649, 5, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Boolean>::Invoke(T) */, { 9648, 0, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Int32>::Invoke(System.Object[]) */, { 9649, 0, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Int32>::Invoke(T) */, { 9648, 60, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Single>::Invoke(System.Object[]) */, { 9649, 60, -1 } /* System.Void UnityEngine.Events.CachedInvokableCall`1<System.Single>::Invoke(T) */, { 8399, 0, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.Int32>::get_Default() */, { 8400, 0, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.Int32>::CreateComparer() */, { 8402, 0, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<System.Int32>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8403, 0, -1 } /* System.Void System.Collections.Generic.Comparer`1<System.Int32>::.ctor() */, { 8400, 72, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.UInt64>::CreateComparer() */, { 8402, 72, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<System.UInt64>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8403, 72, -1 } /* System.Void System.Collections.Generic.Comparer`1<System.UInt64>::.ctor() */, { 8399, 208, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Default() */, { 8400, 208, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::CreateComparer() */, { 8402, 208, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8403, 208, -1 } /* System.Void System.Collections.Generic.Comparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor() */, { 8399, 218, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Default() */, { 8400, 218, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::CreateComparer() */, { 8402, 218, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8403, 218, -1 } /* System.Void System.Collections.Generic.Comparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor() */, { 8399, 299, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Default() */, { 8400, 299, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::CreateComparer() */, { 8402, 299, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8403, 299, -1 } /* System.Void System.Collections.Generic.Comparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor() */, { 633, 0, -1 } /* System.Void System.Comparison`1<System.Int32>::.ctor(System.Object,System.IntPtr) */, { 634, 0, -1 } /* System.Int32 System.Comparison`1<System.Int32>::Invoke(T,T) */, { 635, 0, -1 } /* System.IAsyncResult System.Comparison`1<System.Int32>::BeginInvoke(T,T,System.AsyncCallback,System.Object) */, { 636, 0, -1 } /* System.Int32 System.Comparison`1<System.Int32>::EndInvoke(System.IAsyncResult) */, { 633, 72, -1 } /* System.Void System.Comparison`1<System.UInt64>::.ctor(System.Object,System.IntPtr) */, { 634, 72, -1 } /* System.Int32 System.Comparison`1<System.UInt64>::Invoke(T,T) */, { 635, 72, -1 } /* System.IAsyncResult System.Comparison`1<System.UInt64>::BeginInvoke(T,T,System.AsyncCallback,System.Object) */, { 636, 72, -1 } /* System.Int32 System.Comparison`1<System.UInt64>::EndInvoke(System.IAsyncResult) */, { 633, 208, -1 } /* System.Void System.Comparison`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor(System.Object,System.IntPtr) */, { 634, 208, -1 } /* System.Int32 System.Comparison`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Invoke(T,T) */, { 635, 208, -1 } /* System.IAsyncResult System.Comparison`1<UnityEngine.BeforeRenderHelper/OrderBlock>::BeginInvoke(T,T,System.AsyncCallback,System.Object) */, { 636, 208, -1 } /* System.Int32 System.Comparison`1<UnityEngine.BeforeRenderHelper/OrderBlock>::EndInvoke(System.IAsyncResult) */, { 633, 218, -1 } /* System.Void System.Comparison`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor(System.Object,System.IntPtr) */, { 634, 218, -1 } /* System.Int32 System.Comparison`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Invoke(T,T) */, { 635, 218, -1 } /* System.IAsyncResult System.Comparison`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::BeginInvoke(T,T,System.AsyncCallback,System.Object) */, { 636, 218, -1 } /* System.Int32 System.Comparison`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::EndInvoke(System.IAsyncResult) */, { 633, 299, -1 } /* System.Void System.Comparison`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor(System.Object,System.IntPtr) */, { 634, 299, -1 } /* System.Int32 System.Comparison`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Invoke(T,T) */, { 635, 299, -1 } /* System.IAsyncResult System.Comparison`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::BeginInvoke(T,T,System.AsyncCallback,System.Object) */, { 636, 299, -1 } /* System.Int32 System.Comparison`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::EndInvoke(System.IAsyncResult) */, { 7845, 5, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Boolean>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7845, 0, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Int32>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7846, 0, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult> System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Int32>::GetAwaiter() */, { 7845, 119, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7846, 119, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult> System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<System.Threading.Tasks.VoidTaskResult>::GetAwaiter() */, { 7847, 5, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Boolean>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7849, 5, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Boolean>::UnsafeOnCompleted(System.Action) */, { 7847, 0, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Int32>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7848, 0, -1 } /* System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Int32>::get_IsCompleted() */, { 7849, 0, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Int32>::UnsafeOnCompleted(System.Action) */, { 7850, 0, -1 } /* TResult System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Int32>::GetResult() */, { 7847, 119, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 7848, 119, -1 } /* System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.VoidTaskResult>::get_IsCompleted() */, { 7849, 119, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.VoidTaskResult>::UnsafeOnCompleted(System.Action) */, { 7850, 119, -1 } /* TResult System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<System.Threading.Tasks.VoidTaskResult>::GetResult() */, { 8347, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::.ctor() */, { 8348, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::.ctor(System.Int32) */, { 8349, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::.ctor(System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8350, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::.ctor(System.Int32,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8351, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8352, 8, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::get_Count() */, { 8353, 8, -1 } /* TValue System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::get_Item(TKey) */, { 8354, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::set_Item(TKey,TValue) */, { 8355, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Add(TKey,TValue) */, { 8356, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8357, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8358, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8359, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Clear() */, { 8360, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::ContainsKey(TKey) */, { 8361, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8362, 8, -1 } /* System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue> System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::GetEnumerator() */, { 8363, 8, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator() */, { 8364, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8365, 8, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::FindEntry(TKey) */, { 8366, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Initialize(System.Int32) */, { 8367, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::TryInsert(TKey,TValue,System.Collections.Generic.InsertionBehavior) */, { 8416, 12, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.String>::get_Default() */, { 8368, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::OnDeserialization(System.Object) */, { 8369, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Resize() */, { 8370, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Resize(System.Int32,System.Boolean) */, { 8371, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Remove(TKey) */, { 8372, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::TryGetValue(TKey,TValue&) */, { 8373, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.get_IsReadOnly() */, { 8374, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8375, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8376, 8, -1 } /* System.Collections.IEnumerator System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.IEnumerable.GetEnumerator() */, { 8377, 8, -1 } /* System.Object System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.IDictionary.get_Item(System.Object) */, { 8378, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.IDictionary.set_Item(System.Object,System.Object) */, { 8379, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::IsCompatibleKey(System.Object) */, { 8380, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.IDictionary.Contains(System.Object) */, { 8381, 8, -1 } /* System.Collections.IDictionaryEnumerator System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::System.Collections.IDictionary.GetEnumerator() */, { 8347, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::.ctor() */, { 8348, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::.ctor(System.Int32) */, { 8349, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::.ctor(System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8350, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::.ctor(System.Int32,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8351, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8352, 9, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::get_Count() */, { 8353, 9, -1 } /* TValue System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::get_Item(TKey) */, { 8354, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::set_Item(TKey,TValue) */, { 8355, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::Add(TKey,TValue) */, { 8356, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8357, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8358, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8359, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::Clear() */, { 8360, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::ContainsKey(TKey) */, { 8361, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8362, 9, -1 } /* System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue> System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::GetEnumerator() */, { 8363, 9, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator() */, { 8364, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8365, 9, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::FindEntry(TKey) */, { 8366, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::Initialize(System.Int32) */, { 8367, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::TryInsert(TKey,TValue,System.Collections.Generic.InsertionBehavior) */, { 8368, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::OnDeserialization(System.Object) */, { 8369, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::Resize() */, { 8370, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::Resize(System.Int32,System.Boolean) */, { 8371, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::Remove(TKey) */, { 8372, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::TryGetValue(TKey,TValue&) */, { 8373, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.get_IsReadOnly() */, { 8374, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8375, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8376, 9, -1 } /* System.Collections.IEnumerator System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.IEnumerable.GetEnumerator() */, { 8377, 9, -1 } /* System.Object System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.IDictionary.get_Item(System.Object) */, { 8378, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.IDictionary.set_Item(System.Object,System.Object) */, { 8379, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::IsCompatibleKey(System.Object) */, { 8380, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.IDictionary.Contains(System.Object) */, { 8381, 9, -1 } /* System.Collections.IDictionaryEnumerator System.Collections.Generic.Dictionary`2<System.Object,System.Int32>::System.Collections.IDictionary.GetEnumerator() */, { 8347, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::.ctor() */, { 8348, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::.ctor(System.Int32) */, { 8349, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::.ctor(System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8350, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::.ctor(System.Int32,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8351, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8352, 11, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::get_Count() */, { 8353, 11, -1 } /* TValue System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::get_Item(TKey) */, { 8354, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::set_Item(TKey,TValue) */, { 8355, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::Add(TKey,TValue) */, { 8356, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8357, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8358, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Remove(System.Collections.Generic.KeyValuePair`2<TKey,TValue>) */, { 8359, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::Clear() */, { 8360, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::ContainsKey(TKey) */, { 8361, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8362, 11, -1 } /* System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue> System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::GetEnumerator() */, { 8363, 11, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator() */, { 8364, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8365, 11, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::FindEntry(TKey) */, { 8366, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::Initialize(System.Int32) */, { 8367, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::TryInsert(TKey,TValue,System.Collections.Generic.InsertionBehavior) */, { 8368, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::OnDeserialization(System.Object) */, { 8369, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::Resize() */, { 8370, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::Resize(System.Int32,System.Boolean) */, { 8371, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::Remove(TKey) */, { 8372, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::TryGetValue(TKey,TValue&) */, { 8373, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.get_IsReadOnly() */, { 8374, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8375, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8376, 11, -1 } /* System.Collections.IEnumerator System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.IEnumerable.GetEnumerator() */, { 8377, 11, -1 } /* System.Object System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionary.get_Item(System.Object) */, { 8378, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionary.set_Item(System.Object,System.Object) */, { 8379, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::IsCompatibleKey(System.Object) */, { 8380, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionary.Contains(System.Object) */, { 8381, 11, -1 } /* System.Collections.IDictionaryEnumerator System.Collections.Generic.Dictionary`2<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionary.GetEnumerator() */, { 2759, 44, -1 } /* System.Void System.EmptyArray`1<System.Byte>::.cctor() */, { 2759, 45, -1 } /* System.Void System.EmptyArray`1<System.Char>::.cctor() */, { 2759, 85, -1 } /* System.Void System.EmptyArray`1<System.Reflection.CustomAttributeNamedArgument>::.cctor() */, { 2759, 84, -1 } /* System.Void System.EmptyArray`1<System.Reflection.CustomAttributeTypedArgument>::.cctor() */, { 2759, 273, -1 } /* System.Void System.EmptyArray`1<System.Reflection.ParameterModifier>::.cctor() */, { 499, 239, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::Dispose() */, { 500, 239, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::MoveNext() */, { 501, 239, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::get_Current() */, { 502, 239, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::System.Collections.IEnumerator.get_Current() */, { 503, 239, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::.ctor() */, { 504, 239, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::.cctor() */, { 499, 5, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Boolean>::Dispose() */, { 500, 5, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Boolean>::MoveNext() */, { 501, 5, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Boolean>::get_Current() */, { 502, 5, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Boolean>::System.Collections.IEnumerator.get_Current() */, { 503, 5, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Boolean>::.ctor() */, { 504, 5, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Boolean>::.cctor() */, { 499, 44, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Byte>::Dispose() */, { 500, 44, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Byte>::MoveNext() */, { 501, 44, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Byte>::get_Current() */, { 502, 44, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Byte>::System.Collections.IEnumerator.get_Current() */, { 503, 44, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Byte>::.ctor() */, { 504, 44, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Byte>::.cctor() */, { 499, 100, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Threading.CancellationTokenRegistration>::Dispose() */, { 500, 100, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Threading.CancellationTokenRegistration>::MoveNext() */, { 501, 100, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Threading.CancellationTokenRegistration>::get_Current() */, { 502, 100, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Threading.CancellationTokenRegistration>::System.Collections.IEnumerator.get_Current() */, { 503, 100, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Threading.CancellationTokenRegistration>::.ctor() */, { 504, 100, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Threading.CancellationTokenRegistration>::.cctor() */, { 499, 45, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Char>::Dispose() */, { 500, 45, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Char>::MoveNext() */, { 501, 45, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Char>::get_Current() */, { 502, 45, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Char>::System.Collections.IEnumerator.get_Current() */, { 503, 45, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Char>::.ctor() */, { 504, 45, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Char>::.cctor() */, { 499, 300, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.ContactPoint>::Dispose() */, { 500, 300, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.ContactPoint>::MoveNext() */, { 501, 300, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.ContactPoint>::get_Current() */, { 502, 300, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.ContactPoint>::System.Collections.IEnumerator.get_Current() */, { 503, 300, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.ContactPoint>::.ctor() */, { 504, 300, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.ContactPoint>::.cctor() */, { 499, 85, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::Dispose() */, { 500, 85, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::MoveNext() */, { 501, 85, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::get_Current() */, { 502, 85, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IEnumerator.get_Current() */, { 503, 85, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::.ctor() */, { 504, 85, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::.cctor() */, { 499, 84, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::Dispose() */, { 500, 84, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::MoveNext() */, { 501, 84, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::get_Current() */, { 502, 84, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IEnumerator.get_Current() */, { 503, 84, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::.ctor() */, { 504, 84, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::.cctor() */, { 499, 46, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.DateTime>::Dispose() */, { 500, 46, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.DateTime>::MoveNext() */, { 501, 46, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.DateTime>::get_Current() */, { 502, 46, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.DateTime>::System.Collections.IEnumerator.get_Current() */, { 503, 46, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.DateTime>::.ctor() */, { 504, 46, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.DateTime>::.cctor() */, { 499, 47, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Decimal>::Dispose() */, { 500, 47, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Decimal>::MoveNext() */, { 501, 47, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Decimal>::get_Current() */, { 502, 47, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Decimal>::System.Collections.IEnumerator.get_Current() */, { 503, 47, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Decimal>::.ctor() */, { 504, 47, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Decimal>::.cctor() */, { 499, 301, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.DictionaryEntry>::Dispose() */, { 500, 301, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.DictionaryEntry>::MoveNext() */, { 501, 301, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.DictionaryEntry>::get_Current() */, { 502, 301, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.DictionaryEntry>::System.Collections.IEnumerator.get_Current() */, { 503, 301, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.DictionaryEntry>::.ctor() */, { 504, 301, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.DictionaryEntry>::.cctor() */, { 499, 49, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Double>::Dispose() */, { 500, 49, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Double>::MoveNext() */, { 501, 49, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Double>::get_Current() */, { 502, 49, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Double>::System.Collections.IEnumerator.get_Current() */, { 503, 49, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Double>::.ctor() */, { 504, 49, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Double>::.cctor() */, { 499, 302, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::Dispose() */, { 500, 302, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::MoveNext() */, { 501, 302, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::get_Current() */, { 502, 302, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::System.Collections.IEnumerator.get_Current() */, { 503, 302, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::.ctor() */, { 504, 302, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::.cctor() */, { 499, 303, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::Dispose() */, { 500, 303, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::MoveNext() */, { 501, 303, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::get_Current() */, { 502, 303, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::System.Collections.IEnumerator.get_Current() */, { 503, 303, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::.ctor() */, { 504, 303, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::.cctor() */, { 499, 304, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::Dispose() */, { 500, 304, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::MoveNext() */, { 501, 304, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::get_Current() */, { 502, 304, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::System.Collections.IEnumerator.get_Current() */, { 503, 304, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::.ctor() */, { 504, 304, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::.cctor() */, { 499, 51, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int16>::Dispose() */, { 500, 51, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Int16>::MoveNext() */, { 501, 51, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Int16>::get_Current() */, { 502, 51, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Int16>::System.Collections.IEnumerator.get_Current() */, { 503, 51, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int16>::.ctor() */, { 504, 51, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int16>::.cctor() */, { 499, 0, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int32>::Dispose() */, { 500, 0, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Int32>::MoveNext() */, { 501, 0, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Int32>::get_Current() */, { 502, 0, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Int32>::System.Collections.IEnumerator.get_Current() */, { 503, 0, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int32>::.ctor() */, { 504, 0, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int32>::.cctor() */, { 499, 305, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int32Enum>::Dispose() */, { 500, 305, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Int32Enum>::MoveNext() */, { 501, 305, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Int32Enum>::get_Current() */, { 502, 305, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Int32Enum>::System.Collections.IEnumerator.get_Current() */, { 503, 305, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int32Enum>::.ctor() */, { 504, 305, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int32Enum>::.cctor() */, { 499, 52, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int64>::Dispose() */, { 500, 52, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Int64>::MoveNext() */, { 501, 52, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Int64>::get_Current() */, { 502, 52, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Int64>::System.Collections.IEnumerator.get_Current() */, { 503, 52, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int64>::.ctor() */, { 504, 52, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Int64>::.cctor() */, { 499, 306, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.IntPtr>::Dispose() */, { 500, 306, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.IntPtr>::MoveNext() */, { 501, 306, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.IntPtr>::get_Current() */, { 502, 306, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.IntPtr>::System.Collections.IEnumerator.get_Current() */, { 503, 306, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.IntPtr>::.ctor() */, { 504, 306, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.IntPtr>::.cctor() */, { 499, 307, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::Dispose() */, { 500, 307, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::MoveNext() */, { 501, 307, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::get_Current() */, { 502, 307, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::System.Collections.IEnumerator.get_Current() */, { 503, 307, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::.ctor() */, { 504, 307, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::.cctor() */, { 499, 308, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::Dispose() */, { 500, 308, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::MoveNext() */, { 501, 308, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::get_Current() */, { 502, 308, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::System.Collections.IEnumerator.get_Current() */, { 503, 308, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::.ctor() */, { 504, 308, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::.cctor() */, { 499, 309, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Keyframe>::Dispose() */, { 500, 309, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.Keyframe>::MoveNext() */, { 501, 309, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.Keyframe>::get_Current() */, { 502, 309, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.Keyframe>::System.Collections.IEnumerator.get_Current() */, { 503, 309, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Keyframe>::.ctor() */, { 504, 309, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Keyframe>::.cctor() */, { 499, 245, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::Dispose() */, { 500, 245, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::MoveNext() */, { 501, 245, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::get_Current() */, { 502, 245, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::System.Collections.IEnumerator.get_Current() */, { 503, 245, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::.ctor() */, { 504, 245, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::.cctor() */, { 499, 273, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.ParameterModifier>::Dispose() */, { 500, 273, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Reflection.ParameterModifier>::MoveNext() */, { 501, 273, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Reflection.ParameterModifier>::get_Current() */, { 502, 273, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Reflection.ParameterModifier>::System.Collections.IEnumerator.get_Current() */, { 503, 273, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.ParameterModifier>::.ctor() */, { 504, 273, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Reflection.ParameterModifier>::.cctor() */, { 499, 238, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Plane>::Dispose() */, { 500, 238, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.Plane>::MoveNext() */, { 501, 238, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.Plane>::get_Current() */, { 502, 238, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.Plane>::System.Collections.IEnumerator.get_Current() */, { 503, 238, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Plane>::.ctor() */, { 504, 238, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Plane>::.cctor() */, { 499, 241, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::Dispose() */, { 500, 241, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::MoveNext() */, { 501, 241, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::get_Current() */, { 502, 241, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::System.Collections.IEnumerator.get_Current() */, { 503, 241, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::.ctor() */, { 504, 241, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::.cctor() */, { 499, 310, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::Dispose() */, { 500, 310, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::MoveNext() */, { 501, 310, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::get_Current() */, { 502, 310, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::System.Collections.IEnumerator.get_Current() */, { 503, 310, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::.ctor() */, { 504, 310, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::.cctor() */, { 499, 311, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.RaycastHit>::Dispose() */, { 500, 311, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.RaycastHit>::MoveNext() */, { 501, 311, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.RaycastHit>::get_Current() */, { 502, 311, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.RaycastHit>::System.Collections.IEnumerator.get_Current() */, { 503, 311, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.RaycastHit>::.ctor() */, { 504, 311, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.RaycastHit>::.cctor() */, { 499, 312, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Resources.ResourceLocator>::Dispose() */, { 500, 312, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Resources.ResourceLocator>::MoveNext() */, { 501, 312, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Resources.ResourceLocator>::get_Current() */, { 502, 312, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Resources.ResourceLocator>::System.Collections.IEnumerator.get_Current() */, { 503, 312, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Resources.ResourceLocator>::.ctor() */, { 504, 312, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Resources.ResourceLocator>::.cctor() */, { 499, 59, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.SByte>::Dispose() */, { 500, 59, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.SByte>::MoveNext() */, { 501, 59, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.SByte>::get_Current() */, { 502, 59, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.SByte>::System.Collections.IEnumerator.get_Current() */, { 503, 59, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.SByte>::.ctor() */, { 504, 59, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.SByte>::.cctor() */, { 499, 60, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Single>::Dispose() */, { 500, 60, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Single>::MoveNext() */, { 501, 60, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Single>::get_Current() */, { 502, 60, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Single>::System.Collections.IEnumerator.get_Current() */, { 503, 60, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Single>::.ctor() */, { 504, 60, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Single>::.cctor() */, { 499, 61, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.TimeSpan>::Dispose() */, { 500, 61, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.TimeSpan>::MoveNext() */, { 501, 61, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.TimeSpan>::get_Current() */, { 502, 61, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.TimeSpan>::System.Collections.IEnumerator.get_Current() */, { 503, 61, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.TimeSpan>::.ctor() */, { 504, 61, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.TimeSpan>::.cctor() */, { 499, 70, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt16>::Dispose() */, { 500, 70, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.UInt16>::MoveNext() */, { 501, 70, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.UInt16>::get_Current() */, { 502, 70, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.UInt16>::System.Collections.IEnumerator.get_Current() */, { 503, 70, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt16>::.ctor() */, { 504, 70, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt16>::.cctor() */, { 499, 71, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt32>::Dispose() */, { 500, 71, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.UInt32>::MoveNext() */, { 501, 71, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.UInt32>::get_Current() */, { 502, 71, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.UInt32>::System.Collections.IEnumerator.get_Current() */, { 503, 71, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt32>::.ctor() */, { 504, 71, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt32>::.cctor() */, { 499, 72, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt64>::Dispose() */, { 500, 72, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.UInt64>::MoveNext() */, { 501, 72, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.UInt64>::get_Current() */, { 502, 72, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.UInt64>::System.Collections.IEnumerator.get_Current() */, { 503, 72, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt64>::.ctor() */, { 504, 72, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.UInt64>::.cctor() */, { 499, 208, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Dispose() */, { 500, 208, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::MoveNext() */, { 501, 208, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Current() */, { 502, 208, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IEnumerator.get_Current() */, { 503, 208, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor() */, { 504, 208, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.cctor() */, { 499, 313, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::Dispose() */, { 500, 313, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::MoveNext() */, { 501, 313, -1 } /* T System.Array/EmptyInternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::get_Current() */, { 502, 313, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::System.Collections.IEnumerator.get_Current() */, { 503, 313, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::.ctor() */, { 504, 313, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::.cctor() */, { 499, 314, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Hashtable/bucket>::Dispose() */, { 500, 314, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Hashtable/bucket>::MoveNext() */, { 501, 314, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Hashtable/bucket>::get_Current() */, { 502, 314, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Hashtable/bucket>::System.Collections.IEnumerator.get_Current() */, { 503, 314, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Hashtable/bucket>::.ctor() */, { 504, 314, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Hashtable/bucket>::.cctor() */, { 499, 315, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.ParameterizedStrings/FormatParam>::Dispose() */, { 500, 315, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.ParameterizedStrings/FormatParam>::MoveNext() */, { 501, 315, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.ParameterizedStrings/FormatParam>::get_Current() */, { 502, 315, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.ParameterizedStrings/FormatParam>::System.Collections.IEnumerator.get_Current() */, { 503, 315, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.ParameterizedStrings/FormatParam>::.ctor() */, { 504, 315, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.ParameterizedStrings/FormatParam>::.cctor() */, { 499, 316, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::Dispose() */, { 500, 316, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::MoveNext() */, { 501, 316, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::get_Current() */, { 502, 316, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::System.Collections.IEnumerator.get_Current() */, { 503, 316, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::.ctor() */, { 504, 316, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::.cctor() */, { 499, 218, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Dispose() */, { 500, 218, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::MoveNext() */, { 501, 218, -1 } /* T System.Array/EmptyInternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Current() */, { 502, 218, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IEnumerator.get_Current() */, { 503, 218, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor() */, { 504, 218, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.cctor() */, { 499, 317, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::Dispose() */, { 500, 317, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::MoveNext() */, { 501, 317, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::get_Current() */, { 502, 317, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 503, 317, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::.ctor() */, { 504, 317, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::.cctor() */, { 499, 318, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::Dispose() */, { 500, 318, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::MoveNext() */, { 501, 318, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::get_Current() */, { 502, 318, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::System.Collections.IEnumerator.get_Current() */, { 503, 318, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::.ctor() */, { 504, 318, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::.cctor() */, { 499, 319, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::Dispose() */, { 500, 319, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::MoveNext() */, { 501, 319, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::get_Current() */, { 502, 319, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 503, 319, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::.ctor() */, { 504, 319, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::.cctor() */, { 499, 320, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::Dispose() */, { 500, 320, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::MoveNext() */, { 501, 320, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::get_Current() */, { 502, 320, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::System.Collections.IEnumerator.get_Current() */, { 503, 320, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::.ctor() */, { 504, 320, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::.cctor() */, { 499, 299, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Dispose() */, { 500, 299, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::MoveNext() */, { 501, 299, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Current() */, { 502, 299, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 503, 299, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor() */, { 504, 299, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.cctor() */, { 499, 321, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::Dispose() */, { 500, 321, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::MoveNext() */, { 501, 321, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::get_Current() */, { 502, 321, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 503, 321, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::.ctor() */, { 504, 321, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::.cctor() */, { 499, 322, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::Dispose() */, { 500, 322, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::MoveNext() */, { 501, 322, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::get_Current() */, { 502, 322, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::System.Collections.IEnumerator.get_Current() */, { 503, 322, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::.ctor() */, { 504, 322, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::.cctor() */, { 499, 323, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::Dispose() */, { 500, 323, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::MoveNext() */, { 501, 323, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::get_Current() */, { 502, 323, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 503, 323, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::.ctor() */, { 504, 323, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::.cctor() */, { 499, 324, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::Dispose() */, { 500, 324, -1 } /* System.Boolean System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::MoveNext() */, { 501, 324, -1 } /* T System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::get_Current() */, { 502, 324, -1 } /* System.Object System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::System.Collections.IEnumerator.get_Current() */, { 503, 324, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::.ctor() */, { 504, 324, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::.cctor() */, { 9070, 239, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Rendering.BatchVisibility>::.ctor(Unity.Collections.NativeArray`1<T>&) */, { 9071, 239, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Rendering.BatchVisibility>::Dispose() */, { 9072, 239, -1 } /* System.Boolean Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Rendering.BatchVisibility>::MoveNext() */, { 9073, 239, -1 } /* T Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Rendering.BatchVisibility>::get_Current() */, { 9074, 239, -1 } /* System.Object Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Rendering.BatchVisibility>::System.Collections.IEnumerator.get_Current() */, { 9070, 44, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<System.Byte>::.ctor(Unity.Collections.NativeArray`1<T>&) */, { 9071, 44, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<System.Byte>::Dispose() */, { 9072, 44, -1 } /* System.Boolean Unity.Collections.NativeArray`1/Enumerator<System.Byte>::MoveNext() */, { 9073, 44, -1 } /* T Unity.Collections.NativeArray`1/Enumerator<System.Byte>::get_Current() */, { 9074, 44, -1 } /* System.Object Unity.Collections.NativeArray`1/Enumerator<System.Byte>::System.Collections.IEnumerator.get_Current() */, { 8543, 0, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Int32>::.ctor(System.Collections.Generic.List`1<T>) */, { 8546, 0, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Int32>::MoveNextRare() */, { 8548, 0, -1 } /* System.Object System.Collections.Generic.List`1/Enumerator<System.Int32>::System.Collections.IEnumerator.get_Current() */, { 9070, 0, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<System.Int32>::.ctor(Unity.Collections.NativeArray`1<T>&) */, { 9071, 0, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<System.Int32>::Dispose() */, { 9072, 0, -1 } /* System.Boolean Unity.Collections.NativeArray`1/Enumerator<System.Int32>::MoveNext() */, { 9073, 0, -1 } /* T Unity.Collections.NativeArray`1/Enumerator<System.Int32>::get_Current() */, { 9074, 0, -1 } /* System.Object Unity.Collections.NativeArray`1/Enumerator<System.Int32>::System.Collections.IEnumerator.get_Current() */, { 9070, 245, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::.ctor(Unity.Collections.NativeArray`1<T>&) */, { 9071, 245, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::Dispose() */, { 9072, 245, -1 } /* System.Boolean Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::MoveNext() */, { 9073, 245, -1 } /* T Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::get_Current() */, { 9074, 245, -1 } /* System.Object Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::System.Collections.IEnumerator.get_Current() */, { 9070, 238, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane>::.ctor(Unity.Collections.NativeArray`1<T>&) */, { 9071, 238, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane>::Dispose() */, { 9072, 238, -1 } /* System.Boolean Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane>::MoveNext() */, { 9073, 238, -1 } /* T Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane>::get_Current() */, { 9074, 238, -1 } /* System.Object Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane>::System.Collections.IEnumerator.get_Current() */, { 8543, 208, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor(System.Collections.Generic.List`1<T>) */, { 8544, 208, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<UnityEngine.BeforeRenderHelper/OrderBlock>::Dispose() */, { 8545, 208, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<UnityEngine.BeforeRenderHelper/OrderBlock>::MoveNext() */, { 8546, 208, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<UnityEngine.BeforeRenderHelper/OrderBlock>::MoveNextRare() */, { 8547, 208, -1 } /* T System.Collections.Generic.List`1/Enumerator<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Current() */, { 8548, 208, -1 } /* System.Object System.Collections.Generic.List`1/Enumerator<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IEnumerator.get_Current() */, { 8543, 218, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor(System.Collections.Generic.List`1<T>) */, { 8544, 218, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>::Dispose() */, { 8545, 218, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>::MoveNext() */, { 8546, 218, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>::MoveNextRare() */, { 8547, 218, -1 } /* T System.Collections.Generic.List`1/Enumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Current() */, { 8548, 218, -1 } /* System.Object System.Collections.Generic.List`1/Enumerator<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IEnumerator.get_Current() */, { 8543, 299, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor(System.Collections.Generic.List`1<T>) */, { 8544, 299, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Dispose() */, { 8545, 299, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::MoveNext() */, { 8546, 299, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::MoveNextRare() */, { 8547, 299, -1 } /* T System.Collections.Generic.List`1/Enumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Current() */, { 8548, 299, -1 } /* System.Object System.Collections.Generic.List`1/Enumerator<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 8382, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::.ctor(System.Collections.Generic.Dictionary`2<TKey,TValue>,System.Int32) */, { 8383, 8, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::MoveNext() */, { 8384, 8, -1 } /* System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::get_Current() */, { 8385, 8, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::Dispose() */, { 8386, 8, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::System.Collections.IEnumerator.get_Current() */, { 8387, 8, -1 } /* System.Collections.DictionaryEntry System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::System.Collections.IDictionaryEnumerator.get_Entry() */, { 8388, 8, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::System.Collections.IDictionaryEnumerator.get_Key() */, { 8389, 8, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::System.Collections.IDictionaryEnumerator.get_Value() */, { 8382, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::.ctor(System.Collections.Generic.Dictionary`2<TKey,TValue>,System.Int32) */, { 8383, 9, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::MoveNext() */, { 8384, 9, -1 } /* System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::get_Current() */, { 8385, 9, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::Dispose() */, { 8386, 9, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::System.Collections.IEnumerator.get_Current() */, { 8387, 9, -1 } /* System.Collections.DictionaryEntry System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::System.Collections.IDictionaryEnumerator.get_Entry() */, { 8388, 9, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::System.Collections.IDictionaryEnumerator.get_Key() */, { 8389, 9, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Int32>::System.Collections.IDictionaryEnumerator.get_Value() */, { 8382, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::.ctor(System.Collections.Generic.Dictionary`2<TKey,TValue>,System.Int32) */, { 8383, 11, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::MoveNext() */, { 8384, 11, -1 } /* System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::get_Current() */, { 8385, 11, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::Dispose() */, { 8386, 11, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::System.Collections.IEnumerator.get_Current() */, { 8387, 11, -1 } /* System.Collections.DictionaryEntry System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionaryEnumerator.get_Entry() */, { 8388, 11, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionaryEnumerator.get_Key() */, { 8389, 11, -1 } /* System.Object System.Collections.Generic.Dictionary`2/Enumerator<System.Object,System.Resources.ResourceLocator>::System.Collections.IDictionaryEnumerator.get_Value() */, { 8416, 44, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Byte>::get_Default() */, { 8417, 44, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Byte>::CreateComparer() */, { 8420, 44, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Byte>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 44, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Byte>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 44, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Byte>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 44, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Byte>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8416, 0, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Int32>::get_Default() */, { 8417, 0, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Int32>::CreateComparer() */, { 8420, 0, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Int32>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 0, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Int32>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 0, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Int32>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 0, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Int32>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8424, 0, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.Int32>::.ctor() */, { 8416, 312, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::get_Default() */, { 8417, 312, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::CreateComparer() */, { 8420, 312, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 312, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 312, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 312, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8424, 312, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.Resources.ResourceLocator>::.ctor() */, { 8416, 208, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Default() */, { 8417, 208, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::CreateComparer() */, { 8420, 208, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 208, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 208, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 208, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8424, 208, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor() */, { 8416, 218, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Default() */, { 8417, 218, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::CreateComparer() */, { 8420, 218, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 218, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 218, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 218, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8424, 218, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor() */, { 8416, 299, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Default() */, { 8417, 299, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::CreateComparer() */, { 8420, 299, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 299, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8422, 299, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 299, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8424, 299, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor() */, { 8501, 90, -1 } /* System.Void System.Collections.Generic.List`1<System.IO.Directory/SearchData>::.ctor() */, { 8514, 90, -1 } /* System.Void System.Collections.Generic.List`1<System.IO.Directory/SearchData>::Add(T) */, { 8509, 90, -1 } /* T System.Collections.Generic.List`1<System.IO.Directory/SearchData>::get_Item(System.Int32) */, { 8535, 90, -1 } /* System.Void System.Collections.Generic.List`1<System.IO.Directory/SearchData>::RemoveAt(System.Int32) */, { 8506, 90, -1 } /* System.Int32 System.Collections.Generic.List`1<System.IO.Directory/SearchData>::get_Count() */, { 8529, 90, -1 } /* System.Void System.Collections.Generic.List`1<System.IO.Directory/SearchData>::Insert(System.Int32,T) */, { 621, 5, -1 } /* System.Void System.Func`1<System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 623, 5, -1 } /* System.IAsyncResult System.Func`1<System.Boolean>::BeginInvoke(System.AsyncCallback,System.Object) */, { 624, 5, -1 } /* TResult System.Func`1<System.Boolean>::EndInvoke(System.IAsyncResult) */, { 621, 0, -1 } /* System.Void System.Func`1<System.Int32>::.ctor(System.Object,System.IntPtr) */, { 622, 0, -1 } /* TResult System.Func`1<System.Int32>::Invoke() */, { 623, 0, -1 } /* System.IAsyncResult System.Func`1<System.Int32>::BeginInvoke(System.AsyncCallback,System.Object) */, { 624, 0, -1 } /* TResult System.Func`1<System.Int32>::EndInvoke(System.IAsyncResult) */, { 621, 119, -1 } /* System.Void System.Func`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Object,System.IntPtr) */, { 622, 119, -1 } /* TResult System.Func`1<System.Threading.Tasks.VoidTaskResult>::Invoke() */, { 623, 119, -1 } /* System.IAsyncResult System.Func`1<System.Threading.Tasks.VoidTaskResult>::BeginInvoke(System.AsyncCallback,System.Object) */, { 624, 119, -1 } /* TResult System.Func`1<System.Threading.Tasks.VoidTaskResult>::EndInvoke(System.IAsyncResult) */, { 625, 328, -1 } /* System.Void System.Func`2<System.Object,System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 626, 328, -1 } /* TResult System.Func`2<System.Object,System.Boolean>::Invoke(T) */, { 627, 328, -1 } /* System.IAsyncResult System.Func`2<System.Object,System.Boolean>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 628, 328, -1 } /* TResult System.Func`2<System.Object,System.Boolean>::EndInvoke(System.IAsyncResult) */, { 626, 9, -1 } /* TResult System.Func`2<System.Object,System.Int32>::Invoke(T) */, { 627, 9, -1 } /* System.IAsyncResult System.Func`2<System.Object,System.Int32>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 628, 9, -1 } /* TResult System.Func`2<System.Object,System.Int32>::EndInvoke(System.IAsyncResult) */, { 625, 331, -1 } /* System.Void System.Func`2<System.Object,System.Threading.Tasks.VoidTaskResult>::.ctor(System.Object,System.IntPtr) */, { 626, 331, -1 } /* TResult System.Func`2<System.Object,System.Threading.Tasks.VoidTaskResult>::Invoke(T) */, { 627, 331, -1 } /* System.IAsyncResult System.Func`2<System.Object,System.Threading.Tasks.VoidTaskResult>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 628, 331, -1 } /* TResult System.Func`2<System.Object,System.Threading.Tasks.VoidTaskResult>::EndInvoke(System.IAsyncResult) */, { 629, 332, -1 } /* System.Void System.Func`4<System.Object,System.Object,System.Boolean,System.Object>::.ctor(System.Object,System.IntPtr) */, { 630, 332, -1 } /* TResult System.Func`4<System.Object,System.Object,System.Boolean,System.Object>::Invoke(T1,T2,T3) */, { 631, 332, -1 } /* System.IAsyncResult System.Func`4<System.Object,System.Object,System.Boolean,System.Object>::BeginInvoke(T1,T2,T3,System.AsyncCallback,System.Object) */, { 632, 332, -1 } /* TResult System.Func`4<System.Object,System.Object,System.Boolean,System.Object>::EndInvoke(System.IAsyncResult) */, { 8404, 0, -1 } /* System.Int32 System.Collections.Generic.GenericComparer`1<System.Int32>::Compare(T,T) */, { 8405, 0, -1 } /* System.Boolean System.Collections.Generic.GenericComparer`1<System.Int32>::Equals(System.Object) */, { 8406, 0, -1 } /* System.Int32 System.Collections.Generic.GenericComparer`1<System.Int32>::GetHashCode() */, { 8407, 0, -1 } /* System.Void System.Collections.Generic.GenericComparer`1<System.Int32>::.ctor() */, { 8404, 72, -1 } /* System.Int32 System.Collections.Generic.GenericComparer`1<System.UInt64>::Compare(T,T) */, { 8405, 72, -1 } /* System.Boolean System.Collections.Generic.GenericComparer`1<System.UInt64>::Equals(System.Object) */, { 8406, 72, -1 } /* System.Int32 System.Collections.Generic.GenericComparer`1<System.UInt64>::GetHashCode() */, { 8407, 72, -1 } /* System.Void System.Collections.Generic.GenericComparer`1<System.UInt64>::.ctor() */, { 8425, 44, -1 } /* System.Boolean System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::Equals(T,T) */, { 8426, 44, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::GetHashCode(T) */, { 8427, 44, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8428, 44, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8429, 44, -1 } /* System.Boolean System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::Equals(System.Object) */, { 8430, 44, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::GetHashCode() */, { 8431, 44, -1 } /* System.Void System.Collections.Generic.GenericEqualityComparer`1<System.Byte>::.ctor() */, { 8425, 0, -1 } /* System.Boolean System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::Equals(T,T) */, { 8426, 0, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::GetHashCode(T) */, { 8427, 0, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8428, 0, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8429, 0, -1 } /* System.Boolean System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::Equals(System.Object) */, { 8430, 0, -1 } /* System.Int32 System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::GetHashCode() */, { 8431, 0, -1 } /* System.Void System.Collections.Generic.GenericEqualityComparer`1<System.Int32>::.ctor() */, { 494, 239, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::.ctor(System.Array) */, { 495, 239, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::Dispose() */, { 496, 239, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::MoveNext() */, { 497, 239, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::get_Current() */, { 498, 239, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.Rendering.BatchVisibility>::System.Collections.IEnumerator.get_Current() */, { 494, 5, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Boolean>::.ctor(System.Array) */, { 495, 5, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Boolean>::Dispose() */, { 496, 5, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Boolean>::MoveNext() */, { 497, 5, -1 } /* T System.Array/InternalEnumerator`1<System.Boolean>::get_Current() */, { 498, 5, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Boolean>::System.Collections.IEnumerator.get_Current() */, { 494, 44, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Byte>::.ctor(System.Array) */, { 495, 44, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Byte>::Dispose() */, { 496, 44, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Byte>::MoveNext() */, { 497, 44, -1 } /* T System.Array/InternalEnumerator`1<System.Byte>::get_Current() */, { 498, 44, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Byte>::System.Collections.IEnumerator.get_Current() */, { 494, 100, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Threading.CancellationTokenRegistration>::.ctor(System.Array) */, { 495, 100, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Threading.CancellationTokenRegistration>::Dispose() */, { 496, 100, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Threading.CancellationTokenRegistration>::MoveNext() */, { 497, 100, -1 } /* T System.Array/InternalEnumerator`1<System.Threading.CancellationTokenRegistration>::get_Current() */, { 498, 100, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Threading.CancellationTokenRegistration>::System.Collections.IEnumerator.get_Current() */, { 494, 45, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Char>::.ctor(System.Array) */, { 495, 45, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Char>::Dispose() */, { 496, 45, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Char>::MoveNext() */, { 497, 45, -1 } /* T System.Array/InternalEnumerator`1<System.Char>::get_Current() */, { 498, 45, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Char>::System.Collections.IEnumerator.get_Current() */, { 494, 300, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.ContactPoint>::.ctor(System.Array) */, { 495, 300, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.ContactPoint>::Dispose() */, { 496, 300, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.ContactPoint>::MoveNext() */, { 497, 300, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.ContactPoint>::get_Current() */, { 498, 300, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.ContactPoint>::System.Collections.IEnumerator.get_Current() */, { 494, 85, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::.ctor(System.Array) */, { 495, 85, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::Dispose() */, { 496, 85, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::MoveNext() */, { 497, 85, -1 } /* T System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::get_Current() */, { 498, 85, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IEnumerator.get_Current() */, { 494, 84, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::.ctor(System.Array) */, { 495, 84, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::Dispose() */, { 496, 84, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::MoveNext() */, { 497, 84, -1 } /* T System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::get_Current() */, { 498, 84, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IEnumerator.get_Current() */, { 494, 46, -1 } /* System.Void System.Array/InternalEnumerator`1<System.DateTime>::.ctor(System.Array) */, { 495, 46, -1 } /* System.Void System.Array/InternalEnumerator`1<System.DateTime>::Dispose() */, { 496, 46, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.DateTime>::MoveNext() */, { 497, 46, -1 } /* T System.Array/InternalEnumerator`1<System.DateTime>::get_Current() */, { 498, 46, -1 } /* System.Object System.Array/InternalEnumerator`1<System.DateTime>::System.Collections.IEnumerator.get_Current() */, { 494, 47, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Decimal>::.ctor(System.Array) */, { 495, 47, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Decimal>::Dispose() */, { 496, 47, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Decimal>::MoveNext() */, { 497, 47, -1 } /* T System.Array/InternalEnumerator`1<System.Decimal>::get_Current() */, { 498, 47, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Decimal>::System.Collections.IEnumerator.get_Current() */, { 494, 301, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.DictionaryEntry>::.ctor(System.Array) */, { 495, 301, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.DictionaryEntry>::Dispose() */, { 496, 301, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.DictionaryEntry>::MoveNext() */, { 497, 301, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.DictionaryEntry>::get_Current() */, { 498, 301, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.DictionaryEntry>::System.Collections.IEnumerator.get_Current() */, { 494, 49, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Double>::.ctor(System.Array) */, { 495, 49, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Double>::Dispose() */, { 496, 49, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Double>::MoveNext() */, { 497, 49, -1 } /* T System.Array/InternalEnumerator`1<System.Double>::get_Current() */, { 498, 49, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Double>::System.Collections.IEnumerator.get_Current() */, { 494, 302, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::.ctor(System.Array) */, { 495, 302, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::Dispose() */, { 496, 302, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::MoveNext() */, { 497, 302, -1 } /* T System.Array/InternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::get_Current() */, { 498, 302, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Runtime.CompilerServices.Ephemeron>::System.Collections.IEnumerator.get_Current() */, { 494, 303, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::.ctor(System.Array) */, { 495, 303, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::Dispose() */, { 496, 303, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::MoveNext() */, { 497, 303, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::get_Current() */, { 498, 303, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcAchievementData>::System.Collections.IEnumerator.get_Current() */, { 494, 304, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::.ctor(System.Array) */, { 495, 304, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::Dispose() */, { 496, 304, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::MoveNext() */, { 497, 304, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::get_Current() */, { 498, 304, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.GameCenter.GcScoreData>::System.Collections.IEnumerator.get_Current() */, { 494, 51, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int16>::.ctor(System.Array) */, { 495, 51, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int16>::Dispose() */, { 496, 51, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Int16>::MoveNext() */, { 497, 51, -1 } /* T System.Array/InternalEnumerator`1<System.Int16>::get_Current() */, { 498, 51, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Int16>::System.Collections.IEnumerator.get_Current() */, { 494, 0, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int32>::.ctor(System.Array) */, { 495, 0, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int32>::Dispose() */, { 496, 0, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Int32>::MoveNext() */, { 497, 0, -1 } /* T System.Array/InternalEnumerator`1<System.Int32>::get_Current() */, { 498, 0, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Int32>::System.Collections.IEnumerator.get_Current() */, { 494, 305, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int32Enum>::.ctor(System.Array) */, { 495, 305, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int32Enum>::Dispose() */, { 496, 305, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Int32Enum>::MoveNext() */, { 497, 305, -1 } /* T System.Array/InternalEnumerator`1<System.Int32Enum>::get_Current() */, { 498, 305, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Int32Enum>::System.Collections.IEnumerator.get_Current() */, { 494, 52, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int64>::.ctor(System.Array) */, { 495, 52, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Int64>::Dispose() */, { 496, 52, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Int64>::MoveNext() */, { 497, 52, -1 } /* T System.Array/InternalEnumerator`1<System.Int64>::get_Current() */, { 498, 52, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Int64>::System.Collections.IEnumerator.get_Current() */, { 494, 306, -1 } /* System.Void System.Array/InternalEnumerator`1<System.IntPtr>::.ctor(System.Array) */, { 495, 306, -1 } /* System.Void System.Array/InternalEnumerator`1<System.IntPtr>::Dispose() */, { 496, 306, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.IntPtr>::MoveNext() */, { 497, 306, -1 } /* T System.Array/InternalEnumerator`1<System.IntPtr>::get_Current() */, { 498, 306, -1 } /* System.Object System.Array/InternalEnumerator`1<System.IntPtr>::System.Collections.IEnumerator.get_Current() */, { 494, 307, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::.ctor(System.Array) */, { 495, 307, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::Dispose() */, { 496, 307, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::MoveNext() */, { 497, 307, -1 } /* T System.Array/InternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::get_Current() */, { 498, 307, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Globalization.InternalCodePageDataItem>::System.Collections.IEnumerator.get_Current() */, { 494, 308, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::.ctor(System.Array) */, { 495, 308, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::Dispose() */, { 496, 308, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::MoveNext() */, { 497, 308, -1 } /* T System.Array/InternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::get_Current() */, { 498, 308, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Globalization.InternalEncodingDataItem>::System.Collections.IEnumerator.get_Current() */, { 494, 309, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Keyframe>::.ctor(System.Array) */, { 495, 309, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Keyframe>::Dispose() */, { 496, 309, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.Keyframe>::MoveNext() */, { 497, 309, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.Keyframe>::get_Current() */, { 498, 309, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.Keyframe>::System.Collections.IEnumerator.get_Current() */, { 494, 245, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::.ctor(System.Array) */, { 495, 245, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::Dispose() */, { 496, 245, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::MoveNext() */, { 497, 245, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::get_Current() */, { 498, 245, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::System.Collections.IEnumerator.get_Current() */, { 494, 273, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Reflection.ParameterModifier>::.ctor(System.Array) */, { 495, 273, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Reflection.ParameterModifier>::Dispose() */, { 496, 273, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Reflection.ParameterModifier>::MoveNext() */, { 497, 273, -1 } /* T System.Array/InternalEnumerator`1<System.Reflection.ParameterModifier>::get_Current() */, { 498, 273, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Reflection.ParameterModifier>::System.Collections.IEnumerator.get_Current() */, { 494, 238, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Plane>::.ctor(System.Array) */, { 495, 238, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Plane>::Dispose() */, { 496, 238, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.Plane>::MoveNext() */, { 497, 238, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.Plane>::get_Current() */, { 498, 238, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.Plane>::System.Collections.IEnumerator.get_Current() */, { 494, 241, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::.ctor(System.Array) */, { 495, 241, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::Dispose() */, { 496, 241, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::MoveNext() */, { 497, 241, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::get_Current() */, { 498, 241, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.Playables.PlayableBinding>::System.Collections.IEnumerator.get_Current() */, { 494, 310, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::.ctor(System.Array) */, { 495, 310, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::Dispose() */, { 496, 310, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::MoveNext() */, { 497, 310, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::get_Current() */, { 498, 310, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.LowLevel.PlayerLoopSystem>::System.Collections.IEnumerator.get_Current() */, { 494, 311, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.RaycastHit>::.ctor(System.Array) */, { 495, 311, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.RaycastHit>::Dispose() */, { 496, 311, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.RaycastHit>::MoveNext() */, { 497, 311, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.RaycastHit>::get_Current() */, { 498, 311, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.RaycastHit>::System.Collections.IEnumerator.get_Current() */, { 494, 312, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Resources.ResourceLocator>::.ctor(System.Array) */, { 495, 312, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Resources.ResourceLocator>::Dispose() */, { 496, 312, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Resources.ResourceLocator>::MoveNext() */, { 497, 312, -1 } /* T System.Array/InternalEnumerator`1<System.Resources.ResourceLocator>::get_Current() */, { 498, 312, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Resources.ResourceLocator>::System.Collections.IEnumerator.get_Current() */, { 494, 59, -1 } /* System.Void System.Array/InternalEnumerator`1<System.SByte>::.ctor(System.Array) */, { 495, 59, -1 } /* System.Void System.Array/InternalEnumerator`1<System.SByte>::Dispose() */, { 496, 59, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.SByte>::MoveNext() */, { 497, 59, -1 } /* T System.Array/InternalEnumerator`1<System.SByte>::get_Current() */, { 498, 59, -1 } /* System.Object System.Array/InternalEnumerator`1<System.SByte>::System.Collections.IEnumerator.get_Current() */, { 494, 60, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Single>::.ctor(System.Array) */, { 495, 60, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Single>::Dispose() */, { 496, 60, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Single>::MoveNext() */, { 497, 60, -1 } /* T System.Array/InternalEnumerator`1<System.Single>::get_Current() */, { 498, 60, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Single>::System.Collections.IEnumerator.get_Current() */, { 494, 61, -1 } /* System.Void System.Array/InternalEnumerator`1<System.TimeSpan>::.ctor(System.Array) */, { 495, 61, -1 } /* System.Void System.Array/InternalEnumerator`1<System.TimeSpan>::Dispose() */, { 496, 61, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.TimeSpan>::MoveNext() */, { 497, 61, -1 } /* T System.Array/InternalEnumerator`1<System.TimeSpan>::get_Current() */, { 498, 61, -1 } /* System.Object System.Array/InternalEnumerator`1<System.TimeSpan>::System.Collections.IEnumerator.get_Current() */, { 494, 70, -1 } /* System.Void System.Array/InternalEnumerator`1<System.UInt16>::.ctor(System.Array) */, { 495, 70, -1 } /* System.Void System.Array/InternalEnumerator`1<System.UInt16>::Dispose() */, { 496, 70, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.UInt16>::MoveNext() */, { 497, 70, -1 } /* T System.Array/InternalEnumerator`1<System.UInt16>::get_Current() */, { 498, 70, -1 } /* System.Object System.Array/InternalEnumerator`1<System.UInt16>::System.Collections.IEnumerator.get_Current() */, { 494, 71, -1 } /* System.Void System.Array/InternalEnumerator`1<System.UInt32>::.ctor(System.Array) */, { 495, 71, -1 } /* System.Void System.Array/InternalEnumerator`1<System.UInt32>::Dispose() */, { 496, 71, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.UInt32>::MoveNext() */, { 497, 71, -1 } /* T System.Array/InternalEnumerator`1<System.UInt32>::get_Current() */, { 498, 71, -1 } /* System.Object System.Array/InternalEnumerator`1<System.UInt32>::System.Collections.IEnumerator.get_Current() */, { 494, 72, -1 } /* System.Void System.Array/InternalEnumerator`1<System.UInt64>::.ctor(System.Array) */, { 495, 72, -1 } /* System.Void System.Array/InternalEnumerator`1<System.UInt64>::Dispose() */, { 496, 72, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.UInt64>::MoveNext() */, { 497, 72, -1 } /* T System.Array/InternalEnumerator`1<System.UInt64>::get_Current() */, { 498, 72, -1 } /* System.Object System.Array/InternalEnumerator`1<System.UInt64>::System.Collections.IEnumerator.get_Current() */, { 494, 208, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor(System.Array) */, { 495, 208, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Dispose() */, { 496, 208, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::MoveNext() */, { 497, 208, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Current() */, { 498, 208, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IEnumerator.get_Current() */, { 494, 313, -1 } /* System.Void System.Array/InternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::.ctor(System.Array) */, { 495, 313, -1 } /* System.Void System.Array/InternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::Dispose() */, { 496, 313, -1 } /* System.Boolean System.Array/InternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::MoveNext() */, { 497, 313, -1 } /* T System.Array/InternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::get_Current() */, { 498, 313, -1 } /* System.Object System.Array/InternalEnumerator`1<Mono.Globalization.Unicode.CodePointIndexer/TableRange>::System.Collections.IEnumerator.get_Current() */, { 494, 314, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Hashtable/bucket>::.ctor(System.Array) */, { 495, 314, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Hashtable/bucket>::Dispose() */, { 496, 314, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Hashtable/bucket>::MoveNext() */, { 497, 314, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Hashtable/bucket>::get_Current() */, { 498, 314, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Hashtable/bucket>::System.Collections.IEnumerator.get_Current() */, { 494, 315, -1 } /* System.Void System.Array/InternalEnumerator`1<System.ParameterizedStrings/FormatParam>::.ctor(System.Array) */, { 495, 315, -1 } /* System.Void System.Array/InternalEnumerator`1<System.ParameterizedStrings/FormatParam>::Dispose() */, { 496, 315, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.ParameterizedStrings/FormatParam>::MoveNext() */, { 497, 315, -1 } /* T System.Array/InternalEnumerator`1<System.ParameterizedStrings/FormatParam>::get_Current() */, { 498, 315, -1 } /* System.Object System.Array/InternalEnumerator`1<System.ParameterizedStrings/FormatParam>::System.Collections.IEnumerator.get_Current() */, { 494, 316, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::.ctor(System.Array) */, { 495, 316, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::Dispose() */, { 496, 316, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::MoveNext() */, { 497, 316, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::get_Current() */, { 498, 316, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.SendMouseEvents/HitInfo>::System.Collections.IEnumerator.get_Current() */, { 494, 218, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor(System.Array) */, { 495, 218, -1 } /* System.Void System.Array/InternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Dispose() */, { 496, 218, -1 } /* System.Boolean System.Array/InternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::MoveNext() */, { 497, 218, -1 } /* T System.Array/InternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Current() */, { 498, 218, -1 } /* System.Object System.Array/InternalEnumerator`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IEnumerator.get_Current() */, { 494, 317, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::.ctor(System.Array) */, { 495, 317, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::Dispose() */, { 496, 317, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::MoveNext() */, { 497, 317, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::get_Current() */, { 498, 317, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Int32,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 494, 318, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::.ctor(System.Array) */, { 495, 318, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::Dispose() */, { 496, 318, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::MoveNext() */, { 497, 318, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::get_Current() */, { 498, 318, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Int32>>::System.Collections.IEnumerator.get_Current() */, { 494, 319, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::.ctor(System.Array) */, { 495, 319, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::Dispose() */, { 496, 319, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::MoveNext() */, { 497, 319, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::get_Current() */, { 498, 319, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 494, 320, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::.ctor(System.Array) */, { 495, 320, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::Dispose() */, { 496, 320, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::MoveNext() */, { 497, 320, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::get_Current() */, { 498, 320, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.Dictionary`2/Entry<System.Object,System.Resources.ResourceLocator>>::System.Collections.IEnumerator.get_Current() */, { 494, 299, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor(System.Array) */, { 495, 299, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Dispose() */, { 496, 299, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::MoveNext() */, { 497, 299, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Current() */, { 498, 299, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 494, 321, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::.ctor(System.Array) */, { 495, 321, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::Dispose() */, { 496, 321, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::MoveNext() */, { 497, 321, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::get_Current() */, { 498, 321, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 494, 322, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::.ctor(System.Array) */, { 495, 322, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::Dispose() */, { 496, 322, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::MoveNext() */, { 497, 322, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::get_Current() */, { 498, 322, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>>::System.Collections.IEnumerator.get_Current() */, { 494, 323, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::.ctor(System.Array) */, { 495, 323, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::Dispose() */, { 496, 323, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::MoveNext() */, { 497, 323, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::get_Current() */, { 498, 323, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Object>>::System.Collections.IEnumerator.get_Current() */, { 494, 324, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::.ctor(System.Array) */, { 495, 324, -1 } /* System.Void System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::Dispose() */, { 496, 324, -1 } /* System.Boolean System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::MoveNext() */, { 497, 324, -1 } /* T System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::get_Current() */, { 498, 324, -1 } /* System.Object System.Array/InternalEnumerator`1<System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>>::System.Collections.IEnumerator.get_Current() */, { 9631, 5, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Boolean>::add_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9632, 5, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Boolean>::remove_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9633, 5, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Boolean>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9634, 5, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Boolean>::.ctor(UnityEngine.Events.UnityAction`1<T1>) */, { 9635, 5, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Boolean>::Invoke(System.Object[]) */, { 9636, 5, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Boolean>::Invoke(T1) */, { 9637, 5, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`1<System.Boolean>::Find(System.Object,System.Reflection.MethodInfo) */, { 9631, 0, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Int32>::add_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9632, 0, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Int32>::remove_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9633, 0, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Int32>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9634, 0, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Int32>::.ctor(UnityEngine.Events.UnityAction`1<T1>) */, { 9635, 0, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Int32>::Invoke(System.Object[]) */, { 9636, 0, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Int32>::Invoke(T1) */, { 9637, 0, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`1<System.Int32>::Find(System.Object,System.Reflection.MethodInfo) */, { 9631, 60, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Single>::add_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9632, 60, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Single>::remove_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9633, 60, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Single>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9634, 60, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Single>::.ctor(UnityEngine.Events.UnityAction`1<T1>) */, { 9635, 60, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Single>::Invoke(System.Object[]) */, { 9636, 60, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<System.Single>::Invoke(T1) */, { 9637, 60, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`1<System.Single>::Find(System.Object,System.Reflection.MethodInfo) */, { 8317, 7, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>::.ctor(TKey,TValue) */, { 8318, 7, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>::get_Key() */, { 8319, 7, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>::get_Value() */, { 8320, 7, -1 } /* System.String System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>::ToString() */, { 8320, 181, -1 } /* System.String System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>::ToString() */, { 8317, 8, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>::.ctor(TKey,TValue) */, { 8318, 8, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>::get_Key() */, { 8319, 8, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>::get_Value() */, { 8320, 8, -1 } /* System.String System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>::ToString() */, { 8317, 9, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>::.ctor(TKey,TValue) */, { 8318, 9, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>::get_Key() */, { 8319, 9, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>::get_Value() */, { 8320, 9, -1 } /* System.String System.Collections.Generic.KeyValuePair`2<System.Object,System.Int32>::ToString() */, { 8317, 11, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>::.ctor(TKey,TValue) */, { 8318, 11, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>::get_Key() */, { 8319, 11, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>::get_Value() */, { 8320, 11, -1 } /* System.String System.Collections.Generic.KeyValuePair`2<System.Object,System.Resources.ResourceLocator>::ToString() */, { 8502, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::.ctor(System.Int32) */, { 8503, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8504, 0, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Int32>::get_Capacity() */, { 8505, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::set_Capacity(System.Int32) */, { 8506, 0, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Int32>::get_Count() */, { 8507, 0, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Int32>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8508, 0, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.get_IsReadOnly() */, { 8509, 0, -1 } /* T System.Collections.Generic.List`1<System.Int32>::get_Item(System.Int32) */, { 8510, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::set_Item(System.Int32,T) */, { 8511, 0, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Int32>::IsCompatibleObject(System.Object) */, { 8512, 0, -1 } /* System.Object System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.get_Item(System.Int32) */, { 8513, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8515, 0, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.Add(System.Object) */, { 8516, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 8517, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Clear() */, { 8518, 0, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Int32>::Contains(T) */, { 8519, 0, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.Contains(System.Object) */, { 8520, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::CopyTo(T[]) */, { 8521, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8522, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::CopyTo(T[],System.Int32) */, { 8523, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::EnsureCapacity(System.Int32) */, { 8525, 0, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.List`1<System.Int32>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 8526, 0, -1 } /* System.Collections.IEnumerator System.Collections.Generic.List`1<System.Int32>::System.Collections.IEnumerable.GetEnumerator() */, { 8527, 0, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Int32>::IndexOf(T) */, { 8528, 0, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.IndexOf(System.Object) */, { 8529, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Insert(System.Int32,T) */, { 8530, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8531, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::InsertRange(System.Int32,System.Collections.Generic.IEnumerable`1<T>) */, { 8533, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::System.Collections.IList.Remove(System.Object) */, { 8534, 0, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Int32>::RemoveAll(System.Predicate`1<T>) */, { 8535, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::RemoveAt(System.Int32) */, { 8536, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Reverse() */, { 8537, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Reverse(System.Int32,System.Int32) */, { 8538, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Sort(System.Collections.Generic.IComparer`1<T>) */, { 8539, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8540, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::Sort(System.Comparison`1<T>) */, { 8542, 0, -1 } /* System.Void System.Collections.Generic.List`1<System.Int32>::.cctor() */, { 8502, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor(System.Int32) */, { 8503, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8504, 208, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::get_Capacity() */, { 8505, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::set_Capacity(System.Int32) */, { 8507, 208, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8508, 208, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.get_IsReadOnly() */, { 8510, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::set_Item(System.Int32,T) */, { 8511, 208, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::IsCompatibleObject(System.Object) */, { 8512, 208, -1 } /* System.Object System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.get_Item(System.Int32) */, { 8513, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8514, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Add(T) */, { 8515, 208, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.Add(System.Object) */, { 8516, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 8517, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Clear() */, { 8518, 208, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Contains(T) */, { 8519, 208, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.Contains(System.Object) */, { 8520, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::CopyTo(T[]) */, { 8521, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8522, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::CopyTo(T[],System.Int32) */, { 8523, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::EnsureCapacity(System.Int32) */, { 8524, 208, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::GetEnumerator() */, { 8525, 208, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 8526, 208, -1 } /* System.Collections.IEnumerator System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IEnumerable.GetEnumerator() */, { 8527, 208, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::IndexOf(T) */, { 8528, 208, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.IndexOf(System.Object) */, { 8529, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Insert(System.Int32,T) */, { 8530, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8531, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::InsertRange(System.Int32,System.Collections.Generic.IEnumerable`1<T>) */, { 8532, 208, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Remove(T) */, { 8533, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::System.Collections.IList.Remove(System.Object) */, { 8534, 208, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::RemoveAll(System.Predicate`1<T>) */, { 8535, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::RemoveAt(System.Int32) */, { 8536, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Reverse() */, { 8537, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Reverse(System.Int32,System.Int32) */, { 8538, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Sort(System.Collections.Generic.IComparer`1<T>) */, { 8539, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8540, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Sort(System.Comparison`1<T>) */, { 8541, 208, -1 } /* T[] System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::ToArray() */, { 8542, 208, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.cctor() */, { 8501, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor() */, { 8503, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8504, 218, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::get_Capacity() */, { 8505, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::set_Capacity(System.Int32) */, { 8507, 218, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8508, 218, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.get_IsReadOnly() */, { 8510, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::set_Item(System.Int32,T) */, { 8511, 218, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::IsCompatibleObject(System.Object) */, { 8512, 218, -1 } /* System.Object System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.get_Item(System.Int32) */, { 8513, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8515, 218, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.Add(System.Object) */, { 8518, 218, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Contains(T) */, { 8519, 218, -1 } /* System.Boolean System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.Contains(System.Object) */, { 8520, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::CopyTo(T[]) */, { 8521, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8522, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::CopyTo(T[],System.Int32) */, { 8523, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::EnsureCapacity(System.Int32) */, { 8524, 218, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::GetEnumerator() */, { 8525, 218, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 8526, 218, -1 } /* System.Collections.IEnumerator System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IEnumerable.GetEnumerator() */, { 8527, 218, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::IndexOf(T) */, { 8528, 218, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.IndexOf(System.Object) */, { 8529, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Insert(System.Int32,T) */, { 8530, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8531, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::InsertRange(System.Int32,System.Collections.Generic.IEnumerable`1<T>) */, { 8533, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::System.Collections.IList.Remove(System.Object) */, { 8534, 218, -1 } /* System.Int32 System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::RemoveAll(System.Predicate`1<T>) */, { 8535, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::RemoveAt(System.Int32) */, { 8536, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Reverse() */, { 8537, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Reverse(System.Int32,System.Int32) */, { 8538, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Sort(System.Collections.Generic.IComparer`1<T>) */, { 8539, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8540, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Sort(System.Comparison`1<T>) */, { 8541, 218, -1 } /* T[] System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::ToArray() */, { 8542, 218, -1 } /* System.Void System.Collections.Generic.List`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.cctor() */, { 8501, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor() */, { 8502, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor(System.Int32) */, { 8503, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor(System.Collections.Generic.IEnumerable`1<T>) */, { 8504, 299, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Capacity() */, { 8505, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::set_Capacity(System.Int32) */, { 8506, 299, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Count() */, { 8507, 299, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8508, 299, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.get_IsReadOnly() */, { 8509, 299, -1 } /* T System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::get_Item(System.Int32) */, { 8510, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::set_Item(System.Int32,T) */, { 8511, 299, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::IsCompatibleObject(System.Object) */, { 8512, 299, -1 } /* System.Object System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.get_Item(System.Int32) */, { 8513, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8514, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Add(T) */, { 8515, 299, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.Add(System.Object) */, { 8516, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::AddRange(System.Collections.Generic.IEnumerable`1<T>) */, { 8517, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Clear() */, { 8518, 299, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Contains(T) */, { 8519, 299, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.Contains(System.Object) */, { 8520, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::CopyTo(T[]) */, { 8521, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8522, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::CopyTo(T[],System.Int32) */, { 8523, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::EnsureCapacity(System.Int32) */, { 8524, 299, -1 } /* System.Collections.Generic.List`1/Enumerator<T> System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::GetEnumerator() */, { 8525, 299, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 8526, 299, -1 } /* System.Collections.IEnumerator System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IEnumerable.GetEnumerator() */, { 8527, 299, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::IndexOf(T) */, { 8528, 299, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.IndexOf(System.Object) */, { 8529, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Insert(System.Int32,T) */, { 8530, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8531, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::InsertRange(System.Int32,System.Collections.Generic.IEnumerable`1<T>) */, { 8532, 299, -1 } /* System.Boolean System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Remove(T) */, { 8533, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::System.Collections.IList.Remove(System.Object) */, { 8534, 299, -1 } /* System.Int32 System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::RemoveAll(System.Predicate`1<T>) */, { 8535, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::RemoveAt(System.Int32) */, { 8536, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Reverse() */, { 8537, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Reverse(System.Int32,System.Int32) */, { 8538, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Sort(System.Collections.Generic.IComparer`1<T>) */, { 8539, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8540, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Sort(System.Comparison`1<T>) */, { 8541, 299, -1 } /* T[] System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::ToArray() */, { 8542, 299, -1 } /* System.Void System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.cctor() */, { 9060, 239, -1 } /* System.Int32 Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::get_Length() */, { 9061, 239, -1 } /* T Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::get_Item(System.Int32) */, { 9062, 239, -1 } /* System.Void Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::set_Item(System.Int32,T) */, { 9063, 239, -1 } /* System.Void Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::Dispose() */, { 9064, 239, -1 } /* Unity.Collections.NativeArray`1/Enumerator<T> Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::GetEnumerator() */, { 9065, 239, -1 } /* System.Collections.Generic.IEnumerator`1<T> Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 9066, 239, -1 } /* System.Collections.IEnumerator Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::System.Collections.IEnumerable.GetEnumerator() */, { 9067, 239, -1 } /* System.Boolean Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::Equals(Unity.Collections.NativeArray`1<T>) */, { 9068, 239, -1 } /* System.Boolean Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::Equals(System.Object) */, { 9069, 239, -1 } /* System.Int32 Unity.Collections.NativeArray`1<UnityEngine.Rendering.BatchVisibility>::GetHashCode() */, { 9060, 44, -1 } /* System.Int32 Unity.Collections.NativeArray`1<System.Byte>::get_Length() */, { 9061, 44, -1 } /* T Unity.Collections.NativeArray`1<System.Byte>::get_Item(System.Int32) */, { 9062, 44, -1 } /* System.Void Unity.Collections.NativeArray`1<System.Byte>::set_Item(System.Int32,T) */, { 9063, 44, -1 } /* System.Void Unity.Collections.NativeArray`1<System.Byte>::Dispose() */, { 9064, 44, -1 } /* Unity.Collections.NativeArray`1/Enumerator<T> Unity.Collections.NativeArray`1<System.Byte>::GetEnumerator() */, { 9065, 44, -1 } /* System.Collections.Generic.IEnumerator`1<T> Unity.Collections.NativeArray`1<System.Byte>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 9066, 44, -1 } /* System.Collections.IEnumerator Unity.Collections.NativeArray`1<System.Byte>::System.Collections.IEnumerable.GetEnumerator() */, { 9067, 44, -1 } /* System.Boolean Unity.Collections.NativeArray`1<System.Byte>::Equals(Unity.Collections.NativeArray`1<T>) */, { 9068, 44, -1 } /* System.Boolean Unity.Collections.NativeArray`1<System.Byte>::Equals(System.Object) */, { 9069, 44, -1 } /* System.Int32 Unity.Collections.NativeArray`1<System.Byte>::GetHashCode() */, { 9060, 0, -1 } /* System.Int32 Unity.Collections.NativeArray`1<System.Int32>::get_Length() */, { 9061, 0, -1 } /* T Unity.Collections.NativeArray`1<System.Int32>::get_Item(System.Int32) */, { 9062, 0, -1 } /* System.Void Unity.Collections.NativeArray`1<System.Int32>::set_Item(System.Int32,T) */, { 9063, 0, -1 } /* System.Void Unity.Collections.NativeArray`1<System.Int32>::Dispose() */, { 9064, 0, -1 } /* Unity.Collections.NativeArray`1/Enumerator<T> Unity.Collections.NativeArray`1<System.Int32>::GetEnumerator() */, { 9065, 0, -1 } /* System.Collections.Generic.IEnumerator`1<T> Unity.Collections.NativeArray`1<System.Int32>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 9066, 0, -1 } /* System.Collections.IEnumerator Unity.Collections.NativeArray`1<System.Int32>::System.Collections.IEnumerable.GetEnumerator() */, { 9067, 0, -1 } /* System.Boolean Unity.Collections.NativeArray`1<System.Int32>::Equals(Unity.Collections.NativeArray`1<T>) */, { 9068, 0, -1 } /* System.Boolean Unity.Collections.NativeArray`1<System.Int32>::Equals(System.Object) */, { 9069, 0, -1 } /* System.Int32 Unity.Collections.NativeArray`1<System.Int32>::GetHashCode() */, { 9060, 245, -1 } /* System.Int32 Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::get_Length() */, { 9061, 245, -1 } /* T Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::get_Item(System.Int32) */, { 9062, 245, -1 } /* System.Void Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::set_Item(System.Int32,T) */, { 9063, 245, -1 } /* System.Void Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::Dispose() */, { 9064, 245, -1 } /* Unity.Collections.NativeArray`1/Enumerator<T> Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::GetEnumerator() */, { 9065, 245, -1 } /* System.Collections.Generic.IEnumerator`1<T> Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 9066, 245, -1 } /* System.Collections.IEnumerator Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::System.Collections.IEnumerable.GetEnumerator() */, { 9067, 245, -1 } /* System.Boolean Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::Equals(Unity.Collections.NativeArray`1<T>) */, { 9068, 245, -1 } /* System.Boolean Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::Equals(System.Object) */, { 9069, 245, -1 } /* System.Int32 Unity.Collections.NativeArray`1<UnityEngine.Experimental.GlobalIllumination.LightDataGI>::GetHashCode() */, { 9060, 238, -1 } /* System.Int32 Unity.Collections.NativeArray`1<UnityEngine.Plane>::get_Length() */, { 9061, 238, -1 } /* T Unity.Collections.NativeArray`1<UnityEngine.Plane>::get_Item(System.Int32) */, { 9062, 238, -1 } /* System.Void Unity.Collections.NativeArray`1<UnityEngine.Plane>::set_Item(System.Int32,T) */, { 9063, 238, -1 } /* System.Void Unity.Collections.NativeArray`1<UnityEngine.Plane>::Dispose() */, { 9064, 238, -1 } /* Unity.Collections.NativeArray`1/Enumerator<T> Unity.Collections.NativeArray`1<UnityEngine.Plane>::GetEnumerator() */, { 9065, 238, -1 } /* System.Collections.Generic.IEnumerator`1<T> Unity.Collections.NativeArray`1<UnityEngine.Plane>::System.Collections.Generic.IEnumerable<T>.GetEnumerator() */, { 9066, 238, -1 } /* System.Collections.IEnumerator Unity.Collections.NativeArray`1<UnityEngine.Plane>::System.Collections.IEnumerable.GetEnumerator() */, { 9067, 238, -1 } /* System.Boolean Unity.Collections.NativeArray`1<UnityEngine.Plane>::Equals(Unity.Collections.NativeArray`1<T>) */, { 9068, 238, -1 } /* System.Boolean Unity.Collections.NativeArray`1<UnityEngine.Plane>::Equals(System.Object) */, { 9069, 238, -1 } /* System.Int32 Unity.Collections.NativeArray`1<UnityEngine.Plane>::GetHashCode() */, { 2826, 5, -1 } /* System.Boolean System.Nullable`1<System.Boolean>::Equals(System.Object) */, { 2827, 5, -1 } /* System.Boolean System.Nullable`1<System.Boolean>::Equals(System.Nullable`1<T>) */, { 2828, 5, -1 } /* System.Int32 System.Nullable`1<System.Boolean>::GetHashCode() */, { 2829, 5, -1 } /* System.String System.Nullable`1<System.Boolean>::ToString() */, { 2830, 5, -1 } /* System.Object System.Nullable`1<System.Boolean>::Box(System.Nullable`1<T>) */, { 2831, 5, -1 } /* System.Nullable`1<T> System.Nullable`1<System.Boolean>::Unbox(System.Object) */, { 2823, 0, -1 } /* System.Void System.Nullable`1<System.Int32>::.ctor(T) */, { 2826, 0, -1 } /* System.Boolean System.Nullable`1<System.Int32>::Equals(System.Object) */, { 2827, 0, -1 } /* System.Boolean System.Nullable`1<System.Int32>::Equals(System.Nullable`1<T>) */, { 2828, 0, -1 } /* System.Int32 System.Nullable`1<System.Int32>::GetHashCode() */, { 2829, 0, -1 } /* System.String System.Nullable`1<System.Int32>::ToString() */, { 2830, 0, -1 } /* System.Object System.Nullable`1<System.Int32>::Box(System.Nullable`1<T>) */, { 2831, 0, -1 } /* System.Nullable`1<T> System.Nullable`1<System.Int32>::Unbox(System.Object) */, { 8412, 0, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.Int32>::Compare(T,T) */, { 8413, 0, -1 } /* System.Boolean System.Collections.Generic.ObjectComparer`1<System.Int32>::Equals(System.Object) */, { 8414, 0, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.Int32>::GetHashCode() */, { 8415, 0, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<System.Int32>::.ctor() */, { 8412, 72, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.UInt64>::Compare(T,T) */, { 8413, 72, -1 } /* System.Boolean System.Collections.Generic.ObjectComparer`1<System.UInt64>::Equals(System.Object) */, { 8414, 72, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.UInt64>::GetHashCode() */, { 8415, 72, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<System.UInt64>::.ctor() */, { 8412, 208, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Compare(T,T) */, { 8413, 208, -1 } /* System.Boolean System.Collections.Generic.ObjectComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Equals(System.Object) */, { 8414, 208, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::GetHashCode() */, { 8415, 208, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor() */, { 8412, 218, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Compare(T,T) */, { 8413, 218, -1 } /* System.Boolean System.Collections.Generic.ObjectComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Equals(System.Object) */, { 8414, 218, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::GetHashCode() */, { 8415, 218, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor() */, { 8412, 299, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Compare(T,T) */, { 8413, 299, -1 } /* System.Boolean System.Collections.Generic.ObjectComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Equals(System.Object) */, { 8414, 299, -1 } /* System.Int32 System.Collections.Generic.ObjectComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::GetHashCode() */, { 8415, 299, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor() */, { 8439, 44, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::Equals(T,T) */, { 8440, 44, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::GetHashCode(T) */, { 8441, 44, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 44, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 44, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::Equals(System.Object) */, { 8444, 44, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::GetHashCode() */, { 8445, 44, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<System.Byte>::.ctor() */, { 8439, 0, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::Equals(T,T) */, { 8440, 0, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::GetHashCode(T) */, { 8441, 0, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 0, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 0, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::Equals(System.Object) */, { 8444, 0, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::GetHashCode() */, { 8445, 0, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<System.Int32>::.ctor() */, { 8439, 312, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::Equals(T,T) */, { 8440, 312, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::GetHashCode(T) */, { 8441, 312, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 312, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 312, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::Equals(System.Object) */, { 8444, 312, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::GetHashCode() */, { 8445, 312, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<System.Resources.ResourceLocator>::.ctor() */, { 8439, 208, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Equals(T,T) */, { 8440, 208, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::GetHashCode(T) */, { 8441, 208, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 208, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 208, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Equals(System.Object) */, { 8444, 208, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::GetHashCode() */, { 8445, 208, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor() */, { 8439, 218, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Equals(T,T) */, { 8440, 218, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::GetHashCode(T) */, { 8441, 218, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 218, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 218, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Equals(System.Object) */, { 8444, 218, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::GetHashCode() */, { 8445, 218, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor() */, { 8439, 299, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Equals(T,T) */, { 8440, 299, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::GetHashCode(T) */, { 8441, 299, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8442, 299, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8443, 299, -1 } /* System.Boolean System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Equals(System.Object) */, { 8444, 299, -1 } /* System.Int32 System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::GetHashCode() */, { 8445, 299, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor() */, { 641, 0, -1 } /* System.Void System.Predicate`1<System.Int32>::.ctor(System.Object,System.IntPtr) */, { 642, 0, -1 } /* System.Boolean System.Predicate`1<System.Int32>::Invoke(T) */, { 643, 0, -1 } /* System.IAsyncResult System.Predicate`1<System.Int32>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 644, 0, -1 } /* System.Boolean System.Predicate`1<System.Int32>::EndInvoke(System.IAsyncResult) */, { 641, 208, -1 } /* System.Void System.Predicate`1<UnityEngine.BeforeRenderHelper/OrderBlock>::.ctor(System.Object,System.IntPtr) */, { 642, 208, -1 } /* System.Boolean System.Predicate`1<UnityEngine.BeforeRenderHelper/OrderBlock>::Invoke(T) */, { 643, 208, -1 } /* System.IAsyncResult System.Predicate`1<UnityEngine.BeforeRenderHelper/OrderBlock>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 644, 208, -1 } /* System.Boolean System.Predicate`1<UnityEngine.BeforeRenderHelper/OrderBlock>::EndInvoke(System.IAsyncResult) */, { 641, 218, -1 } /* System.Void System.Predicate`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::.ctor(System.Object,System.IntPtr) */, { 642, 218, -1 } /* System.Boolean System.Predicate`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::Invoke(T) */, { 643, 218, -1 } /* System.IAsyncResult System.Predicate`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 644, 218, -1 } /* System.Boolean System.Predicate`1<UnityEngine.UnitySynchronizationContext/WorkRequest>::EndInvoke(System.IAsyncResult) */, { 641, 299, -1 } /* System.Void System.Predicate`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::.ctor(System.Object,System.IntPtr) */, { 642, 299, -1 } /* System.Boolean System.Predicate`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::Invoke(T) */, { 643, 299, -1 } /* System.IAsyncResult System.Predicate`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::BeginInvoke(T,System.AsyncCallback,System.Object) */, { 644, 299, -1 } /* System.Boolean System.Predicate`1<System.Collections.Generic.KeyValuePair`2<System.DateTime,System.Object>>::EndInvoke(System.IAsyncResult) */, { 8231, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::.ctor(System.Collections.Generic.IList`1<T>) */, { 8232, 85, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::get_Count() */, { 8233, 85, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::get_Item(System.Int32) */, { 8234, 85, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::Contains(T) */, { 8235, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::CopyTo(T[],System.Int32) */, { 8236, 85, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::GetEnumerator() */, { 8237, 85, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::IndexOf(T) */, { 8238, 85, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8239, 85, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.IList<T>.get_Item(System.Int32) */, { 8240, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.IList<T>.set_Item(System.Int32,T) */, { 8241, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.ICollection<T>.Add(T) */, { 8242, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.ICollection<T>.Clear() */, { 8243, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.IList<T>.Insert(System.Int32,T) */, { 8244, 85, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.ICollection<T>.Remove(T) */, { 8245, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.Generic.IList<T>.RemoveAt(System.Int32) */, { 8246, 85, -1 } /* System.Collections.IEnumerator System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IEnumerable.GetEnumerator() */, { 8247, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8248, 85, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.get_IsReadOnly() */, { 8249, 85, -1 } /* System.Object System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.get_Item(System.Int32) */, { 8250, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8251, 85, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.Add(System.Object) */, { 8252, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.Clear() */, { 8253, 85, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::IsCompatibleObject(System.Object) */, { 8254, 85, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.Contains(System.Object) */, { 8255, 85, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.IndexOf(System.Object) */, { 8256, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8257, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.Remove(System.Object) */, { 8258, 85, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeNamedArgument>::System.Collections.IList.RemoveAt(System.Int32) */, { 8232, 84, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::get_Count() */, { 8233, 84, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::get_Item(System.Int32) */, { 8234, 84, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::Contains(T) */, { 8235, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::CopyTo(T[],System.Int32) */, { 8236, 84, -1 } /* System.Collections.Generic.IEnumerator`1<T> System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::GetEnumerator() */, { 8237, 84, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::IndexOf(T) */, { 8238, 84, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.ICollection<T>.get_IsReadOnly() */, { 8239, 84, -1 } /* T System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.IList<T>.get_Item(System.Int32) */, { 8240, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.IList<T>.set_Item(System.Int32,T) */, { 8241, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.ICollection<T>.Add(T) */, { 8242, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.ICollection<T>.Clear() */, { 8243, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.IList<T>.Insert(System.Int32,T) */, { 8244, 84, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.ICollection<T>.Remove(T) */, { 8245, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.Generic.IList<T>.RemoveAt(System.Int32) */, { 8246, 84, -1 } /* System.Collections.IEnumerator System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IEnumerable.GetEnumerator() */, { 8247, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.ICollection.CopyTo(System.Array,System.Int32) */, { 8248, 84, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.get_IsReadOnly() */, { 8249, 84, -1 } /* System.Object System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.get_Item(System.Int32) */, { 8250, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.set_Item(System.Int32,System.Object) */, { 8251, 84, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.Add(System.Object) */, { 8252, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.Clear() */, { 8253, 84, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::IsCompatibleObject(System.Object) */, { 8254, 84, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.Contains(System.Object) */, { 8255, 84, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.IndexOf(System.Object) */, { 8256, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.Insert(System.Int32,System.Object) */, { 8257, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.Remove(System.Object) */, { 8258, 84, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<System.Reflection.CustomAttributeTypedArgument>::System.Collections.IList.RemoveAt(System.Int32) */, { 7842, 5, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Boolean>::.ctor(System.Threading.Tasks.Task`1<TResult>) */, { 7843, 5, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Boolean>::UnsafeOnCompleted(System.Action) */, { 7842, 0, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Int32>::.ctor(System.Threading.Tasks.Task`1<TResult>) */, { 7843, 0, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Int32>::UnsafeOnCompleted(System.Action) */, { 7842, 119, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Threading.Tasks.Task`1<TResult>) */, { 7843, 119, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<System.Threading.Tasks.VoidTaskResult>::UnsafeOnCompleted(System.Action) */, { 7844, 119, -1 } /* TResult System.Runtime.CompilerServices.TaskAwaiter`1<System.Threading.Tasks.VoidTaskResult>::GetResult() */, { 6059, 5, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Boolean>::.ctor() */, { 6060, 5, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Boolean>::.ctor(System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.TaskContinuationOptions,System.Threading.Tasks.TaskScheduler) */, { 6059, 0, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Int32>::.ctor() */, { 6060, 0, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Int32>::.ctor(System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.TaskContinuationOptions,System.Threading.Tasks.TaskScheduler) */, { 6059, 119, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Threading.Tasks.VoidTaskResult>::.ctor() */, { 6060, 119, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.TaskContinuationOptions,System.Threading.Tasks.TaskScheduler) */, { 6041, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::.ctor(TResult) */, { 6043, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::.ctor(System.Func`2<System.Object,TResult>,System.Object,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions) */, { 6044, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::.ctor(System.Delegate,System.Object,System.Threading.Tasks.Task,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.InternalTaskOptions,System.Threading.Tasks.TaskScheduler) */, { 6046, 5, -1 } /* TResult System.Threading.Tasks.Task`1<System.Boolean>::get_Result() */, { 6047, 5, -1 } /* TResult System.Threading.Tasks.Task`1<System.Boolean>::get_ResultOnSuccess() */, { 6048, 5, -1 } /* TResult System.Threading.Tasks.Task`1<System.Boolean>::GetResultCore(System.Boolean) */, { 6049, 5, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Boolean>::TrySetException(System.Object) */, { 6050, 5, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Boolean>::TrySetCanceled(System.Threading.CancellationToken) */, { 6051, 5, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Boolean>::TrySetCanceled(System.Threading.CancellationToken,System.Object) */, { 6052, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::InnerInvoke() */, { 6055, 5, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Boolean>::.cctor() */, { 6040, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::.ctor() */, { 6041, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::.ctor(TResult) */, { 6042, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::.ctor(System.Boolean,TResult,System.Threading.Tasks.TaskCreationOptions,System.Threading.CancellationToken) */, { 6044, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::.ctor(System.Delegate,System.Object,System.Threading.Tasks.Task,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.InternalTaskOptions,System.Threading.Tasks.TaskScheduler) */, { 6045, 0, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Int32>::TrySetResult(TResult) */, { 6046, 0, -1 } /* TResult System.Threading.Tasks.Task`1<System.Int32>::get_Result() */, { 6047, 0, -1 } /* TResult System.Threading.Tasks.Task`1<System.Int32>::get_ResultOnSuccess() */, { 6048, 0, -1 } /* TResult System.Threading.Tasks.Task`1<System.Int32>::GetResultCore(System.Boolean) */, { 6049, 0, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Int32>::TrySetException(System.Object) */, { 6050, 0, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Int32>::TrySetCanceled(System.Threading.CancellationToken) */, { 6051, 0, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Int32>::TrySetCanceled(System.Threading.CancellationToken,System.Object) */, { 6052, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::InnerInvoke() */, { 6054, 0, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult> System.Threading.Tasks.Task`1<System.Int32>::ConfigureAwait(System.Boolean) */, { 6055, 0, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Int32>::.cctor() */, { 6041, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::.ctor(TResult) */, { 6042, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Boolean,TResult,System.Threading.Tasks.TaskCreationOptions,System.Threading.CancellationToken) */, { 6043, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Func`2<System.Object,TResult>,System.Object,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions) */, { 6044, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::.ctor(System.Delegate,System.Object,System.Threading.Tasks.Task,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.InternalTaskOptions,System.Threading.Tasks.TaskScheduler) */, { 6046, 119, -1 } /* TResult System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::get_Result() */, { 6047, 119, -1 } /* TResult System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::get_ResultOnSuccess() */, { 6048, 119, -1 } /* TResult System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::GetResultCore(System.Boolean) */, { 6049, 119, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::TrySetException(System.Object) */, { 6051, 119, -1 } /* System.Boolean System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::TrySetCanceled(System.Threading.CancellationToken,System.Object) */, { 6052, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::InnerInvoke() */, { 6053, 119, -1 } /* System.Runtime.CompilerServices.TaskAwaiter`1<TResult> System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::GetAwaiter() */, { 6054, 119, -1 } /* System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult> System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::ConfigureAwait(System.Boolean) */, { 6055, 119, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>::.cctor() */, { 529, 333, -1 } /* T1 System.Tuple`2<System.Object,System.Char>::get_Item1() */, { 530, 333, -1 } /* T2 System.Tuple`2<System.Object,System.Char>::get_Item2() */, { 531, 333, -1 } /* System.Void System.Tuple`2<System.Object,System.Char>::.ctor(T1,T2) */, { 532, 333, -1 } /* System.Boolean System.Tuple`2<System.Object,System.Char>::Equals(System.Object) */, { 533, 333, -1 } /* System.Boolean System.Tuple`2<System.Object,System.Char>::System.Collections.IStructuralEquatable.Equals(System.Object,System.Collections.IEqualityComparer) */, { 534, 333, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Char>::System.IComparable.CompareTo(System.Object) */, { 535, 333, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Char>::System.Collections.IStructuralComparable.CompareTo(System.Object,System.Collections.IComparer) */, { 536, 333, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Char>::GetHashCode() */, { 537, 333, -1 } /* System.Int32 System.Tuple`2<System.Object,System.Char>::System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer) */, { 538, 333, -1 } /* System.String System.Tuple`2<System.Object,System.Char>::ToString() */, { 539, 333, -1 } /* System.String System.Tuple`2<System.Object,System.Char>::System.ITupleInternal.ToString(System.Text.StringBuilder) */, { 552, 334, -1 } /* T1 System.Tuple`4<System.Object,System.Object,System.Int32,System.Int32>::get_Item1() */, { 553, 334, -1 } /* T2 System.Tuple`4<System.Object,System.Object,System.Int32,System.Int32>::get_Item2() */, { 554, 334, -1 } /* T3 System.Tuple`4<System.Object,System.Object,System.Int32,System.Int32>::get_Item3() */, { 555, 334, -1 } /* T4 System.Tuple`4<System.Object,System.Object,System.Int32,System.Int32>::get_Item4() */, { 9690, 5, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 9691, 5, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Boolean>::Invoke(T0) */, { 9692, 5, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`1<System.Boolean>::BeginInvoke(T0,System.AsyncCallback,System.Object) */, { 9693, 5, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Boolean>::EndInvoke(System.IAsyncResult) */, { 9690, 0, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Int32>::.ctor(System.Object,System.IntPtr) */, { 9692, 0, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`1<System.Int32>::BeginInvoke(T0,System.AsyncCallback,System.Object) */, { 9693, 0, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Int32>::EndInvoke(System.IAsyncResult) */, { 9690, 232, -1 } /* System.Void UnityEngine.Events.UnityAction`1<UnityEngine.SceneManagement.Scene>::.ctor(System.Object,System.IntPtr) */, { 9692, 232, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`1<UnityEngine.SceneManagement.Scene>::BeginInvoke(T0,System.AsyncCallback,System.Object) */, { 9693, 232, -1 } /* System.Void UnityEngine.Events.UnityAction`1<UnityEngine.SceneManagement.Scene>::EndInvoke(System.IAsyncResult) */, { 9690, 60, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Single>::.ctor(System.Object,System.IntPtr) */, { 9691, 60, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Single>::Invoke(T0) */, { 9692, 60, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`1<System.Single>::BeginInvoke(T0,System.AsyncCallback,System.Object) */, { 9693, 60, -1 } /* System.Void UnityEngine.Events.UnityAction`1<System.Single>::EndInvoke(System.IAsyncResult) */, { 9701, 335, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,System.Int32Enum>::.ctor(System.Object,System.IntPtr) */, { 9702, 335, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,System.Int32Enum>::Invoke(T0,T1) */, { 9703, 335, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,System.Int32Enum>::BeginInvoke(T0,T1,System.AsyncCallback,System.Object) */, { 9704, 335, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,System.Int32Enum>::EndInvoke(System.IAsyncResult) */, { 9701, 233, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.Scene>::.ctor(System.Object,System.IntPtr) */, { 9703, 233, -1 } /* System.IAsyncResult UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.Scene>::BeginInvoke(T0,T1,System.AsyncCallback,System.Object) */, { 9704, 233, -1 } /* System.Void UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.Scene>::EndInvoke(System.IAsyncResult) */, { 9697, 0, -1 } /* System.Reflection.MethodInfo UnityEngine.Events.UnityEvent`1<System.Int32>::FindMethod_Impl(System.String,System.Type) */, { 9698, 0, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`1<System.Int32>::GetDelegate(System.Object,System.Reflection.MethodInfo) */, { 9699, 0, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`1<System.Int32>::GetDelegate(UnityEngine.Events.UnityAction`1<T0>) */, { 4573, 89, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.IO.Iterator`1<TSource>::GetEnumerator() */, { 4576, 89, -1 } /* System.Collections.IEnumerator System.IO.Iterator`1<TSource>::System.Collections.IEnumerable.GetEnumerator() */, { 4569, 89, -1 } /* TSource System.IO.Iterator`1<TSource>::get_Current() */, { 4571, 89, -1 } /* System.Void System.IO.Iterator`1<TSource>::Dispose() */, { 4575, 89, -1 } /* System.Object System.IO.Iterator`1<TSource>::System.Collections.IEnumerator.get_Current() */, { 6052, 4, -1 } /* System.Void System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>::InnerInvoke() */, { 8423, 12, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.String>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 12, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.String>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8420, 12, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.String>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 12, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.String>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8402, 155, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<T>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8402, 157, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<System.Nullable`1<T>>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8402, 158, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<T>::System.Collections.IComparer.Compare(System.Object,System.Object) */, { 8423, 160, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 160, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 162, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<System.Nullable`1<T>>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 162, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<System.Nullable`1<T>>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 163, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 163, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8423, 164, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 164, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8420, 164, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 164, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8458, 165, -1 } /* System.Boolean System.Collections.Generic.EnumEqualityComparer`1<T>::Equals(System.Object) */, { 8459, 165, -1 } /* System.Int32 System.Collections.Generic.EnumEqualityComparer`1<T>::GetHashCode() */, { 8423, 165, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 165, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8453, 165, -1 } /* System.Boolean System.Collections.Generic.EnumEqualityComparer`1<T>::Equals(T,T) */, { 8420, 165, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 165, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8457, 165, -1 } /* System.Void System.Collections.Generic.EnumEqualityComparer`1<T>::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8458, 166, -1 } /* System.Boolean System.Collections.Generic.EnumEqualityComparer`1<T>::Equals(System.Object) */, { 8459, 166, -1 } /* System.Int32 System.Collections.Generic.EnumEqualityComparer`1<T>::GetHashCode() */, { 8423, 166, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 166, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8453, 166, -1 } /* System.Boolean System.Collections.Generic.EnumEqualityComparer`1<T>::Equals(T,T) */, { 8420, 166, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 166, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8457, 166, -1 } /* System.Void System.Collections.Generic.EnumEqualityComparer`1<T>::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) */, { 8423, 167, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.Equals(System.Object,System.Object) */, { 8422, 167, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::System.Collections.IEqualityComparer.GetHashCode(System.Object) */, { 8420, 167, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8421, 167, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 8988, 192, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/Iterator`1<TSource>::GetEnumerator() */, { 8992, 192, -1 } /* System.Collections.IEnumerator System.Linq.Enumerable/Iterator`1<TSource>::System.Collections.IEnumerable.GetEnumerator() */, { 8985, 192, -1 } /* TSource System.Linq.Enumerable/Iterator`1<TSource>::get_Current() */, { 8991, 192, -1 } /* System.Object System.Linq.Enumerable/Iterator`1<TSource>::System.Collections.IEnumerator.get_Current() */, { 8988, 194, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/Iterator`1<TSource>::GetEnumerator() */, { 8992, 194, -1 } /* System.Collections.IEnumerator System.Linq.Enumerable/Iterator`1<TSource>::System.Collections.IEnumerable.GetEnumerator() */, { 8985, 194, -1 } /* TSource System.Linq.Enumerable/Iterator`1<TSource>::get_Current() */, { 8987, 194, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<TSource>::Dispose() */, { 8991, 194, -1 } /* System.Object System.Linq.Enumerable/Iterator`1<TSource>::System.Collections.IEnumerator.get_Current() */, { 8988, 196, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/Iterator`1<TSource>::GetEnumerator() */, { 8992, 196, -1 } /* System.Collections.IEnumerator System.Linq.Enumerable/Iterator`1<TSource>::System.Collections.IEnumerable.GetEnumerator() */, { 8985, 196, -1 } /* TSource System.Linq.Enumerable/Iterator`1<TSource>::get_Current() */, { 8987, 196, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<TSource>::Dispose() */, { 8991, 196, -1 } /* System.Object System.Linq.Enumerable/Iterator`1<TSource>::System.Collections.IEnumerator.get_Current() */, { 9637, 227, -1 } /* System.Boolean UnityEngine.Events.InvokableCall`1<T>::Find(System.Object,System.Reflection.MethodInfo) */, { 9697, 234, -1 } /* System.Reflection.MethodInfo UnityEngine.Events.UnityEvent`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::FindMethod_Impl(System.String,System.Type) */, { 9698, 234, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`1<UnityEngine.Networking.PlayerConnection.MessageEventArgs>::GetDelegate(System.Object,System.Reflection.MethodInfo) */, { 8231, 15, -1 } /* System.Void System.Collections.ObjectModel.ReadOnlyCollection`1<T>::.ctor(System.Collections.Generic.IList`1<T>) */, { 638, 16, -1 } /* TOutput System.Converter`2<TInput,TOutput>::Invoke(TInput) */, { 606, 17, -1 } /* System.Void System.Action`1<T>::Invoke(T) */, { 379, -1, 336 } /* System.Int32 System.Array::BinarySearch<T>(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 379, -1, 18 } /* System.Int32 System.Array::BinarySearch<T>(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 379, -1, 337 } /* System.Int32 System.Array::BinarySearch<T>(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 8324, 19, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<T>::BinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 484, -1, 338 } /* System.Int32 System.Array::IndexOfImpl<T>(T[],T,System.Int32,System.Int32) */, { 385, -1, 339 } /* System.Int32 System.Array::IndexOf<T>(T[],T,System.Int32,System.Int32) */, { 484, -1, 340 } /* System.Int32 System.Array::IndexOfImpl<T>(T[],T,System.Int32,System.Int32) */, { 391, -1, 341 } /* System.Int32 System.Array::LastIndexOf<T>(T[],T,System.Int32,System.Int32) */, { 391, -1, 342 } /* System.Int32 System.Array::LastIndexOf<T>(T[],T,System.Int32,System.Int32) */, { 485, -1, 343 } /* System.Int32 System.Array::LastIndexOfImpl<T>(T[],T,System.Int32,System.Int32) */, { 395, -1, 344 } /* System.Void System.Array::Reverse<T>(T[],System.Int32,System.Int32) */, { 411, -1, 345 } /* System.Void System.Array::Sort<T>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 346 } /* System.Void System.Array::Sort<T>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 20 } /* System.Void System.Array::Sort<T>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8323, 21, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::Sort(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8325, 22, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 416, -1, 347 } /* System.Void System.Array::Sort<TKey,TValue>(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 416, -1, 348 } /* System.Void System.Array::Sort<TKey,TValue>(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 416, -1, 349 } /* System.Void System.Array::Sort<TKey,TValue>(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 411, -1, 24 } /* System.Void System.Array::Sort<TKey>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8335, 258, -1 } /* System.Collections.Generic.ArraySortHelper`2<TKey,TValue> System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::get_Default() */, { 8337, 258, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::Sort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 422, -1, 25 } /* System.Int32 System.Array::FindIndex<T>(T[],System.Predicate`1<T>) */, { 642, 26, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 482, -1, 27 } /* T[] System.Array::Empty<T>() */, { 642, 27, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 338, -1, 27 } /* System.Void System.Array::Resize<T>(T[]&,System.Int32) */, { 424, -1, 28 } /* System.Int32 System.Array::FindIndex<T>(T[],System.Int32,System.Int32,System.Predicate`1<T>) */, { 424, -1, 29 } /* System.Int32 System.Array::FindIndex<T>(T[],System.Int32,System.Int32,System.Predicate`1<T>) */, { 642, 30, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 642, 31, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 428, -1, 32 } /* System.Int32 System.Array::FindLastIndex<T>(T[],System.Int32,System.Int32,System.Predicate`1<T>) */, { 428, -1, 33 } /* System.Int32 System.Array::FindLastIndex<T>(T[],System.Int32,System.Int32,System.Predicate`1<T>) */, { 642, 34, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 642, 35, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 494, 36, -1 } /* System.Void System.Array/InternalEnumerator`1<T>::.ctor(System.Array) */, { 8416, 260, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<T>::get_Default() */, { 8420, 260, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::IndexOf(T[],T,System.Int32,System.Int32) */, { 8416, 261, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<T>::get_Default() */, { 8421, 261, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::LastIndexOf(T[],T,System.Int32,System.Int32) */, { 445, -1, 37 } /* T System.Array::InternalArray__get_Item<T>(System.Int32) */, { 497, 37, -1 } /* T System.Array/InternalEnumerator`1<T>::get_Current() */, { 501, 38, -1 } /* T System.Array/EmptyInternalEnumerator`1<T>::get_Current() */, { 503, 38, -1 } /* System.Void System.Array/EmptyInternalEnumerator`1<T>::.ctor() */, { 531, 39, -1 } /* System.Void System.Tuple`2<T1,T2>::.ctor(T1,T2) */, { 338, -1, 264 } /* System.Void System.Array::Resize<T>(T[]&,System.Int32) */, { 2827, 77, -1 } /* System.Boolean System.Nullable`1<T>::Equals(System.Nullable`1<T>) */, { 2823, 77, -1 } /* System.Void System.Nullable`1<T>::.ctor(T) */, { 4267, 86, -1 } /* R System.Reflection.MonoProperty/Getter`2<T,R>::Invoke(T) */, { 4271, 87, -1 } /* R System.Reflection.MonoProperty/StaticGetter`1<R>::Invoke() */, { 4572, 88, -1 } /* System.Void System.IO.Iterator`1<TSource>::Dispose(System.Boolean) */, { 4570, 88, -1 } /* System.IO.Iterator`1<TSource> System.IO.Iterator`1<TSource>::Clone() */, { 4569, 88, -1 } /* TSource System.IO.Iterator`1<TSource>::get_Current() */, { 4573, 88, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.IO.Iterator`1<TSource>::GetEnumerator() */, { 4568, 89, -1 } /* System.Void System.IO.Iterator`1<TSource>::.ctor() */, { 4587, 89, -1 } /* System.String System.IO.FileSystemEnumerableIterator`1<TSource>::NormalizeSearchPattern(System.String) */, { 4589, 89, -1 } /* System.String System.IO.FileSystemEnumerableIterator`1<TSource>::GetFullSearchString(System.String,System.String) */, { 4588, 89, -1 } /* System.String System.IO.FileSystemEnumerableIterator`1<TSource>::GetNormalizedSearchCriteria(System.String,System.String) */, { 4578, 89, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<TSource>::CommonInit() */, { 4584, 89, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<TSource>::HandleError(System.Int32,System.String) */, { 4583, 89, -1 } /* System.IO.SearchResult System.IO.FileSystemEnumerableIterator`1<TSource>::CreateSearchResult(System.IO.Directory/SearchData,Microsoft.Win32.Win32Native/WIN32_FIND_DATA) */, { 4590, 89, -1 } /* System.Boolean System.IO.SearchResultHandler`1<TSource>::IsResultIncluded(System.IO.SearchResult) */, { 4591, 89, -1 } /* TSource System.IO.SearchResultHandler`1<TSource>::CreateObject(System.IO.SearchResult) */, { 4579, 89, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<TSource>::.ctor(System.String,System.String,System.String,System.String,System.IO.SearchOption,System.IO.SearchResultHandler`1<TSource>,System.Boolean) */, { 4572, 89, -1 } /* System.Void System.IO.Iterator`1<TSource>::Dispose(System.Boolean) */, { 4585, 89, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<TSource>::AddSearchableDirsToStack(System.IO.Directory/SearchData) */, { 4586, 89, -1 } /* System.Void System.IO.FileSystemEnumerableIterator`1<TSource>::DoDemand(System.String) */, { 5633, 101, -1 } /* System.Void System.Threading.SparselyPopulatedArrayFragment`1<T>::.ctor(System.Int32) */, { 5636, 101, -1 } /* System.Int32 System.Threading.SparselyPopulatedArrayFragment`1<T>::get_Length() */, { 5986, -1, 101 } /* T System.Threading.Interlocked::CompareExchange<T>(T&,T,T) */, { 5630, 101, -1 } /* System.Void System.Threading.SparselyPopulatedArrayAddInfo`1<T>::.ctor(System.Threading.SparselyPopulatedArrayFragment`1<T>,System.Int32) */, { 5634, 101, -1 } /* System.Void System.Threading.SparselyPopulatedArrayFragment`1<T>::.ctor(System.Int32,System.Threading.SparselyPopulatedArrayFragment`1<T>) */, { 5986, -1, 350 } /* T System.Threading.Interlocked::CompareExchange<System.Threading.SparselyPopulatedArrayFragment`1<T>>(T&,T,T) */, { 5634, 103, -1 } /* System.Void System.Threading.SparselyPopulatedArrayFragment`1<T>::.ctor(System.Int32,System.Threading.SparselyPopulatedArrayFragment`1<T>) */, { 6032, -1, 103 } /* T System.Threading.Volatile::Read<T>(T&) */, { 5986, -1, 103 } /* T System.Threading.Interlocked::CompareExchange<T>(T&,T,T) */, { 6032, -1, 104 } /* T System.Threading.Volatile::Read<T>(T&) */, { 5640, -1, 104 } /* T System.Threading.LazyInitializer::EnsureInitializedCore<T>(T&,System.Func`1<T>) */, { 622, 105, -1 } /* TResult System.Func`1<T>::Invoke() */, { 5986, -1, 105 } /* T System.Threading.Interlocked::CompareExchange<T>(T&,T,T) */, { 6033, -1, 351 } /* System.Void System.Threading.Volatile::Write<T>(T&,T) */, { 6044, 113, -1 } /* System.Void System.Threading.Tasks.Task`1<TResult>::.ctor(System.Delegate,System.Object,System.Threading.Tasks.Task,System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.InternalTaskOptions,System.Threading.Tasks.TaskScheduler) */, { 6048, 113, -1 } /* TResult System.Threading.Tasks.Task`1<TResult>::GetResultCore(System.Boolean) */, { 6051, 113, -1 } /* System.Boolean System.Threading.Tasks.Task`1<TResult>::TrySetCanceled(System.Threading.CancellationToken,System.Object) */, { 622, 113, -1 } /* TResult System.Func`1<TResult>::Invoke() */, { 626, 112, -1 } /* TResult System.Func`2<System.Object,TResult>::Invoke(T) */, { 7842, 113, -1 } /* System.Void System.Runtime.CompilerServices.TaskAwaiter`1<TResult>::.ctor(System.Threading.Tasks.Task`1<TResult>) */, { 7845, 113, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 6059, 113, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<TResult>::.ctor() */, { 6058, 113, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Threading.Tasks.Task`1/<>c<TResult>::<.cctor>b__64_0(System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>) */, { 625, 114, -1 } /* System.Void System.Func`2<System.Threading.Tasks.Task`1<System.Threading.Tasks.Task>,System.Threading.Tasks.Task`1<TResult>>::.ctor(System.Object,System.IntPtr) */, { 6057, 115, -1 } /* System.Void System.Threading.Tasks.Task`1/<>c<TResult>::.ctor() */, { 6060, 352, -1 } /* System.Void System.Threading.Tasks.TaskFactory`1<TResult>::.ctor(System.Threading.CancellationToken,System.Threading.Tasks.TaskCreationOptions,System.Threading.Tasks.TaskContinuationOptions,System.Threading.Tasks.TaskScheduler) */, { 6042, 116, -1 } /* System.Void System.Threading.Tasks.Task`1<TResult>::.ctor(System.Boolean,TResult,System.Threading.Tasks.TaskCreationOptions,System.Threading.CancellationToken) */, { 7798, 127, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult>::get_Task() */, { 6040, 127, -1 } /* System.Void System.Threading.Tasks.Task`1<TResult>::.ctor() */, { 7801, 127, -1 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult>::GetTaskForResult(TResult) */, { 6045, 127, -1 } /* System.Boolean System.Threading.Tasks.Task`1<TResult>::TrySetResult(TResult) */, { 6049, 127, -1 } /* System.Boolean System.Threading.Tasks.Task`1<TResult>::TrySetException(System.Object) */, { 6051, 127, -1 } /* System.Boolean System.Threading.Tasks.Task`1<TResult>::TrySetCanceled(System.Threading.CancellationToken,System.Object) */, { 7875, -1, 353 } /* T System.Runtime.CompilerServices.JitHelpers::UnsafeCast<System.Threading.Tasks.Task`1<TResult>>(System.Object) */, { 6041, 127, -1 } /* System.Void System.Threading.Tasks.Task`1<TResult>::.ctor(TResult) */, { 7804, -1, 127 } /* System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskCache::CreateCacheableTask<TResult>(TResult) */, { 6042, 128, -1 } /* System.Void System.Threading.Tasks.Task`1<TResult>::.ctor(System.Boolean,TResult,System.Threading.Tasks.TaskCreationOptions,System.Threading.CancellationToken) */, { 6047, 129, -1 } /* TResult System.Threading.Tasks.Task`1<TResult>::get_ResultOnSuccess() */, { 7847, 130, -1 } /* System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<TResult>::.ctor(System.Threading.Tasks.Task`1<TResult>,System.Boolean) */, { 6047, 131, -1 } /* TResult System.Threading.Tasks.Task`1<TResult>::get_ResultOnSuccess() */, { 489, -1, 354 } /* R System.Array::UnsafeMov<System.Object,T>(S) */, { 489, -1, 355 } /* R System.Array::UnsafeMov<T,System.Int32>(S) */, { 489, -1, 356 } /* R System.Array::UnsafeMov<T,System.Int64>(S) */, { 7881, 132, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<TKey,TValue>::RecomputeSize() */, { 7880, 132, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<TKey,TValue>::RehashWithoutResize() */, { 7882, 132, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<TKey,TValue>::Rehash() */, { 7885, 132, -1 } /* System.Boolean System.Runtime.CompilerServices.ConditionalWeakTable`2<TKey,TValue>::TryGetValue(TKey,TValue&) */, { 7888, 132, -1 } /* TValue System.Runtime.CompilerServices.ConditionalWeakTable`2/CreateValueCallback<TKey,TValue>::Invoke(TKey) */, { 7883, 132, -1 } /* System.Void System.Runtime.CompilerServices.ConditionalWeakTable`2<TKey,TValue>::Add(TKey,TValue) */, { 8232, 134, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<T>::get_Count() */, { 8253, 134, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<T>::IsCompatibleObject(System.Object) */, { 8234, 134, -1 } /* System.Boolean System.Collections.ObjectModel.ReadOnlyCollection`1<T>::Contains(T) */, { 8237, 134, -1 } /* System.Int32 System.Collections.ObjectModel.ReadOnlyCollection`1<T>::IndexOf(T) */, { 8296, 136, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::get_DefaultConcurrencyLevel() */, { 8264, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::.ctor(System.Int32,System.Int32,System.Boolean,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8301, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/Tables<TKey,TValue>::.ctor(System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>[],System.Object[],System.Int32[]) */, { 8416, 135, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<TKey>::get_Default() */, { 8278, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::ThrowKeyNullException() */, { 8276, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::TryAddInternal(TKey,System.Int32,TValue,System.Boolean,System.Boolean,TValue&) */, { 8268, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::TryGetValue(TKey,TValue&) */, { 8295, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::GetBucketAndLockNo(System.Int32,System.Int32&,System.Int32&,System.Int32,System.Int32) */, { 8416, 266, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<TValue>::get_Default() */, { 8418, 266, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<TValue>::Equals(T,T) */, { 6033, -1, 357 } /* System.Void System.Threading.Volatile::Write<System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>>(T&,T) */, { 8269, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::TryGetValueInternal(TKey,System.Int32,TValue&) */, { 8294, 136, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::GetBucket(System.Int32,System.Int32) */, { 6032, -1, 357 } /* T System.Threading.Volatile::Read<System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>>(T&) */, { 8297, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::AcquireAllLocks(System.Int32&) */, { 8299, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::ReleaseLocks(System.Int32,System.Int32) */, { 8272, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::CopyToPairs(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8317, 136, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<TKey,TValue>::.ctor(TKey,TValue) */, { 8309, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/<GetEnumerator>d__32<TKey,TValue>::.ctor(System.Int32) */, { 8302, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>::.ctor(TKey,TValue,System.Int32,System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>) */, { 8293, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::GrowTable(System.Collections.Concurrent.ConcurrentDictionary`2/Tables<TKey,TValue>) */, { 8280, 136, -1 } /* System.Int32 System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::GetCountInternal() */, { 626, 136, -1 } /* TResult System.Func`2<TKey,TValue>::Invoke(T) */, { 8265, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::TryAdd(TKey,TValue) */, { 8318, 136, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Key() */, { 8319, 136, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Value() */, { 8267, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::TryRemoveInternal(TKey,TValue&,System.Boolean,TValue) */, { 8275, 136, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::GetEnumerator() */, { 8266, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::ContainsKey(TKey) */, { 8303, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<TKey,TValue>::.ctor(System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>) */, { 8277, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::set_Item(TKey,TValue) */, { 8273, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::CopyToEntries(System.Collections.DictionaryEntry[],System.Int32) */, { 8274, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::CopyToObjects(System.Object[],System.Int32) */, { 8298, 136, -1 } /* System.Void System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::AcquireLocks(System.Int32,System.Int32,System.Int32&) */, { 8262, 136, -1 } /* System.Boolean System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::IsValueWriteAtomic() */, { 8275, 140, -1 } /* System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> System.Collections.Concurrent.ConcurrentDictionary`2<TKey,TValue>::GetEnumerator() */, { 8318, 140, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Key() */, { 8319, 140, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Value() */, { 8304, 140, -1 } /* System.Collections.DictionaryEntry System.Collections.Concurrent.ConcurrentDictionary`2/DictionaryEnumerator<TKey,TValue>::get_Entry() */, { 6032, -1, 358 } /* T System.Threading.Volatile::Read<System.Collections.Concurrent.ConcurrentDictionary`2/Node<TKey,TValue>>(T&) */, { 8317, 142, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<TKey,TValue>::.ctor(TKey,TValue) */, { 8315, -1, 144 } /* TValue System.Collections.Generic.CollectionExtensions::GetValueOrDefault<TKey,TValue>(System.Collections.Generic.IReadOnlyDictionary`2<TKey,TValue>,TKey,TValue) */, { 8318, 359, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Key() */, { 8319, 359, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Value() */, { 8399, 146, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<T>::get_Default() */, { 8484, 146, -1 } /* System.Int32 System.Collections.Generic.IComparer`1<T>::Compare(T,T) */, { 633, 146, -1 } /* System.Void System.Comparison`1<T>::.ctor(System.Object,System.IntPtr) */, { 8329, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::IntrospectiveSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8326, 146, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<T>::InternalBinarySearch(T[],System.Int32,System.Int32,T,System.Collections.Generic.IComparer`1<T>) */, { 634, 146, -1 } /* System.Int32 System.Comparison`1<T>::Invoke(T,T) */, { 8330, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::IntroSort(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8327, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::SwapIfGreater(T[],System.Comparison`1<T>,System.Int32,System.Int32) */, { 8334, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::InsertionSort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8332, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::Heapsort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8331, 146, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`1<T>::PickPivotAndPartition(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8328, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::Swap(T[],System.Int32,System.Int32) */, { 8333, 146, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::DownHeap(T[],System.Int32,System.Int32,System.Int32,System.Comparison`1<T>) */, { 8336, 147, -1 } /* System.Collections.Generic.ArraySortHelper`2<TKey,TValue> System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::CreateArraySortHelper() */, { 8346, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::.ctor() */, { 8399, 148, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<TKey>::get_Default() */, { 8340, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::IntrospectiveSort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8341, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::IntroSort(TKey[],TValue[],System.Int32,System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8338, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::SwapIfGreaterWithItems(TKey[],TValue[],System.Collections.Generic.IComparer`1<TKey>,System.Int32,System.Int32) */, { 8345, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::InsertionSort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8343, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::Heapsort(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8342, 147, -1 } /* System.Int32 System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::PickPivotAndPartition(TKey[],TValue[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8339, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::Swap(TKey[],TValue[],System.Int32,System.Int32) */, { 8344, 147, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`2<TKey,TValue>::DownHeap(TKey[],TValue[],System.Int32,System.Int32,System.Int32,System.Collections.Generic.IComparer`1<TKey>) */, { 8350, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::.ctor(System.Int32,System.Collections.Generic.IEqualityComparer`1<TKey>) */, { 8366, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::Initialize(System.Int32) */, { 8416, 149, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<TKey>::get_Default() */, { 8365, 150, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<TKey,TValue>::FindEntry(TKey) */, { 8367, 150, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<TKey,TValue>::TryInsert(TKey,TValue,System.Collections.Generic.InsertionBehavior) */, { 8318, 150, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Key() */, { 8319, 150, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Value() */, { 8355, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::Add(TKey,TValue) */, { 8416, 267, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<TValue>::get_Default() */, { 8418, 267, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<TValue>::Equals(T,T) */, { 8371, 150, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<TKey,TValue>::Remove(TKey) */, { 8352, 150, -1 } /* System.Int32 System.Collections.Generic.Dictionary`2<TKey,TValue>::get_Count() */, { 8317, 150, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<TKey,TValue>::.ctor(TKey,TValue) */, { 8382, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue>::.ctor(System.Collections.Generic.Dictionary`2<TKey,TValue>,System.Int32) */, { 8361, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[],System.Int32) */, { 8369, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::Resize() */, { 8370, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::Resize(System.Int32,System.Boolean) */, { 8379, 150, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<TKey,TValue>::IsCompatibleKey(System.Object) */, { 8354, 150, -1 } /* System.Void System.Collections.Generic.Dictionary`2<TKey,TValue>::set_Item(TKey,TValue) */, { 8360, 150, -1 } /* System.Boolean System.Collections.Generic.Dictionary`2<TKey,TValue>::ContainsKey(TKey) */, { 8317, 152, -1 } /* System.Void System.Collections.Generic.KeyValuePair`2<TKey,TValue>::.ctor(TKey,TValue) */, { 8318, 152, -1 } /* TKey System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Key() */, { 8319, 152, -1 } /* TValue System.Collections.Generic.KeyValuePair`2<TKey,TValue>::get_Value() */, { 8400, 154, -1 } /* System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<T>::CreateComparer() */, { 8415, 154, -1 } /* System.Void System.Collections.Generic.ObjectComparer`1<T>::.ctor() */, { 8401, 154, -1 } /* System.Int32 System.Collections.Generic.Comparer`1<T>::Compare(T,T) */, { 1542, 155, -1 } /* System.Int32 System.IComparable`1<T>::CompareTo(T) */, { 8403, 155, -1 } /* System.Void System.Collections.Generic.Comparer`1<T>::.ctor() */, { 2824, 156, -1 } /* System.Boolean System.Nullable`1<T>::get_HasValue() */, { 1542, 156, -1 } /* System.Int32 System.IComparable`1<T>::CompareTo(T) */, { 8403, 157, -1 } /* System.Void System.Collections.Generic.Comparer`1<System.Nullable`1<T>>::.ctor() */, { 8403, 158, -1 } /* System.Void System.Collections.Generic.Comparer`1<T>::.ctor() */, { 8417, 159, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<T>::CreateComparer() */, { 8445, 159, -1 } /* System.Void System.Collections.Generic.ObjectEqualityComparer`1<T>::.ctor() */, { 8418, 159, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::Equals(T,T) */, { 8419, 159, -1 } /* System.Int32 System.Collections.Generic.EqualityComparer`1<T>::GetHashCode(T) */, { 1562, 160, -1 } /* System.Boolean System.IEquatable`1<T>::Equals(T) */, { 8424, 160, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<T>::.ctor() */, { 2824, 161, -1 } /* System.Boolean System.Nullable`1<T>::get_HasValue() */, { 1562, 161, -1 } /* System.Boolean System.IEquatable`1<T>::Equals(T) */, { 8424, 162, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<System.Nullable`1<T>>::.ctor() */, { 8424, 163, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<T>::.ctor() */, { 7876, -1, 164 } /* System.Int32 System.Runtime.CompilerServices.JitHelpers::UnsafeEnumCast<T>(T) */, { 8424, 164, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<T>::.ctor() */, { 8455, 165, -1 } /* System.Void System.Collections.Generic.EnumEqualityComparer`1<T>::.ctor() */, { 7876, -1, 165 } /* System.Int32 System.Runtime.CompilerServices.JitHelpers::UnsafeEnumCast<T>(T) */, { 8455, 166, -1 } /* System.Void System.Collections.Generic.EnumEqualityComparer`1<T>::.ctor() */, { 7876, -1, 166 } /* System.Int32 System.Runtime.CompilerServices.JitHelpers::UnsafeEnumCast<T>(T) */, { 7877, -1, 167 } /* System.Int64 System.Runtime.CompilerServices.JitHelpers::UnsafeEnumCastLong<T>(T) */, { 8424, 167, -1 } /* System.Void System.Collections.Generic.EqualityComparer`1<T>::.ctor() */, { 8514, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::Add(T) */, { 487, -1, 177 } /* T System.Array::UnsafeLoad<T>(T[],System.Int32) */, { 8509, 177, -1 } /* T System.Collections.Generic.List`1<T>::get_Item(System.Int32) */, { 333, -1, 177 } /* System.Void System.ThrowHelper::IfNullAndNullsAreIllegalThenThrow<T>(System.Object,System.ExceptionArgument) */, { 8510, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::set_Item(System.Int32,T) */, { 8523, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::EnsureCapacity(System.Int32) */, { 8506, 177, -1 } /* System.Int32 System.Collections.Generic.List`1<T>::get_Count() */, { 8531, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::InsertRange(System.Int32,System.Collections.Generic.IEnumerable`1<T>) */, { 8416, 177, -1 } /* System.Collections.Generic.EqualityComparer`1<T> System.Collections.Generic.EqualityComparer`1<T>::get_Default() */, { 8418, 177, -1 } /* System.Boolean System.Collections.Generic.EqualityComparer`1<T>::Equals(T,T) */, { 8511, 177, -1 } /* System.Boolean System.Collections.Generic.List`1<T>::IsCompatibleObject(System.Object) */, { 8518, 177, -1 } /* System.Boolean System.Collections.Generic.List`1<T>::Contains(T) */, { 8522, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::CopyTo(T[],System.Int32) */, { 8505, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::set_Capacity(System.Int32) */, { 8543, 177, -1 } /* System.Void System.Collections.Generic.List`1/Enumerator<T>::.ctor(System.Collections.Generic.List`1<T>) */, { 385, -1, 177 } /* System.Int32 System.Array::IndexOf<T>(T[],T,System.Int32,System.Int32) */, { 8527, 177, -1 } /* System.Int32 System.Collections.Generic.List`1<T>::IndexOf(T) */, { 8529, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::Insert(System.Int32,T) */, { 8535, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::RemoveAt(System.Int32) */, { 8532, 177, -1 } /* System.Boolean System.Collections.Generic.List`1<T>::Remove(T) */, { 642, 177, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 8537, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::Reverse(System.Int32,System.Int32) */, { 395, -1, 177 } /* System.Void System.Array::Reverse<T>(T[],System.Int32,System.Int32) */, { 8539, 177, -1 } /* System.Void System.Collections.Generic.List`1<T>::Sort(System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 411, -1, 177 } /* System.Void System.Array::Sort<T>(T[],System.Int32,System.Int32,System.Collections.Generic.IComparer`1<T>) */, { 8325, 177, -1 } /* System.Void System.Collections.Generic.ArraySortHelper`1<T>::Sort(T[],System.Int32,System.Int32,System.Comparison`1<T>) */, { 8546, 178, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<T>::MoveNextRare() */, { 8547, 178, -1 } /* T System.Collections.Generic.List`1/Enumerator<T>::get_Current() */, { 642, 179, -1 } /* System.Boolean System.Predicate`1<T>::Invoke(T) */, { 8990, 182, -1 } /* System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/Iterator`1<TSource>::Where(System.Func`2<TSource,System.Boolean>) */, { 8998, 182, -1 } /* System.Void System.Linq.Enumerable/WhereArrayIterator`1<TSource>::.ctor(TSource[],System.Func`2<TSource,System.Boolean>) */, { 9002, 182, -1 } /* System.Void System.Linq.Enumerable/WhereListIterator`1<TSource>::.ctor(System.Collections.Generic.List`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8993, 182, -1 } /* System.Void System.Linq.Enumerable/WhereEnumerableIterator`1<TSource>::.ctor(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 9006, 268, -1 } /* System.Void System.Linq.Enumerable/<>c__DisplayClass6_0`1<TSource>::.ctor() */, { 9007, 268, -1 } /* System.Boolean System.Linq.Enumerable/<>c__DisplayClass6_0`1<TSource>::<CombinePredicates>b__0(TSource) */, { 625, 184, -1 } /* System.Void System.Func`2<TSource,System.Boolean>::.ctor(System.Object,System.IntPtr) */, { 626, 186, -1 } /* !1 System.Func`2<TSource,System.Boolean>::Invoke(!0) */, { 626, 189, -1 } /* !1 System.Func`2<TSource,System.Boolean>::Invoke(!0) */, { 8986, 190, -1 } /* System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/Iterator`1<TSource>::Clone() */, { 8985, 190, -1 } /* TSource System.Linq.Enumerable/Iterator`1<TSource>::get_Current() */, { 8988, 190, -1 } /* System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/Iterator`1<TSource>::GetEnumerator() */, { 8984, 192, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<TSource>::.ctor() */, { 8993, 192, -1 } /* System.Void System.Linq.Enumerable/WhereEnumerableIterator`1<TSource>::.ctor(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8987, 192, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<TSource>::Dispose() */, { 626, 193, -1 } /* !1 System.Func`2<TSource,System.Boolean>::Invoke(!0) */, { 8980, -1, 192 } /* System.Func`2<TSource,System.Boolean> System.Linq.Enumerable::CombinePredicates<TSource>(System.Func`2<TSource,System.Boolean>,System.Func`2<TSource,System.Boolean>) */, { 8984, 194, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<TSource>::.ctor() */, { 8998, 194, -1 } /* System.Void System.Linq.Enumerable/WhereArrayIterator`1<TSource>::.ctor(TSource[],System.Func`2<TSource,System.Boolean>) */, { 626, 195, -1 } /* !1 System.Func`2<TSource,System.Boolean>::Invoke(!0) */, { 8980, -1, 194 } /* System.Func`2<TSource,System.Boolean> System.Linq.Enumerable::CombinePredicates<TSource>(System.Func`2<TSource,System.Boolean>,System.Func`2<TSource,System.Boolean>) */, { 8984, 196, -1 } /* System.Void System.Linq.Enumerable/Iterator`1<TSource>::.ctor() */, { 9002, 196, -1 } /* System.Void System.Linq.Enumerable/WhereListIterator`1<TSource>::.ctor(System.Collections.Generic.List`1<TSource>,System.Func`2<TSource,System.Boolean>) */, { 8524, 196, -1 } /* System.Collections.Generic.List`1/Enumerator<!0> System.Collections.Generic.List`1<TSource>::GetEnumerator() */, { 8547, 196, -1 } /* !0 System.Collections.Generic.List`1/Enumerator<TSource>::get_Current() */, { 626, 197, -1 } /* !1 System.Func`2<TSource,System.Boolean>::Invoke(!0) */, { 8545, 196, -1 } /* System.Boolean System.Collections.Generic.List`1/Enumerator<TSource>::MoveNext() */, { 8980, -1, 196 } /* System.Func`2<TSource,System.Boolean> System.Linq.Enumerable::CombinePredicates<TSource>(System.Func`2<TSource,System.Boolean>,System.Func`2<TSource,System.Boolean>) */, { 626, 198, -1 } /* !1 System.Func`2<TSource,System.Boolean>::Invoke(!0) */, { 9083, -1, 199 } /* T Unity.Collections.LowLevel.Unsafe.UnsafeUtility::ReadArrayElement<T>(System.Void*,System.Int32) */, { 9084, -1, 199 } /* System.Void Unity.Collections.LowLevel.Unsafe.UnsafeUtility::WriteArrayElement<T>(System.Void*,System.Int32,T) */, { 9070, 199, -1 } /* System.Void Unity.Collections.NativeArray`1/Enumerator<T>::.ctor(Unity.Collections.NativeArray`1<T>&) */, { 9064, 199, -1 } /* Unity.Collections.NativeArray`1/Enumerator<T> Unity.Collections.NativeArray`1<T>::GetEnumerator() */, { 9067, 199, -1 } /* System.Boolean Unity.Collections.NativeArray`1<T>::Equals(Unity.Collections.NativeArray`1<T>) */, { 9060, 200, -1 } /* System.Int32 Unity.Collections.NativeArray`1<T>::get_Length() */, { 9061, 200, -1 } /* T Unity.Collections.NativeArray`1<T>::get_Item(System.Int32) */, { 9073, 200, -1 } /* T Unity.Collections.NativeArray`1/Enumerator<T>::get_Current() */, { 5986, -1, 360 } /* !!0 System.Threading.Interlocked::CompareExchange<UnityEngine.Events.UnityAction`1<T1>>(!!0&,!!0,!!0) */, { 9631, 223, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<T1>::add_Delegate(UnityEngine.Events.UnityAction`1<T1>) */, { 9622, -1, 223 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T1>(System.Object) */, { 9691, 223, -1 } /* System.Void UnityEngine.Events.UnityAction`1<T1>::Invoke(T0) */, { 9622, -1, 361 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T1>(System.Object) */, { 9622, -1, 362 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T2>(System.Object) */, { 9702, 224, -1 } /* System.Void UnityEngine.Events.UnityAction`2<T1,T2>::Invoke(T0,T1) */, { 9622, -1, 363 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T1>(System.Object) */, { 9622, -1, 364 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T2>(System.Object) */, { 9622, -1, 365 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T3>(System.Object) */, { 9709, 225, -1 } /* System.Void UnityEngine.Events.UnityAction`3<T1,T2,T3>::Invoke(T0,T1,T2) */, { 9622, -1, 366 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T1>(System.Object) */, { 9622, -1, 367 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T2>(System.Object) */, { 9622, -1, 368 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T3>(System.Object) */, { 9622, -1, 369 } /* System.Void UnityEngine.Events.BaseInvokableCall::ThrowOnInvalidArg<T4>(System.Object) */, { 9716, 226, -1 } /* System.Void UnityEngine.Events.UnityAction`4<T1,T2,T3,T4>::Invoke(T0,T1,T2,T3) */, { 9633, 227, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<T>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9636, 227, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<T>::Invoke(T1) */, { 9699, 230, -1 } /* UnityEngine.Events.BaseInvokableCall UnityEngine.Events.UnityEvent`1<T0>::GetDelegate(UnityEngine.Events.UnityAction`1<T0>) */, { 9633, 230, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<T0>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9634, 230, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<T0>::.ctor(UnityEngine.Events.UnityAction`1<T1>) */, { 9636, 230, -1 } /* System.Void UnityEngine.Events.InvokableCall`1<T0>::Invoke(T1) */, { 9638, 269, -1 } /* System.Void UnityEngine.Events.InvokableCall`2<T0,T1>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9641, 270, -1 } /* System.Void UnityEngine.Events.InvokableCall`3<T0,T1,T2>::.ctor(System.Object,System.Reflection.MethodInfo) */, { 9644, 271, -1 } /* System.Void UnityEngine.Events.InvokableCall`4<T0,T1,T2,T3>::.ctor(System.Object,System.Reflection.MethodInfo) */, };
609525.c
/** @file This library registers CPU features defined in Intel(R) 64 and IA-32 Architectures Software Developer's Manual. Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "CpuCommonFeatures.h" /** Register CPU features. @retval RETURN_SUCCESS Register successfully **/ RETURN_STATUS EFIAPI CpuCommonFeaturesLibConstructor ( VOID ) { RETURN_STATUS Status; if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) { Status = RegisterCpuFeature ( "AESNI", AesniGetConfigData, AesniSupport, AesniInitialize, CPU_FEATURE_AESNI, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) { Status = RegisterCpuFeature ( "MWAIT", NULL, MonitorMwaitSupport, MonitorMwaitInitialize, CPU_FEATURE_MWAIT, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_ACPI)) { Status = RegisterCpuFeature ( "ACPI", ClockModulationGetConfigData, ClockModulationSupport, ClockModulationInitialize, CPU_FEATURE_ACPI, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_EIST)) { Status = RegisterCpuFeature ( "EIST", NULL, EistSupport, EistInitialize, CPU_FEATURE_EIST, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_FASTSTRINGS)) { Status = RegisterCpuFeature ( "FastStrings", NULL, NULL, FastStringsInitialize, CPU_FEATURE_FASTSTRINGS, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER)) { Status = RegisterCpuFeature ( "Lock Feature Control Register", NULL, LockFeatureControlRegisterSupport, LockFeatureControlRegisterInitialize, CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_SMX)) { Status = RegisterCpuFeature ( "SMX", NULL, SmxSupport, SmxInitialize, CPU_FEATURE_SMX, CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | CPU_FEATURE_THREAD_BEFORE, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_VMX)) { Status = RegisterCpuFeature ( "VMX", NULL, VmxSupport, VmxInitialize, CPU_FEATURE_VMX, CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | CPU_FEATURE_THREAD_BEFORE, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_LIMIT_CPUID_MAX_VAL)) { Status = RegisterCpuFeature ( "Limit CpuId Maximum Value", NULL, LimitCpuidMaxvalSupport, LimitCpuidMaxvalInitialize, CPU_FEATURE_LIMIT_CPUID_MAX_VAL, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_MCE)) { Status = RegisterCpuFeature ( "Machine Check Enable", NULL, MceSupport, MceInitialize, CPU_FEATURE_MCE, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_MCA)) { Status = RegisterCpuFeature ( "Machine Check Architect", NULL, McaSupport, McaInitialize, CPU_FEATURE_MCA, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_MCG_CTL)) { Status = RegisterCpuFeature ( "MCG_CTL", NULL, McgCtlSupport, McgCtlInitialize, CPU_FEATURE_MCG_CTL, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_PENDING_BREAK)) { Status = RegisterCpuFeature ( "Pending Break", NULL, PendingBreakSupport, PendingBreakInitialize, CPU_FEATURE_PENDING_BREAK, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_C1E)) { Status = RegisterCpuFeature ( "C1E", NULL, C1eSupport, C1eInitialize, CPU_FEATURE_C1E, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_X2APIC)) { Status = RegisterCpuFeature ( "X2Apic", X2ApicGetConfigData, X2ApicSupport, X2ApicInitialize, CPU_FEATURE_X2APIC, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_PPIN)) { Status = RegisterCpuFeature ( "PPIN", PpinGetConfigData, PpinSupport, PpinInitialize, CPU_FEATURE_PPIN, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_LMCE)) { Status = RegisterCpuFeature ( "LMCE", NULL, LmceSupport, LmceInitialize, CPU_FEATURE_LMCE, CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | CPU_FEATURE_THREAD_BEFORE, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } if (IsCpuFeatureSupported (CPU_FEATURE_PROC_TRACE)) { Status = RegisterCpuFeature ( "Proc Trace", ProcTraceGetConfigData, ProcTraceSupport, ProcTraceInitialize, CPU_FEATURE_PROC_TRACE, CPU_FEATURE_END ); ASSERT_EFI_ERROR (Status); } return RETURN_SUCCESS; }
449777.c
#include "Vector.h" ArrayPtr CreateGenericArray(int initialLength, size_t elementSize) { ArrayPtr newArr = malloc(sizeof(struct GenericArray)); newArr->elementSize = elementSize; newArr->length = 0; newArr->capacity = initialLength; newArr->arr = malloc(elementSize * initialLength); #ifdef PRINT_NEW_VECTOR_MSG printf("Created a new generic array with %d element(s) and whose elementSize is %ld\n", initialLength, elementSize); #endif return newArr; } void ArrPush(ArrayPtr array, void *newElement) { if (array->length == array->capacity) { // increase the capacity of the array array->capacity *= 2; array->arr = realloc(array->arr, array->capacity * array->elementSize); } memcpy(array->arr + (array->length * array->elementSize), newElement, array->elementSize); array->length++; } void *GetArray(ArrayPtr array, int idx) { if (idx >= array->length || idx < 0) return NULL; return array->arr + (idx * array->elementSize); }
587502.c
#include <math.h> //Required for cos and sin functions typedef double IN_TYPE; // Data type for the input signal typedef double TEMP_TYPE; // Data type for the temporary variables #define N 256 // DFT Size void dft(IN_TYPE sample_real[N], IN_TYPE sample_imag[N]) { int i, j; TEMP_TYPE w; TEMP_TYPE c, s; // Temporary arrays to hold the intermediate frequency domain results TEMP_TYPE temp_real[N]; TEMP_TYPE temp_imag[N]; // Calculate each frequency domain sample iteratively for (i = 0; i < N; i += 1) { temp_real[i] = 0; temp_imag[i] = 0; // (2 * pi * i)/N w = (2.0 * 3.141592653589 / N) * (TEMP_TYPE)i; // Calculate the jth frequency sample sequentially for (j = 0; j < N; j += 1) { // Utilize HLS tool to calculate sine and cosine values c = cos(j * w); s = sin(j * w); // Multiply the current phasor with the appropriate input sample and keep // running sum temp_real[i] += (sample_real[j] * c - sample_imag[j] * s); temp_imag[i] += (sample_real[j] * s + sample_imag[j] * c); } } // Perform an inplace DFT, i.e., copy result into the input arrays for (i = 0; i < N; i += 1) { sample_real[i] = temp_real[i]; sample_imag[i] = temp_imag[i]; } }
288209.c
/*stmasse2d2.c - A sequence to generate a two pulse STMAS 2D spectrum with a third selective echo pulse - phase cycle with 3Q suppression. The initial F1 delay subtracts the internal pulse widths for rotor synchronization. This means that the d2 = 0.0 point is bad and that the first dwell should be greater than the sum of the pulses. Use Linear Predicition to fix the first point or set d2 = one dwell. See: Ashbrooke, S.E., Wimperis, S.E. Progress in NMR Spectroscopy 45 (2004) 53-108. D. Rice 05/10/06 */ #include "standard.h" #include "solidstandard.h" // Define Values for Phasetables static int table1[4] = {0,0,0,0}; // ph1Xstmas static int table2[8] = {0,0,1,1,2,2,3,3}; // ph2Xstmas static int table3[8] = {0,1,0,1,0,1,0,1}; // phf2Xstmas static int table4[32] = {0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3}; // phXechsel static int table5[16] = {0,0,0,0,0,0,0,0, 2,2,2,2,2,2,2,2}; // phRec #define ph1Xstmas t1 #define ph2Xstmas t2 #define ph2fXstmas t3 #define phXechsel t4 #define phRec t5 static double d2_init; void pulsesequence() { // Define Variables and Objects and Get Parameter Values double pw1Xstmas = getval("pw1Xstmas"); double pw2Xstmas = getval("pw2Xstmas"); double tXechselinit = getval("tXechsel"); double tXechsel = tXechselinit - 3.0e-6; if (tXechsel < 0.0) tXechsel = 0.0; double d2init = getval("d2"); double d2 = d2init - pw1Xstmas/2.0 - pw2Xstmas/2.0; if (d2 < 0.0) d2 = 0.0; DSEQ dec = getdseq("H"); strncpy(dec.t.ch,"dec",3); putCmd("chHtppm='dec'\n"); strncpy(dec.s.ch,"dec",3); putCmd("chHspinal='dec'\n"); // Set Constant-time Period for d2. if (d2_index == 0) d2_init = getval("d2"); double d2_ = (ni - 1)/sw1 + d2_init; putCmd("d2acqret = %f\n",roundoff(d2_,12.5e-9)); putCmd("d2dwret = %f\n",roundoff(1.0/sw1,12.5e-9)); //-------------------------------------- // Copy Current Parameters to Processed //------------------------------------- putCmd("groupcopy('current','processed','acquisition')"); // Dutycycle Protection DUTY d = init_dutycycle(); d.dutyon = getval("pw1Xstmas") + getval("pw2Xstmas") + getval("pwXechsel"); d.dutyoff = d1 + 4.0e-6; d.c1 = d.c1 + (!strcmp(dec.seq,"tppm")); d.c1 = d.c1 + ((!strcmp(dec.seq,"tppm")) && (dec.t.a > 0.0)); d.t1 = d2_ + tXechsel + getval("rd") + getval("ad") + at; d.c2 = d.c2 + (!strcmp(dec.seq,"spinal")); d.c2 = d.c2 + ((!strcmp(dec.seq,"spinal")) && (dec.s.a > 0.0)); d.t2 = d2_ + tXechsel + getval("rd") + getval("ad") + at; d = update_dutycycle(d); abort_dutycycle(d,10.0); // Set Phase Tables settable(ph1Xstmas,4,table1); settable(ph2Xstmas,8,table2); settable(ph2fXstmas,8,table3); settable(phXechsel,32,table4); settable(phRec,16,table5); if (phase1 == 2) { tsadd(ph1Xstmas,1,4); } setreceiver(phRec); obsstepsize(45.0); // Begin Sequence txphase(ph1Xstmas); decphase(zero); obspower(getval("tpwr")); obspwrf(getval("aXstmas")); obsunblank(); decunblank(); _unblank34(); delay(d1); sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6); // H Decoupler on Before STMAS _dseqon(dec); // Two-Pulse STMAS rgpulse(getval("pw1Xstmas"),ph1Xstmas,0.0,0.0); xmtrphase(ph2fXstmas); txphase(ph2Xstmas); delay(d2); rgpulse(getval("pw2Xstmas"),ph2Xstmas,0.0,0.0); xmtrphase(zero); // Selective Echo Pulse txphase(phXechsel); obsblank(); obspower(getval("dbXechsel")); obspwrf(getval("aXechsel")); delay(3.0e-6); obsunblank(); delay(tXechsel); rgpulse(getval("pwXechsel"),phXechsel,0.0,0.0); // Begin Acquisition obsblank(); _blank34(); delay(getval("rd")); startacq(getval("ad")); acquire(np, 1/sw); endacq(); _dseqoff(dec); obsunblank(); decunblank(); _unblank34(); }
646821.c
/** ****************************************************************************** * @file PWR/PWR_STANDBY/Src/stm32f4xx_it.c * @author MCD Application Team * @version V1.0.0 * @date 06-May-2016 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * 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 STMicroelectronics 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 "main.h" #include "stm32f4xx_it.h" /** @addtogroup STM32F4xx_HAL_Examples * @{ */ /** @addtogroup PWR_STANDBY * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { HAL_SYSTICK_IRQHandler(); } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f4xx.s). */ /******************************************************************************/ /** * @brief This function handles external line 0 interrupt request. * @param None * @retval None */ void EXTI0_IRQHandler(void) { HAL_GPIO_EXTI_IRQHandler(WAKEUP_BUTTON_PIN); } /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
543892.c
/** * \file * * \mainpage * * \section title Delay service example * * \section file File(s) * - \ref delay_example.c * * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. * * \asf_license_start * * \page License * * Subject to your compliance with these terms, you may use Microchip * software and any derivatives exclusively with Microchip products. * It is your responsibility to comply with third party license terms applicable * to your use of third party software (including open source software) that * may accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a> */ #include <asf.h> int main(void) { system_init(); delay_init(); struct port_config pin; port_get_config_defaults(&pin); pin.direction = PORT_PIN_DIR_OUTPUT; port_pin_set_config(LED0_PIN, &pin); port_pin_set_output_level(LED0_PIN, LED0_INACTIVE); while (true) { for (int i = 0; i < 5; i++) { port_pin_toggle_output_level(LED0_PIN); delay_s(1); } for (int i = 0; i < 50; i++) { port_pin_toggle_output_level(LED0_PIN); delay_ms(100); } for (int i = 0; i < 5000; i++) { port_pin_toggle_output_level(LED0_PIN); delay_cycles(100); } } }
5772.c
/* * Automatically Tuned Linear Algebra Software v3.10.1 * (C) Copyright 1999 Antoine P. Petitet * * Code contributers : Antoine P. Petitet, R. Clint Whaley * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions, and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the ATLAS group or the names of its contributers may * not be used to endorse or promote products derived from this * software without specific 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 ATLAS GROUP 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 "atlas_misc.h" #include "atlas_tst.h" #include "atlas_f77blas.h" void Mjoin( PATL, f77trsm ) ( const enum ATLAS_SIDE SIDE, const enum ATLAS_UPLO UPLO, const enum ATLAS_TRANS TRANS, const enum ATLAS_DIAG DIAG, const int M, const int N, const SCALAR ALPHA, const TYPE * A, const int LDA, TYPE * B, const int LDB ) { #if defined( StringSunStyle ) #if defined( ATL_FunkyInts ) F77_INTEGER ONE = 1; #else int ONE = 1; #endif #elif defined( StringStructVal ) || defined( StringStructPtr ) F77_CHAR fside; F77_CHAR fuplo; F77_CHAR ftran; F77_CHAR fdiag; #elif defined( StringCrayStyle ) F77_CHAR fside; F77_CHAR fuplo; F77_CHAR ftran; F77_CHAR fdiag; #endif char cside, cuplo, ctran, cdiag; #ifdef ATL_FunkyInts const F77_INTEGER F77M = M, F77N = N, F77lda = LDA, F77ldb = LDB; #else #define F77M M #define F77N N #define F77lda LDA #define F77ldb LDB #endif #ifdef TCPLX TYPE alpha[2]; *alpha = *ALPHA; alpha[1] = ALPHA[1]; #else TYPE alpha = ALPHA; #endif if( TRANS == AtlasNoTrans ) ctran = 'N'; else if( TRANS == AtlasTrans ) ctran = 'T'; else ctran = 'C'; if( SIDE == AtlasRight ) cside = 'R'; else cside = 'L'; if( UPLO == AtlasLower ) cuplo = 'L'; else cuplo = 'U'; if( DIAG == AtlasUnit ) cdiag = 'U'; else cdiag = 'N'; #if defined( StringSunStyle ) F77trsm( &cside, &cuplo, &ctran, &cdiag, &F77M, &F77N, SADD alpha, A, &F77lda, B, &F77ldb, ONE, ONE, ONE, ONE ); #elif defined( StringCrayStyle ) fside = ATL_C2F_TransChar( cside ); fuplo = ATL_C2F_TransChar( cuplo ); ftran = ATL_C2F_TransChar( ctran ); fdiag = ATL_C2F_TransChar( cdiag ); F77trsm( fside, fuplo, ftran, fdiag, &F77M, &F77N, SADD alpha, A, &F77lda, B, &F77ldb ); #elif defined( StringStructVal ) fside.len = 1; fside.cp = &cside; fuplo.len = 1; fuplo.cp = &cuplo; ftran.len = 1; ftran.cp = &ctran; fdiag.len = 1; fdiag.cp = &cdiag; F77trsm( fside, fuplo, ftran, fdiag, &F77M, &F77N, SADD alpha, A, &F77lda, B, &F77ldb ); #elif defined( StringStructPtr ) fside.len = 1; fside.cp = &cside; fuplo.len = 1; fuplo.cp = &cuplo; ftran.len = 1; ftran.cp = &ctran; fdiag.len = 1; fdiag.cp = &cdiag; F77trsm( &fside, &fuplo, &ftran, &fdiag, &F77M, &F77N, SADD alpha, A, &F77lda, B, &F77ldb ); #else (void) fprintf( stderr, "\n\nF77/C interface not defined!!\n\n" ); exit( -1 ); #endif }
225653.c
/************************************************** * * Generated by build/generate-future-functions.py. * * DO NOT EDIT THIS FILE. * *************************************************/ /* * Define two sets of functions: background functions and future functions. * A background function like background_mongoc_cursor_next runs a driver * operation on a thread. * A future function like future_mongoc_cursor_next launches the background * operation and returns a future_t that will resolve when the operation * finishes. * * These are used with mock_server_t so you can run the driver on a thread while * controlling the server from the main thread. */ #include "mongoc-topology-private.h" #include "future-functions.h" static void * background_mongoc_bulk_operation_execute (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_uint32_t_type; future_value_set_uint32_t ( &return_value, mongoc_bulk_operation_execute ( future_value_get_mongoc_bulk_operation_ptr (future_get_param (future, 0)), future_value_get_bson_ptr (future_get_param (future, 1)), future_value_get_bson_error_ptr (future_get_param (future, 2)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_client_command_simple (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_bool_type; future_value_set_bool ( &return_value, mongoc_client_command_simple ( future_value_get_mongoc_client_ptr (future_get_param (future, 0)), future_value_get_const_char_ptr (future_get_param (future, 1)), future_value_get_const_bson_ptr (future_get_param (future, 2)), future_value_get_const_mongoc_read_prefs_ptr (future_get_param (future, 3)), future_value_get_bson_ptr (future_get_param (future, 4)), future_value_get_bson_error_ptr (future_get_param (future, 5)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_client_kill_cursor (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_void_type; mongoc_client_kill_cursor ( future_value_get_mongoc_client_ptr (future_get_param (future, 0)), future_value_get_int64_t (future_get_param (future, 1))); future_resolve (future, return_value); return NULL; } static void * background_mongoc_collection_aggregate (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_mongoc_cursor_ptr_type; future_value_set_mongoc_cursor_ptr ( &return_value, mongoc_collection_aggregate ( future_value_get_mongoc_collection_ptr (future_get_param (future, 0)), future_value_get_mongoc_query_flags_t (future_get_param (future, 1)), future_value_get_const_bson_ptr (future_get_param (future, 2)), future_value_get_const_bson_ptr (future_get_param (future, 3)), future_value_get_const_mongoc_read_prefs_ptr (future_get_param (future, 4)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_collection_count (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_int64_t_type; future_value_set_int64_t ( &return_value, mongoc_collection_count ( future_value_get_mongoc_collection_ptr (future_get_param (future, 0)), future_value_get_mongoc_query_flags_t (future_get_param (future, 1)), future_value_get_const_bson_ptr (future_get_param (future, 2)), future_value_get_int64_t (future_get_param (future, 3)), future_value_get_int64_t (future_get_param (future, 4)), future_value_get_const_mongoc_read_prefs_ptr (future_get_param (future, 5)), future_value_get_bson_error_ptr (future_get_param (future, 6)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_collection_find_and_modify_with_opts (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_bool_type; future_value_set_bool ( &return_value, mongoc_collection_find_and_modify_with_opts ( future_value_get_mongoc_collection_ptr (future_get_param (future, 0)), future_value_get_const_bson_ptr (future_get_param (future, 1)), future_value_get_const_mongoc_find_and_modify_opts_ptr (future_get_param (future, 2)), future_value_get_bson_ptr (future_get_param (future, 3)), future_value_get_bson_error_ptr (future_get_param (future, 4)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_collection_find_and_modify (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_bool_type; future_value_set_bool ( &return_value, mongoc_collection_find_and_modify ( future_value_get_mongoc_collection_ptr (future_get_param (future, 0)), future_value_get_const_bson_ptr (future_get_param (future, 1)), future_value_get_const_bson_ptr (future_get_param (future, 2)), future_value_get_const_bson_ptr (future_get_param (future, 3)), future_value_get_const_bson_ptr (future_get_param (future, 4)), future_value_get_bool (future_get_param (future, 5)), future_value_get_bool (future_get_param (future, 6)), future_value_get_bool (future_get_param (future, 7)), future_value_get_bson_ptr (future_get_param (future, 8)), future_value_get_bson_error_ptr (future_get_param (future, 9)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_collection_insert (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_bool_type; future_value_set_bool ( &return_value, mongoc_collection_insert ( future_value_get_mongoc_collection_ptr (future_get_param (future, 0)), future_value_get_mongoc_insert_flags_t (future_get_param (future, 1)), future_value_get_const_bson_ptr (future_get_param (future, 2)), future_value_get_const_mongoc_write_concern_ptr (future_get_param (future, 3)), future_value_get_bson_error_ptr (future_get_param (future, 4)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_collection_insert_bulk (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_bool_type; future_value_set_bool ( &return_value, mongoc_collection_insert_bulk ( future_value_get_mongoc_collection_ptr (future_get_param (future, 0)), future_value_get_mongoc_insert_flags_t (future_get_param (future, 1)), future_value_get_const_bson_ptr_ptr (future_get_param (future, 2)), future_value_get_uint32_t (future_get_param (future, 3)), future_value_get_const_mongoc_write_concern_ptr (future_get_param (future, 4)), future_value_get_bson_error_ptr (future_get_param (future, 5)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_cursor_destroy (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_void_type; mongoc_cursor_destroy ( future_value_get_mongoc_cursor_ptr (future_get_param (future, 0))); future_resolve (future, return_value); return NULL; } static void * background_mongoc_cursor_next (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_bool_type; future_value_set_bool ( &return_value, mongoc_cursor_next ( future_value_get_mongoc_cursor_ptr (future_get_param (future, 0)), future_value_get_const_bson_ptr_ptr (future_get_param (future, 1)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_client_get_database_names (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_char_ptr_ptr_type; future_value_set_char_ptr_ptr ( &return_value, mongoc_client_get_database_names ( future_value_get_mongoc_client_ptr (future_get_param (future, 0)), future_value_get_bson_error_ptr (future_get_param (future, 1)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_database_get_collection_names (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_char_ptr_ptr_type; future_value_set_char_ptr_ptr ( &return_value, mongoc_database_get_collection_names ( future_value_get_mongoc_database_ptr (future_get_param (future, 0)), future_value_get_bson_error_ptr (future_get_param (future, 1)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_gridfs_file_readv (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_ssize_t_type; future_value_set_ssize_t ( &return_value, mongoc_gridfs_file_readv ( future_value_get_mongoc_gridfs_file_ptr (future_get_param (future, 0)), future_value_get_mongoc_iovec_ptr (future_get_param (future, 1)), future_value_get_size_t (future_get_param (future, 2)), future_value_get_size_t (future_get_param (future, 3)), future_value_get_uint32_t (future_get_param (future, 4)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_gridfs_file_seek (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_int_type; future_value_set_int ( &return_value, mongoc_gridfs_file_seek ( future_value_get_mongoc_gridfs_file_ptr (future_get_param (future, 0)), future_value_get_int64_t (future_get_param (future, 1)), future_value_get_int (future_get_param (future, 2)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_gridfs_file_writev (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_ssize_t_type; future_value_set_ssize_t ( &return_value, mongoc_gridfs_file_writev ( future_value_get_mongoc_gridfs_file_ptr (future_get_param (future, 0)), future_value_get_mongoc_iovec_ptr (future_get_param (future, 1)), future_value_get_size_t (future_get_param (future, 2)), future_value_get_uint32_t (future_get_param (future, 3)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_topology_select (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_mongoc_server_description_ptr_type; future_value_set_mongoc_server_description_ptr ( &return_value, mongoc_topology_select ( future_value_get_mongoc_topology_ptr (future_get_param (future, 0)), future_value_get_mongoc_ss_optype_t (future_get_param (future, 1)), future_value_get_const_mongoc_read_prefs_ptr (future_get_param (future, 2)), future_value_get_int64_t (future_get_param (future, 3)), future_value_get_bson_error_ptr (future_get_param (future, 4)) )); future_resolve (future, return_value); return NULL; } static void * background_mongoc_client_get_gridfs (void *data) { future_t *future = (future_t *) data; future_value_t return_value; return_value.type = future_value_mongoc_gridfs_ptr_type; future_value_set_mongoc_gridfs_ptr ( &return_value, mongoc_client_get_gridfs ( future_value_get_mongoc_client_ptr (future_get_param (future, 0)), future_value_get_const_char_ptr (future_get_param (future, 1)), future_value_get_const_char_ptr (future_get_param (future, 2)), future_value_get_bson_error_ptr (future_get_param (future, 3)) )); future_resolve (future, return_value); return NULL; } future_t * future_bulk_operation_execute ( mongoc_bulk_operation_ptr bulk, bson_ptr reply, bson_error_ptr error) { future_t *future = future_new (future_value_uint32_t_type, 3); future_value_set_mongoc_bulk_operation_ptr ( future_get_param (future, 0), bulk); future_value_set_bson_ptr ( future_get_param (future, 1), reply); future_value_set_bson_error_ptr ( future_get_param (future, 2), error); future_start (future, background_mongoc_bulk_operation_execute); return future; } future_t * future_client_command_simple ( mongoc_client_ptr client, const_char_ptr db_name, const_bson_ptr command, const_mongoc_read_prefs_ptr read_prefs, bson_ptr reply, bson_error_ptr error) { future_t *future = future_new (future_value_bool_type, 6); future_value_set_mongoc_client_ptr ( future_get_param (future, 0), client); future_value_set_const_char_ptr ( future_get_param (future, 1), db_name); future_value_set_const_bson_ptr ( future_get_param (future, 2), command); future_value_set_const_mongoc_read_prefs_ptr ( future_get_param (future, 3), read_prefs); future_value_set_bson_ptr ( future_get_param (future, 4), reply); future_value_set_bson_error_ptr ( future_get_param (future, 5), error); future_start (future, background_mongoc_client_command_simple); return future; } future_t * future_client_kill_cursor ( mongoc_client_ptr client, int64_t cursor_id) { future_t *future = future_new (future_value_void_type, 2); future_value_set_mongoc_client_ptr ( future_get_param (future, 0), client); future_value_set_int64_t ( future_get_param (future, 1), cursor_id); future_start (future, background_mongoc_client_kill_cursor); return future; } future_t * future_collection_aggregate ( mongoc_collection_ptr collection, mongoc_query_flags_t flags, const_bson_ptr pipeline, const_bson_ptr options, const_mongoc_read_prefs_ptr read_prefs) { future_t *future = future_new (future_value_mongoc_cursor_ptr_type, 5); future_value_set_mongoc_collection_ptr ( future_get_param (future, 0), collection); future_value_set_mongoc_query_flags_t ( future_get_param (future, 1), flags); future_value_set_const_bson_ptr ( future_get_param (future, 2), pipeline); future_value_set_const_bson_ptr ( future_get_param (future, 3), options); future_value_set_const_mongoc_read_prefs_ptr ( future_get_param (future, 4), read_prefs); future_start (future, background_mongoc_collection_aggregate); return future; } future_t * future_collection_count ( mongoc_collection_ptr collection, mongoc_query_flags_t flags, const_bson_ptr query, int64_t skip, int64_t limit, const_mongoc_read_prefs_ptr read_prefs, bson_error_ptr error) { future_t *future = future_new (future_value_int64_t_type, 7); future_value_set_mongoc_collection_ptr ( future_get_param (future, 0), collection); future_value_set_mongoc_query_flags_t ( future_get_param (future, 1), flags); future_value_set_const_bson_ptr ( future_get_param (future, 2), query); future_value_set_int64_t ( future_get_param (future, 3), skip); future_value_set_int64_t ( future_get_param (future, 4), limit); future_value_set_const_mongoc_read_prefs_ptr ( future_get_param (future, 5), read_prefs); future_value_set_bson_error_ptr ( future_get_param (future, 6), error); future_start (future, background_mongoc_collection_count); return future; } future_t * future_collection_find_and_modify_with_opts ( mongoc_collection_ptr collection, const_bson_ptr query, const_mongoc_find_and_modify_opts_ptr opts, bson_ptr reply, bson_error_ptr error) { future_t *future = future_new (future_value_bool_type, 5); future_value_set_mongoc_collection_ptr ( future_get_param (future, 0), collection); future_value_set_const_bson_ptr ( future_get_param (future, 1), query); future_value_set_const_mongoc_find_and_modify_opts_ptr ( future_get_param (future, 2), opts); future_value_set_bson_ptr ( future_get_param (future, 3), reply); future_value_set_bson_error_ptr ( future_get_param (future, 4), error); future_start (future, background_mongoc_collection_find_and_modify_with_opts); return future; } future_t * future_collection_find_and_modify ( mongoc_collection_ptr collection, const_bson_ptr query, const_bson_ptr sort, const_bson_ptr update, const_bson_ptr fields, bool _remove, bool upsert, bool _new, bson_ptr reply, bson_error_ptr error) { future_t *future = future_new (future_value_bool_type, 10); future_value_set_mongoc_collection_ptr ( future_get_param (future, 0), collection); future_value_set_const_bson_ptr ( future_get_param (future, 1), query); future_value_set_const_bson_ptr ( future_get_param (future, 2), sort); future_value_set_const_bson_ptr ( future_get_param (future, 3), update); future_value_set_const_bson_ptr ( future_get_param (future, 4), fields); future_value_set_bool ( future_get_param (future, 5), _remove); future_value_set_bool ( future_get_param (future, 6), upsert); future_value_set_bool ( future_get_param (future, 7), _new); future_value_set_bson_ptr ( future_get_param (future, 8), reply); future_value_set_bson_error_ptr ( future_get_param (future, 9), error); future_start (future, background_mongoc_collection_find_and_modify); return future; } future_t * future_collection_insert ( mongoc_collection_ptr collection, mongoc_insert_flags_t flags, const_bson_ptr document, const_mongoc_write_concern_ptr write_concern, bson_error_ptr error) { future_t *future = future_new (future_value_bool_type, 5); future_value_set_mongoc_collection_ptr ( future_get_param (future, 0), collection); future_value_set_mongoc_insert_flags_t ( future_get_param (future, 1), flags); future_value_set_const_bson_ptr ( future_get_param (future, 2), document); future_value_set_const_mongoc_write_concern_ptr ( future_get_param (future, 3), write_concern); future_value_set_bson_error_ptr ( future_get_param (future, 4), error); future_start (future, background_mongoc_collection_insert); return future; } future_t * future_collection_insert_bulk ( mongoc_collection_ptr collection, mongoc_insert_flags_t flags, const_bson_ptr_ptr documents, uint32_t n_documents, const_mongoc_write_concern_ptr write_concern, bson_error_ptr error) { future_t *future = future_new (future_value_bool_type, 6); future_value_set_mongoc_collection_ptr ( future_get_param (future, 0), collection); future_value_set_mongoc_insert_flags_t ( future_get_param (future, 1), flags); future_value_set_const_bson_ptr_ptr ( future_get_param (future, 2), documents); future_value_set_uint32_t ( future_get_param (future, 3), n_documents); future_value_set_const_mongoc_write_concern_ptr ( future_get_param (future, 4), write_concern); future_value_set_bson_error_ptr ( future_get_param (future, 5), error); future_start (future, background_mongoc_collection_insert_bulk); return future; } future_t * future_cursor_destroy ( mongoc_cursor_ptr cursor) { future_t *future = future_new (future_value_void_type, 1); future_value_set_mongoc_cursor_ptr ( future_get_param (future, 0), cursor); future_start (future, background_mongoc_cursor_destroy); return future; } future_t * future_cursor_next ( mongoc_cursor_ptr cursor, const_bson_ptr_ptr doc) { future_t *future = future_new (future_value_bool_type, 2); future_value_set_mongoc_cursor_ptr ( future_get_param (future, 0), cursor); future_value_set_const_bson_ptr_ptr ( future_get_param (future, 1), doc); future_start (future, background_mongoc_cursor_next); return future; } future_t * future_client_get_database_names ( mongoc_client_ptr client, bson_error_ptr error) { future_t *future = future_new (future_value_char_ptr_ptr_type, 2); future_value_set_mongoc_client_ptr ( future_get_param (future, 0), client); future_value_set_bson_error_ptr ( future_get_param (future, 1), error); future_start (future, background_mongoc_client_get_database_names); return future; } future_t * future_database_get_collection_names ( mongoc_database_ptr database, bson_error_ptr error) { future_t *future = future_new (future_value_char_ptr_ptr_type, 2); future_value_set_mongoc_database_ptr ( future_get_param (future, 0), database); future_value_set_bson_error_ptr ( future_get_param (future, 1), error); future_start (future, background_mongoc_database_get_collection_names); return future; } future_t * future_gridfs_file_readv ( mongoc_gridfs_file_ptr file, mongoc_iovec_ptr iov, size_t iovcnt, size_t min_bytes, uint32_t timeout_msec) { future_t *future = future_new (future_value_ssize_t_type, 5); future_value_set_mongoc_gridfs_file_ptr ( future_get_param (future, 0), file); future_value_set_mongoc_iovec_ptr ( future_get_param (future, 1), iov); future_value_set_size_t ( future_get_param (future, 2), iovcnt); future_value_set_size_t ( future_get_param (future, 3), min_bytes); future_value_set_uint32_t ( future_get_param (future, 4), timeout_msec); future_start (future, background_mongoc_gridfs_file_readv); return future; } future_t * future_gridfs_file_seek ( mongoc_gridfs_file_ptr file, int64_t delta, int whence) { future_t *future = future_new (future_value_int_type, 3); future_value_set_mongoc_gridfs_file_ptr ( future_get_param (future, 0), file); future_value_set_int64_t ( future_get_param (future, 1), delta); future_value_set_int ( future_get_param (future, 2), whence); future_start (future, background_mongoc_gridfs_file_seek); return future; } future_t * future_gridfs_file_writev ( mongoc_gridfs_file_ptr file, mongoc_iovec_ptr iov, size_t iovcnt, uint32_t timeout_msec) { future_t *future = future_new (future_value_ssize_t_type, 4); future_value_set_mongoc_gridfs_file_ptr ( future_get_param (future, 0), file); future_value_set_mongoc_iovec_ptr ( future_get_param (future, 1), iov); future_value_set_size_t ( future_get_param (future, 2), iovcnt); future_value_set_uint32_t ( future_get_param (future, 3), timeout_msec); future_start (future, background_mongoc_gridfs_file_writev); return future; } future_t * future_topology_select ( mongoc_topology_ptr topology, mongoc_ss_optype_t optype, const_mongoc_read_prefs_ptr read_prefs, int64_t local_threshold_ms, bson_error_ptr error) { future_t *future = future_new (future_value_mongoc_server_description_ptr_type, 5); future_value_set_mongoc_topology_ptr ( future_get_param (future, 0), topology); future_value_set_mongoc_ss_optype_t ( future_get_param (future, 1), optype); future_value_set_const_mongoc_read_prefs_ptr ( future_get_param (future, 2), read_prefs); future_value_set_int64_t ( future_get_param (future, 3), local_threshold_ms); future_value_set_bson_error_ptr ( future_get_param (future, 4), error); future_start (future, background_mongoc_topology_select); return future; } future_t * future_client_get_gridfs ( mongoc_client_ptr client, const_char_ptr db, const_char_ptr prefix, bson_error_ptr error) { future_t *future = future_new (future_value_mongoc_gridfs_ptr_type, 4); future_value_set_mongoc_client_ptr ( future_get_param (future, 0), client); future_value_set_const_char_ptr ( future_get_param (future, 1), db); future_value_set_const_char_ptr ( future_get_param (future, 2), prefix); future_value_set_bson_error_ptr ( future_get_param (future, 3), error); future_start (future, background_mongoc_client_get_gridfs); return future; }
202115.c
// INFO: trying to register non-static key in red_destroy // https://syzkaller.appspot.com/bug?id=6e95a4fabf88dc217145 // status:6 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include <arpa/inet.h> #include <endian.h> #include <errno.h> #include <fcntl.h> #include <net/if.h> #include <net/if_arp.h> #include <netinet/in.h> #include <sched.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <sys/mount.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/time.h> #include <sys/types.h> #include <sys/uio.h> #include <sys/wait.h> #include <unistd.h> #include <linux/capability.h> #include <linux/genetlink.h> #include <linux/if_addr.h> #include <linux/if_ether.h> #include <linux/if_link.h> #include <linux/if_tun.h> #include <linux/in6.h> #include <linux/ip.h> #include <linux/neighbour.h> #include <linux/net.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <linux/tcp.h> #include <linux/veth.h> static unsigned long long procid; static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } struct nlmsg { char* pos; int nesting; struct nlattr* nested[8]; char buf[1024]; }; static struct nlmsg nlmsg; static void netlink_init(struct nlmsg* nlmsg, int typ, int flags, const void* data, int size) { memset(nlmsg, 0, sizeof(*nlmsg)); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_type = typ; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; memcpy(hdr + 1, data, size); nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size); } static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data, int size) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_len = sizeof(*attr) + size; attr->nla_type = typ; memcpy(attr + 1, data, size); nlmsg->pos += NLMSG_ALIGN(attr->nla_len); } static void netlink_nest(struct nlmsg* nlmsg, int typ) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_type = typ; nlmsg->pos += sizeof(*attr); nlmsg->nested[nlmsg->nesting++] = attr; } static void netlink_done(struct nlmsg* nlmsg) { struct nlattr* attr = nlmsg->nested[--nlmsg->nesting]; attr->nla_len = nlmsg->pos - (char*)attr; } static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type, int* reply_len) { if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting) exit(1); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_len = nlmsg->pos - nlmsg->buf; struct sockaddr_nl addr; memset(&addr, 0, sizeof(addr)); addr.nl_family = AF_NETLINK; unsigned n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr)); if (n != hdr->nlmsg_len) exit(1); n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); if (hdr->nlmsg_type == NLMSG_DONE) { *reply_len = 0; return 0; } if (n < sizeof(struct nlmsghdr)) exit(1); if (reply_len && hdr->nlmsg_type == reply_type) { *reply_len = n; return 0; } if (n < sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr)) exit(1); if (hdr->nlmsg_type != NLMSG_ERROR) exit(1); return -((struct nlmsgerr*)(hdr + 1))->error; } static int netlink_send(struct nlmsg* nlmsg, int sock) { return netlink_send_ext(nlmsg, sock, 0, NULL); } static int netlink_next_msg(struct nlmsg* nlmsg, unsigned int offset, unsigned int total_len) { struct nlmsghdr* hdr = (struct nlmsghdr*)(nlmsg->buf + offset); if (offset == total_len || offset + hdr->nlmsg_len > total_len) return -1; return hdr->nlmsg_len; } static void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_add_device(struct nlmsg* nlmsg, int sock, const char* type, const char* name) { netlink_add_device_impl(nlmsg, type, name); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_veth(struct nlmsg* nlmsg, int sock, const char* name, const char* peer) { netlink_add_device_impl(nlmsg, "veth", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_nest(nlmsg, VETH_INFO_PEER); nlmsg->pos += sizeof(struct ifinfomsg); netlink_attr(nlmsg, IFLA_IFNAME, peer, strlen(peer)); netlink_done(nlmsg); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_hsr(struct nlmsg* nlmsg, int sock, const char* name, const char* slave1, const char* slave2) { netlink_add_device_impl(nlmsg, "hsr", name); netlink_nest(nlmsg, IFLA_INFO_DATA); int ifindex1 = if_nametoindex(slave1); netlink_attr(nlmsg, IFLA_HSR_SLAVE1, &ifindex1, sizeof(ifindex1)); int ifindex2 = if_nametoindex(slave2); netlink_attr(nlmsg, IFLA_HSR_SLAVE2, &ifindex2, sizeof(ifindex2)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_linked(struct nlmsg* nlmsg, int sock, const char* type, const char* name, const char* link) { netlink_add_device_impl(nlmsg, type, name); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_vlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t id, uint16_t proto) { netlink_add_device_impl(nlmsg, "vlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_VLAN_ID, &id, sizeof(id)); netlink_attr(nlmsg, IFLA_VLAN_PROTOCOL, &proto, sizeof(proto)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_macvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link) { netlink_add_device_impl(nlmsg, "macvlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); uint32_t mode = MACVLAN_MODE_BRIDGE; netlink_attr(nlmsg, IFLA_MACVLAN_MODE, &mode, sizeof(mode)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_geneve(struct nlmsg* nlmsg, int sock, const char* name, uint32_t vni, struct in_addr* addr4, struct in6_addr* addr6) { netlink_add_device_impl(nlmsg, "geneve", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_GENEVE_ID, &vni, sizeof(vni)); if (addr4) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE, addr4, sizeof(*addr4)); if (addr6) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE6, addr6, sizeof(*addr6)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } #define IFLA_IPVLAN_FLAGS 2 #define IPVLAN_MODE_L3S 2 #undef IPVLAN_F_VEPA #define IPVLAN_F_VEPA 2 static void netlink_add_ipvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t mode, uint16_t flags) { netlink_add_device_impl(nlmsg, "ipvlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_IPVLAN_MODE, &mode, sizeof(mode)); netlink_attr(nlmsg, IFLA_IPVLAN_FLAGS, &flags, sizeof(flags)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); (void)err; } static int netlink_add_addr(struct nlmsg* nlmsg, int sock, const char* dev, const void* addr, int addrsize) { struct ifaddrmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120; hdr.ifa_scope = RT_SCOPE_UNIVERSE; hdr.ifa_index = if_nametoindex(dev); netlink_init(nlmsg, RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, IFA_LOCAL, addr, addrsize); netlink_attr(nlmsg, IFA_ADDRESS, addr, addrsize); return netlink_send(nlmsg, sock); } static void netlink_add_addr4(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in_addr in_addr; inet_pton(AF_INET, addr, &in_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in_addr, sizeof(in_addr)); (void)err; } static void netlink_add_addr6(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in6_addr in6_addr; inet_pton(AF_INET6, addr, &in6_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in6_addr, sizeof(in6_addr)); (void)err; } #define DEVLINK_FAMILY_NAME "devlink" #define DEVLINK_CMD_PORT_GET 5 #define DEVLINK_ATTR_BUS_NAME 1 #define DEVLINK_ATTR_DEV_NAME 2 #define DEVLINK_ATTR_NETDEV_NAME 7 static int netlink_devlink_id_get(struct nlmsg* nlmsg, int sock) { struct genlmsghdr genlhdr; struct nlattr* attr; int err, n; uint16_t id = 0; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = CTRL_CMD_GETFAMILY; netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, DEVLINK_FAMILY_NAME, strlen(DEVLINK_FAMILY_NAME) + 1); err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n); if (err) { return -1; } attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg->buf + n; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == CTRL_ATTR_FAMILY_ID) { id = *(uint16_t*)(attr + 1); break; } } if (!id) { return -1; } recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); /* recv ack */ return id; } static struct nlmsg nlmsg2; static void initialize_devlink_ports(const char* bus_name, const char* dev_name, const char* netdev_prefix) { struct genlmsghdr genlhdr; int len, total_len, id, err, offset; uint16_t netdev_index; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) exit(1); int rtsock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (rtsock == -1) exit(1); id = netlink_devlink_id_get(&nlmsg, sock); if (id == -1) goto error; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = DEVLINK_CMD_PORT_GET; netlink_init(&nlmsg, id, NLM_F_DUMP, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1); netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1); err = netlink_send_ext(&nlmsg, sock, id, &total_len); if (err) { goto error; } offset = 0; netdev_index = 0; while ((len = netlink_next_msg(&nlmsg, offset, total_len)) != -1) { struct nlattr* attr = (struct nlattr*)(nlmsg.buf + offset + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg.buf + offset + len; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == DEVLINK_ATTR_NETDEV_NAME) { char* port_name; char netdev_name[IFNAMSIZ]; port_name = (char*)(attr + 1); snprintf(netdev_name, sizeof(netdev_name), "%s%d", netdev_prefix, netdev_index); netlink_device_change(&nlmsg2, rtsock, port_name, true, 0, 0, 0, netdev_name); break; } } offset += len; netdev_index++; } error: close(rtsock); close(sock); } #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02x" #define DEV_MAC 0x00aaaaaaaaaa static void netdevsim_add(unsigned int addr, unsigned int port_count) { char buf[16]; sprintf(buf, "%u %u", addr, port_count); if (write_file("/sys/bus/netdevsim/new_device", buf)) { snprintf(buf, sizeof(buf), "netdevsim%d", addr); initialize_devlink_ports("netdevsim", buf, "netdevsim"); } } #define WG_GENL_NAME "wireguard" enum wg_cmd { WG_CMD_GET_DEVICE, WG_CMD_SET_DEVICE, }; enum wgdevice_attribute { WGDEVICE_A_UNSPEC, WGDEVICE_A_IFINDEX, WGDEVICE_A_IFNAME, WGDEVICE_A_PRIVATE_KEY, WGDEVICE_A_PUBLIC_KEY, WGDEVICE_A_FLAGS, WGDEVICE_A_LISTEN_PORT, WGDEVICE_A_FWMARK, WGDEVICE_A_PEERS, }; enum wgpeer_attribute { WGPEER_A_UNSPEC, WGPEER_A_PUBLIC_KEY, WGPEER_A_PRESHARED_KEY, WGPEER_A_FLAGS, WGPEER_A_ENDPOINT, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, WGPEER_A_LAST_HANDSHAKE_TIME, WGPEER_A_RX_BYTES, WGPEER_A_TX_BYTES, WGPEER_A_ALLOWEDIPS, WGPEER_A_PROTOCOL_VERSION, }; enum wgallowedip_attribute { WGALLOWEDIP_A_UNSPEC, WGALLOWEDIP_A_FAMILY, WGALLOWEDIP_A_IPADDR, WGALLOWEDIP_A_CIDR_MASK, }; static int netlink_wireguard_id_get(struct nlmsg* nlmsg, int sock) { struct genlmsghdr genlhdr; struct nlattr* attr; int err, n; uint16_t id = 0; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = CTRL_CMD_GETFAMILY; netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, WG_GENL_NAME, strlen(WG_GENL_NAME) + 1); err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n); if (err) { return -1; } attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg->buf + n; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == CTRL_ATTR_FAMILY_ID) { id = *(uint16_t*)(attr + 1); break; } } if (!id) { return -1; } recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); /* recv ack */ return id; } static void netlink_wireguard_setup(void) { const char ifname_a[] = "wg0"; const char ifname_b[] = "wg1"; const char ifname_c[] = "wg2"; const char private_a[] = "\xa0\x5c\xa8\x4f\x6c\x9c\x8e\x38\x53\xe2\xfd\x7a" "\x70\xae\x0f\xb2\x0f\xa1\x52\x60\x0c\xb0\x08\x45" "\x17\x4f\x08\x07\x6f\x8d\x78\x43"; const char private_b[] = "\xb0\x80\x73\xe8\xd4\x4e\x91\xe3\xda\x92\x2c\x22" "\x43\x82\x44\xbb\x88\x5c\x69\xe2\x69\xc8\xe9\xd8" "\x35\xb1\x14\x29\x3a\x4d\xdc\x6e"; const char private_c[] = "\xa0\xcb\x87\x9a\x47\xf5\xbc\x64\x4c\x0e\x69\x3f" "\xa6\xd0\x31\xc7\x4a\x15\x53\xb6\xe9\x01\xb9\xff" "\x2f\x51\x8c\x78\x04\x2f\xb5\x42"; const char public_a[] = "\x97\x5c\x9d\x81\xc9\x83\xc8\x20\x9e\xe7\x81\x25\x4b" "\x89\x9f\x8e\xd9\x25\xae\x9f\x09\x23\xc2\x3c\x62\xf5" "\x3c\x57\xcd\xbf\x69\x1c"; const char public_b[] = "\xd1\x73\x28\x99\xf6\x11\xcd\x89\x94\x03\x4d\x7f\x41" "\x3d\xc9\x57\x63\x0e\x54\x93\xc2\x85\xac\xa4\x00\x65" "\xcb\x63\x11\xbe\x69\x6b"; const char public_c[] = "\xf4\x4d\xa3\x67\xa8\x8e\xe6\x56\x4f\x02\x02\x11\x45" "\x67\x27\x08\x2f\x5c\xeb\xee\x8b\x1b\xf5\xeb\x73\x37" "\x34\x1b\x45\x9b\x39\x22"; const uint16_t listen_a = 20001; const uint16_t listen_b = 20002; const uint16_t listen_c = 20003; const uint16_t af_inet = AF_INET; const uint16_t af_inet6 = AF_INET6; /* Unused, but useful in case we change this: const struct sockaddr_in endpoint_a_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_a), .sin_addr = {htonl(INADDR_LOOPBACK)}};*/ const struct sockaddr_in endpoint_b_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_b), .sin_addr = {htonl(INADDR_LOOPBACK)}}; const struct sockaddr_in endpoint_c_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_c), .sin_addr = {htonl(INADDR_LOOPBACK)}}; struct sockaddr_in6 endpoint_a_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_a)}; endpoint_a_v6.sin6_addr = in6addr_loopback; /* Unused, but useful in case we change this: const struct sockaddr_in6 endpoint_b_v6 = { .sin6_family = AF_INET6, .sin6_port = htons(listen_b)}; endpoint_b_v6.sin6_addr = in6addr_loopback; */ struct sockaddr_in6 endpoint_c_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_c)}; endpoint_c_v6.sin6_addr = in6addr_loopback; const struct in_addr first_half_v4 = {0}; const struct in_addr second_half_v4 = {htonl(128 << 24)}; const struct in6_addr first_half_v6 = {{{0}}}; const struct in6_addr second_half_v6 = {{{0x80}}}; const uint8_t half_cidr = 1; const uint16_t persistent_keepalives[] = {1, 3, 7, 9, 14, 19}; struct genlmsghdr genlhdr = {.cmd = WG_CMD_SET_DEVICE, .version = 1}; int sock; int id, err; sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) { return; } id = netlink_wireguard_id_get(&nlmsg, sock); if (id == -1) goto error; netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_a, strlen(ifname_a) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_a, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_a, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[0], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v6, sizeof(endpoint_c_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[1], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_b, strlen(ifname_b) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_b, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_b, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[2], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v4, sizeof(endpoint_c_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[3], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_c, strlen(ifname_c) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_c, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_c, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[4], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[5], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err) { } error: close(sock); } static void initialize_netdevices(void) { char netdevsim[16]; sprintf(netdevsim, "netdevsim%d", (int)procid); struct { const char* type; const char* dev; } devtypes[] = { {"ip6gretap", "ip6gretap0"}, {"bridge", "bridge0"}, {"vcan", "vcan0"}, {"bond", "bond0"}, {"team", "team0"}, {"dummy", "dummy0"}, {"nlmon", "nlmon0"}, {"caif", "caif0"}, {"batadv", "batadv0"}, {"vxcan", "vxcan1"}, {"netdevsim", netdevsim}, {"veth", 0}, {"xfrm", "xfrm0"}, {"wireguard", "wg0"}, {"wireguard", "wg1"}, {"wireguard", "wg2"}, }; const char* devmasters[] = {"bridge", "bond", "team", "batadv"}; struct { const char* name; int macsize; bool noipv6; } devices[] = { {"lo", ETH_ALEN}, {"sit0", 0}, {"bridge0", ETH_ALEN}, {"vcan0", 0, true}, {"tunl0", 0}, {"gre0", 0}, {"gretap0", ETH_ALEN}, {"ip_vti0", 0}, {"ip6_vti0", 0}, {"ip6tnl0", 0}, {"ip6gre0", 0}, {"ip6gretap0", ETH_ALEN}, {"erspan0", ETH_ALEN}, {"bond0", ETH_ALEN}, {"veth0", ETH_ALEN}, {"veth1", ETH_ALEN}, {"team0", ETH_ALEN}, {"veth0_to_bridge", ETH_ALEN}, {"veth1_to_bridge", ETH_ALEN}, {"veth0_to_bond", ETH_ALEN}, {"veth1_to_bond", ETH_ALEN}, {"veth0_to_team", ETH_ALEN}, {"veth1_to_team", ETH_ALEN}, {"veth0_to_hsr", ETH_ALEN}, {"veth1_to_hsr", ETH_ALEN}, {"hsr0", 0}, {"dummy0", ETH_ALEN}, {"nlmon0", 0}, {"vxcan0", 0, true}, {"vxcan1", 0, true}, {"caif0", ETH_ALEN}, {"batadv0", ETH_ALEN}, {netdevsim, ETH_ALEN}, {"xfrm0", ETH_ALEN}, {"veth0_virt_wifi", ETH_ALEN}, {"veth1_virt_wifi", ETH_ALEN}, {"virt_wifi0", ETH_ALEN}, {"veth0_vlan", ETH_ALEN}, {"veth1_vlan", ETH_ALEN}, {"vlan0", ETH_ALEN}, {"vlan1", ETH_ALEN}, {"macvlan0", ETH_ALEN}, {"macvlan1", ETH_ALEN}, {"ipvlan0", ETH_ALEN}, {"ipvlan1", ETH_ALEN}, {"veth0_macvtap", ETH_ALEN}, {"veth1_macvtap", ETH_ALEN}, {"macvtap0", ETH_ALEN}, {"macsec0", ETH_ALEN}, {"veth0_to_batadv", ETH_ALEN}, {"veth1_to_batadv", ETH_ALEN}, {"batadv_slave_0", ETH_ALEN}, {"batadv_slave_1", ETH_ALEN}, {"geneve0", ETH_ALEN}, {"geneve1", ETH_ALEN}, {"wg0", 0}, {"wg1", 0}, {"wg2", 0}, }; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) netlink_add_device(&nlmsg, sock, devtypes[i].type, devtypes[i].dev); for (i = 0; i < sizeof(devmasters) / (sizeof(devmasters[0])); i++) { char master[32], slave0[32], veth0[32], slave1[32], veth1[32]; sprintf(slave0, "%s_slave_0", devmasters[i]); sprintf(veth0, "veth0_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave0, veth0); sprintf(slave1, "%s_slave_1", devmasters[i]); sprintf(veth1, "veth1_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave1, veth1); sprintf(master, "%s0", devmasters[i]); netlink_device_change(&nlmsg, sock, slave0, false, master, 0, 0, NULL); netlink_device_change(&nlmsg, sock, slave1, false, master, 0, 0, NULL); } netlink_device_change(&nlmsg, sock, "bridge_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "bridge_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "hsr_slave_0", "veth0_to_hsr"); netlink_add_veth(&nlmsg, sock, "hsr_slave_1", "veth1_to_hsr"); netlink_add_hsr(&nlmsg, sock, "hsr0", "hsr_slave_0", "hsr_slave_1"); netlink_device_change(&nlmsg, sock, "hsr_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "hsr_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "veth0_virt_wifi", "veth1_virt_wifi"); netlink_add_linked(&nlmsg, sock, "virt_wifi", "virt_wifi0", "veth1_virt_wifi"); netlink_add_veth(&nlmsg, sock, "veth0_vlan", "veth1_vlan"); netlink_add_vlan(&nlmsg, sock, "vlan0", "veth0_vlan", 0, htons(ETH_P_8021Q)); netlink_add_vlan(&nlmsg, sock, "vlan1", "veth0_vlan", 1, htons(ETH_P_8021AD)); netlink_add_macvlan(&nlmsg, sock, "macvlan0", "veth1_vlan"); netlink_add_macvlan(&nlmsg, sock, "macvlan1", "veth1_vlan"); netlink_add_ipvlan(&nlmsg, sock, "ipvlan0", "veth0_vlan", IPVLAN_MODE_L2, 0); netlink_add_ipvlan(&nlmsg, sock, "ipvlan1", "veth0_vlan", IPVLAN_MODE_L3S, IPVLAN_F_VEPA); netlink_add_veth(&nlmsg, sock, "veth0_macvtap", "veth1_macvtap"); netlink_add_linked(&nlmsg, sock, "macvtap", "macvtap0", "veth0_macvtap"); netlink_add_linked(&nlmsg, sock, "macsec", "macsec0", "veth1_macvtap"); char addr[32]; sprintf(addr, DEV_IPV4, 14 + 10); struct in_addr geneve_addr4; if (inet_pton(AF_INET, addr, &geneve_addr4) <= 0) exit(1); struct in6_addr geneve_addr6; if (inet_pton(AF_INET6, "fc00::01", &geneve_addr6) <= 0) exit(1); netlink_add_geneve(&nlmsg, sock, "geneve0", 0, &geneve_addr4, 0); netlink_add_geneve(&nlmsg, sock, "geneve1", 1, 0, &geneve_addr6); netdevsim_add((int)procid, 4); netlink_wireguard_setup(); for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) { char addr[32]; sprintf(addr, DEV_IPV4, i + 10); netlink_add_addr4(&nlmsg, sock, devices[i].name, addr); if (!devices[i].noipv6) { sprintf(addr, DEV_IPV6, i + 10); netlink_add_addr6(&nlmsg, sock, devices[i].name, addr); } uint64_t macaddr = DEV_MAC + ((i + 10ull) << 40); netlink_device_change(&nlmsg, sock, devices[i].name, true, 0, &macaddr, devices[i].macsize, NULL); } close(sock); } static void initialize_netdevices_init(void) { int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); struct { const char* type; int macsize; bool noipv6; bool noup; } devtypes[] = { {"nr", 7, true}, {"rose", 5, true, true}, }; unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) { char dev[32], addr[32]; sprintf(dev, "%s%d", devtypes[i].type, (int)procid); sprintf(addr, "172.30.%d.%d", i, (int)procid + 1); netlink_add_addr4(&nlmsg, sock, dev, addr); if (!devtypes[i].noipv6) { sprintf(addr, "fe88::%02x:%02x", i, (int)procid + 1); netlink_add_addr6(&nlmsg, sock, dev, addr); } int macsize = devtypes[i].macsize; uint64_t macaddr = 0xbbbbbb + ((unsigned long long)i << (8 * (macsize - 2))) + (procid << (8 * (macsize - 1))); netlink_device_change(&nlmsg, sock, dev, !devtypes[i].noup, 0, &macaddr, macsize, NULL); } close(sock); } static void setup_common() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 0; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); setup_common(); sandbox_common(); drop_caps(); initialize_netdevices_init(); if (unshare(CLONE_NEWNET)) { } initialize_netdevices(); loop(); exit(1); } uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void loop(void) { intptr_t res = 0; res = syscall(__NR_socket, 2ul, 2ul, 0); if (res != -1) r[0] = res; memcpy((void*)0x20003c00, "bridge_slave_1\000\000", 16); *(uint32_t*)0x20003c10 = 0; res = syscall(__NR_ioctl, r[0], 0x8933, 0x20003c00ul); if (res != -1) r[1] = *(uint32_t*)0x20003c10; *(uint64_t*)0x20000240 = 0; *(uint32_t*)0x20000248 = 0; *(uint64_t*)0x20000250 = 0x200000c0; *(uint64_t*)0x200000c0 = 0x20000280; memcpy((void*)0x20000280, "\x70\x01\x00\x00\x24\x00\x07\x05\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00", 20); *(uint32_t*)0x20000294 = r[1]; memcpy( (void*)0x20000298, "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x28\x00\x08\x00\x1c\x00" "\x01\x00\x10\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\xff\x0f" "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x02\xc6\x00\x00\x02\x00\x08\x00" "\x01\x00\x72\x65\x64\x00\x1c\x01\x00\x00\x04\x01\x02\x00\x4e\x08\xe3\xb1" "\xb5\xf7\x57\x80\x56\x0a\x59\xa8\x48\x0d\xae\x55\x81\x80\x41\xc0\x2d\x84" "\x71\x38\x9f\x5a\x07\x6e\xaa\x78\x7f\x82\x46\xae\xf2\x32\xf4\x1f\xb4\xfd" "\x09\x5e\x66\x40\x69\x03\x5a\x01\x1a\xfb\x42\x7b\x47\x99\xdc\x17\x33\x83" "\x22\xc9\xd9\x19\x68\xa8\x8f\x2f\xbc\xbb\xa7\x34\x48\x6e\x4d\x3c\x39\x2e" "\xc5\xc4\x04\x33\x02\x1f\x00\x6b\x4d\xdf\x02\x64\x50\x62\xba\xce\xdc\xbc" "\xd6\x1e\x4b\xe8\xee\xa0\xe5\x77\xda\xe0\xa2\x31\x61\xa0\x78\xfe\xdf\x38" "\x77\x0e\x05\x53\x41\xdb\x2e\xca\x0c\xa5\x65\xe8\xc9\x23\x36\x42\x2a\x57" "\xf6\xad\xad\x6e\xd5\x81\xb2\x7c\xcc\x91\x55\xe9\x3c\x54\x23\x53\xf1\x68" "\x14\x23\x16\x1c\xb1\xe4\x4c\xc5\xb7\x5a\x30\x51\x2f\xff\x1d\x3a\x8f\x0d" "\x2b\xcb\x9e\x9e\xbf\xa6\x29\x0d\xd5\xfd\x8c\xd5\x15\x04\x10\x92\x2c\x3f" "\x86\xa3\xce\xe1\xd9\xe8\x07\xad\x34\x28\x20\xb8\x87\x7a\x65\x50\xa6\x28" "\x08\x7b\x76\xf3\xc9\xf5\x1c\x99\xeb\x16\x01\x8b\xf7\xa6\xcd\x83\xdc\xa6" "\xff\x4a\xf8\xa9\x4f\xab\x0a\x1d\x86\xfd\xed\x7a\x38\x35\xa9\x87\xbd\x9f" "\x53\x49\x9d\xef\x91\x15\xff\x45\xce\x9d\x94\xaa\x00\x00\x3f\x00\x00\x00" "\x00\x00\x14\x00\x01\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xe9\xcf\xb7\xff\xbb\x02\xf8\x58\x94\x68\x3c\x42\xa1\x52" "\x5d\x70\xc4\xee\x0f\x56\x24\x5d\x22\x84\x50\x5c\x55\x5f\x4c\x23\x47\xe7" "\xc6\x55\xa3\x74\xfb\x5e\x5d\x65\xb2\xa0\x00\x00\x00\x00\x00\x00\x00\x08" "\x18\xa8\x11\x8a\xf0\x59\xbd\x41\xa3\x43\x52\xa8\xab\x7c\x39\xe0\x11\xc1" "\x46\x15\x8a\xd3\x13\x22\xb8\xf8\x57\xfc\x96\xd2\xa2\xcd\x30\xe3\xc5\xa5" "\x1f\x8b\xd4\xe6\xba\x30\xda\xac\x4f\xda\xe9\x8f\x92\x21\x60\x0b\x28\xa1" "\x7d\x09\xaa\xd7\x49\xb9\x0d\xde\x7e\x3e\xfd\x51\xa7\xbc\xc9\x14\x53\x36" "\x8e\xbc\x30\x76\x06\xb5\x33\x26\xff\xd1\x74\x41\x37\x34\xb3\xe9\x27\x81" "\xfa\x68\x21\x36\x76\x46\xa4\x8d\x2a\x54\xa1\x64\x2b\x96\x5e\x89\x60\xd5" "\xa6\x4d\x0e\x54\x5d\x3a\x20\x7a\xac\xba\x04\x2f\x02\x00\x00\x00\xbf\x7f" "\x1f\x97\x0d\x7c\x1e\x85\x89\x97\x26\xc6\x72\xab\x9b\x89\x39\xa2\x28\x61" "\xfa\xb7\x19\x36\x9b\x60\x45\xb1\xdc\x7a\x64\xa7\xa4\x47\x3d\x1c\xfe\x94" "\x9f\x4b\x43\xf7\x51\x78\x20\xa7\xca\x6e\x3d\xc6\x8f\x6c\x3e\x1b\xe4\xd4" "\x75\x56\x31\x96\xdd\x6d\xf7\xa1\x60\x87\x88\xe9\xa3\x78\x6a\xbc\x2e\x7e" "\x2c\x92\xbd\xae", 598); *(uint64_t*)0x200000c8 = 0x170; *(uint64_t*)0x20000258 = 1; *(uint64_t*)0x20000260 = 0; *(uint64_t*)0x20000268 = 0; *(uint32_t*)0x20000270 = 0; syscall(__NR_sendmsg, -1, 0x20000240ul, 0ul); res = syscall(__NR_socket, 0x10ul, 0x80002ul, 0); if (res != -1) r[2] = res; *(uint64_t*)0x20000180 = 3; *(uint32_t*)0x20000188 = 0; *(uint64_t*)0x20000190 = 0x20000080; *(uint64_t*)0x20000198 = 0xe; *(uint64_t*)0x200001a0 = 0x20000100; *(uint64_t*)0x200001a8 = 0; *(uint32_t*)0x200001b0 = 0; syscall(__NR_sendmmsg, r[2], 0x20000180ul, 0x492492492492642ul, 0ul); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); do_sandbox_none(); return 0; }
898266.c
#include "lua_dyn.h" #ifdef _WIN32 #include <windows.h> #else #include <dlfcn.h> #endif #define LUA_PREFIX LuaFunctions. lua_All_functions LuaFunctions; int main(int argc, char* argv[]) { lua_State* L; /* Load lua.dll dynamically */ #ifdef _WIN32 HMODULE module = LoadLibrary("lua5.1.dll"); #else void* module = dlopen("liblua-5.1.so", RTLD_LAZY); #endif if(!luaL_loadfunctions(module, &LuaFunctions, sizeof(LuaFunctions))) { printf("Error loading Lua DLL!\n"); return (1); } /* From now on, the usual Lua API is available */ L = lua_open(); luaL_openlibs(L); luaL_dostring(L, "print 'Hello World'"); lua_close(L); return 0; }
991213.c
/* * bsfilt.c - a colcrt-like processor for cawf(1) */ /* * Copyright (c) 1991 Purdue University Research Foundation, * West Lafayette, Indiana 47907. All rights reserved. * * Written by Victor A. Abell <[email protected]>, Purdue * University Computing Center. Not derived from licensed software; * derived from awf(1) by Henry Spencer of the University of Toronto. * * Permission is granted to anyone to use this software for any * purpose on any computer system, and to alter it and redistribute * it freely, subject to the following restrictions: * * 1. The author is not responsible for any consequences of use of * this software, even if they arise from flaws in it. * * 2. The origin of this software must not be misrepresented, either * by explicit claim or by omission. Credits must appear in the * documentation. * * 3. Altered versions must be plainly marked as such, and must not * be misrepresented as being the original software. Credits must * appear in the documentation. * * 4. This notice may not be removed or altered. */ #include <stdlib.h> #include <stdio.h> #ifdef UNIX # ifdef USG #include <string.h> # else /* not USG */ #include <strings.h> # endif /* USG */ #else /* not UNIX */ #include <string.h> #endif /* UNIX */ #include <sys/types.h> #define MAXLL 2048 /* ridiculous maximum line length */ int Dash = 1; /* underline with dashes */ int Dp = 0; /* dash pending */ int Lc = 0; /* line count */ char *Pname; /* program name */ unsigned char Ulb[MAXLL]; /* underline buffer */ int Ulx = 0; /* underline buffer index */ void Putchar(int ch); int main(int argc, char *argv[]) { int ax = 1; /* argument index */ unsigned char c; /* character buffer */ FILE *fs; /* file stream */ int nf = 0; /* number of files processed */ unsigned char pc; /* previous character */ int under = 0; /* underline */ /* * Save program name. */ if ((Pname = strrchr(argv[0], '/')) != NULL) Pname++; else if ((Pname = strrchr(argv[0], '\\')) != NULL) Pname++; else Pname = argv[0]; /* * Process options. */ if (argc > 1 && argv[1][0] == '-') { switch (argv[1][1]) { /* * "-U" - underline with dashes. */ case 'U': Dash = 0; under = 1; break; /* * "-" - do no underlining at all. */ case '\0': Dash = under = 0; break; default: (void) fprintf(stderr, "%s usage: [-] [-U] [file]\n", Pname); exit(1); } ax++; } /* * Process files. Read standard input if no files names. */ while (ax < argc || nf == 0) { if (ax >= argc) fs = stdin; else { #ifdef UNIX if ((fs = fopen(argv[ax], "r")) == NULL) #else if ((fs = fopen(argv[ax], "rt")) == NULL) #endif { (void) fprintf(stderr, "%s: can't open %s\n", Pname, argv[ax]); exit(1); } ax++; } nf++; /* * Read input a character at a time. */ for (pc = '\0';;) { c = (unsigned char)fgetc(fs); if (feof(fs)) break; switch(c) { case '\n': if (pc) Putchar((int)pc); Putchar('\n'); pc = '\0'; break; case '\b': if (pc == '_') { if (under) { putchar(pc); putchar('\b'); } else if (Dash) Dp = 1; } pc = '\0'; break; default: if (pc) Putchar((int)pc); pc = c; } } if (pc) { Putchar((int)pc); Putchar((int)'\n'); } } exit(0); } /* * Putchar(ch) - put a character with possible underlining */ void Putchar(int ch) { int i; /* temporary index */ if ((unsigned char)ch == '\n') { /* * Handle end of line. */ putchar('\n'); if (Ulx) { while (Ulx && Ulb[Ulx-1] == ' ') Ulx--; if (Ulx) { for (i = 0; i < Ulx; i++) putchar(Ulb[i]); putchar('\n'); } } Dp = Ulx = 0; Lc++; return; } /* * Put "normal" character. */ putchar((unsigned char)ch); if (Dash) { /* * Handle dash-type underlining. */ if (Ulx >= MAXLL) { (void) fprintf(stderr, "%s: underline for line %d > %d characters\n", Pname, Lc, MAXLL); exit(1); } Ulb[Ulx++] = Dp ? '-' : ' '; Dp = 0; } }
644439.c
/*************************************************************************** video.c Functions to emulate the video hardware of the machine. ***************************************************************************/ #include "emu.h" #include "video/konicdev.h" #include "includes/combatsc.h" PALETTE_INIT( combatsc ) { int pal; /* allocate the colortable */ machine.colortable = colortable_alloc(machine, 0x80); for (pal = 0; pal < 8; pal++) { int i, clut; switch (pal) { default: case 0: /* other sprites */ case 2: /* other sprites(alt) */ clut = 1; /* 0 is wrong for Firing Range III targets */ break; case 4: /* player sprites */ case 6: /* player sprites(alt) */ clut = 2; break; case 1: /* background */ case 3: /* background(alt) */ clut = 1; break; case 5: /* foreground tiles */ case 7: /* foreground tiles(alt) */ clut = 3; break; } for (i = 0; i < 0x100; i++) { UINT8 ctabentry; if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0)) ctabentry = 0; else ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f); colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry); } } } PALETTE_INIT( combatscb ) { int pal; /* allocate the colortable */ machine.colortable = colortable_alloc(machine, 0x80); for (pal = 0; pal < 8; pal++) { int i; for (i = 0; i < 0x100; i++) { UINT8 ctabentry; if ((pal & 1) == 0) /* sprites */ ctabentry = (pal << 4) | (~color_prom[i] & 0x0f); else /* chars - no lookup? */ ctabentry = (pal << 4) | (i & 0x0f); /* no lookup? */ colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry); } } } static void set_pens( running_machine &machine ) { combatsc_state *state = machine.driver_data<combatsc_state>(); int i; for (i = 0x00; i < 0x100; i += 2) { UINT16 data = state->m_paletteram[i] | (state->m_paletteram[i | 1] << 8); rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10)); colortable_palette_set_color(machine.colortable, i >> 1, color); } } /*************************************************************************** Callbacks for the TileMap code ***************************************************************************/ static TILE_GET_INFO( get_tile_info0 ) { combatsc_state *state = machine.driver_data<combatsc_state>(); UINT8 ctrl_6 = k007121_ctrlram_r(state->m_k007121_1, 6); UINT8 attributes = state->m_page[0][tile_index]; int bank = 4 * ((state->m_vreg & 0x0f) - 1); int number, color; if (bank < 0) bank = 0; if ((attributes & 0xb0) == 0) bank = 0; /* text bank */ if (attributes & 0x80) bank += 1; if (attributes & 0x10) bank += 2; if (attributes & 0x20) bank += 4; color = ((ctrl_6 & 0x10) * 2 + 16) + (attributes & 0x0f); number = state->m_page[0][tile_index + 0x400] + 256 * bank; SET_TILE_INFO( 0, number, color, 0); tileinfo->category = (attributes & 0x40) >> 6; } static TILE_GET_INFO( get_tile_info1 ) { combatsc_state *state = machine.driver_data<combatsc_state>(); UINT8 ctrl_6 = k007121_ctrlram_r(state->m_k007121_2, 6); UINT8 attributes = state->m_page[1][tile_index]; int bank = 4 * ((state->m_vreg >> 4) - 1); int number, color; if (bank < 0) bank = 0; if ((attributes & 0xb0) == 0) bank = 0; /* text bank */ if (attributes & 0x80) bank += 1; if (attributes & 0x10) bank += 2; if (attributes & 0x20) bank += 4; color = ((ctrl_6 & 0x10) * 2 + 16 + 4 * 16) + (attributes & 0x0f); number = state->m_page[1][tile_index + 0x400] + 256 * bank; SET_TILE_INFO( 1, number, color, 0); tileinfo->category = (attributes & 0x40) >> 6; } static TILE_GET_INFO( get_text_info ) { combatsc_state *state = machine.driver_data<combatsc_state>(); UINT8 attributes = state->m_page[0][tile_index + 0x800]; int number = state->m_page[0][tile_index + 0xc00]; int color = 16 + (attributes & 0x0f); SET_TILE_INFO( 0, number, color, 0); } static TILE_GET_INFO( get_tile_info0_bootleg ) { combatsc_state *state = machine.driver_data<combatsc_state>(); UINT8 attributes = state->m_page[0][tile_index]; int bank = 4 * ((state->m_vreg & 0x0f) - 1); int number, pal, color; if (bank < 0) bank = 0; if ((attributes & 0xb0) == 0) bank = 0; /* text bank */ if (attributes & 0x80) bank += 1; if (attributes & 0x10) bank += 2; if (attributes & 0x20) bank += 4; pal = (bank == 0 || bank >= 0x1c || (attributes & 0x40)) ? 1 : 3; color = pal*16;// + (attributes & 0x0f); number = state->m_page[0][tile_index + 0x400] + 256 * bank; SET_TILE_INFO( 0, number, color, 0); } static TILE_GET_INFO( get_tile_info1_bootleg ) { combatsc_state *state = machine.driver_data<combatsc_state>(); UINT8 attributes = state->m_page[1][tile_index]; int bank = 4*((state->m_vreg >> 4) - 1); int number, pal, color; if (bank < 0) bank = 0; if ((attributes & 0xb0) == 0) bank = 0; /* text bank */ if (attributes & 0x80) bank += 1; if (attributes & 0x10) bank += 2; if (attributes & 0x20) bank += 4; pal = (bank == 0 || bank >= 0x1c || (attributes & 0x40)) ? 5 : 7; color = pal * 16;// + (attributes & 0x0f); number = state->m_page[1][tile_index + 0x400] + 256 * bank; SET_TILE_INFO( 1, number, color, 0); } static TILE_GET_INFO( get_text_info_bootleg ) { combatsc_state *state = machine.driver_data<combatsc_state>(); // UINT8 attributes = state->m_page[0][tile_index + 0x800]; int number = state->m_page[0][tile_index + 0xc00]; int color = 16;// + (attributes & 0x0f); SET_TILE_INFO( 1, number, color, 0); } /*************************************************************************** Start the video hardware emulation. ***************************************************************************/ VIDEO_START( combatsc ) { combatsc_state *state = machine.driver_data<combatsc_state>(); state->m_bg_tilemap[0] = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 8, 8, 32, 32); state->m_bg_tilemap[1] = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 8, 8, 32, 32); state->m_textlayer = tilemap_create(machine, get_text_info, tilemap_scan_rows, 8, 8, 32, 32); state->m_spriteram[0] = auto_alloc_array_clear(machine, UINT8, 0x800); state->m_spriteram[1] = auto_alloc_array_clear(machine, UINT8, 0x800); tilemap_set_transparent_pen(state->m_bg_tilemap[0], 0); tilemap_set_transparent_pen(state->m_bg_tilemap[1], 0); tilemap_set_transparent_pen(state->m_textlayer, 0); tilemap_set_scroll_rows(state->m_textlayer, 32); state->save_pointer(NAME(state->m_spriteram[0]), 0x800); state->save_pointer(NAME(state->m_spriteram[1]), 0x800); } VIDEO_START( combatscb ) { combatsc_state *state = machine.driver_data<combatsc_state>(); state->m_bg_tilemap[0] = tilemap_create(machine, get_tile_info0_bootleg, tilemap_scan_rows, 8, 8, 32, 32); state->m_bg_tilemap[1] = tilemap_create(machine, get_tile_info1_bootleg, tilemap_scan_rows, 8, 8, 32, 32); state->m_textlayer = tilemap_create(machine, get_text_info_bootleg, tilemap_scan_rows, 8, 8, 32, 32); state->m_spriteram[0] = auto_alloc_array_clear(machine, UINT8, 0x800); state->m_spriteram[1] = auto_alloc_array_clear(machine, UINT8, 0x800); tilemap_set_transparent_pen(state->m_bg_tilemap[0], 0); tilemap_set_transparent_pen(state->m_bg_tilemap[1], 0); tilemap_set_transparent_pen(state->m_textlayer, 0); tilemap_set_scroll_rows(state->m_bg_tilemap[0], 32); tilemap_set_scroll_rows(state->m_bg_tilemap[1], 32); state->save_pointer(NAME(state->m_spriteram[0]), 0x800); state->save_pointer(NAME(state->m_spriteram[1]), 0x800); } /*************************************************************************** Memory handlers ***************************************************************************/ READ8_HANDLER( combatsc_video_r ) { combatsc_state *state = space->machine().driver_data<combatsc_state>(); return state->m_videoram[offset]; } WRITE8_HANDLER( combatsc_video_w ) { combatsc_state *state = space->machine().driver_data<combatsc_state>(); state->m_videoram[offset] = data; if (offset < 0x800) { if (state->m_video_circuit) tilemap_mark_tile_dirty(state->m_bg_tilemap[1], offset & 0x3ff); else tilemap_mark_tile_dirty(state->m_bg_tilemap[0], offset & 0x3ff); } else if (offset < 0x1000 && state->m_video_circuit == 0) { tilemap_mark_tile_dirty(state->m_textlayer, offset & 0x3ff); } } WRITE8_HANDLER( combatsc_pf_control_w ) { combatsc_state *state = space->machine().driver_data<combatsc_state>(); device_t *k007121 = state->m_video_circuit ? state->m_k007121_2 : state->m_k007121_1; k007121_ctrl_w(k007121, offset, data); if (offset == 7) tilemap_set_flip(state->m_bg_tilemap[state->m_video_circuit],(data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (offset == 3) { if (data & 0x08) memcpy(state->m_spriteram[state->m_video_circuit], state->m_page[state->m_video_circuit] + 0x1000, 0x800); else memcpy(state->m_spriteram[state->m_video_circuit], state->m_page[state->m_video_circuit] + 0x1800, 0x800); } } READ8_HANDLER( combatsc_scrollram_r ) { combatsc_state *state = space->machine().driver_data<combatsc_state>(); return state->m_scrollram[offset]; } WRITE8_HANDLER( combatsc_scrollram_w ) { combatsc_state *state = space->machine().driver_data<combatsc_state>(); state->m_scrollram[offset] = data; } /*************************************************************************** Display Refresh ***************************************************************************/ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit, UINT32 pri_mask ) { combatsc_state *state = machine.driver_data<combatsc_state>(); device_t *k007121 = circuit ? state->m_k007121_2 : state->m_k007121_1; int base_color = (circuit * 4) * 16 + (k007121_ctrlram_r(k007121, 6) & 0x10) * 2; k007121_sprites_draw(k007121, bitmap, cliprect, machine.gfx[circuit], machine.colortable, source, base_color, 0, 0, pri_mask); } SCREEN_UPDATE( combatsc ) { combatsc_state *state = screen->machine().driver_data<combatsc_state>(); int i; set_pens(screen->machine()); if (k007121_ctrlram_r(state->m_k007121_1, 1) & 0x02) { tilemap_set_scroll_rows(state->m_bg_tilemap[0], 32); for (i = 0; i < 32; i++) tilemap_set_scrollx(state->m_bg_tilemap[0], i, state->m_scrollram0[i]); } else { tilemap_set_scroll_rows(state->m_bg_tilemap[0], 1); tilemap_set_scrollx(state->m_bg_tilemap[0], 0, k007121_ctrlram_r(state->m_k007121_1, 0) | ((k007121_ctrlram_r(state->m_k007121_1, 1) & 0x01) << 8)); } if (k007121_ctrlram_r(state->m_k007121_2, 1) & 0x02) { tilemap_set_scroll_rows(state->m_bg_tilemap[1], 32); for (i = 0; i < 32; i++) tilemap_set_scrollx(state->m_bg_tilemap[1], i, state->m_scrollram1[i]); } else { tilemap_set_scroll_rows(state->m_bg_tilemap[1], 1); tilemap_set_scrollx(state->m_bg_tilemap[1], 0, k007121_ctrlram_r(state->m_k007121_2, 0) | ((k007121_ctrlram_r(state->m_k007121_2, 1) & 0x01) << 8)); } tilemap_set_scrolly(state->m_bg_tilemap[0], 0, k007121_ctrlram_r(state->m_k007121_1, 2)); tilemap_set_scrolly(state->m_bg_tilemap[1], 0, k007121_ctrlram_r(state->m_k007121_2, 2)); bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); if (state->m_priority == 0) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], TILEMAP_DRAW_OPAQUE | 0, 4); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], TILEMAP_DRAW_OPAQUE | 1, 8); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 0, 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 1, 2); /* we use the priority buffer so sprites are drawn front to back */ draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[1], 1, 0x0f00); draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], TILEMAP_DRAW_OPAQUE | 0, 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], TILEMAP_DRAW_OPAQUE | 1, 2); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 1, 4); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 0, 8); /* we use the priority buffer so sprites are drawn front to back */ draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[1], 1, 0x0f00); draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444); } if (k007121_ctrlram_r(state->m_k007121_1, 1) & 0x08) { for (i = 0; i < 32; i++) { tilemap_set_scrollx(state->m_textlayer, i, state->m_scrollram0[0x20 + i] ? 0 : TILE_LINE_DISABLED); tilemap_draw(bitmap, cliprect, state->m_textlayer, 0, 0); } } /* chop the extreme columns if necessary */ if (k007121_ctrlram_r(state->m_k007121_1, 3) & 0x40) { rectangle clip; clip = *cliprect; clip.max_x = clip.min_x + 7; bitmap_fill(bitmap, &clip, 0); clip = *cliprect; clip.min_x = clip.max_x - 7; bitmap_fill(bitmap, &clip, 0); } return 0; } /*************************************************************************** bootleg Combat School sprites. Each sprite has 5 bytes: byte #0: sprite number byte #1: y position byte #2: x position byte #3: bit 0: x position (bit 0) bits 1..3: ??? bit 4: flip x bit 5: unused? bit 6: sprite bank # (bit 2) bit 7: ??? byte #4: bits 0,1: sprite bank # (bits 0 & 1) bits 2,3: unused? bits 4..7: sprite color ***************************************************************************/ static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit ) { address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); const gfx_element *gfx = machine.gfx[circuit + 2]; int limit = circuit ? (space->read_byte(0xc2) * 256 + space->read_byte(0xc3)) : (space->read_byte(0xc0) * 256 + space->read_byte(0xc1)); const UINT8 *finish; source += 0x1000; finish = source; source += 0x400; limit = (0x3400 - limit) / 8; if (limit >= 0) finish = source - limit * 8; source -= 8; while (source > finish) { UINT8 attributes = source[3]; /* PBxF ?xxX */ { int number = source[0]; int x = source[2] - 71 + (attributes & 0x01)*256; int y = 242 - source[1]; UINT8 color = source[4]; /* CCCC xxBB */ int bank = (color & 0x03) | ((attributes & 0x40) >> 4); number = ((number & 0x02) << 1) | ((number & 0x04) >> 1) | (number & (~6)); number += 256 * bank; color = (circuit * 4) * 16 + (color >> 4); /* hacks to select alternate palettes */ // if(state->m_vreg == 0x40 && (attributes & 0x40)) color += 1*16; // if(state->m_vreg == 0x23 && (attributes & 0x02)) color += 1*16; // if(state->m_vreg == 0x66 ) color += 2*16; drawgfx_transpen( bitmap, cliprect, gfx, number, color, attributes & 0x10,0, /* flip */ x, y, 15 ); } source -= 8; } } SCREEN_UPDATE( combatscb ) { combatsc_state *state = screen->machine().driver_data<combatsc_state>(); int i; set_pens(screen->machine()); for (i = 0; i < 32; i++) { tilemap_set_scrollx(state->m_bg_tilemap[0], i, state->m_io_ram[0x040 + i] + 5); tilemap_set_scrollx(state->m_bg_tilemap[1], i, state->m_io_ram[0x060 + i] + 3); } tilemap_set_scrolly(state->m_bg_tilemap[0], 0, state->m_io_ram[0x000] + 1); tilemap_set_scrolly(state->m_bg_tilemap[1], 0, state->m_io_ram[0x020] + 1); if (state->m_priority == 0) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], TILEMAP_DRAW_OPAQUE, 0); bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[0], 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 0 ,0); bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[1], 1); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], TILEMAP_DRAW_OPAQUE, 0); bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[0], 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 0, 0); bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[1], 1); } tilemap_draw(bitmap, cliprect, state->m_textlayer, 0, 0); return 0; }
702948.c
/* * Core Definitions for QAPI/QMP Dispatch * * Copyright IBM, Corp. 2011 * * Authors: * Anthony Liguori <[email protected]> * * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING.LIB file in the top-level directory. * */ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qmp/types.h" #include "qapi/qmp/dispatch.h" #include "qapi/qmp/json-parser.h" #include "qapi/qmp/qjson.h" #include "qapi-types.h" #include "qapi/qmp/qerror.h" static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp) { const QDictEntry *ent; const char *arg_name; const QObject *arg_obj; bool has_exec_key = false; QDict *dict = NULL; if (qobject_type(request) != QTYPE_QDICT) { error_setg(errp, QERR_QMP_BAD_INPUT_OBJECT, "request is not a dictionary"); return NULL; } dict = qobject_to_qdict(request); for (ent = qdict_first(dict); ent; ent = qdict_next(dict, ent)) { arg_name = qdict_entry_key(ent); arg_obj = qdict_entry_value(ent); if (!strcmp(arg_name, "execute")) { if (qobject_type(arg_obj) != QTYPE_QSTRING) { error_setg(errp, QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "execute", "string"); return NULL; } has_exec_key = true; } else if (strcmp(arg_name, "arguments")) { error_setg(errp, QERR_QMP_EXTRA_MEMBER, arg_name); return NULL; } } if (!has_exec_key) { error_setg(errp, QERR_QMP_BAD_INPUT_OBJECT, "execute"); return NULL; } return dict; } static QObject *do_qmp_dispatch(QObject *request, Error **errp) { Error *local_err = NULL; const char *command; QDict *args, *dict; QmpCommand *cmd; QObject *ret = NULL; dict = qmp_dispatch_check_obj(request, errp); if (!dict) { return NULL; } command = qdict_get_str(dict, "execute"); cmd = qmp_find_command(command); if (cmd == NULL) { error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND, "The command %s has not been found", command); return NULL; } if (!cmd->enabled) { error_setg(errp, "The command %s has been disabled for this instance", command); return NULL; } if (!qdict_haskey(dict, "arguments")) { args = qdict_new(); } else { args = qdict_get_qdict(dict, "arguments"); QINCREF(args); } cmd->fn(args, &ret, &local_err); if (local_err) { error_propagate(errp, local_err); } else if (cmd->options & QCO_NO_SUCCESS_RESP) { g_assert(!ret); } else if (!ret) { ret = QOBJECT(qdict_new()); } QDECREF(args); return ret; } QObject *qmp_build_error_object(Error *err) { return qobject_from_jsonf("{ 'class': %s, 'desc': %s }", QapiErrorClass_lookup[error_get_class(err)], error_get_pretty(err)); } QObject *qmp_dispatch(QObject *request) { Error *err = NULL; QObject *ret; QDict *rsp; ret = do_qmp_dispatch(request, &err); rsp = qdict_new(); if (err) { qdict_put_obj(rsp, "error", qmp_build_error_object(err)); error_free(err); } else if (ret) { qdict_put_obj(rsp, "return", ret); } else { QDECREF(rsp); return NULL; } return QOBJECT(rsp); }
878720.c
/***********************************************************************/ #include <stdio.h> #include <sys/types.h> #define KERNEL KERNEL #include <sundev/ipfbreg.h> #include "convolve.h" extern struct ipfb_reg *reg; fb_maxmin(fb,row,col,irow,icol,pmax,pmin) short int *pmax, *pmin; int row,col,irow,icol,fb; { int i, j; short int x,y,pixel; unsigned int mx,mn, upixel; x = X (fb) ; y = Y (fb) ; X (fb)= icol; Y (fb)= irow; *pmin = *pmax = (short) DATA (fb); mx= mn = 0x0000ffff & *pmin ; for (i = 0; i < row; i++) { X (fb) = icol; /* X is incremented automatically after each read */ Y (fb) = irow+i; for (j = 0; j < col; j++) { pixel = (short) DATA (fb); upixel = 0x0000ffff & pixel; *pmin = *pmin <= pixel ? *pmin : pixel; *pmax = *pmax >= pixel ? *pmax : pixel; mn = mn<=upixel ? mn : upixel; mx = mx>=upixel ? mx : upixel; } } X (fb) = x ; Y (fb) = y ; fprintf (stderr, "MIN-PIX (SIGNED DEC) =%d\n", *pmin); fprintf (stderr, "MAX-PIX (SIGNED HEX) =%x\n", *pmax); fprintf (stderr, "UNSIGNED HEX: MAX-PIX =%x, MIN-PIX=%x\n", mx, mn); }
956013.c
// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron']" --set exp.privatization none --set exp.apron.privatization dummy // Example from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/recursive-simple/afterrec_2calls-1.c void f(int); void f2(int); void f(int n) { if (n<3) return; n--; f2(n); assert(1); } void f2(int n) { if (n<3) return; n--; f(n); assert(1); } int main(void) { f(4); }
971755.c
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "tool_setup.h" #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_LOCALE_H # include <locale.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #elif defined(HAVE_UNISTD_H) # include <unistd.h> #endif #ifdef __VMS # include <fabdef.h> #endif #ifdef __AMIGA__ # include <proto/dos.h> #endif #include "strcase.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_binmode.h" #include "tool_cfgable.h" #include "tool_cb_dbg.h" #include "tool_cb_hdr.h" #include "tool_cb_prg.h" #include "tool_cb_rea.h" #include "tool_cb_see.h" #include "tool_cb_wrt.h" #include "tool_dirhie.h" #include "tool_doswin.h" #include "tool_easysrc.h" #include "tool_filetime.h" #include "tool_getparam.h" #include "tool_helpers.h" #include "tool_homedir.h" #include "tool_libinfo.h" #include "tool_main.h" #include "tool_metalink.h" #include "tool_msgs.h" #include "tool_operate.h" #include "tool_operhlp.h" #include "tool_paramhlp.h" #include "tool_parsecfg.h" #include "tool_setopt.h" #include "tool_sleep.h" #include "tool_urlglob.h" #include "tool_util.h" #include "tool_writeout.h" #include "tool_xattr.h" #include "tool_vms.h" #include "tool_help.h" #include "tool_hugehelp.h" #include "tool_progress.h" #include "memdebug.h" /* keep this as LAST include */ #ifdef CURLDEBUG /* libcurl's debug builds provide an extra function */ CURLcode curl_easy_perform_ev(CURL *easy); #endif #define CURLseparator "--_curl_--" #ifndef O_BINARY /* since O_BINARY as used in bitmasks, setting it to zero makes it usable in source code but yet it doesn't ruin anything */ # define O_BINARY 0 #endif #define CURL_CA_CERT_ERRORMSG \ "More details here: https://curl.se/docs/sslcerts.html\n\n" \ "curl failed to verify the legitimacy of the server and therefore " \ "could not\nestablish a secure connection to it. To learn more about " \ "this situation and\nhow to fix it, please visit the web page mentioned " \ "above.\n" static CURLcode single_transfer(struct GlobalConfig *global, struct OperationConfig *config, CURLSH *share, bool capath_from_env, bool *added); static CURLcode create_transfer(struct GlobalConfig *global, CURLSH *share, bool *added); static bool is_fatal_error(CURLcode code) { switch(code) { case CURLE_FAILED_INIT: case CURLE_OUT_OF_MEMORY: case CURLE_UNKNOWN_OPTION: case CURLE_FUNCTION_NOT_FOUND: case CURLE_BAD_FUNCTION_ARGUMENT: /* critical error */ return TRUE; default: break; } /* no error or not critical */ return FALSE; } /* * Check if a given string is a PKCS#11 URI */ static bool is_pkcs11_uri(const char *string) { if(curl_strnequal(string, "pkcs11:", 7)) { return TRUE; } else { return FALSE; } } #ifdef __VMS /* * get_vms_file_size does what it takes to get the real size of the file * * For fixed files, find out the size of the EOF block and adjust. * * For all others, have to read the entire file in, discarding the contents. * Most posted text files will be small, and binary files like zlib archives * and CD/DVD images should be either a STREAM_LF format or a fixed format. * */ static curl_off_t vms_realfilesize(const char *name, const struct_stat *stat_buf) { char buffer[8192]; curl_off_t count; int ret_stat; FILE * file; /* !checksrc! disable FOPENMODE 1 */ file = fopen(name, "r"); /* VMS */ if(file == NULL) { return 0; } count = 0; ret_stat = 1; while(ret_stat > 0) { ret_stat = fread(buffer, 1, sizeof(buffer), file); if(ret_stat != 0) count += ret_stat; } fclose(file); return count; } /* * * VmsSpecialSize checks to see if the stat st_size can be trusted and * if not to call a routine to get the correct size. * */ static curl_off_t VmsSpecialSize(const char *name, const struct_stat *stat_buf) { switch(stat_buf->st_fab_rfm) { case FAB$C_VAR: case FAB$C_VFC: return vms_realfilesize(name, stat_buf); break; default: return stat_buf->st_size; } } #endif /* __VMS */ #define BUFFER_SIZE (100*1024) struct per_transfer *transfers; /* first node */ static struct per_transfer *transfersl; /* last node */ /* add_per_transfer creates a new 'per_transfer' node in the linked list of transfers */ static CURLcode add_per_transfer(struct per_transfer **per) { struct per_transfer *p; p = calloc(sizeof(struct per_transfer), 1); if(!p) return CURLE_OUT_OF_MEMORY; if(!transfers) /* first entry */ transfersl = transfers = p; else { /* make the last node point to the new node */ transfersl->next = p; /* make the new node point back to the formerly last node */ p->prev = transfersl; /* move the last node pointer to the new entry */ transfersl = p; } *per = p; all_xfers++; /* count total number of transfers added */ return CURLE_OK; } /* Remove the specified transfer from the list (and free it), return the next in line */ static struct per_transfer *del_per_transfer(struct per_transfer *per) { struct per_transfer *n; struct per_transfer *p; DEBUGASSERT(transfers); DEBUGASSERT(transfersl); DEBUGASSERT(per); n = per->next; p = per->prev; if(p) p->next = n; else transfers = n; if(n) n->prev = p; else transfersl = p; free(per); return n; } static CURLcode pre_transfer(struct GlobalConfig *global, struct per_transfer *per) { curl_off_t uploadfilesize = -1; struct_stat fileinfo; CURLcode result = CURLE_OK; if(per->separator_err) fprintf(global->errors, "%s\n", per->separator_err); if(per->separator) printf("%s\n", per->separator); if(per->uploadfile && !stdin_upload(per->uploadfile)) { /* VMS Note: * * Reading binary from files can be a problem... Only FIXED, VAR * etc WITHOUT implied CC will work Others need a \n appended to a * line * * - Stat gives a size but this is UNRELIABLE in VMS As a f.e. a * fixed file with implied CC needs to have a byte added for every * record processed, this can by derived from Filesize & recordsize * for VARiable record files the records need to be counted! for * every record add 1 for linefeed and subtract 2 for the record * header for VARIABLE header files only the bare record data needs * to be considered with one appended if implied CC */ #ifdef __VMS /* Calculate the real upload size for VMS */ per->infd = -1; if(stat(per->uploadfile, &fileinfo) == 0) { fileinfo.st_size = VmsSpecialSize(uploadfile, &fileinfo); switch(fileinfo.st_fab_rfm) { case FAB$C_VAR: case FAB$C_VFC: case FAB$C_STMCR: per->infd = open(per->uploadfile, O_RDONLY | O_BINARY); break; default: per->infd = open(per->uploadfile, O_RDONLY | O_BINARY, "rfm=stmlf", "ctx=stm"); } } if(per->infd == -1) #else per->infd = open(per->uploadfile, O_RDONLY | O_BINARY); if((per->infd == -1) || fstat(per->infd, &fileinfo)) #endif { helpf(global->errors, "Can't open '%s'!\n", per->uploadfile); if(per->infd != -1) { close(per->infd); per->infd = STDIN_FILENO; } return CURLE_READ_ERROR; } per->infdopen = TRUE; /* we ignore file size for char/block devices, sockets, etc. */ if(S_ISREG(fileinfo.st_mode)) uploadfilesize = fileinfo.st_size; if(uploadfilesize != -1) { struct OperationConfig *config = per->config; /* for the macro below */ #ifdef CURL_DISABLE_LIBCURL_OPTION (void)config; #endif my_setopt(per->curl, CURLOPT_INFILESIZE_LARGE, uploadfilesize); } per->input.fd = per->infd; } return result; } /* * Call this after a transfer has completed. */ static CURLcode post_per_transfer(struct GlobalConfig *global, struct per_transfer *per, CURLcode result, bool *retryp, long *delay) /* milliseconds! */ { struct OutStruct *outs = &per->outs; CURL *curl = per->curl; struct OperationConfig *config = per->config; if(!curl || !config) return result; *retryp = FALSE; *delay = 0; /* for no retry, keep it zero */ if(per->infdopen) close(per->infd); #ifdef __VMS if(is_vms_shell()) { /* VMS DCL shell behavior */ if(!global->showerror) vms_show = VMSSTS_HIDE; } else #endif if(!config->synthetic_error && result && global->showerror) { fprintf(global->errors, "curl: (%d) %s\n", result, (per->errorbuffer[0]) ? per->errorbuffer : curl_easy_strerror(result)); if(result == CURLE_PEER_FAILED_VERIFICATION) fputs(CURL_CA_CERT_ERRORMSG, global->errors); } /* Set file extended attributes */ if(!result && config->xattr && outs->fopened && outs->stream) { int rc = fwrite_xattr(curl, fileno(outs->stream)); if(rc) warnf(config->global, "Error setting extended attributes: %s\n", strerror(errno)); } if(!result && !outs->stream && !outs->bytes) { /* we have received no data despite the transfer was successful ==> force creation of an empty output file (if an output file was specified) */ long cond_unmet = 0L; /* do not create (or even overwrite) the file in case we get no data because of unmet condition */ curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet); if(!cond_unmet && !tool_create_output_file(outs, config)) result = CURLE_WRITE_ERROR; } if(!outs->s_isreg && outs->stream) { /* Dump standard stream buffered data */ int rc = fflush(outs->stream); if(!result && rc) { /* something went wrong in the writing process */ result = CURLE_WRITE_ERROR; if(global->showerror) fprintf(global->errors, "curl: (%d) Failed writing body\n", result); } } #ifdef USE_METALINK if(per->metalink && !per->metalink_next_res) fprintf(global->errors, "Metalink: fetching (%s) from (%s) OK\n", per->mlfile->filename, per->this_url); if(!per->metalink && config->use_metalink && result == CURLE_OK) { int rv = parse_metalink(config, outs, per->this_url); if(!rv) { fprintf(config->global->errors, "Metalink: parsing (%s) OK\n", per->this_url); } else if(rv == -1) fprintf(config->global->errors, "Metalink: parsing (%s) FAILED\n", per->this_url); } else if(per->metalink && result == CURLE_OK && !per->metalink_next_res) { int rv; (void)fflush(outs->stream); rv = metalink_check_hash(global, per->mlfile, outs->filename); if(!rv) per->metalink_next_res = 1; } #endif /* USE_METALINK */ #ifdef USE_METALINK if(outs->metalink_parser) metalink_parser_context_delete(outs->metalink_parser); #endif /* USE_METALINK */ /* if retry-max-time is non-zero, make sure we haven't exceeded the time */ if(per->retry_numretries && (!config->retry_maxtime || (tvdiff(tvnow(), per->retrystart) < config->retry_maxtime*1000L)) ) { enum { RETRY_NO, RETRY_ALL_ERRORS, RETRY_TIMEOUT, RETRY_CONNREFUSED, RETRY_HTTP, RETRY_FTP, RETRY_LAST /* not used */ } retry = RETRY_NO; long response = 0; if((CURLE_OPERATION_TIMEDOUT == result) || (CURLE_COULDNT_RESOLVE_HOST == result) || (CURLE_COULDNT_RESOLVE_PROXY == result) || (CURLE_FTP_ACCEPT_TIMEOUT == result)) /* retry timeout always */ retry = RETRY_TIMEOUT; else if(config->retry_connrefused && (CURLE_COULDNT_CONNECT == result)) { long oserrno = 0; curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &oserrno); if(ECONNREFUSED == oserrno) retry = RETRY_CONNREFUSED; } else if((CURLE_OK == result) || (config->failonerror && (CURLE_HTTP_RETURNED_ERROR == result))) { /* If it returned OK. _or_ failonerror was enabled and it returned due to such an error, check for HTTP transient errors to retry on. */ long protocol = 0; curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); if((protocol == CURLPROTO_HTTP) || (protocol == CURLPROTO_HTTPS)) { /* This was HTTP(S) */ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response); switch(response) { case 408: /* Request Timeout */ case 429: /* Too Many Requests (RFC6585) */ case 500: /* Internal Server Error */ case 502: /* Bad Gateway */ case 503: /* Service Unavailable */ case 504: /* Gateway Timeout */ retry = RETRY_HTTP; /* * At this point, we have already written data to the output * file (or terminal). If we write to a file, we must rewind * or close/re-open the file so that the next attempt starts * over from the beginning. * * TODO: similar action for the upload case. We might need * to start over reading from a previous point if we have * uploaded something when this was returned. */ break; } } } /* if CURLE_OK */ else if(result) { long protocol = 0; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response); curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); if((protocol == CURLPROTO_FTP || protocol == CURLPROTO_FTPS) && response / 100 == 4) /* * This is typically when the FTP server only allows a certain * amount of users and we are not one of them. All 4xx codes * are transient. */ retry = RETRY_FTP; } if(result && !retry && config->retry_all_errors) retry = RETRY_ALL_ERRORS; if(retry) { long sleeptime = 0; curl_off_t retry_after = 0; static const char * const m[]={ NULL, "(retrying all errors)", ": timeout", ": connection refused", ": HTTP error", ": FTP error" }; sleeptime = per->retry_sleep; if(RETRY_HTTP == retry) { curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after); if(retry_after) { /* store in a 'long', make sure it doesn't overflow */ if(retry_after > LONG_MAX/1000) sleeptime = LONG_MAX; else sleeptime = (long)retry_after * 1000; /* milliseconds */ } } warnf(config->global, "Problem %s. " "Will retry in %ld seconds. " "%ld retries left.\n", m[retry], sleeptime/1000L, per->retry_numretries); per->retry_numretries--; if(!config->retry_delay) { per->retry_sleep *= 2; if(per->retry_sleep > RETRY_SLEEP_MAX) per->retry_sleep = RETRY_SLEEP_MAX; } if(outs->bytes && outs->filename && outs->stream) { int rc; /* We have written data to a output file, we truncate file */ if(!global->mute) fprintf(global->errors, "Throwing away %" CURL_FORMAT_CURL_OFF_T " bytes\n", outs->bytes); fflush(outs->stream); /* truncate file at the position where we started appending */ #ifdef HAVE_FTRUNCATE if(ftruncate(fileno(outs->stream), outs->init)) { /* when truncate fails, we can't just append as then we'll create something strange, bail out */ if(global->showerror) fprintf(global->errors, "curl: (23) Failed to truncate file\n"); return CURLE_WRITE_ERROR; } /* now seek to the end of the file, the position where we just truncated the file in a large file-safe way */ rc = fseek(outs->stream, 0, SEEK_END); #else /* ftruncate is not available, so just reposition the file to the location we would have truncated it. This won't work properly with large files on 32-bit systems, but most of those will have ftruncate. */ rc = fseek(outs->stream, (long)outs->init, SEEK_SET); #endif if(rc) { if(global->showerror) fprintf(global->errors, "curl: (23) Failed seeking to end of file\n"); return CURLE_WRITE_ERROR; } outs->bytes = 0; /* clear for next round */ } *retryp = TRUE; *delay = sleeptime; return CURLE_OK; } } /* if retry_numretries */ else if(per->metalink) { /* Metalink: Decide to try the next resource or not. Try the next resource if download was not successful. */ long response = 0; if(CURLE_OK == result) { /* TODO We want to try next resource when download was not successful. How to know that? */ char *effective_url = NULL; curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &effective_url); if(effective_url && curl_strnequal(effective_url, "http", 4)) { /* This was HTTP(S) */ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response); if(response != 200 && response != 206) { per->metalink_next_res = 1; fprintf(global->errors, "Metalink: fetching (%s) from (%s) FAILED " "(HTTP status code %ld)\n", per->mlfile->filename, per->this_url, response); } } } else { per->metalink_next_res = 1; fprintf(global->errors, "Metalink: fetching (%s) from (%s) FAILED (%s)\n", per->mlfile->filename, per->this_url, curl_easy_strerror(result)); } } if((global->progressmode == CURL_PROGRESS_BAR) && per->progressbar.calls) /* if the custom progress bar has been displayed, we output a newline here */ fputs("\n", per->progressbar.out); if(config->writeout) ourWriteOut(per->curl, per, config->writeout, result); /* Close the outs file */ if(outs->fopened && outs->stream) { int rc = fclose(outs->stream); if(!result && rc) { /* something went wrong in the writing process */ result = CURLE_WRITE_ERROR; if(global->showerror) fprintf(global->errors, "curl: (%d) Failed writing body\n", result); } } /* File time can only be set _after_ the file has been closed */ if(!result && config->remote_time && outs->s_isreg && outs->filename) { /* Ask libcurl if we got a remote file time */ curl_off_t filetime = -1; curl_easy_getinfo(curl, CURLINFO_FILETIME_T, &filetime); setfiletime(filetime, outs->filename, config->global->errors); } /* Close function-local opened file descriptors */ if(per->heads.fopened && per->heads.stream) fclose(per->heads.stream); if(per->heads.alloc_filename) Curl_safefree(per->heads.filename); if(per->etag_save.fopened && per->etag_save.stream) fclose(per->etag_save.stream); if(per->etag_save.alloc_filename) Curl_safefree(per->etag_save.filename); curl_easy_cleanup(per->curl); if(outs->alloc_filename) free(outs->filename); free(per->this_url); free(per->separator_err); free(per->separator); free(per->outfile); free(per->uploadfile); return CURLE_OK; } static void single_transfer_cleanup(struct OperationConfig *config) { if(config) { struct State *state = &config->state; if(state->urls) { /* Free list of remaining URLs */ glob_cleanup(state->urls); state->urls = NULL; } Curl_safefree(state->outfiles); Curl_safefree(state->httpgetfields); Curl_safefree(state->uploadfile); if(state->inglob) { /* Free list of globbed upload files */ glob_cleanup(state->inglob); state->inglob = NULL; } } } /* create the next (singular) transfer */ static CURLcode single_transfer(struct GlobalConfig *global, struct OperationConfig *config, CURLSH *share, bool capath_from_env, bool *added) { CURLcode result = CURLE_OK; struct getout *urlnode; struct metalinkfile *mlfile_last = NULL; bool orig_noprogress = global->noprogress; bool orig_isatty = global->isatty; struct State *state = &config->state; char *httpgetfields = state->httpgetfields; *added = FALSE; /* not yet */ if(config->postfields) { if(config->use_httpget) { if(!httpgetfields) { /* Use the postfields data for a http get */ httpgetfields = state->httpgetfields = strdup(config->postfields); Curl_safefree(config->postfields); if(!httpgetfields) { errorf(global, "out of memory\n"); result = CURLE_OUT_OF_MEMORY; } else if(SetHTTPrequest(config, (config->no_body?HTTPREQ_HEAD:HTTPREQ_GET), &config->httpreq)) { result = CURLE_FAILED_INIT; } } } else { if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq)) result = CURLE_FAILED_INIT; } if(result) { single_transfer_cleanup(config); return result; } } if(!state->urlnode) { /* first time caller, setup things */ state->urlnode = config->url_list; state->infilenum = 1; } while(config->state.urlnode) { char *infiles; /* might be a glob pattern */ struct URLGlob *inglob = state->inglob; bool metalink = FALSE; /* metalink download? */ struct metalinkfile *mlfile; struct metalink_resource *mlres; urlnode = config->state.urlnode; if(urlnode->flags & GETOUT_METALINK) { metalink = 1; if(mlfile_last == NULL) { mlfile_last = config->metalinkfile_list; } mlfile = mlfile_last; mlfile_last = mlfile_last->next; mlres = mlfile->resource; } else { mlfile = NULL; mlres = NULL; } /* urlnode->url is the full URL (it might be NULL) */ if(!urlnode->url) { /* This node has no URL. Free node data without destroying the node itself nor modifying next pointer and continue to next */ Curl_safefree(urlnode->outfile); Curl_safefree(urlnode->infile); urlnode->flags = 0; config->state.urlnode = urlnode->next; state->up = 0; continue; /* next URL please */ } /* save outfile pattern before expansion */ if(urlnode->outfile && !state->outfiles) { state->outfiles = strdup(urlnode->outfile); if(!state->outfiles) { errorf(global, "out of memory\n"); result = CURLE_OUT_OF_MEMORY; break; } } infiles = urlnode->infile; if(!config->globoff && infiles && !inglob) { /* Unless explicitly shut off */ result = glob_url(&inglob, infiles, &state->infilenum, global->showerror?global->errors:NULL); if(result) break; config->state.inglob = inglob; } { int separator; unsigned long urlnum; if(!state->up && !infiles) Curl_nop_stmt; else { if(!state->uploadfile) { if(inglob) { result = glob_next_url(&state->uploadfile, inglob); if(result == CURLE_OUT_OF_MEMORY) errorf(global, "out of memory\n"); } else if(!state->up) { state->uploadfile = strdup(infiles); if(!state->uploadfile) { errorf(global, "out of memory\n"); result = CURLE_OUT_OF_MEMORY; } } } if(result) break; } if(!state->urlnum) { if(metalink) { /* For Metalink download, we don't use glob. Instead we use the number of resources as urlnum. */ urlnum = count_next_metalink_resource(mlfile); } else if(!config->globoff) { /* Unless explicitly shut off, we expand '{...}' and '[...]' expressions and return total number of URLs in pattern set */ result = glob_url(&state->urls, urlnode->url, &state->urlnum, global->showerror?global->errors:NULL); if(result) break; urlnum = state->urlnum; } else urlnum = 1; /* without globbing, this is a single URL */ } else urlnum = state->urlnum; /* if multiple files extracted to stdout, insert separators! */ separator = ((!state->outfiles || !strcmp(state->outfiles, "-")) && urlnum > 1); if(state->up < state->infilenum) { struct per_transfer *per; struct OutStruct *outs; struct InStruct *input; struct OutStruct *heads; struct OutStruct *etag_save; struct HdrCbData *hdrcbdata = NULL; CURL *curl = curl_easy_init(); result = add_per_transfer(&per); if(result || !curl) { curl_easy_cleanup(curl); result = CURLE_OUT_OF_MEMORY; break; } if(state->uploadfile) { per->uploadfile = strdup(state->uploadfile); if(!per->uploadfile) { curl_easy_cleanup(curl); result = CURLE_OUT_OF_MEMORY; break; } } *added = TRUE; per->config = config; per->curl = curl; per->urlnum = urlnode->num; /* default headers output stream is stdout */ heads = &per->heads; heads->stream = stdout; /* Single header file for all URLs */ if(config->headerfile) { /* open file for output: */ if(strcmp(config->headerfile, "-")) { FILE *newfile; newfile = fopen(config->headerfile, per->prev == NULL?"wb":"ab"); if(!newfile) { warnf(config->global, "Failed to open %s\n", config->headerfile); result = CURLE_WRITE_ERROR; break; } else { heads->filename = config->headerfile; heads->s_isreg = TRUE; heads->fopened = TRUE; heads->stream = newfile; } } else { /* always use binary mode for protocol header output */ set_binmode(heads->stream); } } hdrcbdata = &per->hdrcbdata; outs = &per->outs; input = &per->input; per->outfile = NULL; per->infdopen = FALSE; per->infd = STDIN_FILENO; /* default output stream is stdout */ outs->stream = stdout; /* --etag-compare */ if(config->etag_compare_file) { char *etag_from_file = NULL; char *header = NULL; /* open file for reading: */ FILE *file = fopen(config->etag_compare_file, FOPEN_READTEXT); if(!file && !config->etag_save_file) { errorf(config->global, "Failed to open %s\n", config->etag_compare_file); result = CURLE_READ_ERROR; break; } if((PARAM_OK == file2string(&etag_from_file, file)) && etag_from_file) { header = aprintf("If-None-Match: %s", etag_from_file); Curl_safefree(etag_from_file); } else header = aprintf("If-None-Match: \"\""); if(!header) { if(file) fclose(file); errorf(config->global, "Failed to allocate memory for custom etag header\n"); result = CURLE_OUT_OF_MEMORY; break; } /* add Etag from file to list of custom headers */ add2list(&config->headers, header); Curl_safefree(header); if(file) { fclose(file); } } /* --etag-save */ etag_save = &per->etag_save; etag_save->stream = stdout; if(config->etag_save_file) { /* open file for output: */ if(strcmp(config->etag_save_file, "-")) { FILE *newfile = fopen(config->etag_save_file, "wb"); if(!newfile) { warnf( config->global, "Failed to open %s\n", config->etag_save_file); result = CURLE_WRITE_ERROR; break; } else { etag_save->filename = config->etag_save_file; etag_save->s_isreg = TRUE; etag_save->fopened = TRUE; etag_save->stream = newfile; } } else { /* always use binary mode for protocol header output */ set_binmode(etag_save->stream); } } if(metalink) { /* For Metalink download, use name in Metalink file as filename. */ per->outfile = strdup(mlfile->filename); if(!per->outfile) { result = CURLE_OUT_OF_MEMORY; break; } per->this_url = strdup(mlres->url); if(!per->this_url) { result = CURLE_OUT_OF_MEMORY; break; } per->mlfile = mlfile; } else { if(state->urls) { result = glob_next_url(&per->this_url, state->urls); if(result) break; } else if(!state->li) { per->this_url = strdup(urlnode->url); if(!per->this_url) { result = CURLE_OUT_OF_MEMORY; break; } } else per->this_url = NULL; if(!per->this_url) break; if(state->outfiles) { per->outfile = strdup(state->outfiles); if(!per->outfile) { result = CURLE_OUT_OF_MEMORY; break; } } } if(((urlnode->flags&GETOUT_USEREMOTE) || (per->outfile && strcmp("-", per->outfile))) && (metalink || !config->use_metalink)) { /* * We have specified a file name to store the result in, or we have * decided we want to use the remote file name. */ if(!per->outfile) { /* extract the file name from the URL */ result = get_url_file_name(&per->outfile, per->this_url); if(result) break; if(!*per->outfile && !config->content_disposition) { errorf(global, "Remote file name has no length!\n"); result = CURLE_WRITE_ERROR; break; } } else if(state->urls) { /* fill '#1' ... '#9' terms from URL pattern */ char *storefile = per->outfile; result = glob_match_url(&per->outfile, storefile, state->urls); Curl_safefree(storefile); if(result) { /* bad globbing */ warnf(config->global, "bad output glob!\n"); break; } } if(config->output_dir) { char *d = aprintf("%s/%s", config->output_dir, per->outfile); if(!d) { result = CURLE_WRITE_ERROR; break; } free(per->outfile); per->outfile = d; } /* Create the directory hierarchy, if not pre-existent to a multiple file output call */ if(config->create_dirs || metalink) { result = create_dir_hierarchy(per->outfile, global->errors); /* create_dir_hierarchy shows error upon CURLE_WRITE_ERROR */ if(result) break; } if((urlnode->flags & GETOUT_USEREMOTE) && config->content_disposition) { /* Our header callback MIGHT set the filename */ DEBUGASSERT(!outs->filename); } if(config->resume_from_current) { /* We're told to continue from where we are now. Get the size of the file as it is now and open it for append instead */ struct_stat fileinfo; /* VMS -- Danger, the filesize is only valid for stream files */ if(0 == stat(per->outfile, &fileinfo)) /* set offset to current file size: */ config->resume_from = fileinfo.st_size; else /* let offset be 0 */ config->resume_from = 0; } if(config->resume_from) { #ifdef __VMS /* open file for output, forcing VMS output format into stream mode which is needed for stat() call above to always work. */ FILE *file = fopen(outfile, "ab", "ctx=stm", "rfm=stmlf", "rat=cr", "mrs=0"); #else /* open file for output: */ FILE *file = fopen(per->outfile, "ab"); #endif if(!file) { errorf(global, "Can't open '%s'!\n", per->outfile); result = CURLE_WRITE_ERROR; break; } outs->fopened = TRUE; outs->stream = file; outs->init = config->resume_from; } else { outs->stream = NULL; /* open when needed */ } outs->filename = per->outfile; outs->s_isreg = TRUE; } if(per->uploadfile && !stdin_upload(per->uploadfile)) { /* * We have specified a file to upload and it isn't "-". */ char *nurl = add_file_name_to_url(per->this_url, per->uploadfile); if(!nurl) { result = CURLE_OUT_OF_MEMORY; break; } per->this_url = nurl; } else if(per->uploadfile && stdin_upload(per->uploadfile)) { /* count to see if there are more than one auth bit set in the authtype field */ int authbits = 0; int bitcheck = 0; while(bitcheck < 32) { if(config->authtype & (1UL << bitcheck++)) { authbits++; if(authbits > 1) { /* more than one, we're done! */ break; } } } /* * If the user has also selected --anyauth or --proxy-anyauth * we should warn him/her. */ if(config->proxyanyauth || (authbits>1)) { warnf(config->global, "Using --anyauth or --proxy-anyauth with upload from stdin" " involves a big risk of it not working. Use a temporary" " file or a fixed auth type instead!\n"); } DEBUGASSERT(per->infdopen == FALSE); DEBUGASSERT(per->infd == STDIN_FILENO); set_binmode(stdin); if(!strcmp(per->uploadfile, ".")) { if(curlx_nonblock((curl_socket_t)per->infd, TRUE) < 0) warnf(config->global, "fcntl failed on fd=%d: %s\n", per->infd, strerror(errno)); } } if(per->uploadfile && config->resume_from_current) config->resume_from = -1; /* -1 will then force get-it-yourself */ if(output_expected(per->this_url, per->uploadfile) && outs->stream && isatty(fileno(outs->stream))) /* we send the output to a tty, therefore we switch off the progress meter */ per->noprogress = global->noprogress = global->isatty = TRUE; else { /* progress meter is per download, so restore config values */ per->noprogress = global->noprogress = orig_noprogress; global->isatty = orig_isatty; } if(urlnum > 1 && !global->mute) { per->separator_err = aprintf("\n[%lu/%lu]: %s --> %s", state->li + 1, urlnum, per->this_url, per->outfile ? per->outfile : "<stdout>"); if(separator) per->separator = aprintf("%s%s", CURLseparator, per->this_url); } if(httpgetfields) { char *urlbuffer; /* Find out whether the url contains a file name */ const char *pc = strstr(per->this_url, "://"); char sep = '?'; if(pc) pc += 3; else pc = per->this_url; pc = strrchr(pc, '/'); /* check for a slash */ if(pc) { /* there is a slash present in the URL */ if(strchr(pc, '?')) /* Ouch, there's already a question mark in the URL string, we then append the data with an ampersand separator instead! */ sep = '&'; } /* * Then append ? followed by the get fields to the url. */ if(pc) urlbuffer = aprintf("%s%c%s", per->this_url, sep, httpgetfields); else /* Append / before the ? to create a well-formed url if the url contains a hostname only */ urlbuffer = aprintf("%s/?%s", per->this_url, httpgetfields); if(!urlbuffer) { result = CURLE_OUT_OF_MEMORY; break; } Curl_safefree(per->this_url); /* free previous URL */ per->this_url = urlbuffer; /* use our new URL instead! */ } if(!global->errors) global->errors = stderr; if((!per->outfile || !strcmp(per->outfile, "-")) && !config->use_ascii) { /* We get the output to stdout and we have not got the ASCII/text flag, then set stdout to be binary */ set_binmode(stdout); } /* explicitly passed to stdout means okaying binary gunk */ config->terminal_binary_ok = (per->outfile && !strcmp(per->outfile, "-")); /* Avoid having this setopt added to the --libcurl source output. */ result = curl_easy_setopt(curl, CURLOPT_SHARE, share); if(result) break; if(!config->tcp_nodelay) my_setopt(curl, CURLOPT_TCP_NODELAY, 0L); if(config->tcp_fastopen) my_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L); /* where to store */ my_setopt(curl, CURLOPT_WRITEDATA, per); my_setopt(curl, CURLOPT_INTERLEAVEDATA, per); if(metalink || !config->use_metalink) /* what call to write */ my_setopt(curl, CURLOPT_WRITEFUNCTION, tool_write_cb); #ifdef USE_METALINK else /* Set Metalink specific write callback function to parse XML data progressively. */ my_setopt(curl, CURLOPT_WRITEFUNCTION, metalink_write_cb); #endif /* USE_METALINK */ /* for uploads */ input->config = config; /* Note that if CURLOPT_READFUNCTION is fread (the default), then * lib/telnet.c will Curl_poll() on the input file descriptor * rather then calling the READFUNCTION at regular intervals. * The circumstances in which it is preferable to enable this * behavior, by omitting to set the READFUNCTION & READDATA options, * have not been determined. */ my_setopt(curl, CURLOPT_READDATA, input); /* what call to read */ my_setopt(curl, CURLOPT_READFUNCTION, tool_read_cb); /* in 7.18.0, the CURLOPT_SEEKFUNCTION/DATA pair is taking over what CURLOPT_IOCTLFUNCTION/DATA pair previously provided for seeking */ my_setopt(curl, CURLOPT_SEEKDATA, input); my_setopt(curl, CURLOPT_SEEKFUNCTION, tool_seek_cb); if(config->recvpersecond && (config->recvpersecond < BUFFER_SIZE)) /* use a smaller sized buffer for better sleeps */ my_setopt(curl, CURLOPT_BUFFERSIZE, (long)config->recvpersecond); else my_setopt(curl, CURLOPT_BUFFERSIZE, (long)BUFFER_SIZE); my_setopt_str(curl, CURLOPT_URL, per->this_url); my_setopt(curl, CURLOPT_NOPROGRESS, global->noprogress?1L:0L); if(config->no_body) my_setopt(curl, CURLOPT_NOBODY, 1L); if(config->oauth_bearer) my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer); { my_setopt_str(curl, CURLOPT_PROXY, config->proxy); /* new in libcurl 7.5 */ if(config->proxy) my_setopt_enum(curl, CURLOPT_PROXYTYPE, config->proxyver); my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd); /* new in libcurl 7.3 */ my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L); /* new in libcurl 7.52.0 */ if(config->preproxy) my_setopt_str(curl, CURLOPT_PRE_PROXY, config->preproxy); /* new in libcurl 7.10.6 */ if(config->proxyanyauth) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); else if(config->proxynegotiate) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_GSSNEGOTIATE); else if(config->proxyntlm) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_NTLM); else if(config->proxydigest) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_DIGEST); else if(config->proxybasic) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_BASIC); /* new in libcurl 7.19.4 */ my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy); my_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS, config->suppress_connect_headers?1L:0L); } my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L); my_setopt(curl, CURLOPT_REQUEST_TARGET, config->request_target); my_setopt(curl, CURLOPT_UPLOAD, per->uploadfile?1L:0L); my_setopt(curl, CURLOPT_DIRLISTONLY, config->dirlistonly?1L:0L); my_setopt(curl, CURLOPT_APPEND, config->ftp_append?1L:0L); if(config->netrc_opt) my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_OPTIONAL); else if(config->netrc || config->netrc_file) my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED); else my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_IGNORED); if(config->netrc_file) my_setopt_str(curl, CURLOPT_NETRC_FILE, config->netrc_file); my_setopt(curl, CURLOPT_TRANSFERTEXT, config->use_ascii?1L:0L); if(config->login_options) my_setopt_str(curl, CURLOPT_LOGIN_OPTIONS, config->login_options); my_setopt_str(curl, CURLOPT_USERPWD, config->userpwd); my_setopt_str(curl, CURLOPT_RANGE, config->range); my_setopt(curl, CURLOPT_ERRORBUFFER, per->errorbuffer); my_setopt(curl, CURLOPT_TIMEOUT_MS, (long)(config->timeout * 1000)); switch(config->httpreq) { case HTTPREQ_SIMPLEPOST: my_setopt_str(curl, CURLOPT_POSTFIELDS, config->postfields); my_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, config->postfieldsize); break; case HTTPREQ_MIMEPOST: /* free previous remainders */ curl_mime_free(config->mimepost); config->mimepost = NULL; result = tool2curlmime(curl, config->mimeroot, &config->mimepost); if(result) break; my_setopt_mimepost(curl, CURLOPT_MIMEPOST, config->mimepost); break; default: break; } if(result) break; /* new in libcurl 7.10.6 (default is Basic) */ if(config->authtype) my_setopt_bitmask(curl, CURLOPT_HTTPAUTH, (long)config->authtype); my_setopt_slist(curl, CURLOPT_HTTPHEADER, config->headers); if(built_in_protos & (CURLPROTO_HTTP | CURLPROTO_RTSP)) { my_setopt_str(curl, CURLOPT_REFERER, config->referer); my_setopt_str(curl, CURLOPT_USERAGENT, config->useragent); } if(built_in_protos & CURLPROTO_HTTP) { long postRedir = 0; my_setopt(curl, CURLOPT_FOLLOWLOCATION, config->followlocation?1L:0L); my_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, config->unrestricted_auth?1L:0L); my_setopt(curl, CURLOPT_AUTOREFERER, config->autoreferer?1L:0L); /* new in libcurl 7.36.0 */ if(config->proxyheaders) { my_setopt_slist(curl, CURLOPT_PROXYHEADER, config->proxyheaders); my_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE); } /* new in libcurl 7.5 */ my_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs); if(config->httpversion) my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion); else if(curlinfo->features & CURL_VERSION_HTTP2) { my_setopt_enum(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); } /* curl 7.19.1 (the 301 version existed in 7.18.2), 303 was added in 7.26.0 */ if(config->post301) postRedir |= CURL_REDIR_POST_301; if(config->post302) postRedir |= CURL_REDIR_POST_302; if(config->post303) postRedir |= CURL_REDIR_POST_303; my_setopt(curl, CURLOPT_POSTREDIR, postRedir); /* new in libcurl 7.21.6 */ if(config->encoding) my_setopt_str(curl, CURLOPT_ACCEPT_ENCODING, ""); /* new in libcurl 7.21.6 */ if(config->tr_encoding) my_setopt(curl, CURLOPT_TRANSFER_ENCODING, 1L); /* new in libcurl 7.64.0 */ my_setopt(curl, CURLOPT_HTTP09_ALLOWED, config->http09_allowed ? 1L : 0L); } /* (built_in_protos & CURLPROTO_HTTP) */ my_setopt_str(curl, CURLOPT_FTPPORT, config->ftpport); my_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, config->low_speed_limit); my_setopt(curl, CURLOPT_LOW_SPEED_TIME, config->low_speed_time); my_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, config->sendpersecond); my_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, config->recvpersecond); if(config->use_resume) my_setopt(curl, CURLOPT_RESUME_FROM_LARGE, config->resume_from); else my_setopt(curl, CURLOPT_RESUME_FROM_LARGE, CURL_OFF_T_C(0)); my_setopt_str(curl, CURLOPT_KEYPASSWD, config->key_passwd); my_setopt_str(curl, CURLOPT_PROXY_KEYPASSWD, config->proxy_key_passwd); if(built_in_protos & (CURLPROTO_SCP|CURLPROTO_SFTP|CURLPROTO_SSH)) { /* SSH and SSL private key uses same command-line option */ /* new in libcurl 7.16.1 */ my_setopt_str(curl, CURLOPT_SSH_PRIVATE_KEYFILE, config->key); /* new in libcurl 7.16.1 */ my_setopt_str(curl, CURLOPT_SSH_PUBLIC_KEYFILE, config->pubkey); /* new in libcurl 7.17.1: SSH host key md5 checking allows us to fail if we are not talking to who we think we should */ my_setopt_str(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, config->hostpubmd5); /* new in libcurl 7.56.0 */ if(config->ssh_compression) my_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L); } if(config->cacert) my_setopt_str(curl, CURLOPT_CAINFO, config->cacert); if(config->proxy_cacert) my_setopt_str(curl, CURLOPT_PROXY_CAINFO, config->proxy_cacert); if(config->capath) { result = res_setopt_str(curl, CURLOPT_CAPATH, config->capath); if(result == CURLE_NOT_BUILT_IN) { warnf(config->global, "ignoring %s, not supported by libcurl\n", capath_from_env? "SSL_CERT_DIR environment variable":"--capath"); } else if(result) break; } /* For the time being if --proxy-capath is not set then we use the --capath value for it, if any. See #1257 */ if((config->proxy_capath || config->capath) && !tool_setopt_skip(CURLOPT_PROXY_CAPATH)) { result = res_setopt_str(curl, CURLOPT_PROXY_CAPATH, (config->proxy_capath ? config->proxy_capath : config->capath)); if(result == CURLE_NOT_BUILT_IN) { if(config->proxy_capath) { warnf(config->global, "ignoring --proxy-capath, not supported by libcurl\n"); } } else if(result) break; } if(config->crlfile) my_setopt_str(curl, CURLOPT_CRLFILE, config->crlfile); if(config->proxy_crlfile) my_setopt_str(curl, CURLOPT_PROXY_CRLFILE, config->proxy_crlfile); else if(config->crlfile) /* CURLOPT_PROXY_CRLFILE default is crlfile */ my_setopt_str(curl, CURLOPT_PROXY_CRLFILE, config->crlfile); if(config->pinnedpubkey) my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey); if(config->ssl_ec_curves) my_setopt_str(curl, CURLOPT_SSL_EC_CURVES, config->ssl_ec_curves); if(curlinfo->features & CURL_VERSION_SSL) { /* Check if config->cert is a PKCS#11 URI and set the * config->cert_type if necessary */ if(config->cert) { if(!config->cert_type) { if(is_pkcs11_uri(config->cert)) { config->cert_type = strdup("ENG"); } } } /* Check if config->key is a PKCS#11 URI and set the * config->key_type if necessary */ if(config->key) { if(!config->key_type) { if(is_pkcs11_uri(config->key)) { config->key_type = strdup("ENG"); } } } /* Check if config->proxy_cert is a PKCS#11 URI and set the * config->proxy_type if necessary */ if(config->proxy_cert) { if(!config->proxy_cert_type) { if(is_pkcs11_uri(config->proxy_cert)) { config->proxy_cert_type = strdup("ENG"); } } } /* Check if config->proxy_key is a PKCS#11 URI and set the * config->proxy_key_type if necessary */ if(config->proxy_key) { if(!config->proxy_key_type) { if(is_pkcs11_uri(config->proxy_key)) { config->proxy_key_type = strdup("ENG"); } } } /* In debug build of curl tool, using * --cert loadmem=<filename>:<password> --cert-type p12 * must do the same thing than classic: * --cert <filename>:<password> --cert-type p12 * but is designed to test blob */ #if defined(CURLDEBUG) || defined(DEBUGBUILD) if(config->cert && (strlen(config->cert) > 8) && (memcmp(config->cert, "loadmem=",8) == 0)) { FILE *fInCert = fopen(config->cert + 8, "rb"); void *certdata = NULL; long filesize = 0; bool continue_reading = fInCert != NULL; if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_END) == 0; if(continue_reading) filesize = ftell(fInCert); if(filesize < 0) continue_reading = FALSE; if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_SET) == 0; if(continue_reading) certdata = malloc(((size_t)filesize) + 1); if((!certdata) || ((int)fread(certdata, (size_t)filesize, 1, fInCert) != 1)) continue_reading = FALSE; if(fInCert) fclose(fInCert); if((filesize > 0) && continue_reading) { struct curl_blob structblob; structblob.data = certdata; structblob.len = (size_t)filesize; structblob.flags = CURL_BLOB_COPY; my_setopt_str(curl, CURLOPT_SSLCERT_BLOB, &structblob); /* if test run well, we are sure we don't reuse * original mem pointer */ memset(certdata, 0, (size_t)filesize); } free(certdata); } else #endif my_setopt_str(curl, CURLOPT_SSLCERT, config->cert); my_setopt_str(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert); my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type); my_setopt_str(curl, CURLOPT_PROXY_SSLCERTTYPE, config->proxy_cert_type); #if defined(CURLDEBUG) || defined(DEBUGBUILD) if(config->key && (strlen(config->key) > 8) && (memcmp(config->key, "loadmem=",8) == 0)) { FILE *fInCert = fopen(config->key + 8, "rb"); void *certdata = NULL; long filesize = 0; bool continue_reading = fInCert != NULL; if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_END) == 0; if(continue_reading) filesize = ftell(fInCert); if(filesize < 0) continue_reading = FALSE; if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_SET) == 0; if(continue_reading) certdata = malloc(((size_t)filesize) + 1); if((!certdata) || ((int)fread(certdata, (size_t)filesize, 1, fInCert) != 1)) continue_reading = FALSE; if(fInCert) fclose(fInCert); if((filesize > 0) && continue_reading) { struct curl_blob structblob; structblob.data = certdata; structblob.len = (size_t)filesize; structblob.flags = CURL_BLOB_COPY; my_setopt_str(curl, CURLOPT_SSLKEY_BLOB, &structblob); /* if test run well, we are sure we don't reuse * original mem pointer */ memset(certdata, 0, (size_t)filesize); } free(certdata); } else #endif my_setopt_str(curl, CURLOPT_SSLKEY, config->key); my_setopt_str(curl, CURLOPT_PROXY_SSLKEY, config->proxy_key); my_setopt_str(curl, CURLOPT_SSLKEYTYPE, config->key_type); my_setopt_str(curl, CURLOPT_PROXY_SSLKEYTYPE, config->proxy_key_type); my_setopt_str(curl, CURLOPT_AWS_SIGV4, config->aws_sigv4_provider); if(config->insecure_ok) { my_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); my_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); } else { my_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); /* libcurl default is strict verifyhost -> 2L */ /* my_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L); */ } if(config->proxy_insecure_ok) { my_setopt(curl, CURLOPT_PROXY_SSL_VERIFYPEER, 0L); my_setopt(curl, CURLOPT_PROXY_SSL_VERIFYHOST, 0L); } else { my_setopt(curl, CURLOPT_PROXY_SSL_VERIFYPEER, 1L); } if(config->verifystatus) my_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L); if(config->falsestart) my_setopt(curl, CURLOPT_SSL_FALSESTART, 1L); my_setopt_enum(curl, CURLOPT_SSLVERSION, config->ssl_version | config->ssl_version_max); my_setopt_enum(curl, CURLOPT_PROXY_SSLVERSION, config->proxy_ssl_version); { long mask = (config->ssl_allow_beast ? CURLSSLOPT_ALLOW_BEAST : 0) | (config->ssl_revoke_best_effort ? CURLSSLOPT_REVOKE_BEST_EFFORT : 0) | (config->native_ca_store ? CURLSSLOPT_NATIVE_CA : 0) | (config->ssl_no_revoke ? CURLSSLOPT_NO_REVOKE : 0); if(mask) my_setopt_bitmask(curl, CURLOPT_SSL_OPTIONS, mask); } if(config->proxy_ssl_allow_beast) my_setopt(curl, CURLOPT_PROXY_SSL_OPTIONS, (long)CURLSSLOPT_ALLOW_BEAST); } if(config->path_as_is) my_setopt(curl, CURLOPT_PATH_AS_IS, 1L); if((built_in_protos & (CURLPROTO_SCP|CURLPROTO_SFTP|CURLPROTO_SSH)) && !config->insecure_ok) { char *home = homedir(NULL); if(home) { char *file = aprintf("%s/.ssh/known_hosts", home); if(file) { /* new in curl 7.19.6 */ result = res_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, file); curl_free(file); if(result == CURLE_UNKNOWN_OPTION) /* libssh2 version older than 1.1.1 */ result = CURLE_OK; } Curl_safefree(home); if(result) break; } else warnf(global, "No home dir, couldn't find known_hosts file!"); } if(config->no_body || config->remote_time) { /* no body or use remote time */ my_setopt(curl, CURLOPT_FILETIME, 1L); } my_setopt(curl, CURLOPT_CRLF, config->crlf?1L:0L); my_setopt_slist(curl, CURLOPT_QUOTE, config->quote); my_setopt_slist(curl, CURLOPT_POSTQUOTE, config->postquote); my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote); if(config->cookie) my_setopt_str(curl, CURLOPT_COOKIE, config->cookie); if(config->cookiefile) my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile); /* new in libcurl 7.9 */ if(config->cookiejar) my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar); /* new in libcurl 7.9.7 */ my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L); my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond); my_setopt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime); my_setopt_str(curl, CURLOPT_CUSTOMREQUEST, config->customrequest); customrequest_helper(config, config->httpreq, config->customrequest); my_setopt(curl, CURLOPT_STDERR, global->errors); /* three new ones in libcurl 7.3: */ my_setopt_str(curl, CURLOPT_INTERFACE, config->iface); my_setopt_str(curl, CURLOPT_KRBLEVEL, config->krblevel); progressbarinit(&per->progressbar, config); if((global->progressmode == CURL_PROGRESS_BAR) && !global->noprogress && !global->mute) { /* we want the alternative style, then we have to implement it ourselves! */ my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_progress_cb); my_setopt(curl, CURLOPT_XFERINFODATA, per); } else if(per->uploadfile && !strcmp(per->uploadfile, ".")) { /* when reading from stdin in non-blocking mode, we use the progress function to unpause a busy read */ my_setopt(curl, CURLOPT_NOPROGRESS, 0L); my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_readbusy_cb); my_setopt(curl, CURLOPT_XFERINFODATA, per); } /* new in libcurl 7.24.0: */ if(config->dns_servers) my_setopt_str(curl, CURLOPT_DNS_SERVERS, config->dns_servers); /* new in libcurl 7.33.0: */ if(config->dns_interface) my_setopt_str(curl, CURLOPT_DNS_INTERFACE, config->dns_interface); if(config->dns_ipv4_addr) my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr); if(config->dns_ipv6_addr) my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP6, config->dns_ipv6_addr); /* new in libcurl 7.6.2: */ my_setopt_slist(curl, CURLOPT_TELNETOPTIONS, config->telnet_options); /* new in libcurl 7.7: */ my_setopt_str(curl, CURLOPT_RANDOM_FILE, config->random_file); my_setopt_str(curl, CURLOPT_EGDSOCKET, config->egd_file); my_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, (long)(config->connecttimeout * 1000)); if(config->doh_url) my_setopt_str(curl, CURLOPT_DOH_URL, config->doh_url); if(config->cipher_list) my_setopt_str(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list); if(config->proxy_cipher_list) my_setopt_str(curl, CURLOPT_PROXY_SSL_CIPHER_LIST, config->proxy_cipher_list); if(config->cipher13_list) my_setopt_str(curl, CURLOPT_TLS13_CIPHERS, config->cipher13_list); if(config->proxy_cipher13_list) my_setopt_str(curl, CURLOPT_PROXY_TLS13_CIPHERS, config->proxy_cipher13_list); /* new in libcurl 7.9.2: */ if(config->disable_epsv) /* disable it */ my_setopt(curl, CURLOPT_FTP_USE_EPSV, 0L); /* new in libcurl 7.10.5 */ if(config->disable_eprt) /* disable it */ my_setopt(curl, CURLOPT_FTP_USE_EPRT, 0L); if(global->tracetype != TRACE_NONE) { my_setopt(curl, CURLOPT_DEBUGFUNCTION, tool_debug_cb); my_setopt(curl, CURLOPT_DEBUGDATA, config); my_setopt(curl, CURLOPT_VERBOSE, 1L); } /* new in curl 7.9.3 */ if(config->engine) { result = res_setopt_str(curl, CURLOPT_SSLENGINE, config->engine); if(result) break; } /* new in curl 7.10.7, extended in 7.19.4. Modified to use CREATE_DIR_RETRY in 7.49.0 */ my_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, (long)(config->ftp_create_dirs? CURLFTP_CREATE_DIR_RETRY: CURLFTP_CREATE_DIR_NONE)); /* new in curl 7.10.8 */ if(config->max_filesize) my_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, config->max_filesize); my_setopt(curl, CURLOPT_IPRESOLVE, config->ip_version); /* new in curl 7.15.5 */ if(config->ftp_ssl_reqd) my_setopt_enum(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); /* new in curl 7.11.0 */ else if(config->ftp_ssl) my_setopt_enum(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY); /* new in curl 7.16.0 */ else if(config->ftp_ssl_control) my_setopt_enum(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_CONTROL); /* new in curl 7.16.1 */ if(config->ftp_ssl_ccc) my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC, (long)config->ftp_ssl_ccc_mode); /* new in curl 7.19.4 */ if(config->socks5_gssapi_nec) my_setopt_str(curl, CURLOPT_SOCKS5_GSSAPI_NEC, config->socks5_gssapi_nec); /* new in curl 7.55.0 */ if(config->socks5_auth) my_setopt_bitmask(curl, CURLOPT_SOCKS5_AUTH, (long)config->socks5_auth); /* new in curl 7.43.0 */ if(config->proxy_service_name) my_setopt_str(curl, CURLOPT_PROXY_SERVICE_NAME, config->proxy_service_name); /* new in curl 7.43.0 */ if(config->service_name) my_setopt_str(curl, CURLOPT_SERVICE_NAME, config->service_name); /* curl 7.13.0 */ my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account); my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl?1L:0L); /* curl 7.14.2 */ my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip?1L:0L); /* curl 7.15.1 */ my_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long)config->ftp_filemethod); /* curl 7.15.2 */ if(config->localport) { my_setopt(curl, CURLOPT_LOCALPORT, config->localport); my_setopt_str(curl, CURLOPT_LOCALPORTRANGE, config->localportrange); } /* curl 7.15.5 */ my_setopt_str(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, config->ftp_alternative_to_user); /* curl 7.16.0 */ if(config->disable_sessionid) /* disable it */ my_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L); /* curl 7.16.2 */ if(config->raw) { my_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 0L); my_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L); } /* curl 7.17.1 */ if(!config->nokeepalive) { my_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); if(config->alivetime != 0) { my_setopt(curl, CURLOPT_TCP_KEEPIDLE, config->alivetime); my_setopt(curl, CURLOPT_TCP_KEEPINTVL, config->alivetime); } } else my_setopt(curl, CURLOPT_TCP_KEEPALIVE, 0L); /* curl 7.20.0 */ if(config->tftp_blksize) my_setopt(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize); if(config->mail_from) my_setopt_str(curl, CURLOPT_MAIL_FROM, config->mail_from); if(config->mail_rcpt) my_setopt_slist(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt); /* curl 7.69.x */ my_setopt(curl, CURLOPT_MAIL_RCPT_ALLLOWFAILS, config->mail_rcpt_allowfails ? 1L : 0L); /* curl 7.20.x */ if(config->ftp_pret) my_setopt(curl, CURLOPT_FTP_USE_PRET, 1L); if(config->proto_present) my_setopt_flags(curl, CURLOPT_PROTOCOLS, config->proto); if(config->proto_redir_present) my_setopt_flags(curl, CURLOPT_REDIR_PROTOCOLS, config->proto_redir); if(config->content_disposition && (urlnode->flags & GETOUT_USEREMOTE)) hdrcbdata->honor_cd_filename = TRUE; else hdrcbdata->honor_cd_filename = FALSE; hdrcbdata->outs = outs; hdrcbdata->heads = heads; hdrcbdata->etag_save = etag_save; hdrcbdata->global = global; hdrcbdata->config = config; my_setopt(curl, CURLOPT_HEADERFUNCTION, tool_header_cb); my_setopt(curl, CURLOPT_HEADERDATA, per); if(config->resolve) /* new in 7.21.3 */ my_setopt_slist(curl, CURLOPT_RESOLVE, config->resolve); if(config->connect_to) /* new in 7.49.0 */ my_setopt_slist(curl, CURLOPT_CONNECT_TO, config->connect_to); /* new in 7.21.4 */ if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) { if(config->tls_username) my_setopt_str(curl, CURLOPT_TLSAUTH_USERNAME, config->tls_username); if(config->tls_password) my_setopt_str(curl, CURLOPT_TLSAUTH_PASSWORD, config->tls_password); if(config->tls_authtype) my_setopt_str(curl, CURLOPT_TLSAUTH_TYPE, config->tls_authtype); if(config->proxy_tls_username) my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, config->proxy_tls_username); if(config->proxy_tls_password) my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, config->proxy_tls_password); if(config->proxy_tls_authtype) my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_TYPE, config->proxy_tls_authtype); } /* new in 7.22.0 */ if(config->gssapi_delegation) my_setopt_str(curl, CURLOPT_GSSAPI_DELEGATION, config->gssapi_delegation); if(config->mail_auth) my_setopt_str(curl, CURLOPT_MAIL_AUTH, config->mail_auth); /* new in 7.66.0 */ if(config->sasl_authzid) my_setopt_str(curl, CURLOPT_SASL_AUTHZID, config->sasl_authzid); /* new in 7.31.0 */ if(config->sasl_ir) my_setopt(curl, CURLOPT_SASL_IR, 1L); if(config->nonpn) { my_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 0L); } if(config->noalpn) { my_setopt(curl, CURLOPT_SSL_ENABLE_ALPN, 0L); } /* new in 7.40.0, abstract support added in 7.53.0 */ if(config->unix_socket_path) { if(config->abstract_unix_socket) { my_setopt_str(curl, CURLOPT_ABSTRACT_UNIX_SOCKET, config->unix_socket_path); } else { my_setopt_str(curl, CURLOPT_UNIX_SOCKET_PATH, config->unix_socket_path); } } /* new in 7.45.0 */ if(config->proto_default) my_setopt_str(curl, CURLOPT_DEFAULT_PROTOCOL, config->proto_default); /* new in 7.47.0 */ if(config->expect100timeout > 0) my_setopt_str(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, (long)(config->expect100timeout*1000)); /* new in 7.48.0 */ if(config->tftp_no_options) my_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L); /* new in 7.59.0 */ if(config->happy_eyeballs_timeout_ms != CURL_HET_DEFAULT) my_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, config->happy_eyeballs_timeout_ms); /* new in 7.60.0 */ if(config->haproxy_protocol) my_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L); if(config->disallow_username_in_url) my_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L); if(config->altsvc) my_setopt_str(curl, CURLOPT_ALTSVC, config->altsvc); if(config->hsts) my_setopt_str(curl, CURLOPT_HSTS, config->hsts); #ifdef USE_METALINK if(!metalink && config->use_metalink) { outs->metalink_parser = metalink_parser_context_new(); if(outs->metalink_parser == NULL) { result = CURLE_OUT_OF_MEMORY; break; } fprintf(config->global->errors, "Metalink: parsing (%s) metalink/XML...\n", per->this_url); } else if(metalink) fprintf(config->global->errors, "Metalink: fetching (%s) from (%s)...\n", mlfile->filename, per->this_url); #endif /* USE_METALINK */ per->metalink = metalink; /* initialize retry vars for loop below */ per->retry_sleep_default = (config->retry_delay) ? config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */ per->retry_numretries = config->req_retry; per->retry_sleep = per->retry_sleep_default; /* ms */ per->retrystart = tvnow(); state->li++; /* Here's looping around each globbed URL */ if(state->li >= urlnum) { state->li = 0; state->urlnum = 0; /* forced reglob of URLs */ glob_cleanup(state->urls); state->urls = NULL; state->up++; Curl_safefree(state->uploadfile); /* clear it to get the next */ } } else { /* Free this URL node data without destroying the the node itself nor modifying next pointer. */ Curl_safefree(urlnode->outfile); Curl_safefree(urlnode->infile); urlnode->flags = 0; glob_cleanup(state->urls); state->urls = NULL; state->urlnum = 0; Curl_safefree(state->outfiles); Curl_safefree(state->uploadfile); if(state->inglob) { /* Free list of globbed upload files */ glob_cleanup(state->inglob); state->inglob = NULL; } config->state.urlnode = urlnode->next; state->up = 0; continue; } } break; } if(!*added || result) { *added = FALSE; single_transfer_cleanup(config); } return result; } static long all_added; /* number of easy handles currently added */ /* * add_parallel_transfers() sets 'morep' to TRUE if there are more transfers * to add even after this call returns. sets 'addedp' to TRUE if one or more * transfers were added. */ static CURLcode add_parallel_transfers(struct GlobalConfig *global, CURLM *multi, CURLSH *share, bool *morep, bool *addedp) { struct per_transfer *per; CURLcode result = CURLE_OK; CURLMcode mcode; bool sleeping = FALSE; *addedp = FALSE; *morep = FALSE; result = create_transfer(global, share, addedp); if(result) return result; for(per = transfers; per && (all_added < global->parallel_max); per = per->next) { bool getadded = FALSE; if(per->added) /* already added */ continue; if(per->startat && (time(NULL) < per->startat)) { /* this is still delaying */ sleeping = TRUE; continue; } result = pre_transfer(global, per); if(result) return result; /* parallel connect means that we don't set PIPEWAIT since pipewait will make libcurl prefer multiplexing */ (void)curl_easy_setopt(per->curl, CURLOPT_PIPEWAIT, global->parallel_connect ? 0L : 1L); (void)curl_easy_setopt(per->curl, CURLOPT_PRIVATE, per); (void)curl_easy_setopt(per->curl, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); (void)curl_easy_setopt(per->curl, CURLOPT_XFERINFODATA, per); mcode = curl_multi_add_handle(multi, per->curl); if(mcode) return CURLE_OUT_OF_MEMORY; result = create_transfer(global, share, &getadded); if(result) return result; per->added = TRUE; all_added++; *addedp = TRUE; } *morep = (per || sleeping) ? TRUE : FALSE; return CURLE_OK; } static CURLcode parallel_transfers(struct GlobalConfig *global, CURLSH *share) { CURLM *multi; CURLMcode mcode = CURLM_OK; CURLcode result = CURLE_OK; int still_running = 1; struct timeval start = tvnow(); bool more_transfers; bool added_transfers; time_t tick = time(NULL); multi = curl_multi_init(); if(!multi) return CURLE_OUT_OF_MEMORY; result = add_parallel_transfers(global, multi, share, &more_transfers, &added_transfers); if(result) { curl_multi_cleanup(multi); return result; } while(!mcode && (still_running || more_transfers)) { mcode = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(!mcode) mcode = curl_multi_perform(multi, &still_running); progress_meter(global, &start, FALSE); if(!mcode) { int rc; CURLMsg *msg; bool checkmore = FALSE; do { msg = curl_multi_info_read(multi, &rc); if(msg) { bool retry; long delay; struct per_transfer *ended; CURL *easy = msg->easy_handle; result = msg->data.result; curl_easy_getinfo(easy, CURLINFO_PRIVATE, (void *)&ended); curl_multi_remove_handle(multi, easy); result = post_per_transfer(global, ended, result, &retry, &delay); progress_finalize(ended); /* before it goes away */ all_added--; /* one fewer added */ checkmore = TRUE; if(retry) { ended->added = FALSE; /* add it again */ /* we delay retries in full integer seconds only */ ended->startat = delay ? time(NULL) + delay/1000 : 0; } else (void)del_per_transfer(ended); } } while(msg); if(!checkmore) { time_t tock = time(NULL); if(tick != tock) { checkmore = TRUE; tick = tock; } } if(checkmore) { /* one or more transfers completed, add more! */ (void)add_parallel_transfers(global, multi, share, &more_transfers, &added_transfers); if(added_transfers) /* we added new ones, make sure the loop doesn't exit yet */ still_running = 1; } } } (void)progress_meter(global, &start, TRUE); /* Make sure to return some kind of error if there was a multi problem */ if(mcode) { result = (mcode == CURLM_OUT_OF_MEMORY) ? CURLE_OUT_OF_MEMORY : /* The other multi errors should never happen, so return something suitably generic */ CURLE_BAD_FUNCTION_ARGUMENT; } curl_multi_cleanup(multi); return result; } static CURLcode serial_transfers(struct GlobalConfig *global, CURLSH *share) { CURLcode returncode = CURLE_OK; CURLcode result = CURLE_OK; struct per_transfer *per; bool added = FALSE; result = create_transfer(global, share, &added); if(result || !added) return result; for(per = transfers; per;) { bool retry; long delay; bool bailout = FALSE; result = pre_transfer(global, per); if(result) break; #ifndef CURL_DISABLE_LIBCURL_OPTION if(global->libcurl) { result = easysrc_perform(); if(result) break; } #endif #ifdef CURLDEBUG if(global->test_event_based) result = curl_easy_perform_ev(per->curl); else #endif result = curl_easy_perform(per->curl); /* store the result of the actual transfer */ returncode = result; result = post_per_transfer(global, per, result, &retry, &delay); if(retry) { tool_go_sleep(delay); continue; } /* Bail out upon critical errors or --fail-early */ if(result || is_fatal_error(returncode) || (returncode && global->fail_early)) bailout = TRUE; else { /* setup the next one just before we delete this */ result = create_transfer(global, share, &added); if(result) bailout = TRUE; } /* Release metalink related resources here */ delete_metalinkfile(per->mlfile); per = del_per_transfer(per); if(bailout) break; } if(returncode) /* returncode errors have priority */ result = returncode; if(result) single_transfer_cleanup(global->current); return result; } /* setup a transfer for the given config */ static CURLcode transfer_per_config(struct GlobalConfig *global, struct OperationConfig *config, CURLSH *share, bool *added) { CURLcode result = CURLE_OK; bool capath_from_env; *added = FALSE; /* Check we have a url */ if(!config->url_list || !config->url_list->url) { helpf(global->errors, "no URL specified!\n"); return CURLE_FAILED_INIT; } /* On WIN32 we can't set the path to curl-ca-bundle.crt * at compile time. So we look here for the file in two ways: * 1: look at the environment variable CURL_CA_BUNDLE for a path * 2: if #1 isn't found, use the windows API function SearchPath() * to find it along the app's path (includes app's dir and CWD) * * We support the environment variable thing for non-Windows platforms * too. Just for the sake of it. */ capath_from_env = false; if(!config->cacert && !config->capath && !config->insecure_ok) { CURL *curltls = curl_easy_init(); struct curl_tlssessioninfo *tls_backend_info = NULL; /* With the addition of CAINFO support for Schannel, this search could find * a certificate bundle that was previously ignored. To maintain backward * compatibility, only perform this search if not using Schannel. */ result = curl_easy_getinfo(curltls, CURLINFO_TLS_SSL_PTR, &tls_backend_info); if(result) return result; /* Set the CA cert locations specified in the environment. For Windows if * no environment-specified filename is found then check for CA bundle * default filename curl-ca-bundle.crt in the user's PATH. * * If Schannel is the selected SSL backend then these locations are * ignored. We allow setting CA location for schannel only when explicitly * specified by the user via CURLOPT_CAINFO / --cacert. */ if(tls_backend_info->backend != CURLSSLBACKEND_SCHANNEL) { char *env; env = curlx_getenv("CURL_CA_BUNDLE"); if(env) { config->cacert = strdup(env); if(!config->cacert) { curl_free(env); errorf(global, "out of memory\n"); return CURLE_OUT_OF_MEMORY; } } else { env = curlx_getenv("SSL_CERT_DIR"); if(env) { config->capath = strdup(env); if(!config->capath) { curl_free(env); helpf(global->errors, "out of memory\n"); return CURLE_OUT_OF_MEMORY; } capath_from_env = true; } else { env = curlx_getenv("SSL_CERT_FILE"); if(env) { config->cacert = strdup(env); if(!config->cacert) { curl_free(env); errorf(global, "out of memory\n"); return CURLE_OUT_OF_MEMORY; } } } } if(env) curl_free(env); #ifdef WIN32 else { result = FindWin32CACert(config, tls_backend_info->backend, TEXT("curl-ca-bundle.crt")); } #endif } curl_easy_cleanup(curltls); } if(!result) result = single_transfer(global, config, share, capath_from_env, added); return result; } /* * 'create_transfer' gets the details and sets up a new transfer if 'added' * returns TRUE. */ static CURLcode create_transfer(struct GlobalConfig *global, CURLSH *share, bool *added) { CURLcode result = CURLE_OK; *added = FALSE; while(global->current) { result = transfer_per_config(global, global->current, share, added); if(!result && !*added) { /* when one set is drained, continue to next */ global->current = global->current->next; continue; } break; } return result; } static CURLcode run_all_transfers(struct GlobalConfig *global, CURLSH *share, CURLcode result) { /* Save the values of noprogress and isatty to restore them later on */ bool orig_noprogress = global->noprogress; bool orig_isatty = global->isatty; struct per_transfer *per; /* Time to actually do the transfers */ if(!result) { if(global->parallel) result = parallel_transfers(global, share); else result = serial_transfers(global, share); } /* cleanup if there are any left */ for(per = transfers; per;) { bool retry; long delay; CURLcode result2 = post_per_transfer(global, per, result, &retry, &delay); if(!result) /* don't overwrite the original error */ result = result2; /* Free list of given URLs */ clean_getout(per->config); /* Release metalink related resources here */ clean_metalink(per->config); per = del_per_transfer(per); } /* Reset the global config variables */ global->noprogress = orig_noprogress; global->isatty = orig_isatty; return result; } CURLcode operate(struct GlobalConfig *global, int argc, argv_item_t argv[]) { CURLcode result = CURLE_OK; char *first_arg = curlx_convert_tchar_to_UTF8(argv[1]); /* Setup proper locale from environment */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, ""); #endif /* Parse .curlrc if necessary */ if((argc == 1) || (first_arg && strncmp(first_arg, "-q", 2) && !curl_strequal(first_arg, "--disable"))) { parseconfig(NULL, global); /* ignore possible failure */ /* If we had no arguments then make sure a url was specified in .curlrc */ if((argc < 2) && (!global->first->url_list)) { helpf(global->errors, NULL); result = CURLE_FAILED_INIT; } } curlx_unicodefree(first_arg); if(!result) { /* Parse the command line arguments */ ParameterError res = parse_args(global, argc, argv); if(res) { result = CURLE_OK; /* Check if we were asked for the help */ if(res == PARAM_HELP_REQUESTED) tool_help(global->help_category); /* Check if we were asked for the manual */ else if(res == PARAM_MANUAL_REQUESTED) hugehelp(); /* Check if we were asked for the version information */ else if(res == PARAM_VERSION_INFO_REQUESTED) tool_version_info(); /* Check if we were asked to list the SSL engines */ else if(res == PARAM_ENGINES_REQUESTED) tool_list_engines(); else if(res == PARAM_LIBCURL_UNSUPPORTED_PROTOCOL) result = CURLE_UNSUPPORTED_PROTOCOL; else result = CURLE_FAILED_INIT; } else { #ifndef CURL_DISABLE_LIBCURL_OPTION if(global->libcurl) { /* Initialise the libcurl source output */ result = easysrc_init(); } #endif /* Perform the main operations */ if(!result) { size_t count = 0; struct OperationConfig *operation = global->first; CURLSH *share = curl_share_init(); if(!share) { #ifndef CURL_DISABLE_LIBCURL_OPTION if(global->libcurl) { /* Cleanup the libcurl source output */ easysrc_cleanup(); } #endif return CURLE_OUT_OF_MEMORY; } curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_PSL); /* Get the required arguments for each operation */ do { result = get_args(operation, count++); operation = operation->next; } while(!result && operation); /* Set the current operation pointer */ global->current = global->first; /* now run! */ result = run_all_transfers(global, share, result); curl_share_cleanup(share); #ifndef CURL_DISABLE_LIBCURL_OPTION if(global->libcurl) { /* Cleanup the libcurl source output */ easysrc_cleanup(); /* Dump the libcurl code if previously enabled */ dumpeasysrc(global); } #endif } else errorf(global, "out of memory\n"); } } return result; }
683639.c
/* * taskdtl_display.c * * Brief Description: * A 'library' routine of sorts... invoked from another module/linked into * other kernel module. * Given the task structure pointer as a parameter, this function displays * (via printk's) some of the task structure details. * * Author: Kaiwan N Billimoria <kaiwan -at- kaiwantech -dot- com> * License: Dual MIT/GPL */ #include <linux/sched.h> /* current */ #include <linux/vmalloc.h> /* gcc err "dereferencing pointer to incomplete type" if not included */ #include <linux/mm_types.h> #include <linux/version.h> #if LINUX_VERSION_CODE > KERNEL_VERSION(4, 10, 0) #include <linux/sched/signal.h> #endif #include <linux/mm.h> #include <linux/atomic.h> #include <linux/spinlock.h> int disp_task_details(struct task_struct *p) { char *pol=NULL; struct thread_info *ti = task_thread_info(p); if (!pid_alive(p)) { pr_info("%s(): task not alive? aborting...\n", __func__); return -EINVAL; } task_lock(p); pr_info("\n<--------------- %16s : %7d ------------------>\n", p->comm, p->pid); /* Task PID, ownership */ pr_info("Task struct @ 0x%lx ::\n" "Process/Thread: %16s, TGID %6d, PID %6d\n" "%26sRealUID : %6d, EffUID : %6d\n" "%26slogin UID : %6d\n", p, p->comm, p->tgid, p->pid, " ", __kuid_val(p->cred->uid), __kuid_val(p->cred->euid), " ", __kuid_val(p->loginuid)); #if 0 #ifdef CONFIG_ARM64 u64 sp_el0; asm ("mrs %0, sp_el0" : "=r" (sp_el0)); pr_info(" arm64: sp_el0 holds task ptr (value is 0x%lx)\n", sp_el0); #endif /* CONFIG_ARM64 */ #endif /* Task state */ pr_info("Task state (%d) : ", p->state); switch (p->state) { case TASK_RUNNING : pr_info(" R: ready-to-run (on rq) OR running (on cpu)\n"); break; case TASK_INTERRUPTIBLE : pr_info(" S: interruptible sleep\n"); break; case TASK_UNINTERRUPTIBLE : pr_info(" D: uninterruptible sleep (!)\n"); break; case __TASK_STOPPED : pr_info(" T: stopped\n"); break; case __TASK_TRACED : pr_info(" t: traced\n"); break; case TASK_PARKED : pr_info(" .: PARKED\n"); break; case TASK_DEAD : pr_info(" X: DEAD\n"); break; case TASK_WAKEKILL : pr_info(" .: WAKEKILL\n"); break; case TASK_WAKING : pr_info(" .: WAKING\n"); break; case TASK_NOLOAD : pr_info(" .: NOLOAD\n"); break; case TASK_NEW : pr_info(" .: NEW\n"); break; default : pr_info(" ? <unknown>\n"); } if (!ti) pr_warn("ti invalid!\n"); else { pr_info( "thread_info (0x%lx) is " #ifdef CONFIG_THREAD_INFO_IN_TASK "within the task struct itself\n" #else "separate (not within the task struct)\n" #endif , ti); } pr_info( "# threads : %7d\n" "stack : 0x%lx ; vmapped?" /* we use the %lx fmt spec instead of the * recommended-for-security %pK as we really do want * to see the actual address here; don't do this in * production! */ #ifdef CONFIG_VMAP_STACK " yes\n" #else " no\n" #endif #ifdef CONFIG_GCC_PLUGIN_STACKLEAK " (GCC STACKLEAK) lowest stack : 0x%lx\n" #endif "flags : 0x%x\n" "sched ::\n" #ifdef CONFIG_THREAD_INFO_IN_TASK " curr CPU : %3d\n" #endif " on RQ? : %s\n" " prio : %3d\n" " static prio : %3d\n" " normal prio : %3d\n" " RT priority : %3d\n" " vruntime : %llu\n", get_nr_threads(p), p->stack, #ifdef CONFIG_GCC_PLUGIN_STACKLEAK p->lowest_stack, #endif p->flags, #ifdef CONFIG_THREAD_INFO_IN_TASK p->cpu, #endif p->on_rq ? "yes" : "no", p->prio, p->static_prio, p->normal_prio, p->rt_priority, p->se.vruntime ); // Sched Policy switch (p->policy) { case SCHED_NORMAL: pol = "Normal/Other"; break; case SCHED_FIFO: pol = "FIFO"; break; case SCHED_RR: pol = "RR"; break; case SCHED_BATCH: pol = "BATCH"; break; case SCHED_IDLE: pol = "IDLE"; break; case SCHED_DEADLINE: pol = "DEADLINE"; break; default: pol = "<Unknown>"; } pr_info(" policy : %s", pol); pr_info( " cpus allowed: %3d\n" #ifdef CONFIG_SCHED_INFO " # times run on cpu: %4ld\n" " time waiting on RQ: %9llu\n" // TODO :: unit ?? #endif , p->nr_cpus_allowed #ifdef CONFIG_SCHED_INFO , p->sched_info.pcount, p->sched_info.run_delay // TODO :: unit ?? #endif ); /* some mm details */ if (p->mm) { pr_info("mm info ::\n" " not a kernel thread; mm_struct : 0x%lx\n", p->mm); pr_info( " PGD base addr : 0x%lx\n" " mm_users = %d, mm_count = %d\n" #ifdef CONFIG_MMU " PTE page table pages = %ld bytes\n" #endif " # of VMAs = %9d\n" " Highest VMA end address = 0x%lx\n" " High-watermark of RSS usage = %9lu pages\n" " High-water virtual memory usage = %9lu pages\n" " Total pages mapped = %9lu pages\n" " Pages that have PG_mlocked set = %9lu pages\n" " Refcount permanently increased = %9lu pages\n" " data_vm: VM_WRITE & ~VM_SHARED & ~VM_STACK = %9lu pages\n" " exec_vm: VM_EXEC & ~VM_WRITE & ~VM_STACK = %9lu pages\n" " stack_vm: VM_STACK = %9lu pages\n" " def_flags = 0x%x\n" , p->mm->pgd, atomic_read(&p->mm->mm_users), atomic_read(&p->mm->mm_count), #ifdef CONFIG_MMU atomic64_read(&p->mm->pgtables_bytes), #endif p->mm->map_count, p->mm->highest_vm_end, p->mm->hiwater_rss, /* High-watermark of RSS usage */ p->mm->hiwater_vm, /* High-water virtual memory usage */ p->mm->total_vm, /* Total pages mapped */ p->mm->locked_vm, /* Pages that have PG_mlocked set */ p->mm->pinned_vm, /* Refcount permanently increased */ p->mm->data_vm, /* VM_WRITE & ~VM_SHARED & ~VM_STACK */ p->mm->exec_vm, /* VM_EXEC & ~VM_WRITE & ~VM_STACK */ p->mm->stack_vm, /* VM_STACK */ p->mm->def_flags ); /* userspace mappings */ //spin_lock(&p->mm->arg_lock); pr_info( "mm userspace mapings (high to low) ::\n" " env : 0x%lx - 0x%lx [%6u bytes]\n" " args : 0x%lx - 0x%lx [%6u bytes]\n" // " stack : 0x%lx - 0x%lx [%6u bytes]\n" " start stack: 0x%lx\n" " heap : 0x%lx - 0x%lx [%6u KB, %6u MB]\n" " data : 0x%lx - 0x%lx [%6u KB, %6u MB]\n" " code : 0x%lx - 0x%lx [%6u KB, %6u MB]\n" , p->mm->env_start, p->mm->env_end, p->mm->env_end - p->mm->env_start, p->mm->arg_start, p->mm->arg_end, p->mm->arg_end - p->mm->arg_start, //p->mm->start_stack, p->mm->arg_start, //p->mm->arg_start - p->mm->start_stack, p->mm->start_stack, p->mm->start_brk, p->mm->brk, (p->mm->brk - p->mm->start_brk)/1024, (p->mm->brk - p->mm->start_brk)/(1024*1024), p->mm->start_data, p->mm->end_data, (p->mm->end_data - p->mm->start_data)/1024, (p->mm->end_data - p->mm->start_data)/(1024*1024), p->mm->start_code, p->mm->end_data, (p->mm->end_data - p->mm->start_code)/1024, (p->mm->end_data - p->mm->start_code)/(1024*1024) ); //spin_unlock(&p->mm->arg_lock); // Get SP #ifdef CONFIG_ARM64 { u64 sp_el1; asm ("mrs %0, sp_el1" : "=r" (sp_el1)); pr_info(" arm64: sp_el1 = 0x%lx\n", sp_el1); } #endif /* CONFIG_ARM64 */ } else pr_info("is a kernel thread (mm NUL)\n"); pr_info( "in execve()? %s\n" "in iowait ? %s\n" #ifdef CONFIG_STACKPROTECTOR "stack canary : 0x%lx\n" #endif "utime, stime : %llu, %llu\n" "# vol c/s, # invol c/s : %6lu, %6lu\n" "# minor, major faults : %6lu, %6lu\n" #ifdef CONFIG_LOCKDEP "lockdep depth : %d\n" #endif #ifdef CONFIG_TASK_IO_ACCOUNTING "task I/O accounting ::\n" " read bytes : %7llu\n" " written (or will) bytes : %7llu\n" " cancelled write bytes : %7llu\n" #endif #ifdef CONFIG_TASK_XACCT " # read syscalls : %7llu\n" " # write syscalls : %7llu\n" " accumulated RSS usage : %9llu (%6llu KB)\n" // bytes ?? " accumulated VM usage : %9llu (%6llu KB)\n" // bytes ?? #endif #ifdef CONFIG_PSI "pressure stall state flags: 0x%lx\n" #endif , p->in_execve == 1 ? "yes" : "no", p->in_iowait == 1 ? "yes" : "no", #ifdef CONFIG_STACKPROTECTOR p->stack_canary, #endif p->utime, p->stime, p->nvcsw, p->nivcsw, p->min_flt, p->maj_flt, #ifdef CONFIG_LOCKDEP p->lockdep_depth, #endif #ifdef CONFIG_TASK_IO_ACCOUNTING p->ioac.read_bytes, p->ioac.write_bytes, p->ioac.cancelled_write_bytes, #endif #ifdef CONFIG_TASK_XACCT p->ioac.syscr, p->ioac.syscw, p->acct_rss_mem1, p->acct_rss_mem1/1024, p->acct_vm_mem1, p->acct_vm_mem1/1024 #endif #ifdef CONFIG_PSI , p->psi_flags #endif ); /* thread struct : cpu-specific hardware context */ pr_info( "Hardware ctx info location is thread struct: 0x%lx\n" #ifdef CONFIG_X86_64 "X86_64 ::\n" " thrd info: 0x%lx\n" " sp : 0x%lx\n" " es : 0x%x, ds : 0x%x\n" " cr2 : 0x%lx, trap # : 0x%lx, error code : 0x%lx\n" #endif /* CONFIG_X86_64 */ #ifdef CONFIG_ARM64 "ARM64 ::\n" " thrd info: 0x%lx\n" " addr limit : 0x%lx (%u MB, %u GB)\n" " Saved registers ::\n" " X19 = 0x%lx X20 = 0x%lx X21 = 0x%lx\n" " X22 = 0x%lx X23 = 0x%lx X24 = 0x%lx\n" " X25 = 0x%lx X26 = 0x%lx X27 = 0x%lx\n" " X28 = 0x%lx\n" " FP = 0x%lx SP = 0x%lx PC = 0x%lx\n" " fault_address : 0x%lx, fault code (ESR_EL1): 0x%lx\n" " arm64 pointer authentication" #ifdef CONFIG_ARM64_PTR_AUTH " present.\n" #else " absent.\n" #endif #endif /* CONFIG_ARM64 */ , &(p->thread), #ifdef CONFIG_X86_64 ti, p->thread.sp, p->thread.es, p->thread.ds, p->thread.cr2, p->thread.trap_nr, p->thread.error_code #endif /* CONFIG_X86_64 */ #ifdef CONFIG_ARM64 ti, ti->addr_limit, ti->addr_limit/(1024*1024), ti->addr_limit/(1024*1024*1024), p->thread.cpu_context.x19, p->thread.cpu_context.x20, p->thread.cpu_context.x21, p->thread.cpu_context.x22, p->thread.cpu_context.x23, p->thread.cpu_context.x24, p->thread.cpu_context.x25, p->thread.cpu_context.x26, p->thread.cpu_context.x27, p->thread.cpu_context.x28, p->thread.cpu_context.fp, p->thread.cpu_context.sp, p->thread.cpu_context.pc, p->thread.fault_address, p->thread.fault_code #endif /* CONFIG_ARM64 */ ); task_unlock(p); #if 0 dump_stack(); #endif return 0; } EXPORT_SYMBOL(disp_task_details);
123970.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstadd_back.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: lpaulo-m <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/02/04 22:16:37 by lpaulo-m #+# #+# */ /* Updated: 2021/02/07 16:37:46 by lpaulo-m ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> int main(void) { char string1[80] = "When I grow up, I wanna be indexed by a linked list!"; char string2[80] = "Don't forget to free up memory dawg."; char string3[80] = "Leaking all over the place, don't it bother you?."; char string4[80] = "Last call, hail mary presscott touchdown."; t_list *list; t_list *node1; t_list *node2; t_list *node3; t_list *node4; node1 = ft_lstnew(string1); node2 = ft_lstnew(string2); node3 = ft_lstnew(string3); node4 = ft_lstnew(string4); list = NULL; ft_lstadd_back(&list, node1); ft_lstadd_back(&list, node2); ft_lstadd_back(&list, node3); ft_lstadd_back(&list, node4); printf("%p\n", node1->next); printf("%p\n", node2->next); printf("%p\n", node3->next); printf("%p\n", node4->next); while (node1->next != NULL) { ft_putendl_fd((char *)(node1->content), 1); node1 = node1->next; } ft_putendl_fd("--------------", 1); return (0); }
752500.c
/* $OpenBSD: auth-passwd.c,v 1.43 2007/09/21 08:15:29 djm Exp $ */ /* * Author: Tatu Ylonen <[email protected]> * Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland * All rights reserved * Password authentication. This file contains the functions to check whether * the password is valid for the user. * * As far as I am concerned, the code I have written for this software * can be used freely for any purpose. Any derived versions of this * software must be clearly marked as such, and if the derived work is * incompatible with the protocol description in the RFC file, it must be * called by a name other than "ssh" or "Secure Shell". * * Copyright (c) 1999 Dug Song. All rights reserved. * Copyright (c) 2000 Markus Friedl. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR 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 "includes.h" #include <sys/types.h> #include <pwd.h> #include <stdio.h> #include <string.h> #include <stdarg.h> #include "packet.h" #include "buffer.h" #include "log.h" #include "servconf.h" #include "key.h" #include "hostfile.h" #include "auth.h" #include "auth-options.h" extern Buffer loginmsg; extern ServerOptions options; #ifdef HAVE_LOGIN_CAP extern login_cap_t *lc; #endif #define DAY (24L * 60 * 60) /* 1 day in seconds */ #define TWO_WEEKS (2L * 7 * DAY) /* 2 weeks in seconds */ void disable_forwarding(void) { no_port_forwarding_flag = 1; no_agent_forwarding_flag = 1; no_x11_forwarding_flag = 1; } /* * Tries to authenticate the user using password. Returns true if * authentication succeeds. */ int auth_password(Authctxt *authctxt, const char *password) { struct passwd * pw = authctxt->pw; int result, ok = authctxt->valid; #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) static int expire_checked = 0; #endif #ifndef HAVE_CYGWIN if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) ok = 0; #endif if (*password == '\0' && options.permit_empty_passwd == 0) return 0; #ifdef KRB5 if (options.kerberos_authentication == 1) { int ret = auth_krb5_password(authctxt, password); if (ret == 1 || ret == 0) return ret && ok; /* Fall back to ordinary passwd authentication. */ } #endif #ifdef HAVE_CYGWIN { HANDLE hToken = cygwin_logon_user(pw, password); if (hToken == INVALID_HANDLE_VALUE) return 0; cygwin_set_impersonation_token(hToken); return ok; } #endif #ifdef USE_PAM if (options.use_pam) return (sshpam_auth_passwd(authctxt, password) && ok); #endif #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) if (!expire_checked) { expire_checked = 1; if (auth_shadow_pwexpired(authctxt)) authctxt->force_pwchange = 1; } #endif result = sys_auth_passwd(authctxt, password); if (authctxt->force_pwchange) disable_forwarding(); return (result && ok); } #ifdef BSD_AUTH static void warn_expiry(Authctxt *authctxt, auth_session_t *as) { char buf[256]; quad_t pwtimeleft, actimeleft, daysleft, pwwarntime, acwarntime; pwwarntime = acwarntime = TWO_WEEKS; pwtimeleft = auth_check_change(as); actimeleft = auth_check_expire(as); #ifdef HAVE_LOGIN_CAP if (authctxt->valid) { pwwarntime = login_getcaptime(lc, "password-warn", TWO_WEEKS, TWO_WEEKS); acwarntime = login_getcaptime(lc, "expire-warn", TWO_WEEKS, TWO_WEEKS); } #endif if (pwtimeleft != 0 && pwtimeleft < pwwarntime) { daysleft = pwtimeleft / DAY + 1; snprintf(buf, sizeof(buf), "Your password will expire in %lld day%s.\n", daysleft, daysleft == 1 ? "" : "s"); buffer_append(&loginmsg, buf, strlen(buf)); } if (actimeleft != 0 && actimeleft < acwarntime) { daysleft = actimeleft / DAY + 1; snprintf(buf, sizeof(buf), "Your account will expire in %lld day%s.\n", daysleft, daysleft == 1 ? "" : "s"); buffer_append(&loginmsg, buf, strlen(buf)); } } int sys_auth_passwd(Authctxt *authctxt, const char *password) { struct passwd *pw = authctxt->pw; auth_session_t *as; static int expire_checked = 0; as = auth_usercheck(pw->pw_name, authctxt->style, "auth-ssh", (char *)password); if (as == NULL) return (0); if (auth_getstate(as) & AUTH_PWEXPIRED) { auth_close(as); disable_forwarding(); authctxt->force_pwchange = 1; return (1); } else { if (!expire_checked) { expire_checked = 1; warn_expiry(authctxt, as); } return (auth_close(as)); } } #elif !defined(CUSTOM_SYS_AUTH_PASSWD) int sys_auth_passwd(Authctxt *authctxt, const char *password) { struct passwd *pw = authctxt->pw; char *encrypted_password; /* Just use the supplied fake password if authctxt is invalid */ char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd; /* Check for users with no password. */ if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0) return (1); /* Encrypt the candidate password using the proper salt. */ encrypted_password = xcrypt(password, (pw_password[0] && pw_password[1]) ? pw_password : "xx"); /* * Authentication is accepted if the encrypted passwords * are identical. */ return encrypted_password != NULL && strcmp(encrypted_password, pw_password) == 0; } #endif
775246.c
#include <string.h> #include <stdlib.h> #include "nic_mem.h" #include "hash_table.h" #include "harmonia.h" /* * Hard-coded addresses */ static const uint32_t HARMONIA_ADDR = 0x0A0A01FF; /* * Global variables */ static msg_num_t counter; static sess_num_t sess_num; static uint32_t last_replica; #define N_REPLICAS 3 static concurrent_ht_t *modified_keys_completed = NULL; static concurrent_ht_t *modified_keys_started = NULL; static sync_pt_t sync_pt_completed; static sync_pt_t sync_pt_started; /* * Static function declarations */ static void convert_endian(void *dst, const void *src, size_t n); static uint64_t checksum(const void *buf, size_t n); static int init(); static packet_type_t match_harmonia_packet(uint64_t buf); static void process_ordered_multicast(uint64_t buf); static void process_sequencer(uint64_t buf); static int process_kv(uint64_t buf); /* * Static function definitions */ static void convert_endian(void *dst, const void *src, size_t n) { size_t i; uint8_t *dptr, *sptr; dptr = (uint8_t*)dst; sptr = (uint8_t*)src; for (i = 0; i < n; i++) { *(dptr + i) = *(sptr + n - i - 1); } } static uint64_t checksum(const void *buf, size_t n) { uint64_t sum; uint16_t *ptr = (uint16_t *)buf; size_t i; for (i = 0, sum = 0; i < (n / 2); i++) { sum += *ptr++; } sum = (sum >> 16) + (sum & 0xFFFF); sum += (sum >> 16); return ~sum; } static int init() { printf("Harmonia initializing...\n"); sess_num = 0; counter = 0; last_replica = 0; sync_pt_completed = 0; sync_pt_started = 0; if (modified_keys_completed != NULL) { concur_hashtable_free(modified_keys_completed); } modified_keys_completed = concur_hashtable_init(0); if (modified_keys_started != NULL) { concur_hashtable_free(modified_keys_started); } modified_keys_started = concur_hashtable_init(0); return 0; } static packet_type_t match_harmonia_packet(uint64_t buf) { if (*(uint32_t *)(buf + IP_DST) == HARMONIA_ADDR) { identifier_t identifier; convert_endian(&identifier, (const void *)(buf+APP_HEADER), sizeof(identifier_t)); if (identifier == HARMONIA_ID) { return ORDERED_MCAST; } else if (identifier == SEQUENCER_ID) { return SEQUENCER; } else { return UNKNOWN; } } else { return UNKNOWN; } } static void process_ordered_multicast(uint64_t buf) { udp_port_t udp_src = (1 << N_REPLICAS) - 1; int update_counter = 1; uint64_t ptr = buf + APP_HEADER; ptr += sizeof(identifier_t) + sizeof(meta_len_t); *(udp_port_t*)ptr = *(udp_port_t*)(buf+UDP_SRC); ptr += sizeof(udp_port_t); convert_endian((void*)ptr, &sess_num, sizeof(sess_num_t)); ptr += sizeof(sess_num_t); ptr += sizeof(ngroups_t) + sizeof(group_num_t); msg_num_t *msg_num = (msg_num_t *)ptr; ptr += sizeof(msg_num_t); appheader_len_t header_len; convert_endian(&header_len, (void*)ptr, sizeof(appheader_len_t)); if (header_len > 0) { ptr += sizeof(appheader_len_t); apptype_t apptype = *(apptype_t *)ptr; ptr += sizeof(apptype_t); if (apptype == APPTYPE_KV) { update_counter = process_kv(ptr); } } if (update_counter) { counter++; convert_endian((void*)msg_num, &counter, sizeof(msg_num_t)); } else { udp_src = 1 << last_replica; last_replica = (last_replica + 1) % N_REPLICAS; } *(udp_port_t*)(buf+UDP_SRC) = udp_src; *(uint16_t *)(buf + UDP_CKSUM) = 0; } static int process_kv(uint64_t buf) { ht_status ret; kvop_t *kvop = (kvop_t *)buf; buf += sizeof(kvop_t); // XXX Currently not using opid buf += sizeof(opid_t); char *key = (char *)buf; if (*kvop == KVOP_WRITE) { uint8_t val = 1; ret = concur_hashtable_insert(modified_keys_completed, key, &val, sizeof(uint8_t)); if (ret == HT_INSERT_FAILURE_TABLE_FULL) { printf("ERROR: failed to insert into modified_keys_sc\n"); } /* ret = concur_hashtable_insert(modified_keys_started, key, &val, sizeof(uint8_t)); if (ret == HT_INSERT_FAILURE_TABLE_FULL) { printf("ERROR: failed to insert into modified_keys_ss\n"); } */ return 1; } else if (*kvop == KVOP_READ) { uint8_t *val; size_t val_len; ret = concur_hashtable_find(modified_keys_completed, key, (void **)&val, &val_len); if (ret == HT_FOUND) { // Conflict detected! return 1; } else { // Safe to do single replica read *kvop = KVOP_READ_ONE; return 0; } } else { printf("ERROR: wrong KV packet format\n"); return 1; } } static void process_sequencer(uint64_t buf) { uint64_t ptr = buf + APP_HEADER + sizeof(identifier_t); seqtype_t type = *(seqtype_t *)ptr; ptr += sizeof(seqtype_t); if (type == SEQTYPE_RESET) { init(); } else if (type == SEQTYPE_BEG_SYNC) { if (modified_keys_started != NULL) { concur_hashtable_free(modified_keys_started); } modified_keys_started = concur_hashtable_init(0); convert_endian((void *)ptr, &counter, sizeof(msg_num_t)); sync_pt_started = counter; } else if (type == SEQTYPE_FIN_SYNC) { msg_num_t ts; convert_endian(&ts, (void *)ptr, sizeof(msg_num_t)); if (ts == sync_pt_started && ts != sync_pt_completed) { if (modified_keys_completed != NULL) { concur_hashtable_free(modified_keys_completed); } modified_keys_completed = modified_keys_started; modified_keys_started = concur_hashtable_init(0); sync_pt_completed = sync_pt_started; sync_pt_started = 0; } } else if (type == SEQTYPE_COMPLETE_SYNC) { nkeys_t nkeys; convert_endian(&nkeys, (void *)ptr, sizeof(nkeys_t)); ptr += sizeof(nkeys_t); nkeys_t i; for (i = 0; i < nkeys; i++) { char *key = (char *)ptr; concur_hashtable_delete(modified_keys_completed, key); ptr += strlen(key) + 1; } } } /* * Public function definitions */ int harmonia_init() { #ifdef USE_NIC_MEMORY nic_local_shared_mm_init(); #endif return init(); } void harmonia_packet_proc(uint64_t buf) { switch (match_harmonia_packet(buf)) { case ORDERED_MCAST: { process_ordered_multicast(buf); break; } case SEQUENCER: { process_sequencer(buf); break; } default: return; } }
274993.c
/* * Copyright (C) ST-Ericsson SA 2010 * * License Terms: GNU General Public License v2 * Author: Srinidhi Kasagar <[email protected]> * Author: Rabin Vincent <[email protected]> * Author: Mattias Wallin <[email protected]> */ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/irq.h> #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/mfd/core.h> #include <linux/mfd/abx500.h> #include <linux/mfd/abx500/ab8500.h> #include <linux/regulator/ab8500.h> /* * Interrupt register offsets * Bank : 0x0E */ #define AB8500_IT_SOURCE1_REG 0x00 #define AB8500_IT_SOURCE2_REG 0x01 #define AB8500_IT_SOURCE3_REG 0x02 #define AB8500_IT_SOURCE4_REG 0x03 #define AB8500_IT_SOURCE5_REG 0x04 #define AB8500_IT_SOURCE6_REG 0x05 #define AB8500_IT_SOURCE7_REG 0x06 #define AB8500_IT_SOURCE8_REG 0x07 #define AB9540_IT_SOURCE13_REG 0x0C #define AB8500_IT_SOURCE19_REG 0x12 #define AB8500_IT_SOURCE20_REG 0x13 #define AB8500_IT_SOURCE21_REG 0x14 #define AB8500_IT_SOURCE22_REG 0x15 #define AB8500_IT_SOURCE23_REG 0x16 #define AB8500_IT_SOURCE24_REG 0x17 /* * latch registers */ #define AB8500_IT_LATCH1_REG 0x20 #define AB8500_IT_LATCH2_REG 0x21 #define AB8500_IT_LATCH3_REG 0x22 #define AB8500_IT_LATCH4_REG 0x23 #define AB8500_IT_LATCH5_REG 0x24 #define AB8500_IT_LATCH6_REG 0x25 #define AB8500_IT_LATCH7_REG 0x26 #define AB8500_IT_LATCH8_REG 0x27 #define AB8500_IT_LATCH9_REG 0x28 #define AB8500_IT_LATCH10_REG 0x29 #define AB8500_IT_LATCH12_REG 0x2B #define AB9540_IT_LATCH13_REG 0x2C #define AB8500_IT_LATCH19_REG 0x32 #define AB8500_IT_LATCH20_REG 0x33 #define AB8500_IT_LATCH21_REG 0x34 #define AB8500_IT_LATCH22_REG 0x35 #define AB8500_IT_LATCH23_REG 0x36 #define AB8500_IT_LATCH24_REG 0x37 /* * mask registers */ #define AB8500_IT_MASK1_REG 0x40 #define AB8500_IT_MASK2_REG 0x41 #define AB8500_IT_MASK3_REG 0x42 #define AB8500_IT_MASK4_REG 0x43 #define AB8500_IT_MASK5_REG 0x44 #define AB8500_IT_MASK6_REG 0x45 #define AB8500_IT_MASK7_REG 0x46 #define AB8500_IT_MASK8_REG 0x47 #define AB8500_IT_MASK9_REG 0x48 #define AB8500_IT_MASK10_REG 0x49 #define AB8500_IT_MASK11_REG 0x4A #define AB8500_IT_MASK12_REG 0x4B #define AB8500_IT_MASK13_REG 0x4C #define AB8500_IT_MASK14_REG 0x4D #define AB8500_IT_MASK15_REG 0x4E #define AB8500_IT_MASK16_REG 0x4F #define AB8500_IT_MASK17_REG 0x50 #define AB8500_IT_MASK18_REG 0x51 #define AB8500_IT_MASK19_REG 0x52 #define AB8500_IT_MASK20_REG 0x53 #define AB8500_IT_MASK21_REG 0x54 #define AB8500_IT_MASK22_REG 0x55 #define AB8500_IT_MASK23_REG 0x56 #define AB8500_IT_MASK24_REG 0x57 #define AB8500_REV_REG 0x80 #define AB8500_IC_NAME_REG 0x82 #define AB8500_SWITCH_OFF_STATUS 0x00 #define AB8500_TURN_ON_STATUS 0x00 #define AB9540_MODEM_CTRL2_REG 0x23 #define AB9540_MODEM_CTRL2_SWDBBRSTN_BIT BIT(2) /* * Map interrupt numbers to the LATCH and MASK register offsets, Interrupt * numbers are indexed into this array with (num / 8). The interupts are * defined in linux/mfd/ab8500.h * * This is one off from the register names, i.e. AB8500_IT_MASK1_REG is at * offset 0. */ /* AB8500 support */ static const int ab8500_irq_regoffset[AB8500_NUM_IRQ_REGS] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 18, 19, 20, 21, }; /* AB9540 support */ static const int ab9540_irq_regoffset[AB9540_NUM_IRQ_REGS] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 18, 19, 20, 21, 12, 13, 24, }; static const char ab8500_version_str[][7] = { [AB8500_VERSION_AB8500] = "AB8500", [AB8500_VERSION_AB8505] = "AB8505", [AB8500_VERSION_AB9540] = "AB9540", [AB8500_VERSION_AB8540] = "AB8540", }; static int ab8500_get_chip_id(struct device *dev) { struct ab8500 *ab8500; if (!dev) return -EINVAL; ab8500 = dev_get_drvdata(dev->parent); return ab8500 ? (int)ab8500->chip_id : -EINVAL; } static int set_register_interruptible(struct ab8500 *ab8500, u8 bank, u8 reg, u8 data) { int ret; /* * Put the u8 bank and u8 register together into a an u16. * The bank on higher 8 bits and register in lower 8 bits. * */ u16 addr = ((u16)bank) << 8 | reg; dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data); mutex_lock(&ab8500->lock); ret = ab8500->write(ab8500, addr, data); if (ret < 0) dev_err(ab8500->dev, "failed to write reg %#x: %d\n", addr, ret); mutex_unlock(&ab8500->lock); return ret; } static int ab8500_set_register(struct device *dev, u8 bank, u8 reg, u8 value) { struct ab8500 *ab8500 = dev_get_drvdata(dev->parent); return set_register_interruptible(ab8500, bank, reg, value); } static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, u8 reg, u8 *value) { int ret; /* put the u8 bank and u8 reg together into a an u16. * bank on higher 8 bits and reg in lower */ u16 addr = ((u16)bank) << 8 | reg; mutex_lock(&ab8500->lock); ret = ab8500->read(ab8500, addr); if (ret < 0) dev_err(ab8500->dev, "failed to read reg %#x: %d\n", addr, ret); else *value = ret; mutex_unlock(&ab8500->lock); dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret); return ret; } static int ab8500_get_register(struct device *dev, u8 bank, u8 reg, u8 *value) { struct ab8500 *ab8500 = dev_get_drvdata(dev->parent); return get_register_interruptible(ab8500, bank, reg, value); } static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank, u8 reg, u8 bitmask, u8 bitvalues) { int ret; /* put the u8 bank and u8 reg together into a an u16. * bank on higher 8 bits and reg in lower */ u16 addr = ((u16)bank) << 8 | reg; mutex_lock(&ab8500->lock); if (ab8500->write_masked == NULL) { u8 data; ret = ab8500->read(ab8500, addr); if (ret < 0) { dev_err(ab8500->dev, "failed to read reg %#x: %d\n", addr, ret); goto out; } data = (u8)ret; data = (~bitmask & data) | (bitmask & bitvalues); ret = ab8500->write(ab8500, addr, data); if (ret < 0) dev_err(ab8500->dev, "failed to write reg %#x: %d\n", addr, ret); dev_vdbg(ab8500->dev, "mask: addr %#x => data %#x\n", addr, data); goto out; } ret = ab8500->write_masked(ab8500, addr, bitmask, bitvalues); if (ret < 0) dev_err(ab8500->dev, "failed to modify reg %#x: %d\n", addr, ret); out: mutex_unlock(&ab8500->lock); return ret; } static int ab8500_mask_and_set_register(struct device *dev, u8 bank, u8 reg, u8 bitmask, u8 bitvalues) { struct ab8500 *ab8500 = dev_get_drvdata(dev->parent); return mask_and_set_register_interruptible(ab8500, bank, reg, bitmask, bitvalues); } static struct abx500_ops ab8500_ops = { .get_chip_id = ab8500_get_chip_id, .get_register = ab8500_get_register, .set_register = ab8500_set_register, .get_register_page = NULL, .set_register_page = NULL, .mask_and_set_register = ab8500_mask_and_set_register, .event_registers_startup_state_get = NULL, .startup_irq_enabled = NULL, }; static void ab8500_irq_lock(struct irq_data *data) { struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data); mutex_lock(&ab8500->irq_lock); } static void ab8500_irq_sync_unlock(struct irq_data *data) { struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data); int i; for (i = 0; i < ab8500->mask_size; i++) { u8 old = ab8500->oldmask[i]; u8 new = ab8500->mask[i]; int reg; if (new == old) continue; /* * Interrupt register 12 doesn't exist prior to AB8500 version * 2.0 */ if (ab8500->irq_reg_offset[i] == 11 && is_ab8500_1p1_or_earlier(ab8500)) continue; ab8500->oldmask[i] = new; reg = AB8500_IT_MASK1_REG + ab8500->irq_reg_offset[i]; set_register_interruptible(ab8500, AB8500_INTERRUPT, reg, new); } mutex_unlock(&ab8500->irq_lock); } static void ab8500_irq_mask(struct irq_data *data) { struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data); int offset = data->irq - ab8500->irq_base; int index = offset / 8; int mask = 1 << (offset % 8); ab8500->mask[index] |= mask; } static void ab8500_irq_unmask(struct irq_data *data) { struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data); int offset = data->irq - ab8500->irq_base; int index = offset / 8; int mask = 1 << (offset % 8); ab8500->mask[index] &= ~mask; } static struct irq_chip ab8500_irq_chip = { .name = "ab8500", .irq_bus_lock = ab8500_irq_lock, .irq_bus_sync_unlock = ab8500_irq_sync_unlock, .irq_mask = ab8500_irq_mask, .irq_disable = ab8500_irq_mask, .irq_unmask = ab8500_irq_unmask, }; static irqreturn_t ab8500_irq(int irq, void *dev) { struct ab8500 *ab8500 = dev; int i; dev_vdbg(ab8500->dev, "interrupt\n"); for (i = 0; i < ab8500->mask_size; i++) { int regoffset = ab8500->irq_reg_offset[i]; int status; u8 value; /* * Interrupt register 12 doesn't exist prior to AB8500 version * 2.0 */ if (regoffset == 11 && is_ab8500_1p1_or_earlier(ab8500)) continue; status = get_register_interruptible(ab8500, AB8500_INTERRUPT, AB8500_IT_LATCH1_REG + regoffset, &value); if (status < 0 || value == 0) continue; do { int bit = __ffs(value); int line = i * 8 + bit; handle_nested_irq(ab8500->irq_base + line); value &= ~(1 << bit); } while (value); } return IRQ_HANDLED; } static int ab8500_irq_init(struct ab8500 *ab8500) { int base = ab8500->irq_base; int irq; int num_irqs; if (is_ab9540(ab8500)) num_irqs = AB9540_NR_IRQS; else if (is_ab8505(ab8500)) num_irqs = AB8505_NR_IRQS; else num_irqs = AB8500_NR_IRQS; for (irq = base; irq < base + num_irqs; irq++) { irq_set_chip_data(irq, ab8500); irq_set_chip_and_handler(irq, &ab8500_irq_chip, handle_simple_irq); irq_set_nested_thread(irq, 1); #ifdef CONFIG_ARM set_irq_flags(irq, IRQF_VALID); #else irq_set_noprobe(irq); #endif } return 0; } static void ab8500_irq_remove(struct ab8500 *ab8500) { int base = ab8500->irq_base; int irq; int num_irqs; if (is_ab9540(ab8500)) num_irqs = AB9540_NR_IRQS; else if (is_ab8505(ab8500)) num_irqs = AB8505_NR_IRQS; else num_irqs = AB8500_NR_IRQS; for (irq = base; irq < base + num_irqs; irq++) { #ifdef CONFIG_ARM set_irq_flags(irq, 0); #endif irq_set_chip_and_handler(irq, NULL, NULL); irq_set_chip_data(irq, NULL); } } /* AB8500 GPIO Resources */ static struct resource __devinitdata ab8500_gpio_resources[] = { { .name = "GPIO_INT6", .start = AB8500_INT_GPIO6R, .end = AB8500_INT_GPIO41F, .flags = IORESOURCE_IRQ, } }; /* AB9540 GPIO Resources */ static struct resource __devinitdata ab9540_gpio_resources[] = { { .name = "GPIO_INT6", .start = AB8500_INT_GPIO6R, .end = AB8500_INT_GPIO41F, .flags = IORESOURCE_IRQ, }, { .name = "GPIO_INT14", .start = AB9540_INT_GPIO50R, .end = AB9540_INT_GPIO54R, .flags = IORESOURCE_IRQ, }, { .name = "GPIO_INT15", .start = AB9540_INT_GPIO50F, .end = AB9540_INT_GPIO54F, .flags = IORESOURCE_IRQ, } }; static struct resource __devinitdata ab8500_gpadc_resources[] = { { .name = "HW_CONV_END", .start = AB8500_INT_GP_HW_ADC_CONV_END, .end = AB8500_INT_GP_HW_ADC_CONV_END, .flags = IORESOURCE_IRQ, }, { .name = "SW_CONV_END", .start = AB8500_INT_GP_SW_ADC_CONV_END, .end = AB8500_INT_GP_SW_ADC_CONV_END, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_rtc_resources[] = { { .name = "60S", .start = AB8500_INT_RTC_60S, .end = AB8500_INT_RTC_60S, .flags = IORESOURCE_IRQ, }, { .name = "ALARM", .start = AB8500_INT_RTC_ALARM, .end = AB8500_INT_RTC_ALARM, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_poweronkey_db_resources[] = { { .name = "ONKEY_DBF", .start = AB8500_INT_PON_KEY1DB_F, .end = AB8500_INT_PON_KEY1DB_F, .flags = IORESOURCE_IRQ, }, { .name = "ONKEY_DBR", .start = AB8500_INT_PON_KEY1DB_R, .end = AB8500_INT_PON_KEY1DB_R, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_av_acc_detect_resources[] = { { .name = "ACC_DETECT_1DB_F", .start = AB8500_INT_ACC_DETECT_1DB_F, .end = AB8500_INT_ACC_DETECT_1DB_F, .flags = IORESOURCE_IRQ, }, { .name = "ACC_DETECT_1DB_R", .start = AB8500_INT_ACC_DETECT_1DB_R, .end = AB8500_INT_ACC_DETECT_1DB_R, .flags = IORESOURCE_IRQ, }, { .name = "ACC_DETECT_21DB_F", .start = AB8500_INT_ACC_DETECT_21DB_F, .end = AB8500_INT_ACC_DETECT_21DB_F, .flags = IORESOURCE_IRQ, }, { .name = "ACC_DETECT_21DB_R", .start = AB8500_INT_ACC_DETECT_21DB_R, .end = AB8500_INT_ACC_DETECT_21DB_R, .flags = IORESOURCE_IRQ, }, { .name = "ACC_DETECT_22DB_F", .start = AB8500_INT_ACC_DETECT_22DB_F, .end = AB8500_INT_ACC_DETECT_22DB_F, .flags = IORESOURCE_IRQ, }, { .name = "ACC_DETECT_22DB_R", .start = AB8500_INT_ACC_DETECT_22DB_R, .end = AB8500_INT_ACC_DETECT_22DB_R, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_charger_resources[] = { { .name = "MAIN_CH_UNPLUG_DET", .start = AB8500_INT_MAIN_CH_UNPLUG_DET, .end = AB8500_INT_MAIN_CH_UNPLUG_DET, .flags = IORESOURCE_IRQ, }, { .name = "MAIN_CHARGE_PLUG_DET", .start = AB8500_INT_MAIN_CH_PLUG_DET, .end = AB8500_INT_MAIN_CH_PLUG_DET, .flags = IORESOURCE_IRQ, }, { .name = "VBUS_DET_R", .start = AB8500_INT_VBUS_DET_R, .end = AB8500_INT_VBUS_DET_R, .flags = IORESOURCE_IRQ, }, { .name = "VBUS_DET_F", .start = AB8500_INT_VBUS_DET_F, .end = AB8500_INT_VBUS_DET_F, .flags = IORESOURCE_IRQ, }, { .name = "USB_LINK_STATUS", .start = AB8500_INT_USB_LINK_STATUS, .end = AB8500_INT_USB_LINK_STATUS, .flags = IORESOURCE_IRQ, }, { .name = "VBUS_OVV", .start = AB8500_INT_VBUS_OVV, .end = AB8500_INT_VBUS_OVV, .flags = IORESOURCE_IRQ, }, { .name = "USB_CH_TH_PROT_R", .start = AB8500_INT_USB_CH_TH_PROT_R, .end = AB8500_INT_USB_CH_TH_PROT_R, .flags = IORESOURCE_IRQ, }, { .name = "USB_CH_TH_PROT_F", .start = AB8500_INT_USB_CH_TH_PROT_F, .end = AB8500_INT_USB_CH_TH_PROT_F, .flags = IORESOURCE_IRQ, }, { .name = "MAIN_EXT_CH_NOT_OK", .start = AB8500_INT_MAIN_EXT_CH_NOT_OK, .end = AB8500_INT_MAIN_EXT_CH_NOT_OK, .flags = IORESOURCE_IRQ, }, { .name = "MAIN_CH_TH_PROT_R", .start = AB8500_INT_MAIN_CH_TH_PROT_R, .end = AB8500_INT_MAIN_CH_TH_PROT_R, .flags = IORESOURCE_IRQ, }, { .name = "MAIN_CH_TH_PROT_F", .start = AB8500_INT_MAIN_CH_TH_PROT_F, .end = AB8500_INT_MAIN_CH_TH_PROT_F, .flags = IORESOURCE_IRQ, }, { .name = "USB_CHARGER_NOT_OKR", .start = AB8500_INT_USB_CHARGER_NOT_OKR, .end = AB8500_INT_USB_CHARGER_NOT_OKR, .flags = IORESOURCE_IRQ, }, { .name = "CH_WD_EXP", .start = AB8500_INT_CH_WD_EXP, .end = AB8500_INT_CH_WD_EXP, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_btemp_resources[] = { { .name = "BAT_CTRL_INDB", .start = AB8500_INT_BAT_CTRL_INDB, .end = AB8500_INT_BAT_CTRL_INDB, .flags = IORESOURCE_IRQ, }, { .name = "BTEMP_LOW", .start = AB8500_INT_BTEMP_LOW, .end = AB8500_INT_BTEMP_LOW, .flags = IORESOURCE_IRQ, }, { .name = "BTEMP_HIGH", .start = AB8500_INT_BTEMP_HIGH, .end = AB8500_INT_BTEMP_HIGH, .flags = IORESOURCE_IRQ, }, { .name = "BTEMP_LOW_MEDIUM", .start = AB8500_INT_BTEMP_LOW_MEDIUM, .end = AB8500_INT_BTEMP_LOW_MEDIUM, .flags = IORESOURCE_IRQ, }, { .name = "BTEMP_MEDIUM_HIGH", .start = AB8500_INT_BTEMP_MEDIUM_HIGH, .end = AB8500_INT_BTEMP_MEDIUM_HIGH, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_fg_resources[] = { { .name = "NCONV_ACCU", .start = AB8500_INT_CCN_CONV_ACC, .end = AB8500_INT_CCN_CONV_ACC, .flags = IORESOURCE_IRQ, }, { .name = "BATT_OVV", .start = AB8500_INT_BATT_OVV, .end = AB8500_INT_BATT_OVV, .flags = IORESOURCE_IRQ, }, { .name = "LOW_BAT_F", .start = AB8500_INT_LOW_BAT_F, .end = AB8500_INT_LOW_BAT_F, .flags = IORESOURCE_IRQ, }, { .name = "LOW_BAT_R", .start = AB8500_INT_LOW_BAT_R, .end = AB8500_INT_LOW_BAT_R, .flags = IORESOURCE_IRQ, }, { .name = "CC_INT_CALIB", .start = AB8500_INT_CC_INT_CALIB, .end = AB8500_INT_CC_INT_CALIB, .flags = IORESOURCE_IRQ, }, { .name = "CCEOC", .start = AB8500_INT_CCEOC, .end = AB8500_INT_CCEOC, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_chargalg_resources[] = {}; #ifdef CONFIG_DEBUG_FS static struct resource __devinitdata ab8500_debug_resources[] = { { .name = "IRQ_FIRST", .start = AB8500_INT_MAIN_EXT_CH_NOT_OK, .end = AB8500_INT_MAIN_EXT_CH_NOT_OK, .flags = IORESOURCE_IRQ, }, { .name = "IRQ_LAST", .start = AB8500_INT_XTAL32K_KO, .end = AB8500_INT_XTAL32K_KO, .flags = IORESOURCE_IRQ, }, }; #endif static struct resource __devinitdata ab8500_usb_resources[] = { { .name = "ID_WAKEUP_R", .start = AB8500_INT_ID_WAKEUP_R, .end = AB8500_INT_ID_WAKEUP_R, .flags = IORESOURCE_IRQ, }, { .name = "ID_WAKEUP_F", .start = AB8500_INT_ID_WAKEUP_F, .end = AB8500_INT_ID_WAKEUP_F, .flags = IORESOURCE_IRQ, }, { .name = "VBUS_DET_F", .start = AB8500_INT_VBUS_DET_F, .end = AB8500_INT_VBUS_DET_F, .flags = IORESOURCE_IRQ, }, { .name = "VBUS_DET_R", .start = AB8500_INT_VBUS_DET_R, .end = AB8500_INT_VBUS_DET_R, .flags = IORESOURCE_IRQ, }, { .name = "USB_LINK_STATUS", .start = AB8500_INT_USB_LINK_STATUS, .end = AB8500_INT_USB_LINK_STATUS, .flags = IORESOURCE_IRQ, }, { .name = "USB_ADP_PROBE_PLUG", .start = AB8500_INT_ADP_PROBE_PLUG, .end = AB8500_INT_ADP_PROBE_PLUG, .flags = IORESOURCE_IRQ, }, { .name = "USB_ADP_PROBE_UNPLUG", .start = AB8500_INT_ADP_PROBE_UNPLUG, .end = AB8500_INT_ADP_PROBE_UNPLUG, .flags = IORESOURCE_IRQ, }, }; static struct resource __devinitdata ab8500_temp_resources[] = { { .name = "AB8500_TEMP_WARM", .start = AB8500_INT_TEMP_WARM, .end = AB8500_INT_TEMP_WARM, .flags = IORESOURCE_IRQ, }, }; static struct mfd_cell __devinitdata abx500_common_devs[] = { #ifdef CONFIG_DEBUG_FS { .name = "ab8500-debug", .num_resources = ARRAY_SIZE(ab8500_debug_resources), .resources = ab8500_debug_resources, }, #endif { .name = "ab8500-sysctrl", }, { .name = "ab8500-regulator", }, { .name = "ab8500-gpadc", .num_resources = ARRAY_SIZE(ab8500_gpadc_resources), .resources = ab8500_gpadc_resources, }, { .name = "ab8500-rtc", .num_resources = ARRAY_SIZE(ab8500_rtc_resources), .resources = ab8500_rtc_resources, }, { .name = "ab8500-charger", .num_resources = ARRAY_SIZE(ab8500_charger_resources), .resources = ab8500_charger_resources, }, { .name = "ab8500-btemp", .num_resources = ARRAY_SIZE(ab8500_btemp_resources), .resources = ab8500_btemp_resources, }, { .name = "ab8500-fg", .num_resources = ARRAY_SIZE(ab8500_fg_resources), .resources = ab8500_fg_resources, }, { .name = "ab8500-chargalg", .num_resources = ARRAY_SIZE(ab8500_chargalg_resources), .resources = ab8500_chargalg_resources, }, { .name = "ab8500-acc-det", .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources), .resources = ab8500_av_acc_detect_resources, }, { .name = "ab8500-codec", }, { .name = "ab8500-poweron-key", .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources), .resources = ab8500_poweronkey_db_resources, }, { .name = "ab8500-pwm", .id = 1, }, { .name = "ab8500-pwm", .id = 2, }, { .name = "ab8500-pwm", .id = 3, }, { .name = "ab8500-leds", }, { .name = "ab8500-denc", }, { .name = "ab8500-temp", .num_resources = ARRAY_SIZE(ab8500_temp_resources), .resources = ab8500_temp_resources, }, }; static struct mfd_cell __devinitdata ab8500_devs[] = { { .name = "ab8500-gpio", .num_resources = ARRAY_SIZE(ab8500_gpio_resources), .resources = ab8500_gpio_resources, }, { .name = "ab8500-usb", .num_resources = ARRAY_SIZE(ab8500_usb_resources), .resources = ab8500_usb_resources, }, }; static struct mfd_cell __devinitdata ab9540_devs[] = { { .name = "ab8500-gpio", .num_resources = ARRAY_SIZE(ab9540_gpio_resources), .resources = ab9540_gpio_resources, }, { .name = "ab9540-usb", .num_resources = ARRAY_SIZE(ab8500_usb_resources), .resources = ab8500_usb_resources, }, }; static ssize_t show_chip_id(struct device *dev, struct device_attribute *attr, char *buf) { struct ab8500 *ab8500; ab8500 = dev_get_drvdata(dev); return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL); } /* * ab8500 has switched off due to (SWITCH_OFF_STATUS): * 0x01 Swoff bit programming * 0x02 Thermal protection activation * 0x04 Vbat lower then BattOk falling threshold * 0x08 Watchdog expired * 0x10 Non presence of 32kHz clock * 0x20 Battery level lower than power on reset threshold * 0x40 Power on key 1 pressed longer than 10 seconds * 0x80 DB8500 thermal shutdown */ static ssize_t show_switch_off_status(struct device *dev, struct device_attribute *attr, char *buf) { int ret; u8 value; struct ab8500 *ab8500; ab8500 = dev_get_drvdata(dev); ret = get_register_interruptible(ab8500, AB8500_RTC, AB8500_SWITCH_OFF_STATUS, &value); if (ret < 0) return ret; return sprintf(buf, "%#x\n", value); } /* * ab8500 has turned on due to (TURN_ON_STATUS): * 0x01 PORnVbat * 0x02 PonKey1dbF * 0x04 PonKey2dbF * 0x08 RTCAlarm * 0x10 MainChDet * 0x20 VbusDet * 0x40 UsbIDDetect * 0x80 Reserved */ static ssize_t show_turn_on_status(struct device *dev, struct device_attribute *attr, char *buf) { int ret; u8 value; struct ab8500 *ab8500; ab8500 = dev_get_drvdata(dev); ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK, AB8500_TURN_ON_STATUS, &value); if (ret < 0) return ret; return sprintf(buf, "%#x\n", value); } static ssize_t show_ab9540_dbbrstn(struct device *dev, struct device_attribute *attr, char *buf) { struct ab8500 *ab8500; int ret; u8 value; ab8500 = dev_get_drvdata(dev); ret = get_register_interruptible(ab8500, AB8500_REGU_CTRL2, AB9540_MODEM_CTRL2_REG, &value); if (ret < 0) return ret; return sprintf(buf, "%d\n", (value & AB9540_MODEM_CTRL2_SWDBBRSTN_BIT) ? 1 : 0); } static ssize_t store_ab9540_dbbrstn(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ab8500 *ab8500; int ret = count; int err; u8 bitvalues; ab8500 = dev_get_drvdata(dev); if (count > 0) { switch (buf[0]) { case '0': bitvalues = 0; break; case '1': bitvalues = AB9540_MODEM_CTRL2_SWDBBRSTN_BIT; break; default: goto exit; } err = mask_and_set_register_interruptible(ab8500, AB8500_REGU_CTRL2, AB9540_MODEM_CTRL2_REG, AB9540_MODEM_CTRL2_SWDBBRSTN_BIT, bitvalues); if (err) dev_info(ab8500->dev, "Failed to set DBBRSTN %c, err %#x\n", buf[0], err); } exit: return ret; } static DEVICE_ATTR(chip_id, S_IRUGO, show_chip_id, NULL); static DEVICE_ATTR(switch_off_status, S_IRUGO, show_switch_off_status, NULL); static DEVICE_ATTR(turn_on_status, S_IRUGO, show_turn_on_status, NULL); static DEVICE_ATTR(dbbrstn, S_IRUGO | S_IWUSR, show_ab9540_dbbrstn, store_ab9540_dbbrstn); static struct attribute *ab8500_sysfs_entries[] = { &dev_attr_chip_id.attr, &dev_attr_switch_off_status.attr, &dev_attr_turn_on_status.attr, NULL, }; static struct attribute *ab9540_sysfs_entries[] = { &dev_attr_chip_id.attr, &dev_attr_switch_off_status.attr, &dev_attr_turn_on_status.attr, &dev_attr_dbbrstn.attr, NULL, }; static struct attribute_group ab8500_attr_group = { .attrs = ab8500_sysfs_entries, }; static struct attribute_group ab9540_attr_group = { .attrs = ab9540_sysfs_entries, }; int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version) { struct ab8500_platform_data *plat = dev_get_platdata(ab8500->dev); int ret; int i; u8 value; if (plat) ab8500->irq_base = plat->irq_base; mutex_init(&ab8500->lock); mutex_init(&ab8500->irq_lock); if (version != AB8500_VERSION_UNDEFINED) ab8500->version = version; else { ret = get_register_interruptible(ab8500, AB8500_MISC, AB8500_IC_NAME_REG, &value); if (ret < 0) return ret; ab8500->version = value; } ret = get_register_interruptible(ab8500, AB8500_MISC, AB8500_REV_REG, &value); if (ret < 0) return ret; ab8500->chip_id = value; dev_info(ab8500->dev, "detected chip, %s rev. %1x.%1x\n", ab8500_version_str[ab8500->version], ab8500->chip_id >> 4, ab8500->chip_id & 0x0F); /* Configure AB8500 or AB9540 IRQ */ if (is_ab9540(ab8500) || is_ab8505(ab8500)) { ab8500->mask_size = AB9540_NUM_IRQ_REGS; ab8500->irq_reg_offset = ab9540_irq_regoffset; } else { ab8500->mask_size = AB8500_NUM_IRQ_REGS; ab8500->irq_reg_offset = ab8500_irq_regoffset; } ab8500->mask = kzalloc(ab8500->mask_size, GFP_KERNEL); if (!ab8500->mask) return -ENOMEM; ab8500->oldmask = kzalloc(ab8500->mask_size, GFP_KERNEL); if (!ab8500->oldmask) { ret = -ENOMEM; goto out_freemask; } /* * ab8500 has switched off due to (SWITCH_OFF_STATUS): * 0x01 Swoff bit programming * 0x02 Thermal protection activation * 0x04 Vbat lower then BattOk falling threshold * 0x08 Watchdog expired * 0x10 Non presence of 32kHz clock * 0x20 Battery level lower than power on reset threshold * 0x40 Power on key 1 pressed longer than 10 seconds * 0x80 DB8500 thermal shutdown */ ret = get_register_interruptible(ab8500, AB8500_RTC, AB8500_SWITCH_OFF_STATUS, &value); if (ret < 0) return ret; dev_info(ab8500->dev, "switch off status: %#x", value); if (plat && plat->init) plat->init(ab8500); /* Clear and mask all interrupts */ for (i = 0; i < ab8500->mask_size; i++) { /* * Interrupt register 12 doesn't exist prior to AB8500 version * 2.0 */ if (ab8500->irq_reg_offset[i] == 11 && is_ab8500_1p1_or_earlier(ab8500)) continue; get_register_interruptible(ab8500, AB8500_INTERRUPT, AB8500_IT_LATCH1_REG + ab8500->irq_reg_offset[i], &value); set_register_interruptible(ab8500, AB8500_INTERRUPT, AB8500_IT_MASK1_REG + ab8500->irq_reg_offset[i], 0xff); } ret = abx500_register_ops(ab8500->dev, &ab8500_ops); if (ret) goto out_freeoldmask; for (i = 0; i < ab8500->mask_size; i++) ab8500->mask[i] = ab8500->oldmask[i] = 0xff; if (ab8500->irq_base) { ret = ab8500_irq_init(ab8500); if (ret) goto out_freeoldmask; ret = request_threaded_irq(ab8500->irq, NULL, ab8500_irq, IRQF_ONESHOT | IRQF_NO_SUSPEND, "ab8500", ab8500); if (ret) goto out_removeirq; } ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs, ARRAY_SIZE(abx500_common_devs), NULL, ab8500->irq_base); if (ret) goto out_freeirq; if (is_ab9540(ab8500)) ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, ARRAY_SIZE(ab9540_devs), NULL, ab8500->irq_base); else ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, ARRAY_SIZE(ab9540_devs), NULL, ab8500->irq_base); if (ret) goto out_freeirq; if (is_ab9540(ab8500)) ret = sysfs_create_group(&ab8500->dev->kobj, &ab9540_attr_group); else ret = sysfs_create_group(&ab8500->dev->kobj, &ab8500_attr_group); if (ret) dev_err(ab8500->dev, "error creating sysfs entries\n"); else return ret; out_freeirq: if (ab8500->irq_base) free_irq(ab8500->irq, ab8500); out_removeirq: if (ab8500->irq_base) ab8500_irq_remove(ab8500); out_freeoldmask: kfree(ab8500->oldmask); out_freemask: kfree(ab8500->mask); return ret; } int __devexit ab8500_exit(struct ab8500 *ab8500) { if (is_ab9540(ab8500)) sysfs_remove_group(&ab8500->dev->kobj, &ab9540_attr_group); else sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group); mfd_remove_devices(ab8500->dev); if (ab8500->irq_base) { free_irq(ab8500->irq, ab8500); ab8500_irq_remove(ab8500); } kfree(ab8500->oldmask); kfree(ab8500->mask); return 0; } MODULE_AUTHOR("Mattias Wallin, Srinidhi Kasagar, Rabin Vincent"); MODULE_DESCRIPTION("AB8500 MFD core"); MODULE_LICENSE("GPL v2");
42064.c
/* * flow2ascii.c * * Copyright (c) 2018 Merit Network, Inc. * Copyright (c) 2012 The Regents of the University of California. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <getopt.h> #include <endian.h> #include <arpa/inet.h> #include <flowtuple.h> /* long getopt options */ static const struct option long_opts[] = { { "help", no_argument, NULL, 'h' }, { "octet", optional_argument, NULL, 'o' }, { NULL, 0, NULL, 0 }, }; /* print header object */ void header_print(flowtuple_header_t *header) { const char *traceuri; const uint32_t *plugins; uint16_t plugin_count; printf("# CORSARO_VERSION %d.%d\n", flowtuple_header_get_version_major(header), flowtuple_header_get_version_minor(header)); printf("# CORSARO_INITTIME %d\n", ntohl(flowtuple_header_get_local_init_time(header))); printf("# CORSARO_INTERVAL %d\n", ntohs(flowtuple_header_get_interval_length(header))); traceuri = flowtuple_header_get_traceuri(header); if (traceuri != NULL) { printf("# CORSARO_TRACEURI %s\n", traceuri); } plugin_count = flowtuple_header_get_plugin_count(header); plugins = flowtuple_header_get_plugins(header); for (int i = 0; i < plugin_count; i++) { /* really, there's only one expected plugin */ /* not true, ...... */ if (plugins[i] == FLOWTUPLE_MAGIC_SIXT || plugins[i] == FLOWTUPLE_MAGIC_SIXU) { printf("# CORSARO_PLUGIN flowtuple\n"); } else if (plugins[i] == 0x414E4F4E) { printf("# CORSARO_PLUGIN anon\n"); } } } /* print interval object */ void interval_print(flowtuple_interval_t *interval, int is_start) { char *tails[] = { "_END", "_START" }; printf("# CORSARO_INTERVAL%s %d %d\n", tails[is_start], ntohs(flowtuple_interval_get_number(interval)), ntohl(flowtuple_interval_get_time(interval))); } /* print trailer object */ void trailer_print(flowtuple_trailer_t *trailer) { uint64_t ac = be64toh(flowtuple_trailer_get_accepted_count(trailer)); uint64_t dc = be64toh(flowtuple_trailer_get_dropped_count(trailer)); printf("# CORSARO_PACKETCNT %"PRIu64"\n", be64toh(flowtuple_trailer_get_packet_count(trailer))); if (ac != UINT64_MAX) { printf("# CORSARO_ACCEPTEDCNT %"PRIu64"\n", ac); } if (dc != UINT64_MAX) { printf("# CORSARO_DROPPEDCNT %"PRIu64"\n", dc); } printf("# CORSARO_FIRSTPKT %d\n", ntohl(flowtuple_trailer_get_first_packet_time(trailer))); printf("# CORSARO_LASTPKT %d\n", ntohl(flowtuple_trailer_get_last_packet_time(trailer))); printf("# CORSARO_FINALTIME %d\n", ntohl(flowtuple_trailer_get_local_final_time(trailer))); printf("# CORSARO_RUNTIME %d\n", ntohl(flowtuple_trailer_get_runtime(trailer))); } /* print class object */ void class_print(flowtuple_class_t *ftclass, int is_start) { char *starts[] = { "END", "START" }; char *class_types[] = { "flowtuple_backscatter", "flowtuple_icmpreq", "flowtuple_other" }; if (is_start) { printf("%s %s %d\n", starts[is_start], class_types[flowtuple_class_get_class_type(ftclass)], ntohl(flowtuple_class_get_key_count(ftclass))); } else { printf("%s %s\n", starts[is_start], class_types[flowtuple_class_get_class_type(ftclass)]); } } /* print data object */ void data_print(flowtuple_data_t *data, uint8_t first_octet) { uint8_t src_ip[4]; uint8_t dst_ip[4]; *(uint32_t*)(dst_ip) = flowtuple_data_get_dest_ip(data); if (flowtuple_data_is_slash_eight(data)) { dst_ip[0] = first_octet; } *(uint32_t*)(src_ip) = flowtuple_data_get_src_ip(data); printf("%u.%u.%u.%u|%u.%u.%u.%u|%u|%u|%u|%u|0x%02x|%u,%u\n", src_ip[0], src_ip[1], src_ip[2], src_ip[3], dst_ip[0], dst_ip[1], dst_ip[2], dst_ip[3], ntohs(flowtuple_data_get_src_port(data)), ntohs(flowtuple_data_get_dest_port(data)), flowtuple_data_get_protocol(data), flowtuple_data_get_ttl(data), flowtuple_data_get_tcp_flags(data), ntohs(flowtuple_data_get_ip_len(data)), ntohl(flowtuple_data_get_packet_count(data))); } void process_record(flowtuple_record_t *record, void *args) { int *iargs = (int*)args; flowtuple_record_type_t type = flowtuple_record_get_type(record); void *data; switch (type) { case FLOWTUPLE_RECORD_TYPE_FLOWTUPLE_CLASS: data = (void*)flowtuple_record_get_class(record); class_print((flowtuple_class_t*)data, iargs[1]); iargs[1] = !iargs[1]; break; case FLOWTUPLE_RECORD_TYPE_FLOWTUPLE_DATA: data = (void*)flowtuple_record_get_data(record); data_print((flowtuple_data_t*)data, (uint8_t)iargs[2]); break; case FLOWTUPLE_RECORD_TYPE_HEADER: data = (void*)flowtuple_record_get_header(record); header_print((flowtuple_header_t*)data); break; case FLOWTUPLE_RECORD_TYPE_TRAILER: data = (void*)flowtuple_record_get_trailer(record); trailer_print((flowtuple_trailer_t*)data); break; case FLOWTUPLE_RECORD_TYPE_INTERVAL: data = (void*)flowtuple_record_get_interval(record); interval_print((flowtuple_interval_t*)data, iargs[0]); iargs[0] = !iargs[0]; break; case FLOWTUPLE_RECORD_TYPE_NULL: default: break; } } /* print usage */ void usage(const char *program_name) { printf("Usage: %s [-o octet] inputfile\n", program_name); } int main(int argc, char **argv) { flowtuple_handle_t *h; /* handle */ flowtuple_errno_t errno; /* errors */ char *filename = NULL; /* file name */ int trackers[] = { 1, 1, 0 }; /* is interval start, is class start, first octet */ int c; /* getopt option */ char *tmp; /* getopt tmp string */ /* we expect arguments, always */ if (argc < 2) { usage(argv[0]); return -1; } while ((c = getopt_long(argc, argv, ":ho:", long_opts, NULL)) != -1) { switch (c) { case 'h': /* help */ usage(argv[0]); return 0; case 'o': /* octet */ if (optarg != NULL) { trackers[2] = (int)strtol(optarg, &tmp, 10); } else { fprintf(stderr, "option --octet requires an integer option\n"); usage(argv[0]); return -1; } if (trackers[2] == 0 && strcmp(tmp, "") != 0) { fprintf(stderr, "option -o requires an integer option\n"); usage(argv[0]); return -1; } if (trackers[2] < 0 || trackers[2] > 255) { fprintf(stderr, "ERROR: octet must be between 0 and 255\n"); return -1; } break; case '?': if (optopt == 'o') { usage(argv[0]); return -1; } default: usage(argv[0]); return -1; } } /* get non-getopt options */ for (int index = optind; index < argc; index++) { if (filename != NULL) { break; } filename = argv[optind]; optind++; } /* initialize flowtuple handle */ h = flowtuple_initialize(filename, &errno); /* loop through records */ flowtuple_loop(h, -1, process_record, (void*)trackers); errno = errno == FLOWTUPLE_ERR_OK ? flowtuple_errno(h) : errno; if (errno != FLOWTUPLE_ERR_OK) { fprintf(stderr, "ERROR: %s\n", flowtuple_strerr(errno)); } flowtuple_release(h); return errno; }
535014.c
/* v3_prn.c */ /* * Written by Dr Stephen N Henson ([email protected]) for the OpenSSL project * 1999. */ /* ==================================================================== * Copyright (c) 1999 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 * [email protected]. * * 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 * ([email protected]). This product includes software written by Tim * Hudson ([email protected]). */ /* X509 v3 extension utilities */ #include <stdio.h> #include <CCryptoBoringSSL_bio.h> #include <CCryptoBoringSSL_conf.h> #include <CCryptoBoringSSL_mem.h> #include <CCryptoBoringSSL_x509v3.h> /* Extension printing routines */ static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent, int supported); /* Print out a name+value stack */ void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml) { size_t i; CONF_VALUE *nval; if (!val) return; if (!ml || !sk_CONF_VALUE_num(val)) { BIO_printf(out, "%*s", indent, ""); if (!sk_CONF_VALUE_num(val)) BIO_puts(out, "<EMPTY>\n"); } for (i = 0; i < sk_CONF_VALUE_num(val); i++) { if (ml) BIO_printf(out, "%*s", indent, ""); else if (i > 0) BIO_printf(out, ", "); nval = sk_CONF_VALUE_value(val, i); if (!nval->name) BIO_puts(out, nval->value); else if (!nval->value) BIO_puts(out, nval->name); else BIO_printf(out, "%s:%s", nval->name, nval->value); if (ml) BIO_puts(out, "\n"); } } /* Main routine: print out a general extension */ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent) { void *ext_str = NULL; char *value = NULL; const X509V3_EXT_METHOD *method; STACK_OF(CONF_VALUE) *nval = NULL; int ok = 1; if (!(method = X509V3_EXT_get(ext))) return unknown_ext_print(out, ext, flag, indent, 0); const ASN1_STRING *ext_data = X509_EXTENSION_get_data(ext); const unsigned char *p = ASN1_STRING_get0_data(ext_data); if (method->it) { ext_str = ASN1_item_d2i(NULL, &p, ASN1_STRING_length(ext_data), ASN1_ITEM_ptr(method->it)); } else { ext_str = method->d2i(NULL, &p, ASN1_STRING_length(ext_data)); } if (!ext_str) return unknown_ext_print(out, ext, flag, indent, 1); if (method->i2s) { if (!(value = method->i2s(method, ext_str))) { ok = 0; goto err; } BIO_printf(out, "%*s%s", indent, "", value); } else if (method->i2v) { if (!(nval = method->i2v(method, ext_str, NULL))) { ok = 0; goto err; } X509V3_EXT_val_prn(out, nval, indent, method->ext_flags & X509V3_EXT_MULTILINE); } else if (method->i2r) { if (!method->i2r(method, ext_str, out, indent)) ok = 0; } else ok = 0; err: sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); if (value) OPENSSL_free(value); if (method->it) ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it)); else method->ext_free(ext_str); return ok; } int X509V3_extensions_print(BIO *bp, const char *title, const STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent) { size_t i; int j; if (sk_X509_EXTENSION_num(exts) <= 0) return 1; if (title) { BIO_printf(bp, "%*s%s:\n", indent, "", title); indent += 4; } for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { ASN1_OBJECT *obj; X509_EXTENSION *ex; ex = sk_X509_EXTENSION_value(exts, i); if (indent && BIO_printf(bp, "%*s", indent, "") <= 0) return 0; obj = X509_EXTENSION_get_object(ex); i2a_ASN1_OBJECT(bp, obj); j = X509_EXTENSION_get_critical(ex); if (BIO_printf(bp, ": %s\n", j ? "critical" : "") <= 0) return 0; if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) { BIO_printf(bp, "%*s", indent + 4, ""); ASN1_STRING_print(bp, X509_EXTENSION_get_data(ex)); } if (BIO_write(bp, "\n", 1) <= 0) return 0; } return 1; } static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent, int supported) { switch (flag & X509V3_EXT_UNKNOWN_MASK) { case X509V3_EXT_DEFAULT: return 0; case X509V3_EXT_ERROR_UNKNOWN: if (supported) BIO_printf(out, "%*s<Parse Error>", indent, ""); else BIO_printf(out, "%*s<Not Supported>", indent, ""); return 1; case X509V3_EXT_PARSE_UNKNOWN: case X509V3_EXT_DUMP_UNKNOWN: { const ASN1_STRING *data = X509_EXTENSION_get_data(ext); return BIO_hexdump(out, ASN1_STRING_get0_data(data), ASN1_STRING_length(data), indent); } default: return 1; } } int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) { BIO *bio_tmp; int ret; if (!(bio_tmp = BIO_new_fp(fp, BIO_NOCLOSE))) return 0; ret = X509V3_EXT_print(bio_tmp, ext, flag, indent); BIO_free(bio_tmp); return ret; }
794488.c
#include "sdcard.h" #include "delay.h" // SD card parameters SDCard_TypeDef SDCard; // Initialize the SDIO GPIO lines void SD_GPIO_Init(void) { // Enable the SDIO corresponding GPIO peripherals RCC->AHB2ENR |= SDIO_GPIO_PERIPH; // Configure SDIO GPIO pins // SDIO_CMD GPIO_set_mode(SDIO_GPIO_CMD_PORT, GPIO_Mode_AF, GPIO_PUPD_PU, SDIO_GPIO_CMD_PIN); GPIO_af_cfg(SDIO_GPIO_CMD_PORT, SDIO_GPIO_CMD_SRC, SDIO_GPIO_AF); GPIO_out_cfg(SDIO_GPIO_CMD_PORT, GPIO_OT_PP, GPIO_SPD_HIGH, SDIO_GPIO_CMD_PIN); // SDIO_CK GPIO_set_mode(SDIO_GPIO_CK_PORT, GPIO_Mode_AF, GPIO_PUPD_PU, SDIO_GPIO_CK_PIN); GPIO_af_cfg(SDIO_GPIO_CK_PORT, SDIO_GPIO_CK_SRC, SDIO_GPIO_AF); GPIO_out_cfg(SDIO_GPIO_CK_PORT, GPIO_OT_PP, GPIO_SPD_HIGH, SDIO_GPIO_CK_PIN); // SDIO_D0 GPIO_set_mode(SDIO_GPIO_D0_PORT, GPIO_Mode_AF, GPIO_PUPD_PU, SDIO_GPIO_D0_PIN); GPIO_af_cfg(SDIO_GPIO_D0_PORT, SDIO_GPIO_D0_SRC, SDIO_GPIO_AF); GPIO_out_cfg(SDIO_GPIO_D0_PORT, GPIO_OT_PP, GPIO_SPD_HIGH, SDIO_GPIO_D0_PIN); #if (SDIO_USE_4BIT) // SDIO_D1 GPIO_set_mode(SDIO_GPIO_D1_PORT, GPIO_Mode_AF, GPIO_PUPD_PU, SDIO_GPIO_D1_PIN); GPIO_af_cfg(SDIO_GPIO_D1_PORT, SDIO_GPIO_D1_SRC, SDIO_GPIO_AF); GPIO_out_cfg(SDIO_GPIO_D1_PORT, GPIO_OT_PP, GPIO_SPD_HIGH, SDIO_GPIO_D1_PIN); // SDIO_D2 GPIO_set_mode(SDIO_GPIO_D2_PORT, GPIO_Mode_AF, GPIO_PUPD_PU, SDIO_GPIO_D2_PIN); GPIO_af_cfg(SDIO_GPIO_D2_PORT, SDIO_GPIO_D2_SRC, SDIO_GPIO_AF); GPIO_out_cfg(SDIO_GPIO_D2_PORT, GPIO_OT_PP, GPIO_SPD_HIGH, SDIO_GPIO_D2_PIN); // SDIO_D3 GPIO_set_mode(SDIO_GPIO_D3_PORT, GPIO_Mode_AF, GPIO_PUPD_PU, SDIO_GPIO_D3_PIN); GPIO_af_cfg(SDIO_GPIO_D3_PORT, SDIO_GPIO_D3_SRC, SDIO_GPIO_AF); GPIO_out_cfg(SDIO_GPIO_D3_PORT, GPIO_OT_PP, GPIO_SPD_HIGH, SDIO_GPIO_D3_PIN); #endif // SDIO_USE_4BIT } // De-initialize the SDIO GPIO lines to its default state void SD_GPIO_DeInit(void) { // SDIO CMD, CK, D0 GPIO_set_mode(SDIO_GPIO_CMD_PORT, GPIO_Mode_AN, GPIO_PUPD_NONE, SDIO_GPIO_CMD_PIN); GPIO_set_mode(SDIO_GPIO_CK_PORT, GPIO_Mode_AN, GPIO_PUPD_NONE, SDIO_GPIO_CK_PIN); GPIO_set_mode(SDIO_GPIO_D0_PORT, GPIO_Mode_AN, GPIO_PUPD_NONE, SDIO_GPIO_D0_PIN); #if (SDIO_USE_4BIT) // SDIO D1, D2, D3 GPIO_set_mode(SDIO_GPIO_D1_PORT, GPIO_Mode_AN, GPIO_PUPD_NONE, SDIO_GPIO_D1_PIN); GPIO_set_mode(SDIO_GPIO_D2_PORT, GPIO_Mode_AN, GPIO_PUPD_NONE, SDIO_GPIO_D2_PIN); GPIO_set_mode(SDIO_GPIO_D3_PORT, GPIO_Mode_AN, GPIO_PUPD_NONE, SDIO_GPIO_D3_PIN); #endif // SDIO_USE_4BIT } // Configure the SDIO peripheral void SD_SDIO_Init(void) { // Enable the SDIO peripheral RCC->APB2ENR |= RCC_APB2ENR_SDMMC1EN; // Reset the SDIO peripheral RCC->APB2RSTR |= RCC_APB2RSTR_SDMMC1RST; RCC->APB2RSTR &= ~RCC_APB2RSTR_SDMMC1RST; // Configure SDIO peripheral clock: // - rising edge of SDIOCLK // - bus: 1-bit // - power saving: enabled // - SDIOCLK bypass: disabled // - clock speed: 400kHz (SDMMC_CLK_DIV_INIT) // - HW flow control: enabled // - clock: enabled SDMMC1->CLKCR = SD_BUS_1BIT | SD_CLK_DIV_INIT | SDMMC_CLKCR_CLKEN | SDMMC_CLKCR_PWRSAV | SDMMC_CLKCR_HWFC_EN; } // De-initialize the SDIO peripheral void SD_SDIO_DeInit(void) { // Disable SDIO clock and then peripheral SDMMC1->POWER = SD_PWR_OFF; // Disable the SDIO peripheral RCC->APB2ENR &= ~RCC_APB2ENR_SDMMC1EN; } // Send command to SD card // input: // cmd - SD card command // arg - argument for command (32-bit) // resp_type - response type, one of SD_RESP_xx values static void SD_Cmd(uint8_t cmd, uint32_t arg, uint32_t resp_type) { // Clear command flags SDMMC1->ICR = SDIO_ICR_CMD; // Program an argument for command SDMMC1->ARG = arg; // Program command value and response type, enable CPSM SDMMC1->CMD = cmd | resp_type | SDMMC_CMD_CPSMEN; } // Check R1 response // input: // cmd - the sent command // return: SDResult static SDResult SD_GetR1Resp(uint8_t cmd) { volatile uint32_t wait = SD_CMD_TIMEOUT; uint32_t respR1; // Wait for response, error or timeout while (!(SDMMC1->STA & (SDMMC_STA_CCRCFAIL | SDMMC_STA_CMDREND | SDMMC_STA_CTIMEOUT)) && --wait); // Timeout? if ((SDMMC1->STA & SDMMC_STA_CTIMEOUT) && (wait == 0)) { SDMMC1->ICR = SDMMC_ICR_CTIMEOUTC; return SDR_Timeout; } // CRC fail? if (SDMMC1->STA & SDMMC_STA_CCRCFAIL) { SDMMC1->ICR = SDMMC_ICR_CCRCFAILC; return SDR_CRCError; } // Illegal command? if (SDMMC1->RESPCMD != cmd) { return SDR_IllegalCommand; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; // Get a R1 response and analyze it for errors respR1 = SDMMC1->RESP1; if (!(respR1 & SD_OCR_ALL_ERRORS)) { return SDR_Success; } if (respR1 & SD_OCR_OUT_OF_RANGE) { return SDR_AddrOutOfRange; } if (respR1 & SD_OCR_ADDRESS_ERROR) { return SDR_AddrMisaligned; } if (respR1 & SD_OCR_BLOCK_LEN_ERROR) { return SDR_BlockLenError; } if (respR1 & SD_OCR_ERASE_SEQ_ERROR) { return SDR_EraseSeqError; } if (respR1 & SD_OCR_ERASE_PARAM) { return SDR_EraseParam; } if (respR1 & SD_OCR_WP_VIOLATION) { return SDR_WPViolation; } if (respR1 & SD_OCR_LOCK_UNLOCK_FAILED) { return SDR_LockUnlockFailed; } if (respR1 & SD_OCR_COM_CRC_ERROR) { return SDR_ComCRCError; } if (respR1 & SD_OCR_ILLEGAL_COMMAND) { return SDR_IllegalCommand; } if (respR1 & SD_OCR_CARD_ECC_FAILED) { return SDR_CardECCFailed; } if (respR1 & SD_OCR_CC_ERROR) { return SDR_CCError; } if (respR1 & SD_OCR_ERROR) { return SDR_GeneralError; } if (respR1 & SD_OCR_STREAM_R_UNDERRUN) { return SDR_StreamUnderrun; } if (respR1 & SD_OCR_STREAM_W_OVERRUN) { return SDR_StreamOverrun; } if (respR1 & SD_OCR_CSD_OVERWRITE) { return SDR_CSDOverwrite; } if (respR1 & SD_OCR_WP_ERASE_SKIP) { return SDR_WPEraseSkip; } if (respR1 & SD_OCR_CARD_ECC_DISABLED) { return SDR_ECCDisabled; } if (respR1 & SD_OCR_ERASE_RESET) { return SDR_EraseReset; } if (respR1 & SD_OCR_AKE_SEQ_ERROR) { return SDR_AKESeqError; } return SDR_Success; } // Check R2 response // input: // pBuf - pointer to the data buffer to store the R2 response // return: SDResult value static SDResult SD_GetR2Resp(uint32_t *pBuf) { volatile uint32_t wait = SD_CMD_TIMEOUT; // Wait for response, error or timeout while (!(SDMMC1->STA & (SDMMC_STA_CCRCFAIL | SDMMC_STA_CMDREND | SDMMC_STA_CTIMEOUT)) && --wait); // Timeout? if ((SDMMC1->STA & SDMMC_STA_CTIMEOUT) && (wait == 0)) { SDMMC1->ICR = SDMMC_ICR_CTIMEOUTC; return SDR_Timeout; } // CRC fail? if (SDMMC1->STA & SDMMC_STA_CCRCFAIL) { SDMMC1->ICR = SDMMC_ICR_CCRCFAILC; return SDR_CRCError; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; // SDMMC_RESP[1..4] registers contains the R2 response #ifdef __GNUC__ // Use GCC built-in intrinsics (fastest, less code) (GCC v4.3 or later) *pBuf++ = __builtin_bswap32(SDMMC1->RESP1); *pBuf++ = __builtin_bswap32(SDMMC1->RESP2); *pBuf++ = __builtin_bswap32(SDMMC1->RESP3); *pBuf = __builtin_bswap32(SDMMC1->RESP4); #else // Use ARM 'REV' instruction (fast, a bit bigger code than GCC intrinsics) *pBuf++ = __REV(SDMMC1->RESP1); *pBuf++ = __REV(SDMMC1->RESP2); *pBuf++ = __REV(SDMMC1->RESP3); *pBuf = __REV(SDMMC1->RESP4); /* // Use SHIFT, AND and OR (slower, biggest code) *pBuf++ = SWAP_UINT32(SDMMC1->RESP1); *pBuf++ = SWAP_UINT32(SDMMC1->RESP2); *pBuf++ = SWAP_UINT32(SDMMC1->RESP3); *pBuf = SWAP_UINT32(SDMMC1->RESP4); */ #endif return SDR_Success; } // Check R3 response // return: SDResult value static SDResult SD_GetR3Resp(void) { volatile uint32_t wait = SD_CMD_TIMEOUT; // Wait for response, error or timeout while (!(SDMMC1->STA & (SDMMC_STA_CCRCFAIL | SDMMC_STA_CMDREND | SDMMC_STA_CTIMEOUT)) && --wait); // Timeout? if ((SDMMC1->STA & SDMMC_STA_CTIMEOUT) && (wait == 0)) { SDMMC1->ICR = SDMMC_ICR_CTIMEOUTC; return SDR_Timeout; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; return SDR_Success; } // Check R6 response (RCA) // return: SDResult value static SDResult SD_GetR6Resp(uint8_t cmd, uint16_t *pRCA) { volatile uint32_t wait = SD_CMD_TIMEOUT; uint32_t respR6; // Wait for response, error or timeout while (!(SDMMC1->STA & (SDMMC_STA_CCRCFAIL | SDMMC_STA_CMDREND | SDMMC_STA_CTIMEOUT)) && --wait); // Timeout? if ((SDMMC1->STA & SDMMC_STA_CTIMEOUT) && (wait == 0)) { SDMMC1->ICR = SDMMC_ICR_CTIMEOUTC; return SDR_Timeout; } // CRC fail? if (SDMMC1->STA & SDMMC_STA_CCRCFAIL) { SDMMC1->ICR = SDMMC_ICR_CCRCFAILC; return SDR_CRCError; } // Illegal command? if (SDMMC1->RESPCMD != cmd) { return SDR_IllegalCommand; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; // Get a R6 response and analyze it for errors respR6 = SDMMC1->RESP1; if (!(respR6 & (SD_R6_ILLEGAL_CMD | SD_R6_GENERAL_UNKNOWN_ERROR | SD_R6_COM_CRC_FAILED))) { *pRCA = (uint16_t)(respR6 >> 16); return SDR_Success; } if (respR6 & SD_R6_GENERAL_UNKNOWN_ERROR) { return SDR_UnknownError; } if (respR6 & SD_R6_ILLEGAL_CMD) { return SDR_IllegalCommand; } if (respR6 & SD_R6_COM_CRC_FAILED) { return SDR_ComCRCError; } return SDR_Success; } // Check R7 response // return: SDResult value static SDResult SD_GetR7Resp(void) { volatile uint32_t wait = SD_CMD_TIMEOUT; // Wait for response, error or timeout while (!(SDMMC1->STA & (SDMMC_STA_CCRCFAIL | SDMMC_STA_CMDREND | SDMMC_STA_CTIMEOUT)) && --wait); // Timeout? if ((SDMMC1->STA & SDMMC_STA_CTIMEOUT) || (wait == 0)) { SDMMC1->ICR = SDMMC_ICR_CTIMEOUTC; return SDR_Timeout; } // Clear command response received flag if (SDMMC1->STA & SDMMC_STA_CMDREND) { SDMMC1->ICR = SDMMC_ICR_CMDRENDC; return SDR_Success; } return SDR_NoResponse; } // Retrieve the SD card SCR register value // input: // pSCR - pointer to the buffer for SCR register (8 bytes) // return: SDResult value // note: card must be in transfer mode, not supported by MMC static SDResult SD_GetSCR(uint32_t *pSCR) { SDResult cmd_res; // Set block size to 8 bytes SD_Cmd(SD_CMD_SET_BLOCKLEN, 8, SD_RESP_SHORT); // CMD16 cmd_res = SD_GetR1Resp(SD_CMD_SET_BLOCKLEN); if (cmd_res != SDR_Success) { return cmd_res; } // Send leading command for ACMD<n> command SD_Cmd(SD_CMD_APP_CMD, SDCard.RCA << 16, SD_RESP_SHORT); // CMD55 cmd_res = SD_GetR1Resp(SD_CMD_APP_CMD); if (cmd_res != SDR_Success) { return cmd_res; } // Clear the data flags SDMMC1->ICR = SDIO_ICR_DATA; // Configure the SDIO data transfer SDMMC1->DTIMER = SD_DATA_R_TIMEOUT; // Data read timeout SDMMC1->DLEN = 8; // Data length in bytes // Data transfer: // - type: block // - direction: card -> controller // - size: 2^3 = 8bytes // - DPSM: enabled SDMMC1->DCTRL = SDMMC_DCTRL_DTDIR | (3 << 4) | SDMMC_DCTRL_DTEN; // Send SEND_SCR command SD_Cmd(SD_CMD_SEND_SCR, 0, SD_RESP_SHORT); // ACMD51 cmd_res = SD_GetR1Resp(SD_CMD_SEND_SCR); if (cmd_res != SDR_Success) { return cmd_res; } // Receive the SCR register value while (!(SDMMC1->STA & (SDMMC_STA_RXOVERR | SDMMC_STA_DCRCFAIL | SDMMC_STA_DTIMEOUT | SDMMC_STA_DBCKEND | SDMMC_STA_STBITERR))) { // Read word when data available in receive FIFO if (SDMMC1->STA & SDMMC_STA_RXDAVL) *pSCR++ = SDMMC1->FIFO; } // Check for errors if (SDMMC1->STA & (SDMMC_STA_DTIMEOUT | SDMMC_STA_DCRCFAIL | SDMMC_STA_RXOVERR | SDMMC_STA_STBITERR)) { if (SDMMC1->STA & SDMMC_STA_DTIMEOUT) { cmd_res = SDR_DataTimeout; } if (SDMMC1->STA & SDMMC_STA_DCRCFAIL) { cmd_res = SDR_DataCRCFail; } if (SDMMC1->STA & SDMMC_STA_RXOVERR) { cmd_res = SDR_RXOverrun; } if (SDMMC1->STA & SDMMC_STA_STBITERR) { cmd_res = SDR_StartBitError; } } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; return cmd_res; } // Set block size of the SD card // input: // block_size - block length // return: SDResult value SDResult SD_SetBlockSize(uint32_t block_size) { // Send SET_BLOCKLEN command SD_Cmd(SD_CMD_SET_BLOCKLEN, block_size, SD_RESP_SHORT); // CMD16 return SD_GetR1Resp(SD_CMD_SET_BLOCKLEN); } // Initialize the SD card // return: SDResult value // note: SDIO peripheral clock must be on and SDIO GPIO configured SDResult SD_Init(void) { volatile uint32_t wait; uint32_t sd_type = SD_STD_CAPACITY; // SD card capacity SDResult cmd_res; // Populate SDCard structure with default values SDCard = (SDCard_TypeDef){0}; SDCard.Type = SDCT_UNKNOWN; // Enable the SDIO clock SDMMC1->POWER = SD_PWR_ON; // CMD0 wait = SD_CMD_TIMEOUT; SD_Cmd(SD_CMD_GO_IDLE_STATE, 0x00, SD_RESP_NONE); while (!(SDMMC1->STA & (SDMMC_STA_CTIMEOUT | SDMMC_STA_CMDSENT)) && --wait); if ((SDMMC1->STA & SDMMC_STA_CTIMEOUT) || !wait) { return SDR_Timeout; } // CMD8: SEND_IF_COND. Send this command to verify SD card interface operating condition // Argument: - [31:12]: Reserved (shall be set to '0') // - [11:08]: Supply Voltage (VHS) 0x1 (Range: 2.7-3.6 V) // - [07:00]: Check Pattern (recommended 0xAA) SD_Cmd(SD_CMD_HS_SEND_EXT_CSD, SD_CHECK_PATTERN, SD_RESP_SHORT); // CMD8 cmd_res = SD_GetR7Resp(); if (cmd_res == SDR_Success) { // SD v2.0 or later // Check echo-back of check pattern if ((SDMMC1->RESP1 & 0x01FF) != (SD_CHECK_PATTERN & 0x01FF)) { return SDR_Unsupported; } sd_type = SD_HIGH_CAPACITY; // SD v2.0 or later // Issue ACMD41 command wait = SD_ACMD41_TRIALS; while (--wait) { // Send leading command for ACMD<n> command SD_Cmd(SD_CMD_APP_CMD, 0, SD_RESP_SHORT); // CMD55 with RCA 0 cmd_res = SD_GetR1Resp(SD_CMD_APP_CMD); if (cmd_res != SDR_Success) { return cmd_res; } // ACMD41 - initiate initialization process. // Set 3.0-3.3V voltage window (bit 20) // Set HCS bit (30) (Host Capacity Support) to inform card what host support high capacity // Set XPC bit (28) (SDXC Power Control) to use maximum performance (SDXC only) SD_Cmd(SD_CMD_SD_SEND_OP_COND, SD_OCR_VOLTAGE | sd_type, SD_RESP_SHORT); cmd_res = SD_GetR3Resp(); if (cmd_res != SDR_Success) { return cmd_res; } if (SDMMC1->RESP1 & (1 << 31)) { // The SD card has finished the power-up sequence break; } } if (wait == 0) { // Unsupported voltage range return SDR_InvalidVoltage; } // This is SDHC/SDXC card? SDCard.Type = (SDMMC1->RESP1 & SD_HIGH_CAPACITY) ? SDCT_SDHC : SDCT_SDSC_V2; } else if (cmd_res == SDR_Timeout) { // SD v1.x or MMC // Issue CMD55 to reset 'Illegal command' bit of the SD card SD_Cmd(SD_CMD_APP_CMD, 0, SD_RESP_SHORT); // CMD55 with RCA 0 SD_GetR1Resp(SD_CMD_APP_CMD); // Issue ACMD41 command with zero argument wait = SD_ACMD41_TRIALS; while (--wait) { // Send leading command for ACMD<n> command SD_Cmd(SD_CMD_APP_CMD, 0, SD_RESP_SHORT); // CMD55 with RCA 0 cmd_res = SD_GetR1Resp(SD_CMD_APP_CMD); if (cmd_res != SDR_Success) { return cmd_res; } // Send ACMD41 - initiate initialization process (bit HCS = 0) SD_Cmd(SD_CMD_SD_SEND_OP_COND, SD_OCR_VOLTAGE, SD_RESP_SHORT); // ACMD41 cmd_res = SD_GetR3Resp(); if (cmd_res == SDR_Timeout) { // MMC will not respond to this command break; } if (cmd_res != SDR_Success) { return cmd_res; } if (SDMMC1->RESP1 & (1 << 31)) { // The SD card has finished the power-up sequence break; } } if (wait == 0) { // Unknown/Unsupported card type return SDR_UnknownCard; } if (cmd_res != SDR_Timeout) { // SD v1.x SDCard.Type = SDCT_SDSC_V1; // SDv1 } else { // MMC or not SD memory card //////////////////////////////////////////////////////////////// // This part has not been tested due to lack of MMCmicro card // //////////////////////////////////////////////////////////////// wait = SD_ACMD41_TRIALS; while (--wait) { // Issue CMD1: initiate initialization process. SD_Cmd(SD_CMD_SEND_OP_COND, SD_OCR_VOLTAGE, SD_RESP_SHORT); // CMD1 cmd_res = SD_GetR3Resp(); if (cmd_res != SDR_Success) { return cmd_res; } if (SDMMC1->RESP1 & (1 << 31)) { // The SD card has finished the power-up sequence break; } } if (wait == 0) { return SDR_UnknownCard; } SDCard.Type = SDCT_MMC; // MMC } } else { return cmd_res; } // Now the CMD2 and CMD3 commands should be issued in cycle until timeout to enumerate all cards on the bus // Since this module suitable to work with single card, issue this commands one time only // Send ALL_SEND_CID command SD_Cmd(SD_CMD_ALL_SEND_CID, 0, SD_RESP_LONG); // CMD2 cmd_res = SD_GetR2Resp((uint32_t *)SDCard.CID); // response is a value of the CID/CSD register if (cmd_res != SDR_Success) { return cmd_res; } if (SDCard.Type != SDCT_MMC) { // Send SEND_REL_ADDR command to ask the SD card to publish a new RCA (Relative Card Address) // Once the RCA is received the card state changes to the stand-by state SD_Cmd(SD_CMD_SEND_REL_ADDR, 0, SD_RESP_SHORT); // CMD3 cmd_res = SD_GetR6Resp(SD_CMD_SEND_REL_ADDR, (uint16_t *)(&SDCard.RCA)); if (cmd_res != SDR_Success) { return cmd_res; } } else { //////////////////////////////////////////////////////////////// // This part has not been tested due to lack of MMCmicro card // //////////////////////////////////////////////////////////////// // For MMC card host should set a RCA value to the card by SET_REL_ADDR command SD_Cmd(SD_CMD_SEND_REL_ADDR, SDIO_MMC_RCA << 16, SD_RESP_SHORT); // CMD3 cmd_res = SD_GetR1Resp(SD_CMD_SEND_REL_ADDR); if (cmd_res != SDR_Success) { return cmd_res; } SDCard.RCA = SDIO_MMC_RCA; } // Send SEND_CSD command to retrieve CSD register from the card SD_Cmd(SD_CMD_SEND_CSD, SDCard.RCA << 16, SD_RESP_LONG); // CMD9 cmd_res = SD_GetR2Resp((uint32_t *)SDCard.CSD); if (cmd_res != SDR_Success) { return cmd_res; } // Parse the values of CID and CSD registers SD_GetCardInfo(); // Now card must be in stand-by mode, from this point it is possible to increase bus speed SD_SetBusClock(SD_CLK_DIV_TRAN); // Put the SD card to the transfer mode SD_Cmd(SD_CMD_SEL_DESEL_CARD, SDCard.RCA << 16, SD_RESP_SHORT); // CMD7 cmd_res = SD_GetR1Resp(SD_CMD_SEL_DESEL_CARD); // In fact R1b response here if (cmd_res != SDR_Success) { return cmd_res; } // Disable the pull-up resistor on CD/DAT3 pin of card // Send leading command for ACMD<n> command SD_Cmd(SD_CMD_APP_CMD, SDCard.RCA << 16, SD_RESP_SHORT); // CMD55 cmd_res = SD_GetR1Resp(SD_CMD_APP_CMD); if (cmd_res != SDR_Success) { return cmd_res; } // Send SET_CLR_CARD_DETECT command SD_Cmd(SD_CMD_SET_CLR_CARD_DETECT, 0, SD_RESP_SHORT); // ACMD42 cmd_res = SD_GetR1Resp(SD_CMD_SET_CLR_CARD_DETECT); if (cmd_res != SDR_Success) { return cmd_res; } // Read the SCR register if (SDCard.Type != SDCT_MMC) { // MMC card doesn't support this feature // Warning: this function set block size to 8 bytes SD_GetSCR((uint32_t *)SDCard.SCR); } // For SDv1, SDv2 and MMC card must set block size // The SDHC/SDXC always have fixed block size (512 bytes) if ((SDCard.Type == SDCT_SDSC_V1) || (SDCard.Type == SDCT_SDSC_V2) || (SDCard.Type == SDCT_MMC)) { SD_Cmd(SD_CMD_SET_BLOCKLEN, 512, SD_RESP_SHORT); // CMD16 cmd_res = SD_GetR1Resp(SD_CMD_SET_BLOCKLEN); if (cmd_res != SDR_Success) { return SDR_SetBlockSizeFailed; } } return SDR_Success; } // Set SDIO bus width // input: // BW - bus width (one of SDIO_BUS_xBIT constants) // return: SDResult // note: card must be in TRAN state and not locked, otherwise it will respond with 'illegal command' SDResult SD_SetBusWidth(uint32_t BW) { SDResult cmd_res = SDR_Success; uint32_t clk; if (SDCard.Type != SDCT_MMC) { // Send leading command for ACMD<n> command SD_Cmd(SD_CMD_APP_CMD, SDCard.RCA << 16, SD_RESP_SHORT); // CMD55 cmd_res = SD_GetR1Resp(SD_CMD_APP_CMD); if (cmd_res != SDR_Success) { return cmd_res; } // Send SET_BUS_WIDTH command clk = (BW == SD_BUS_1BIT) ? 0x00000000 : 0x00000002; SD_Cmd(SD_CMD_SET_BUS_WIDTH, clk, SD_RESP_SHORT); // ACMD6 cmd_res = SD_GetR1Resp(SD_CMD_SET_BUS_WIDTH); if (cmd_res != SDR_Success) { return cmd_res; } } else { // MMC supports only 8-bit ? } // Configure new bus width clk = SDMMC1->CLKCR; clk &= ~SDMMC_CLKCR_WIDBUS; clk |= (BW & SDMMC_CLKCR_WIDBUS); SDMMC1->CLKCR = clk; return cmd_res; } // Set SDIO bus clock // input: // clk_div - bus clock divider (0x00..0xff -> bus_clock = SDIOCLK / (clk_div + 2)) void SD_SetBusClock(uint32_t clk_div) { uint32_t clk; clk = SDMMC1->CLKCR; clk &= ~SDMMC_CLKCR_CLKDIV; clk |= (clk_div & SDMMC_CLKCR_CLKDIV); SDMMC1->CLKCR = clk; } // Parse information about specific card // note: CSD/CID register values already must be in the SDCard structure void SD_GetCardInfo(void) { uint32_t dev_size; uint32_t dev_size_mul; // Parse the CSD register SDCard.CSDVer = SDCard.CSD[0] >> 6; // CSD version if (SDCard.Type != SDCT_MMC) { // SD SDCard.MaxBusClkFreq = SDCard.CSD[3]; if (SDCard.CSDVer == 0) { // CSD v1.00 (SDSCv1, SDSCv2) dev_size = (uint32_t)(SDCard.CSD[6] & 0x03) << 10; // Device size dev_size |= (uint32_t)SDCard.CSD[7] << 2; dev_size |= (SDCard.CSD[8] & 0xc0) >> 6; dev_size_mul = (SDCard.CSD[ 9] & 0x03) << 1; // Device size multiplier dev_size_mul |= (SDCard.CSD[10] & 0x80) >> 7; SDCard.BlockCount = dev_size + 1; SDCard.BlockCount *= 1 << (dev_size_mul + 2); SDCard.BlockSize = 1 << (SDCard.CSD[5] & 0x0f); // Maximum read data block length } else { // CSD v2.00 (SDHC, SDXC) dev_size = (SDCard.CSD[7] & 0x3f) << 16; dev_size |= SDCard.CSD[8] << 8; dev_size |= SDCard.CSD[9]; // C_SIZE SDCard.BlockSize = 512; SDCard.BlockCount = dev_size + 1; // BlockCount >= 65535 means that this is SDXC card } SDCard.Capacity = SDCard.BlockCount * SDCard.BlockSize; } else { // MMC SDCard.MaxBusClkFreq = SDCard.CSD[3]; dev_size = (uint32_t)(SDCard.CSD[6] & 0x03) << 8; // C_SIZE dev_size += (uint32_t)SDCard.CSD[7]; dev_size <<= 2; dev_size += SDCard.CSD[8] >> 6; SDCard.BlockSize = 1 << (SDCard.CSD[5] & 0x0f); // MMC read block length dev_size_mul = ((SDCard.CSD[9] & 0x03) << 1) + ((SDCard.CSD[10] & 0x80) >> 7); SDCard.BlockCount = (dev_size + 1) * (1 << (dev_size_mul + 2)); SDCard.Capacity = SDCard.BlockCount * SDCard.BlockSize; } // Parse the CID register if (SDCard.Type != SDCT_MMC) { // SD card SDCard.MID = SDCard.CID[0]; SDCard.OID = (SDCard.CID[1] << 8) | SDCard.CID[2]; SDCard.PNM[0] = SDCard.CID[3]; SDCard.PNM[1] = SDCard.CID[4]; SDCard.PNM[2] = SDCard.CID[5]; SDCard.PNM[3] = SDCard.CID[6]; SDCard.PNM[4] = SDCard.CID[7]; SDCard.PRV = SDCard.CID[8]; SDCard.PSN = (SDCard.CID[9] << 24) | (SDCard.CID[10] << 16) | (SDCard.CID[11] << 8) | SDCard.CID[12]; SDCard.MDT = ((SDCard.CID[13] << 8) | SDCard.CID[14]) & 0x0fff; } else { // MMC SDCard.MID = 0x00; SDCard.OID = 0x0000; SDCard.PNM[0] = '*'; SDCard.PNM[1] = 'M'; SDCard.PNM[2] = 'M'; SDCard.PNM[3] = 'C'; SDCard.PNM[4] = '*'; SDCard.PRV = 0; SDCard.PSN = 0x00000000; SDCard.MDT = 0x0000; } } // Issue SWITCH_FUNC command (CMD6) // input: // argument - 32-bit argument for the command, refer to SD specification for description // resp - pointer to the buffer for response (should be 64 bytes long) // return: SDResult // note: command response is a contents of the CCCR register (512bit or 64bytes) SDResult SD_CmdSwitch(uint32_t argument, uint8_t *resp) { uint32_t *ptr = (uint32_t *)resp; SDResult res = SDR_Success; // SD specification says that response size is always 512bits, // thus there is no need to set block size before issuing CMD6 // Clear the data flags SDMMC1->ICR = SDIO_ICR_DATA; // Data read timeout SDMMC1->DTIMER = SD_DATA_R_TIMEOUT; // Data length in bytes SDMMC1->DLEN = 64; // Data transfer: // transfer mode: block // direction: to card // DMA: enabled // block size: 2^6 = 64 bytes // DPSM: enabled SDMMC1->DCTRL = SDMMC_DCTRL_DTDIR | (6 << 4) | SDMMC_DCTRL_DTEN; // Send SWITCH_FUNCTION command // Argument: // [31]: MODE: 1 for switch, 0 for check // [30:24]: reserved, all should be '0' // [23:20]: GRP6 - reserved // [19:16]: GRP5 - reserved // [15:12]: GRP4 - power limit // [11:08]: GRP3 - driver strength // [07:04]: GRP2 - command system // [03:00]: GRP1 - access mode (a.k.a. bus speed mode) // Values for groups 6..2: // 0xF: no influence // 0x0: default SD_Cmd(SD_CMD_SWITCH_FUNC, argument, SD_RESP_SHORT); // CMD6 res = SD_GetR1Resp(SD_CMD_SWITCH_FUNC); if (res != SDR_Success) { return res; } // Read the CCCR register value while (!(SDMMC1->STA & (SDMMC_STA_RXOVERR | SDMMC_STA_DCRCFAIL | SDMMC_STA_DTIMEOUT | SDMMC_STA_DBCKEND | SDMMC_STA_STBITERR))) { // The receive FIFO is half full, there are at least 8 words in it if (SDMMC1->STA & SDMMC_STA_RXFIFOHF) { *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; *ptr++ = SDMMC1->FIFO; } } // Check for errors if (SDMMC1->STA & SDIO_XFER_ERROR_FLAGS) { if (SDMMC1->STA & SDMMC_STA_DTIMEOUT) { res = SDR_DataTimeout; } if (SDMMC1->STA & SDMMC_STA_DCRCFAIL) { res = SDR_DataCRCFail; } if (SDMMC1->STA & SDMMC_STA_RXOVERR) { res = SDR_RXOverrun; } if (SDMMC1->STA & SDMMC_STA_STBITERR) { res = SDR_StartBitError; } } // Read the data remnant from the SDIO FIFO (should not be, but just in case) while (SDMMC1->STA & SDMMC_STA_RXDAVL) { *ptr++ = SDMMC1->FIFO; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; return res; } // Switch card to HS (high speed) mode // return: SDResult SDResult SD_HighSpeed(void) { uint8_t CCCR[64]; SDResult cmd_res = SDR_Success; // Check if the card supports HS mode cmd_res = SD_CmdSwitch( (0x0U << 31) | // MODE: check (0xFU << 20) | // GRP6: no influence (0xFU << 16) | // GRP5: no influence (0xFU << 12) | // GRP4: no influence (0xFU << 8) | // GRP3: no influence (0xFU << 4) | // GRP2: default (0x1U << 0), // GRP1: high speed CCCR ); if (cmd_res != SDR_Success) { return SDR_UnknownError; } // Check SHS bit from CCCR if (CCCR[63 - (400 / 8)] & 0x01 != 0x01) { return SDR_Unsupported; } #if 0 // Check EHS bit (BSS0) from CCCR if (CCCR[63 - (400 / 8)] & 0x02 != 0x02) { return SDR_Unsupported; } #endif // Ask the card to switch to HS mode cmd_res = SD_CmdSwitch( (0x1U << 31) | // MODE: switch (0xFU << 20) | // GRP6: no influence (0xFU << 16) | // GRP5: no influence (0xFU << 12) | // GRP4: no influence (0xFU << 8) | // GRP3: no influence (0xFU << 4) | // GRP2: default (0x1U << 0), // GRP1: high speed CCCR ); if (cmd_res != SDR_Success) { return SDR_UnknownError; } // Note: the SD specification says "card shall switch speed mode within 8 clocks // after the end bit of the corresponding response" // Apparently, this is the reason why some SD cards demand a delay between // the request for mode switching and the possibility to continue communication return SDR_Success; } // Abort an ongoing data transfer // return: SDResult value SDResult SD_StopTransfer(void) { // Send STOP_TRANSMISSION command SD_Cmd(SD_CMD_STOP_TRANSMISSION, 0, SD_RESP_SHORT); // CMD12 return SD_GetR1Resp(SD_CMD_STOP_TRANSMISSION); } // Get current SD card state // input: // pState - pointer to the variable for current card state, one of SD_STATE_xx values // return: SDResult value SDResult SD_GetCardState(uint8_t *pState) { uint8_t cmd_res; // Send SEND_STATUS command SD_Cmd(SD_CMD_SEND_STATUS, SDCard.RCA << 16, SD_RESP_SHORT); // CMD13 cmd_res = SD_GetR1Resp(SD_CMD_SEND_STATUS); if (cmd_res != SDR_Success) { *pState = SD_STATE_ERROR; return cmd_res; } // Find out a card status *pState = (SDMMC1->RESP1 & 0x1e00) >> 9; // Check for errors return SDR_Success; } // Read block of data from the SD card // input: // addr - address of the block to be read // pBuf - pointer to the buffer that will contain the received data // length - buffer length (must be multiple of 512) // return: SDResult value SDResult SD_ReadBlock(uint32_t addr, uint32_t *pBuf, uint32_t length) { SDResult cmd_res = SDR_Success; uint32_t blk_count = length >> 9; // Sectors in block register uint32_t STA; // to speed up SDIO flags checking register uint32_t STA_mask; // mask for SDIO flags checking // Initialize the data control register SDMMC1->DCTRL = 0; // SDSC card uses byte unit address and // SDHC/SDXC cards use block unit address (1 unit = 512 bytes) // For SDHC card addr must be converted to block unit address if (SDCard.Type == SDCT_SDHC) { addr >>= 9; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; if (blk_count > 1) { // Prepare bit checking variable for multiple block transfer STA_mask = SDIO_RX_MB_FLAGS; // Send READ_MULT_BLOCK command SD_Cmd(SD_CMD_READ_MULT_BLOCK, addr, SD_RESP_SHORT); // CMD18 cmd_res = SD_GetR1Resp(SD_CMD_READ_MULT_BLOCK); } else { // Prepare bit checking variable for single block transfer STA_mask = SDIO_RX_SB_FLAGS; // Send READ_SINGLE_BLOCK command SD_Cmd(SD_CMD_READ_SINGLE_BLOCK, addr, SD_RESP_SHORT); // CMD17 cmd_res = SD_GetR1Resp(SD_CMD_READ_SINGLE_BLOCK); } if (cmd_res != SDR_Success) { return cmd_res; } // Data read timeout SDMMC1->DTIMER = SD_DATA_R_TIMEOUT; // Data length SDMMC1->DLEN = length; // Data transfer: // transfer mode: block // direction: to card // DMA: disabled // block size: 2^9 = 512 bytes // DPSM: enabled SDMMC1->DCTRL = SDMMC_DCTRL_DTDIR | (9 << 4) | SDMMC_DCTRL_DTEN; // Receive a data block from the SDIO // ----> TIME CRITICAL SECTION BEGIN <---- do { STA = SDMMC1->STA; if (STA & SDMMC_STA_RXFIFOHF) { // The receive FIFO is half full, there are at least 8 words in it *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; *pBuf++ = SDMMC1->FIFO; } } while (!(STA & STA_mask)); // <---- TIME CRITICAL SECTION END ----> // Send stop transmission command in case of multiple block transfer if ((SDCard.Type != SDCT_MMC) && (blk_count > 1)) { cmd_res = SD_StopTransfer(); } // Check for errors if (STA & SDIO_XFER_ERROR_FLAGS) { if (STA & SDMMC_STA_DTIMEOUT) cmd_res = SDR_DataTimeout; if (STA & SDMMC_STA_DCRCFAIL) cmd_res = SDR_DataCRCFail; if (STA & SDMMC_STA_RXOVERR) cmd_res = SDR_RXOverrun; if (STA & SDMMC_STA_STBITERR) cmd_res = SDR_StartBitError; } // Read the data remnant from RX FIFO (if there is still any data) while (SDMMC1->STA & SDMMC_STA_RXDAVL) { *pBuf++ = SDMMC1->FIFO; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; return cmd_res; } // Write block of data to the SD card // input: // addr - address of the block to be written // pBuf - pointer to the buffer that will contain the received data // length - buffer length (must be multiple of 512) // return: SDResult value SDResult SD_WriteBlock(uint32_t addr, uint32_t *pBuf, uint32_t length) { SDResult cmd_res = SDR_Success; uint32_t blk_count = length >> 9; // Sectors in block uint32_t STA; // To speed up SDIO flags checking register uint32_t STA_mask; // Mask for SDIO flags checking uint32_t data_sent = 0; // Counter of transferred bytes uint8_t card_state; // Card state // Initialize the data control register SDMMC1->DCTRL = 0; // SDSC card uses byte unit address and // SDHC/SDXC cards use block unit address (1 unit = 512 bytes) // For SDHC card addr must be converted to block unit address if (SDCard.Type == SDCT_SDHC) { addr >>= 9; } if (blk_count > 1) { // Prepare bit checking variable for multiple block transfer STA_mask = SDIO_TX_MB_FLAGS; // Send WRITE_MULTIPLE_BLOCK command SD_Cmd(SD_CMD_WRITE_MULTIPLE_BLOCK, addr, SD_RESP_SHORT); // CMD25 cmd_res = SD_GetR1Resp(SD_CMD_WRITE_MULTIPLE_BLOCK); } else { // Prepare bit checking variable for single block transfer STA_mask = SDIO_TX_SB_FLAGS; // Send WRITE_BLOCK command SD_Cmd(SD_CMD_WRITE_BLOCK, addr, SD_RESP_SHORT); // CMD24 cmd_res = SD_GetR1Resp(SD_CMD_WRITE_BLOCK); } if (cmd_res != SDR_Success) { return cmd_res; } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; // Data write timeout SDMMC1->DTIMER = SD_DATA_W_TIMEOUT; // Data length SDMMC1->DLEN = length; // Data transfer: // transfer mode: block // direction: to card // DMA: disabled // block size: 2^9 = 512 bytes // DPSM: enabled SDMMC1->DCTRL = (9 << 4) | SDMMC_DCTRL_DTEN; // Transfer data block to the SDIO // ----> TIME CRITICAL SECTION BEGIN <---- if (!(length & 0x1F)) { // The block length is multiple of 32, simplified transfer procedure can be used do { if ((SDMMC1->STA & SDMMC_STA_TXFIFOHE) && (data_sent < length)) { // The TX FIFO is half empty, at least 8 words can be written SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; data_sent += 32; } } while (!(SDMMC1->STA & STA_mask)); } else { // Since the block length is not a multiple of 32, it is necessary to apply additional calculations do { if ((SDMMC1->STA & SDMMC_STA_TXFIFOHE) && (data_sent < length)) { // TX FIFO half empty, at least 8 words can be written uint32_t data_left = length - data_sent; if (data_left < 32) { // Write last portion of data to the TX FIFO data_left = ((data_left & 0x03) == 0) ? (data_left >> 2) : ((data_left >> 2) + 1); data_sent += data_left << 2; while (data_left--) { SDMMC1->FIFO = *pBuf++; } } else { // Write 8 words to the TX FIFO SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; SDMMC1->FIFO = *pBuf++; data_sent += 32; } } } while (!(SDMMC1->STA & STA_mask)); } // <---- TIME CRITICAL SECTION END ----> // Save STA register value for further analysis STA = SDMMC1->STA; // Send stop transmission command in case of multiple block transfer if ((SDCard.Type != SDCT_MMC) && (blk_count > 1)) { cmd_res = SD_StopTransfer(); } // Check for errors if (STA & SDIO_XFER_ERROR_FLAGS) { if (STA & SDMMC_STA_DTIMEOUT) cmd_res = SDR_DataTimeout; if (STA & SDMMC_STA_DCRCFAIL) cmd_res = SDR_DataCRCFail; if (STA & SDMMC_STA_TXUNDERR) cmd_res = SDR_TXUnderrun; if (STA & SDMMC_STA_STBITERR) cmd_res = SDR_StartBitError; } // Wait while the card is in programming state do { if (SD_GetCardState(&card_state) != SDR_Success) { break; } } while ((card_state == SD_STATE_PRG) || (card_state == SD_STATE_RCV)); // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; return cmd_res; } #if (SDIO_USE_DMA) // Initialize the DMA channel for SDIO peripheral (DMA2 Channel4) // input: // pBuf - pointer to the memory buffer // length - size of the memory buffer in bytes (must be a multiple of 4, since the SDIO operates with 32-bit words) // direction - DMA channel direction, one of SDIO_DMA_DIR_xx values // note: the DMA peripheral (DMA2) must be already enabled void SD_Configure_DMA(uint32_t *pBuf, uint32_t length, uint8_t direction) { // Populate SDIO DMA channel handle SDIO_DMA_CH.Channel = SDIO_DMA_CHANNEL; SDIO_DMA_CH.Instance = DMA_GetChannelPeripheral(SDIO_DMA_CHANNEL); SDIO_DMA_CH.ChIndex = DMA_GetChannelIndex(SDIO_DMA_CHANNEL); SDIO_DMA_CH.Request = SDIO_DMA_REQUEST; SDIO_DMA_CH.State = DMA_STATE_RESET; // DMA channel configuration: // channel priority: medium // memory increment: enabled // peripheral increment: disabled // circular mode: disabled // IRQ: disabled // memory size: 32-bit // peripheral size: 32-bit // channel: disabled DMA_ConfigChannel( SDIO_DMA_CH.Channel, direction | DMA_MODE_NORMAL | DMA_MINC_ENABLE | DMA_PINC_DISABLE | DMA_PSIZE_32BIT | DMA_MSIZE_32BIT | DMA_PRIORITY_MEDIUM ); DMA_SetAddrM(SDIO_DMA_CH.Channel, (uint32_t)pBuf); DMA_SetAddrP(SDIO_DMA_CH.Channel, (uint32_t)(&(SDMMC1->FIFO))); // Number of DMA transactions DMA_SetDataLength(SDIO_DMA_CH.Channel, length >> 2); // Map DMA request to DMA channel DMA_SetRequest(SDIO_DMA_CH.Instance, SDIO_DMA_CH.Request, SDIO_DMA_CH.ChIndex); // Clear SDIO DMA channel interrupt flags DMA_ClearFlags(SDIO_DMA_CH.Instance, SDIO_DMA_CH.ChIndex, DMA_CF_ALL); } // Start reading of data block from the SD card with DMA transfer // input: // addr - address of the block to be read // pBuf - pointer to the buffer that will contain the received data // length - buffer length (must be multiple of 512) // return: SDResult value SDResult SD_ReadBlock_DMA(uint32_t addr, uint32_t *pBuf, uint32_t length) { SDResult cmd_res = SDR_Success; uint32_t blk_count = length >> 9; // Initialize data control register and clear static SDIO flags SDMMC1->DCTRL = 0; SDMMC1->ICR = SDIO_ICR_STATIC; // Configure number of transactions and enable the SDIO DMA channel DMA_SetDataLength(SDIO_DMA_CH.Channel, length >> 2); DMA_EnableChannel(SDIO_DMA_CH.Channel); // SDSC card uses byte unit address and // SDHC/SDXC cards use block unit address (1 unit = 512 bytes) // For SDHC card addr must be converted to block unit address if (SDCard.Type == SDCT_SDHC) { addr >>= 9; } if (blk_count > 1) { // Send READ_MULT_BLOCK command SD_Cmd(SD_CMD_READ_MULT_BLOCK, addr, SD_RESP_SHORT); // CMD18 cmd_res = SD_GetR1Resp(SD_CMD_READ_MULT_BLOCK); } else { // Send READ_SINGLE_BLOCK command SD_Cmd(SD_CMD_READ_SINGLE_BLOCK, addr, SD_RESP_SHORT); // CMD17 cmd_res = SD_GetR1Resp(SD_CMD_READ_SINGLE_BLOCK); } if (cmd_res == SDR_Success) { // Data read timeout SDMMC1->DTIMER = SD_DATA_R_TIMEOUT; // Data length SDMMC1->DLEN = length; // Data transfer: // transfer mode: block // direction: from card // DMA: enabled // block size: 2^9 = 512 bytes // DPSM: enabled SDMMC1->DCTRL = SDMMC_DCTRL_DMAEN | SDMMC_DCTRL_DTDIR | (9 << 4) | SDMMC_DCTRL_DTEN; } return cmd_res; } // Start writing block of data to the SD card with DMA transfer // input: // addr - address of the block to be written // pBuf - pointer to the buffer that will contain the received data // length - buffer length (must be multiple of 512) // return: SDResult value SDResult SD_WriteBlock_DMA(uint32_t addr, uint32_t *pBuf, uint32_t length) { SDResult cmd_res = SDR_Success; uint32_t blk_count = length >> 9; // Initialize data control register and clear static SDIO flags SDMMC1->DCTRL = 0; SDMMC1->ICR = SDIO_ICR_STATIC; // Configure number of transactions and enable the SDIO DMA channel DMA_SetDataLength(SDIO_DMA_CH.Channel, length >> 2); DMA_EnableChannel(SDIO_DMA_CH.Channel); // SDSC card uses byte unit address and // SDHC/SDXC cards use block unit address (1 unit = 512 bytes) // For SDHC card addr must be converted to block unit address if (SDCard.Type == SDCT_SDHC) { addr >>= 9; } if (blk_count > 1) { // Send WRITE_MULTIPLE_BLOCK command SD_Cmd(SD_CMD_WRITE_MULTIPLE_BLOCK, addr, SD_RESP_SHORT); // CMD25 cmd_res = SD_GetR1Resp(SD_CMD_WRITE_MULTIPLE_BLOCK); } else { // Send WRITE_BLOCK command SD_Cmd(SD_CMD_WRITE_BLOCK, addr, SD_RESP_SHORT); // CMD24 cmd_res = SD_GetR1Resp(SD_CMD_WRITE_BLOCK); } if (cmd_res == SDR_Success) { // Data write timeout SDMMC1->DTIMER = SD_DATA_W_TIMEOUT; // Data length SDMMC1->DLEN = length; // Data transfer: // transfer mode: block // direction: to card // DMA: enabled // block size: 2^9 = 512 bytes // DPSM: enabled SDMMC1->DCTRL = SDMMC_DCTRL_DMAEN | (9 << 4) | SDMMC_DCTRL_DTEN; } return cmd_res; } // This function waits until the SDIO DMA data read transfer is finished // It must be called after SD_ReadBlock_DMA() function to ensure that all // data sent by the SD card is already transfered by the DMA and send STOP // command in case of multiple block transfer // input: // length - buffer length (must be a multiple of 512) // return: SDResult value // note: length passed here to determine if it was multiple block transfer SDResult SD_CheckRead(uint32_t length) { SDResult cmd_res = SDR_Success; uint32_t blk_count = length >> 9; volatile uint32_t wait = SD_DATA_R_TIMEOUT; uint32_t STA; // Wait for SDIO receive complete or error occurred if (blk_count > 1) { // Multiple block transfer while (!(SDMMC1->STA & SDIO_RX_MB_FLAGS) && --wait); } else { // Single block transfer while (!(SDMMC1->STA & SDIO_RX_SB_FLAGS) && --wait); } STA = SDMMC1->STA; // This is a READ operation, SDIO transfer must be completed before DMA transaction, // therefore will be enough to ensure only DMA transfer completed, without TXACT polling? // Wait for DMA transfer complete and then disable the DMA channel while (!(DMA_GetFlags(SDIO_DMA_CH.Instance, SDIO_DMA_CH.ChIndex, DMA_FLAG_TC)) && --wait); DMA_DisableChannel(SDIO_DMA_CH.Channel); // Send stop transmission command in case of multiple block transfer if ((SDCard.Type != SDCT_MMC) && (blk_count > 1)) { cmd_res = SD_StopTransfer(); } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; // Timeout? if (wait == 0) { return SDR_Timeout; } // Error happened? if (STA & SDIO_XFER_ERROR_FLAGS) { if (STA & SDMMC_STA_DTIMEOUT) cmd_res = SDR_DataTimeout; if (STA & SDMMC_STA_DCRCFAIL) cmd_res = SDR_DataCRCFail; if (STA & SDMMC_STA_RXOVERR) cmd_res = SDR_RXOverrun; if (STA & SDMMC_STA_STBITERR) cmd_res = SDR_StartBitError; } return cmd_res; } // This function waits until the SDIO DMA data write transfer is finished // It must be called after SD_WriteBlock_DMA() function to ensure that all // data is already transfered by the DMA to SD card and send STOP command // in case of multiple block transfer // input: // length - buffer length (must be a multiple of 512) // return: SDResult value // note: length passed here to determine if it was multiple block transfer SDResult SD_CheckWrite(uint32_t length) { SDResult cmd_res = SDR_Success; uint32_t blk_count = length >> 9; volatile uint32_t wait = SD_DATA_W_TIMEOUT; volatile uint32_t STA; uint8_t card_state; // Wait for SDIO receive complete or error occurred if (blk_count > 1) { // Multiple block transfer while (!(SDMMC1->STA & SDIO_TX_MB_FLAGS) && --wait); } else { // Single block transfer while (!(SDMMC1->STA & SDIO_TX_SB_FLAGS) && --wait); } // Wait while the SDIO transfer active while ((SDMMC1->STA & SDMMC_STA_TXACT) && --wait); STA = SDMMC1->STA; // Disable the DMA channel DMA_DisableChannel(SDIO_DMA_CH.Channel); // Send stop transmission command in case of multiple block transfer if ((SDCard.Type != SDCT_MMC) && (blk_count > 1)) { cmd_res = SD_StopTransfer(); } // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; // Timeout? if (wait == 0) { return SDR_Timeout; } // Error happened? if (STA & SDIO_XFER_ERROR_FLAGS) { if (STA & SDMMC_STA_DTIMEOUT) cmd_res = SDR_DataTimeout; if (STA & SDMMC_STA_DCRCFAIL) cmd_res = SDR_DataCRCFail; if (STA & SDMMC_STA_TXUNDERR) cmd_res = SDR_TXUnderrun; if (STA & SDMMC_STA_STBITERR) cmd_res = SDR_StartBitError; } // Wait while the card is in programming state do { if (SD_GetCardState(&card_state) != SDR_Success) { break; } } while ((card_state == SD_STATE_PRG) || (card_state == SD_STATE_RCV)); // Clear the static SDIO flags SDMMC1->ICR = SDIO_ICR_STATIC; return cmd_res; } #endif // SDIO_USE_DMA
512752.c
#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #define for_each_test(i, test) \ for (i = 0; i < sizeof(test) / sizeof(test[0]); i++) struct test_fail { const char *str; unsigned int base; }; #define DEFINE_TEST_FAIL(test) \ const struct test_fail test[] __initdata #define DECLARE_TEST_OK(type, test_type) \ test_type { \ const char *str; \ unsigned int base; \ type expected_res; \ } #define DEFINE_TEST_OK(type, test) \ const type test[] __initdata #define TEST_FAIL(fn, type, fmt, test) \ { \ unsigned int i; \ \ for_each_test(i, test) { \ const struct test_fail *t = &test[i]; \ type tmp; \ int rv; \ \ tmp = 0; \ rv = fn(t->str, t->base, &tmp); \ if (rv >= 0) { \ WARN(1, "str '%s', base %u, expected -E, got %d/" fmt "\n", \ t->str, t->base, rv, tmp); \ continue; \ } \ } \ } #define TEST_OK(fn, type, fmt, test) \ { \ unsigned int i; \ \ for_each_test(i, test) { \ const typeof(test[0]) *t = &test[i]; \ type res; \ int rv; \ \ rv = fn(t->str, t->base, &res); \ if (rv != 0) { \ WARN(1, "str '%s', base %u, expected 0/" fmt ", got %d\n", \ t->str, t->base, t->expected_res, rv); \ continue; \ } \ if (res != t->expected_res) { \ WARN(1, "str '%s', base %u, expected " fmt ", got " fmt "\n", \ t->str, t->base, t->expected_res, res); \ continue; \ } \ } \ } static void __init test_kstrtoull_ok(void) { DECLARE_TEST_OK(unsigned long long, struct test_ull); static DEFINE_TEST_OK(struct test_ull, test_ull_ok) = { {"0", 10, 0ULL}, {"1", 10, 1ULL}, {"127", 10, 127ULL}, {"128", 10, 128ULL}, {"129", 10, 129ULL}, {"255", 10, 255ULL}, {"256", 10, 256ULL}, {"257", 10, 257ULL}, {"32767", 10, 32767ULL}, {"32768", 10, 32768ULL}, {"32769", 10, 32769ULL}, {"65535", 10, 65535ULL}, {"65536", 10, 65536ULL}, {"65537", 10, 65537ULL}, {"2147483647", 10, 2147483647ULL}, {"2147483648", 10, 2147483648ULL}, {"2147483649", 10, 2147483649ULL}, {"4294967295", 10, 4294967295ULL}, {"4294967296", 10, 4294967296ULL}, {"4294967297", 10, 4294967297ULL}, {"9223372036854775807", 10, 9223372036854775807ULL}, {"9223372036854775808", 10, 9223372036854775808ULL}, {"9223372036854775809", 10, 9223372036854775809ULL}, {"18446744073709551614", 10, 18446744073709551614ULL}, {"18446744073709551615", 10, 18446744073709551615ULL}, {"00", 8, 00ULL}, {"01", 8, 01ULL}, {"0177", 8, 0177ULL}, {"0200", 8, 0200ULL}, {"0201", 8, 0201ULL}, {"0377", 8, 0377ULL}, {"0400", 8, 0400ULL}, {"0401", 8, 0401ULL}, {"077777", 8, 077777ULL}, {"0100000", 8, 0100000ULL}, {"0100001", 8, 0100001ULL}, {"0177777", 8, 0177777ULL}, {"0200000", 8, 0200000ULL}, {"0200001", 8, 0200001ULL}, {"017777777777", 8, 017777777777ULL}, {"020000000000", 8, 020000000000ULL}, {"020000000001", 8, 020000000001ULL}, {"037777777777", 8, 037777777777ULL}, {"040000000000", 8, 040000000000ULL}, {"040000000001", 8, 040000000001ULL}, {"0777777777777777777777", 8, 0777777777777777777777ULL}, {"01000000000000000000000", 8, 01000000000000000000000ULL}, {"01000000000000000000001", 8, 01000000000000000000001ULL}, {"01777777777777777777776", 8, 01777777777777777777776ULL}, {"01777777777777777777777", 8, 01777777777777777777777ULL}, {"0x0", 16, 0x0ULL}, {"0x1", 16, 0x1ULL}, {"0x7f", 16, 0x7fULL}, {"0x80", 16, 0x80ULL}, {"0x81", 16, 0x81ULL}, {"0xff", 16, 0xffULL}, {"0x100", 16, 0x100ULL}, {"0x101", 16, 0x101ULL}, {"0x7fff", 16, 0x7fffULL}, {"0x8000", 16, 0x8000ULL}, {"0x8001", 16, 0x8001ULL}, {"0xffff", 16, 0xffffULL}, {"0x10000", 16, 0x10000ULL}, {"0x10001", 16, 0x10001ULL}, {"0x7fffffff", 16, 0x7fffffffULL}, {"0x80000000", 16, 0x80000000ULL}, {"0x80000001", 16, 0x80000001ULL}, {"0xffffffff", 16, 0xffffffffULL}, {"0x100000000", 16, 0x100000000ULL}, {"0x100000001", 16, 0x100000001ULL}, {"0x7fffffffffffffff", 16, 0x7fffffffffffffffULL}, {"0x8000000000000000", 16, 0x8000000000000000ULL}, {"0x8000000000000001", 16, 0x8000000000000001ULL}, {"0xfffffffffffffffe", 16, 0xfffffffffffffffeULL}, {"0xffffffffffffffff", 16, 0xffffffffffffffffULL}, {"0\n", 0, 0ULL}, }; TEST_OK(kstrtoull, unsigned long long, "%llu", test_ull_ok); } static void __init test_kstrtoull_fail(void) { static DEFINE_TEST_FAIL(test_ull_fail) = { {"", 0}, {"", 8}, {"", 10}, {"", 16}, {"\n", 0}, {"\n", 8}, {"\n", 10}, {"\n", 16}, {"\n0", 0}, {"\n0", 8}, {"\n0", 10}, {"\n0", 16}, {"+", 0}, {"+", 8}, {"+", 10}, {"+", 16}, {"-", 0}, {"-", 8}, {"-", 10}, {"-", 16}, {"0x", 0}, {"0x", 16}, {"0X", 0}, {"0X", 16}, {"0 ", 0}, {"1+", 0}, {"1-", 0}, {" 2", 0}, /* base autodetection */ {"0x0z", 0}, {"0z", 0}, {"a", 0}, /* digit >= base */ {"2", 2}, {"8", 8}, {"a", 10}, {"A", 10}, {"g", 16}, {"G", 16}, /* overflow */ {"10000000000000000000000000000000000000000000000000000000000000000", 2}, {"2000000000000000000000", 8}, {"18446744073709551616", 10}, {"10000000000000000", 16}, /* negative */ {"-0", 0}, {"-0", 8}, {"-0", 10}, {"-0", 16}, {"-1", 0}, {"-1", 8}, {"-1", 10}, {"-1", 16}, /* sign is first character if any */ {"-+1", 0}, {"-+1", 8}, {"-+1", 10}, {"-+1", 16}, /* nothing after \n */ {"0\n0", 0}, {"0\n0", 8}, {"0\n0", 10}, {"0\n0", 16}, {"0\n+", 0}, {"0\n+", 8}, {"0\n+", 10}, {"0\n+", 16}, {"0\n-", 0}, {"0\n-", 8}, {"0\n-", 10}, {"0\n-", 16}, {"0\n ", 0}, {"0\n ", 8}, {"0\n ", 10}, {"0\n ", 16}, }; TEST_FAIL(kstrtoull, unsigned long long, "%llu", test_ull_fail); } static void __init test_kstrtoll_ok(void) { DECLARE_TEST_OK(long long, struct test_ll); static DEFINE_TEST_OK(struct test_ll, test_ll_ok) = { {"0", 10, 0LL}, {"1", 10, 1LL}, {"127", 10, 127LL}, {"128", 10, 128LL}, {"129", 10, 129LL}, {"255", 10, 255LL}, {"256", 10, 256LL}, {"257", 10, 257LL}, {"32767", 10, 32767LL}, {"32768", 10, 32768LL}, {"32769", 10, 32769LL}, {"65535", 10, 65535LL}, {"65536", 10, 65536LL}, {"65537", 10, 65537LL}, {"2147483647", 10, 2147483647LL}, {"2147483648", 10, 2147483648LL}, {"2147483649", 10, 2147483649LL}, {"4294967295", 10, 4294967295LL}, {"4294967296", 10, 4294967296LL}, {"4294967297", 10, 4294967297LL}, {"9223372036854775807", 10, 9223372036854775807LL}, {"-1", 10, -1LL}, {"-2", 10, -2LL}, {"-9223372036854775808", 10, LLONG_MIN}, }; TEST_OK(kstrtoll, long long, "%lld", test_ll_ok); } static void __init test_kstrtoll_fail(void) { static DEFINE_TEST_FAIL(test_ll_fail) = { {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"-9223372036854775809", 10}, {"-18446744073709551614", 10}, {"-18446744073709551615", 10}, /* negative zero isn't an integer in Linux */ {"-0", 0}, {"-0", 8}, {"-0", 10}, {"-0", 16}, /* sign is first character if any */ {"-+1", 0}, {"-+1", 8}, {"-+1", 10}, {"-+1", 16}, }; TEST_FAIL(kstrtoll, long long, "%lld", test_ll_fail); } static void __init test_kstrtou64_ok(void) { DECLARE_TEST_OK(u64, struct test_u64); static DEFINE_TEST_OK(struct test_u64, test_u64_ok) = { {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, {"256", 10, 256}, {"257", 10, 257}, {"32766", 10, 32766}, {"32767", 10, 32767}, {"32768", 10, 32768}, {"32769", 10, 32769}, {"65534", 10, 65534}, {"65535", 10, 65535}, {"65536", 10, 65536}, {"65537", 10, 65537}, {"2147483646", 10, 2147483646}, {"2147483647", 10, 2147483647}, {"2147483648", 10, 2147483648ULL}, {"2147483649", 10, 2147483649ULL}, {"4294967294", 10, 4294967294ULL}, {"4294967295", 10, 4294967295ULL}, {"4294967296", 10, 4294967296ULL}, {"4294967297", 10, 4294967297ULL}, {"9223372036854775806", 10, 9223372036854775806ULL}, {"9223372036854775807", 10, 9223372036854775807ULL}, {"9223372036854775808", 10, 9223372036854775808ULL}, {"9223372036854775809", 10, 9223372036854775809ULL}, {"18446744073709551614", 10, 18446744073709551614ULL}, {"18446744073709551615", 10, 18446744073709551615ULL}, }; TEST_OK(kstrtou64, u64, "%llu", test_u64_ok); } static void __init test_kstrtou64_fail(void) { static DEFINE_TEST_FAIL(test_u64_fail) = { {"-2", 10}, {"-1", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtou64, u64, "%llu", test_u64_fail); } static void __init test_kstrtos64_ok(void) { DECLARE_TEST_OK(s64, struct test_s64); static DEFINE_TEST_OK(struct test_s64, test_s64_ok) = { {"-128", 10, -128}, {"-127", 10, -127}, {"-1", 10, -1}, {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, {"256", 10, 256}, {"257", 10, 257}, {"32766", 10, 32766}, {"32767", 10, 32767}, {"32768", 10, 32768}, {"32769", 10, 32769}, {"65534", 10, 65534}, {"65535", 10, 65535}, {"65536", 10, 65536}, {"65537", 10, 65537}, {"2147483646", 10, 2147483646}, {"2147483647", 10, 2147483647}, {"2147483648", 10, 2147483648LL}, {"2147483649", 10, 2147483649LL}, {"4294967294", 10, 4294967294LL}, {"4294967295", 10, 4294967295LL}, {"4294967296", 10, 4294967296LL}, {"4294967297", 10, 4294967297LL}, {"9223372036854775806", 10, 9223372036854775806LL}, {"9223372036854775807", 10, 9223372036854775807LL}, }; TEST_OK(kstrtos64, s64, "%lld", test_s64_ok); } static void __init test_kstrtos64_fail(void) { static DEFINE_TEST_FAIL(test_s64_fail) = { {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtos64, s64, "%lld", test_s64_fail); } static void __init test_kstrtou32_ok(void) { DECLARE_TEST_OK(u32, struct test_u32); static DEFINE_TEST_OK(struct test_u32, test_u32_ok) = { {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, {"256", 10, 256}, {"257", 10, 257}, {"32766", 10, 32766}, {"32767", 10, 32767}, {"32768", 10, 32768}, {"32769", 10, 32769}, {"65534", 10, 65534}, {"65535", 10, 65535}, {"65536", 10, 65536}, {"65537", 10, 65537}, {"2147483646", 10, 2147483646}, {"2147483647", 10, 2147483647}, {"2147483648", 10, 2147483648U}, {"2147483649", 10, 2147483649U}, {"4294967294", 10, 4294967294U}, {"4294967295", 10, 4294967295U}, }; TEST_OK(kstrtou32, u32, "%u", test_u32_ok); } static void __init test_kstrtou32_fail(void) { static DEFINE_TEST_FAIL(test_u32_fail) = { {"-2", 10}, {"-1", 10}, {"4294967296", 10}, {"4294967297", 10}, {"9223372036854775806", 10}, {"9223372036854775807", 10}, {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtou32, u32, "%u", test_u32_fail); } static void __init test_kstrtos32_ok(void) { DECLARE_TEST_OK(s32, struct test_s32); static DEFINE_TEST_OK(struct test_s32, test_s32_ok) = { {"-128", 10, -128}, {"-127", 10, -127}, {"-1", 10, -1}, {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, {"256", 10, 256}, {"257", 10, 257}, {"32766", 10, 32766}, {"32767", 10, 32767}, {"32768", 10, 32768}, {"32769", 10, 32769}, {"65534", 10, 65534}, {"65535", 10, 65535}, {"65536", 10, 65536}, {"65537", 10, 65537}, {"2147483646", 10, 2147483646}, {"2147483647", 10, 2147483647}, }; TEST_OK(kstrtos32, s32, "%d", test_s32_ok); } static void __init test_kstrtos32_fail(void) { static DEFINE_TEST_FAIL(test_s32_fail) = { {"2147483648", 10}, {"2147483649", 10}, {"4294967294", 10}, {"4294967295", 10}, {"4294967296", 10}, {"4294967297", 10}, {"9223372036854775806", 10}, {"9223372036854775807", 10}, {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtos32, s32, "%d", test_s32_fail); } static void __init test_kstrtou16_ok(void) { DECLARE_TEST_OK(u16, struct test_u16); static DEFINE_TEST_OK(struct test_u16, test_u16_ok) = { {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, {"256", 10, 256}, {"257", 10, 257}, {"32766", 10, 32766}, {"32767", 10, 32767}, {"32768", 10, 32768}, {"32769", 10, 32769}, {"65534", 10, 65534}, {"65535", 10, 65535}, }; TEST_OK(kstrtou16, u16, "%hu", test_u16_ok); } static void __init test_kstrtou16_fail(void) { static DEFINE_TEST_FAIL(test_u16_fail) = { {"-2", 10}, {"-1", 10}, {"65536", 10}, {"65537", 10}, {"2147483646", 10}, {"2147483647", 10}, {"2147483648", 10}, {"2147483649", 10}, {"4294967294", 10}, {"4294967295", 10}, {"4294967296", 10}, {"4294967297", 10}, {"9223372036854775806", 10}, {"9223372036854775807", 10}, {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtou16, u16, "%hu", test_u16_fail); } static void __init test_kstrtos16_ok(void) { DECLARE_TEST_OK(s16, struct test_s16); static DEFINE_TEST_OK(struct test_s16, test_s16_ok) = { {"-130", 10, -130}, {"-129", 10, -129}, {"-128", 10, -128}, {"-127", 10, -127}, {"-1", 10, -1}, {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, {"256", 10, 256}, {"257", 10, 257}, {"32766", 10, 32766}, {"32767", 10, 32767}, }; TEST_OK(kstrtos16, s16, "%hd", test_s16_ok); } static void __init test_kstrtos16_fail(void) { static DEFINE_TEST_FAIL(test_s16_fail) = { {"32768", 10}, {"32769", 10}, {"65534", 10}, {"65535", 10}, {"65536", 10}, {"65537", 10}, {"2147483646", 10}, {"2147483647", 10}, {"2147483648", 10}, {"2147483649", 10}, {"4294967294", 10}, {"4294967295", 10}, {"4294967296", 10}, {"4294967297", 10}, {"9223372036854775806", 10}, {"9223372036854775807", 10}, {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtos16, s16, "%hd", test_s16_fail); } static void __init test_kstrtou8_ok(void) { DECLARE_TEST_OK(u8, struct test_u8); static DEFINE_TEST_OK(struct test_u8, test_u8_ok) = { {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, {"128", 10, 128}, {"129", 10, 129}, {"254", 10, 254}, {"255", 10, 255}, }; TEST_OK(kstrtou8, u8, "%hhu", test_u8_ok); } static void __init test_kstrtou8_fail(void) { static DEFINE_TEST_FAIL(test_u8_fail) = { {"-2", 10}, {"-1", 10}, {"256", 10}, {"257", 10}, {"32766", 10}, {"32767", 10}, {"32768", 10}, {"32769", 10}, {"65534", 10}, {"65535", 10}, {"65536", 10}, {"65537", 10}, {"2147483646", 10}, {"2147483647", 10}, {"2147483648", 10}, {"2147483649", 10}, {"4294967294", 10}, {"4294967295", 10}, {"4294967296", 10}, {"4294967297", 10}, {"9223372036854775806", 10}, {"9223372036854775807", 10}, {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtou8, u8, "%hhu", test_u8_fail); } static void __init test_kstrtos8_ok(void) { DECLARE_TEST_OK(s8, struct test_s8); static DEFINE_TEST_OK(struct test_s8, test_s8_ok) = { {"-128", 10, -128}, {"-127", 10, -127}, {"-1", 10, -1}, {"0", 10, 0}, {"1", 10, 1}, {"126", 10, 126}, {"127", 10, 127}, }; TEST_OK(kstrtos8, s8, "%hhd", test_s8_ok); } static void __init test_kstrtos8_fail(void) { static DEFINE_TEST_FAIL(test_s8_fail) = { {"-130", 10}, {"-129", 10}, {"128", 10}, {"129", 10}, {"254", 10}, {"255", 10}, {"256", 10}, {"257", 10}, {"32766", 10}, {"32767", 10}, {"32768", 10}, {"32769", 10}, {"65534", 10}, {"65535", 10}, {"65536", 10}, {"65537", 10}, {"2147483646", 10}, {"2147483647", 10}, {"2147483648", 10}, {"2147483649", 10}, {"4294967294", 10}, {"4294967295", 10}, {"4294967296", 10}, {"4294967297", 10}, {"9223372036854775806", 10}, {"9223372036854775807", 10}, {"9223372036854775808", 10}, {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, }; TEST_FAIL(kstrtos8, s8, "%hhd", test_s8_fail); } static int __init test_kstrtox_init(void) { test_kstrtoull_ok(); test_kstrtoull_fail(); test_kstrtoll_ok(); test_kstrtoll_fail(); test_kstrtou64_ok(); test_kstrtou64_fail(); test_kstrtos64_ok(); test_kstrtos64_fail(); test_kstrtou32_ok(); test_kstrtou32_fail(); test_kstrtos32_ok(); test_kstrtos32_fail(); test_kstrtou16_ok(); test_kstrtou16_fail(); test_kstrtos16_ok(); test_kstrtos16_fail(); test_kstrtou8_ok(); test_kstrtou8_fail(); test_kstrtos8_ok(); test_kstrtos8_fail(); return -EINVAL; } module_init(test_kstrtox_init); MODULE_LICENSE("Dual BSD/GPL");
65722.c
/** * Filename: packet-openflow.c * Author: David Underhill * Changelog: * dgu 2008-Aug-26 created * brandonh 2008-Oct-5 updated to 0x95 * brandonh 2008-Nov-25 updated to 0x96 + bugfixes * meszaros 2010-May-10 updated to support openflow 0.89 MPLS extension (0x97) * * Defines a Wireshark 1.0.0+ dissector for the OpenFlow protocol version 0x96. */ /** the version of openflow this dissector was written for */ #define DISSECTOR_OPENFLOW_MIN_VERSION 0x97 #define DISSECTOR_OPENFLOW_MAX_VERSION 0x97 #define DISSECTOR_OPENFLOW_VERSION_DRAFT_THRESHOLD 0x97 #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <glib.h> #include <epan/emem.h> #include <epan/packet.h> #include <epan/dissectors/packet-tcp.h> #include <epan/prefs.h> #include <epan/ipproto.h> #include <epan/etypes.h> #include <epan/addr_resolv.h> #include <string.h> #include <arpa/inet.h> #include <openflow/openflow.h> //#include <openflow/openflow_089mpls.h> /** if 0, padding bytes will not be shown in the dissector */ #define SHOW_PADDING 0 #define PROTO_TAG_OPENFLOW "OFP" /* Wireshark ID of the OPENFLOW protocol */ static int proto_openflow = -1; static dissector_handle_t openflow_handle; static void dissect_openflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); /* traffic will arrive with TCP port OPENFLOW_DST_TCP_PORT */ #define TCP_PORT_FILTER "tcp.port" static int global_openflow_proto = OPENFLOW_DST_TCP_PORT; /* try to find the ethernet dissector to dissect encapsulated Ethernet data */ static dissector_handle_t data_ethernet; /* AM=Async message, CSM=Control/Switch Message, SM=Symmetric Message */ /** names to bind to various values in the type field */ static const value_string names_ofp_type[] = { /* Immutable messages. */ { OFPT_HELLO, "Hello (SM)" }, { OFPT_ERROR, "Error (SM)" }, { OFPT_ECHO_REQUEST, "Echo Request (SM)" }, { OFPT_ECHO_REPLY, "Echo Reply (SM)" }, { OFPT_VENDOR, "Vendor (SM)" }, /* Switch configuration messages. */ { OFPT_FEATURES_REQUEST, "Features Request (CSM)" }, { OFPT_FEATURES_REPLY, "Features Reply (CSM)" }, { OFPT_VPORT_TABLE_FEATURES_REQUEST, "Virtual Port Table Features Request (CSM)" }, { OFPT_VPORT_TABLE_FEATURES_REPLY, "Virtual Port Table Features Reply (CSM)" }, { OFPT_GET_CONFIG_REQUEST, "Get Config Request (CSM)" }, { OFPT_GET_CONFIG_REPLY, "Get Config Reply (CSM)" }, { OFPT_SET_CONFIG, "Set Config (CSM)" }, /* Asynchronous messages. */ { OFPT_PACKET_IN, "Packet In (AM)" }, { OFPT_FLOW_EXPIRED, "Flow Expired (AM)" }, { OFPT_PORT_STATUS, "Port Status (AM)" }, /* Controller command messages. */ { OFPT_PACKET_OUT, "Packet Out (CSM)" }, { OFPT_FLOW_MOD, "Flow Mod (CSM)" }, { OFPT_PORT_MOD, "Port Mod (CSM)" }, { OFPT_VPORT_MOD, "Modify Virtual Port (CSM)" }, /* Statistics messages. */ { OFPT_STATS_REQUEST, "Stats Request (CSM)" }, { OFPT_STATS_REPLY, "Stats Reply (CSM)" }, { 0, NULL } }; #define OFP_TYPE_MAX_VALUE OFPT_STATS_REPLY /** names from ofp_action_type */ static const value_string names_ofp_action_type[] = { { OFPAT_OUTPUT, "Output to switch port" }, { OFPAT_SET_VLAN_VID, "Set the 802.1q VLAN id." }, { OFPAT_SET_VLAN_PCP, "Set the 802.1q priority." }, { OFPAT_STRIP_VLAN, "Strip the 802.1q header." }, { OFPAT_SET_DL_SRC, "Ethernet source address" }, { OFPAT_SET_DL_DST, "Ethernet destination address" }, { OFPAT_SET_NW_SRC, "IP source address" }, { OFPAT_SET_NW_DST, "IP destination address" }, { OFPAT_SET_TP_SRC, "TCP/UDP source port" }, { OFPAT_SET_TP_DST, "TCP/UDP destination port"}, { OFPAT_SET_MPLS_LABEL, "Set the MPLS label."}, { OFPAT_SET_MPLS_EXP, "Set the MPLS EXP bits."}, { OFPAT_VENDOR, "Vendor-defined action"}, { 0, NULL } }; static const value_string names_ofp_vport_action_type[] = { { OFPPAT_OUTPUT, "Output to switch port" }, { OFPPAT_POP_MPLS, "Pop MLPS label" }, { OFPPAT_PUSH_MPLS, "Push MPLS label" }, { OFPPAT_SET_MPLS_LABEL, "Set MPLS label" }, { OFPPAT_SET_MPLS_EXP, "Set MPLS exp bits" }, { 0, NULL } }; #define NUM_ACTIONS_FLAGS 12 #define NUM_VPORT_ACTIONS_FLAGS 5 #define NUM_MPLS_POP_ACTIONS_FLAGS 4 #define NUM_MPLS_PUSH_ACTIONS_FLAGS 5 #define NUM_PORT_CONFIG_FLAGS 7 #define NUM_PORT_STATE_FLAGS 1 #define NUM_PORT_FEATURES_FLAGS 12 #define NUM_WILDCARDS 12 #define NUM_CAPABILITIES_FLAGS 7 #define NUM_CONFIG_FLAGS 1 #define NUM_SF_REPLY_FLAGS 1 /** yes/no for bitfields field */ static const value_string names_choice[] = { { 0, "No" }, { 1, "Yes" }, { 0, NULL } }; /** wildcard or not for bitfields field */ static const value_string wildcard_choice[] = { { 0, "Exact" }, { 1, "Wildcard" }, { 0, NULL } }; /** wildcard or not for bitfields field */ static const value_string ts_wildcard_choice[] = { { 0, "Exact only" }, { 1, "Wildcard allowed" }, { 0, NULL } }; /** names from ofp_flow_mod_command */ static const value_string names_flow_mod_command[] = { { OFPFC_ADD, "New flow" }, { OFPFC_MODIFY, "Modify all matching flows" }, { OFPFC_MODIFY_STRICT, "Modify entry strictly matching wildcards" }, { OFPFC_DELETE, "Delete all matching flows" }, { OFPFC_DELETE_STRICT, "Delete entry strictly matching wildcards and priority" }, { 0, NULL } }; /** names of stats_types */ static const value_string names_stats_types[] = { { OFPST_DESC, "Description of this OpenFlow switch" }, { OFPST_FLOW, "Individual flow statistics" }, { OFPST_AGGREGATE, "Aggregate flow statistics" }, { OFPST_TABLE, "Flow table statistics" }, { OFPST_PORT, "Physical port statistics" }, { OFPST_PORT_TABLE, "Port table statistics" }, { OFPST_VENDOR, "Vendor extension" }, { 0, NULL } }; /** names from ofp_port_reason */ static const value_string names_ofp_port_reason[] = { { OFPPR_ADD, "The port was added" }, { OFPPR_DELETE, "The port was removed" }, { OFPPR_MODIFY, "Some attribute of the port has changed" }, { 0, NULL } }; /** names from ofp_packet_in_reason */ static const value_string names_ofp_packet_in_reason[] = { { OFPR_NO_MATCH, "No matching flow" }, { OFPR_ACTION, "Action explicitly output to controller" }, { 0, NULL } }; /** names from ofp_flow_expired_reason */ static const value_string names_ofp_flow_expired_reason[] = { { OFPER_IDLE_TIMEOUT, "Flow idle time exceeded idle_timeout" }, { OFPER_HARD_TIMEOUT, "Time exceeded hard_timeout" }, { 0, NULL } }; /** names from ofp_flow_expired_reason */ static const value_string names_ip_frag[] = { { OFPC_FRAG_NORMAL, "No special handling for fragments." }, { OFPC_FRAG_DROP, "Drop fragments." }, { OFPC_FRAG_REASM, "Reassemble (only if OFPC_IP_REASM set)" }, { 0, NULL } }; /** names from ofp_error_type */ static const value_string names_ofp_error_type_reason[] = { { OFPET_HELLO_FAILED, "Hello protocol failed" }, { OFPET_BAD_REQUEST, "Request was not understood" }, { OFPET_BAD_ACTION, "Error in action description" }, { OFPET_FLOW_MOD_FAILED, "Problem modifying flow entry" }, { OFPET_VPORT_MOD_FAILED, "Problem modifying port table entry" }, { 0, NULL } }; /** names from ofp_vport_mod_command */ static const value_string names_ofp_vport_mod_command[] = { { OFPVP_ADD, "New virtual port." }, { OFPVP_DELETE, "Delete virtual port."}, { 0, NULL } }; /** Address masks */ static const value_string addr_mask[] = { { 0, "/32" }, { 1, "/31" }, { 2, "/30" }, { 3, "/29" }, { 4, "/28" }, { 5, "/27" }, { 6, "/26" }, { 7, "/25" }, { 8, "/24" }, { 9, "/23" }, { 10, "/22" }, { 11, "/21" }, { 12, "/20" }, { 13, "/19" }, { 14, "/18" }, { 15, "/17" }, { 16, "/16" }, { 17, "/15" }, { 18, "/14" }, { 19, "/13" }, { 20, "/12" }, { 21, "/11" }, { 22, "/10" }, { 23, "/9" }, { 24, "/8" }, { 25, "/7" }, { 26, "/6" }, { 27, "/5" }, { 28, "/4" }, { 29, "/3" }, { 30, "/2" }, { 31, "/1" }, { 32, "/0" }, { 63, "/0" }, { 0, NULL } }; /** Address masks */ static const value_string ts_addr_mask[] = { { 0, "Exact only" }, { 63, "Wildcard allowed" }, { 0, NULL } }; /** Switch config frag values */ static const value_string sc_frag_choices[] = { { 0, "No special fragment handling" }, { 1, "Drop fragments" }, { 2, "Reassemble (only if OFPC_IP_REASM set)" }, { 0, NULL } }; /* Error strings for the various error types */ static const gchar *hello_failed_err_str[] = {"No compatible version"}; #define N_HELLOFAILED (sizeof hello_failed_err_str / sizeof hello_failed_err_str[0]) static const gchar *bad_request_err_str[] = {"ofp_header.version not supported", "ofp_header.type not supported", "ofp_stats_request.type not supported", "Vendor not supported (in ofp_vendor or ofp_stats_request or ofp_stats_reply)", "Vendor subtype not supported"}; #define N_BADREQUEST (sizeof bad_request_err_str / sizeof bad_request_err_str[0]) static const gchar *bad_action_err_str[] = {"Unknown action type", "Length problem in actions", "Unknown vendor id specified", "Unknown action type for vendor id", "Problem validating output action", "Bad action argument"}; #define N_BADACTION (sizeof bad_action_err_str / sizeof bad_action_err_str[0]) static const gchar *flow_mod_failed_err_str[] = {"Flow not added because of full tables"}; #define N_FLOWMODFAILED (sizeof flow_mod_failed_err_str / sizeof flow_mod_failed_err_str[0]) /* ICMP definitions from wireshark source: epan/dissectors/packet-ip.c */ /* ICMP definitions */ #define ICMP_ECHOREPLY 0 #define ICMP_UNREACH 3 #define ICMP_SOURCEQUENCH 4 #define ICMP_REDIRECT 5 #define ICMP_ECHO 8 #define ICMP_RTRADVERT 9 #define ICMP_RTRSOLICIT 10 #define ICMP_TIMXCEED 11 #define ICMP_PARAMPROB 12 #define ICMP_TSTAMP 13 #define ICMP_TSTAMPREPLY 14 #define ICMP_IREQ 15 #define ICMP_IREQREPLY 16 #define ICMP_MASKREQ 17 #define ICMP_MASKREPLY 18 /* ICMP UNREACHABLE */ #define ICMP_NET_UNREACH 0 /* Network Unreachable */ #define ICMP_HOST_UNREACH 1 /* Host Unreachable */ #define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */ #define ICMP_PORT_UNREACH 3 /* Port Unreachable */ #define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */ #define ICMP_SR_FAILED 5 /* Source Route failed */ #define ICMP_NET_UNKNOWN 6 #define ICMP_HOST_UNKNOWN 7 #define ICMP_HOST_ISOLATED 8 #define ICMP_NET_ANO 9 #define ICMP_HOST_ANO 10 #define ICMP_NET_UNR_TOS 11 #define ICMP_HOST_UNR_TOS 12 #define ICMP_PKT_FILTERED 13 /* Packet filtered */ #define ICMP_PREC_VIOLATION 14 /* Precedence violation */ #define ICMP_PREC_CUTOFF 15 /* Precedence cut off */ static const gchar *unreach_str[] = {"Network unreachable", "Host unreachable", "Protocol unreachable", "Port unreachable", "Fragmentation needed", "Source route failed", "Destination network unknown", "Destination host unknown", "Source host isolated", "Network administratively prohibited", "Host administratively prohibited", "Network unreachable for TOS", "Host unreachable for TOS", "Communication administratively filtered", "Host precedence violation", "Precedence cutoff in effect"}; #define N_UNREACH (sizeof unreach_str / sizeof unreach_str[0]) static const gchar *redir_str[] = {"Redirect for network", "Redirect for host", "Redirect for TOS and network", "Redirect for TOS and host"}; #define N_REDIRECT (sizeof redir_str / sizeof redir_str[0]) static const gchar *ttl_str[] = {"Time to live exceeded in transit", "Fragment reassembly time exceeded"}; #define N_TIMXCEED (sizeof ttl_str / sizeof ttl_str[0]) static const gchar *par_str[] = {"IP header bad", "Required option missing"}; #define N_PARAMPROB (sizeof par_str / sizeof par_str[0]) /* These variables are used to hold the IDs of our fields; they are * set when we call proto_register_field_array() in proto_register_openflow() */ static gint ofp = -1; static gint ofp_pad = -1; static gint ofp_port = -1; /* OpenFlow Header */ static gint ofp_header = -1; static gint ofp_header_version = -1; static gint ofp_header_type = -1; static gint ofp_header_length = -1; static gint ofp_header_xid = -1; static gint ofp_header_warn_ver = -1; static gint ofp_header_warn_type = -1; /* Common Structures */ static gint ofp_phy_port = -1; static gint ofp_phy_port_port_no = -1; static gint ofp_phy_port_hw_addr = -1; static gint ofp_phy_port_name = -1; static gint ofp_phy_port_config_hdr = -1; static gint ofp_phy_port_config[NUM_PORT_CONFIG_FLAGS]; static gint ofp_phy_port_state_hdr = -1; // the following array is EVIL!!!!! do not use, or a curse upon your family. static gint ofp_phy_port_state[NUM_PORT_STATE_FLAGS]; // seriously, don't use this bit. static gint ofp_phy_port_state_not_evil = -1; static gint ofp_phy_port_state_stp_state = -1; static gint ofp_phy_port_curr_hdr = -1; static gint ofp_phy_port_curr[NUM_PORT_FEATURES_FLAGS]; static gint ofp_phy_port_advertised_hdr = -1; static gint ofp_phy_port_advertised[NUM_PORT_FEATURES_FLAGS]; static gint ofp_phy_port_supported_hdr = -1; static gint ofp_phy_port_supported[NUM_PORT_FEATURES_FLAGS]; static gint ofp_phy_port_peer_hdr = -1; static gint ofp_phy_port_peer[NUM_PORT_FEATURES_FLAGS]; static gint ofp_match = -1; static gint ofp_match_wildcards_hdr = -1; static gint ofp_match_wildcards[NUM_WILDCARDS]; static gint ofp_match_in_port = -1; static gint ofp_match_dl_src = -1; static gint ofp_match_dl_dst = -1; static gint ofp_match_dl_vlan = -1; static gint ofp_match_dl_type = -1; static gint ofp_match_nw_src = -1; static gint ofp_match_nw_dst = -1; static gint ofp_match_nw_proto = -1; static gint ofp_match_tp_src = -1; static gint ofp_match_tp_dst = -1; static gint ofp_match_icmp_type = -1; static gint ofp_match_icmp_code = -1; static gint ofp_match_nw_src_mask_bits = -1; static gint ofp_match_nw_dst_mask_bits = -1; static gint ofp_match_mpls_label1 = -1; static gint ofp_match_mpls_label2 = -1; static gint ofp_match_mpls_nolabel= -1; static gint ofp_match_mpls_reservedlabel=-1; static gint ofp_action = -1; static gint ofp_action_type = -1; static gint ofp_action_len = -1; static gint ofp_action_vlan_vid = -1; static gint ofp_action_vlan_pcp = -1; static gint ofp_action_dl_addr = -1; static gint ofp_action_nw_addr = -1; static gint ofp_action_tp_port = -1; static gint ofp_action_vendor = -1; static gint ofp_action_unknown = -1; static gint ofp_action_warn = -1; static gint ofp_action_num = -1; /* type: ofp_action_output */ static gint ofp_action_output = -1; static gint ofp_action_output_port = -1; static gint ofp_action_output_max_len = -1; static gint ofp_action_mpls_label = -1; static gint ofp_action_mpls_label_out = -1; static gint ofp_action_mpls_exp = -1; /* Controller/Switch Messages */ static gint ofp_switch_features = -1; static gint ofp_switch_features_datapath_id = -1; static gint ofp_switch_features_n_buffers = -1; static gint ofp_switch_features_n_tables = -1; static gint ofp_switch_features_capabilities_hdr = -1; static gint ofp_switch_features_capabilities[NUM_CAPABILITIES_FLAGS]; static gint ofp_switch_features_actions_hdr = -1; static gint ofp_switch_features_actions[NUM_ACTIONS_FLAGS]; static gint ofp_switch_features_actions_warn = -1; // are these two necessary? static gint ofp_switch_features_ports_hdr = -1; static gint ofp_switch_features_ports[OFPP_MAX]; static gint ofp_switch_features_ports_num = -1; static gint ofp_switch_features_ports_warn = -1; static gint ofp_vport_table_features = -1; static gint ofp_vport_table_max_vports = -1; static gint ofp_vport_actions_hdr = -1; static gint ofp_vport_actions[NUM_VPORT_ACTIONS_FLAGS]; static gint ofp_vport_table_max_chain_depth = -1; static gint ofp_vport_table_mixed_chaining = -1; static gint ofp_vport_action_pop_mpls_hdr = -1; static gint ofp_vport_action_pop_mpls[NUM_MPLS_POP_ACTIONS_FLAGS]; static gint ofp_vport_action_push_mpls_hdr = -1; static gint ofp_vport_action_push_mpls[NUM_MPLS_PUSH_ACTIONS_FLAGS]; static gint ofp_vport_action_output = -1; static gint ofp_vport_action_warn = -1; static gint ofp_vport_action_num = -1; static gint ofp_vport_action = -1; static gint ofp_vport_action_type = -1; static gint ofp_vport_action_len = -1; static gint ofp_vport_action_unknown = -1; static gint ofp_vport_mpls_set_label = -1; static gint ofp_vport_action_push_mpls_label = -1; static gint ofp_vport_action_push_mpls_exp = -1; static gint ofp_vport_action_push_mpls_ttl = -1; static gint ofp_switch_config = -1; static gint ofp_switch_config_flags_hdr = -1; static gint ofp_switch_config_flags[NUM_CONFIG_FLAGS]; static gint ofp_switch_config_flags_ip_frag = -1; static gint ofp_switch_config_miss_send_len = -1; static gint ofp_flow_mod = -1; /* field: ofp_match */ static gint ofp_flow_mod_command = -1; static gint ofp_flow_mod_idle_timeout = -1; static gint ofp_flow_mod_hard_timeout = -1; static gint ofp_flow_mod_priority = -1; static gint ofp_flow_mod_buffer_id = -1; static gint ofp_flow_mod_out_port = -1; static gint ofp_flow_mod_reserved = -1; static gint ofp_flow_mod_actions = -1; static gint ofp_port_mod = -1; static gint ofp_port_mod_port_no = -1; static gint ofp_port_mod_hw_addr = -1; static gint ofp_port_mod_config_hdr = -1; static gint ofp_port_mod_config[NUM_PORT_CONFIG_FLAGS]; static gint ofp_port_mod_mask_hdr = -1; static gint ofp_port_mod_mask[NUM_PORT_CONFIG_FLAGS]; static gint ofp_port_mod_advertise_hdr = -1; static gint ofp_port_mod_advertise[NUM_PORT_FEATURES_FLAGS]; static gint ofp_vport_mod = -1; static gint ofp_vport_mod_vport = -1; static gint ofp_vport_mod_parent_port = -1; static gint ofp_vport_mod_command = -1; static gint ofp_stats_request = -1; static gint ofp_stats_request_type = -1; static gint ofp_stats_request_flags = -1; static gint ofp_stats_request_body = -1; static gint ofp_stats_reply = -1; static gint ofp_stats_reply_type = -1; static gint ofp_stats_reply_flags = -1; static gint ofp_stats_reply_flag[NUM_SF_REPLY_FLAGS]; static gint ofp_stats_reply_body = -1; static gint ofp_desc_stats = -1; static gint ofp_desc_stats_mfr_desc = -1; static gint ofp_desc_stats_hw_desc = -1; static gint ofp_desc_stats_sw_desc = -1; static gint ofp_desc_stats_serial_num = -1; static gint ofp_flow_stats_request = -1; /* field: ofp_match */ static gint ofp_flow_stats_request_table_id = -1; static gint ofp_flow_stats_reply = -1; /* length won't be put in the tree */ static gint ofp_flow_stats_reply_length = -1; static gint ofp_flow_stats_reply_table_id = -1; /* field: ofp_match */ static gint ofp_flow_stats_reply_duration = -1; static gint ofp_flow_stats_reply_priority = -1; static gint ofp_flow_stats_reply_idle_timeout = -1; static gint ofp_flow_stats_reply_hard_timeout = -1; static gint ofp_flow_stats_reply_packet_count = -1; static gint ofp_flow_stats_reply_byte_count = -1; /* field: ofp_actions */ static gint ofp_aggr_stats_request = -1; /* field: ofp_match */ static gint ofp_aggr_stats_request_table_id = -1; static gint ofp_aggr_stats_reply = -1; static gint ofp_aggr_stats_reply_packet_count = -1; static gint ofp_aggr_stats_reply_byte_count = -1; static gint ofp_aggr_stats_reply_flow_count = -1; static gint ofp_table_stats = -1; static gint ofp_table_stats_table_id = -1; static gint ofp_table_stats_name = -1; static gint ofp_table_stats_wildcards_hdr = -1; static gint ofp_table_stats_wildcards[NUM_WILDCARDS]; static gint ofp_table_stats_max_entries = -1; static gint ofp_table_stats_active_count = -1; static gint ofp_table_stats_lookup_count = -1; static gint ofp_table_stats_matched_count = -1; static gint ofp_port_stats = -1; static gint ofp_port_stats_port_no = -1; static gint ofp_port_stats_rx_packets = -1; static gint ofp_port_stats_tx_packets = -1; static gint ofp_port_stats_rx_bytes = -1; static gint ofp_port_stats_tx_bytes = -1; static gint ofp_port_stats_rx_dropped = -1; static gint ofp_port_stats_tx_dropped = -1; static gint ofp_port_stats_rx_errors = -1; static gint ofp_port_stats_tx_errors = -1; static gint ofp_port_stats_rx_frame_err = -1; static gint ofp_port_stats_rx_over_err = -1; static gint ofp_port_stats_rx_crc_err = -1; static gint ofp_port_stats_collisions = -1; static gint ofp_port_stats_mpls_ttl0_dropped = -1; static gint ofp_port_table_stats = -1; static gint ofp_port_table_stats_max_vports = -1; static gint ofp_port_table_stats_active_vports = -1; static gint ofp_port_table_stats_lookup_count = -1; static gint ofp_port_table_stats_port_match_count = -1; static gint ofp_port_table_stats_chain_match_count = -1; static gint ofp_vendor_stats = -1; static gint ofp_vendor_stats_vendor = -1; static gint ofp_vendor_stats_body = -1; static gint ofp_packet_out = -1; static gint ofp_packet_out_buffer_id = -1; static gint ofp_packet_out_in_port = -1; static gint ofp_packet_out_actions_len = -1; static gint ofp_packet_out_actions_hdr = -1; static gint ofp_packet_out_data_hdr = -1; /* Asynchronous Messages */ static gint ofp_packet_in = -1; static gint ofp_packet_in_buffer_id = -1; static gint ofp_packet_in_total_len = -1; static gint ofp_packet_in_in_port = -1; static gint ofp_packet_in_reason = -1; static gint ofp_packet_in_data_hdr = -1; static gint ofp_flow_expired = -1; /* field: ofp_match */ static gint ofp_flow_expired_priority = -1; static gint ofp_flow_expired_reason = -1; static gint ofp_flow_expired_duration = -1; static gint ofp_flow_expired_packet_count = -1; static gint ofp_flow_expired_byte_count = -1; static gint ofp_port_status = -1; static gint ofp_port_status_reason = -1; /* field: ofp_phy_port desc */ static gint ofp_error_msg = -1; static gint ofp_error_msg_type = -1; static gint ofp_error_msg_code = -1; static gint ofp_error_msg_data = -1; static gint ofp_error_msg_data_str = -1; static gint ofp_echo = -1; static gint ofp_vendor = -1; /* These are the ids of the subtrees that we may be creating */ static gint ett_ofp = -1; /* Open Flow Header */ static gint ett_ofp_header = -1; /* Common Structures */ static gint ett_ofp_hello = -1; static gint ett_ofp_phy_port = -1; static gint ett_ofp_phy_port_config_hdr = -1; static gint ett_ofp_phy_port_state_hdr = -1; static gint ett_ofp_phy_port_curr_hdr = -1; static gint ett_ofp_phy_port_advertised_hdr = -1; static gint ett_ofp_phy_port_supported_hdr = -1; static gint ett_ofp_phy_port_peer_hdr = -1; static gint ett_ofp_match = -1; static gint ett_ofp_match_wildcards_hdr = -1; static gint ett_ofp_action = -1; static gint ett_ofp_action_output = -1; /* Controller/Switch Messages */ static gint ett_ofp_switch_features = -1; static gint ett_ofp_switch_features_capabilities_hdr = -1; static gint ett_ofp_switch_features_actions_hdr = -1; static gint ett_ofp_switch_features_ports_hdr = -1; static gint ett_ofp_switch_config = -1; static gint ett_ofp_switch_config_flags_hdr = -1; static gint ett_ofp_flow_mod = -1; static gint ett_ofp_port_mod = -1; static gint ett_ofp_port_mod_config_hdr = -1; static gint ett_ofp_port_mod_mask_hdr = -1; static gint ett_ofp_port_mod_advertise_hdr = -1; static gint ett_ofp_stats_request = -1; static gint ett_ofp_stats_reply = -1; static gint ett_ofp_stats_reply_flags = -1; static gint ett_ofp_desc_stats = -1; static gint ett_ofp_flow_stats_request = -1; static gint ett_ofp_flow_stats_reply = -1; static gint ett_ofp_aggr_stats_request = -1; static gint ett_ofp_aggr_stats_reply = -1; static gint ett_ofp_table_stats = -1; static gint ett_ofp_port_stats = -1; static gint ett_ofp_port_table_stats = -1; static gint ett_ofp_vendor_stats = -1; static gint ett_ofp_packet_out = -1; static gint ett_ofp_packet_out_actions_hdr = -1; static gint ett_ofp_packet_out_data_hdr = -1; static gint ett_ofp_vport_table_features = -1; static gint ett_ofp_vport_actions_hdr = -1; static gint ett_ofp_vport_mod = -1; static gint ett_ofp_vport_action_output = -1; static gint ett_ofp_vport_action = -1; static gint ett_ofp_vport_actions_pop_mpls_hdr = -1; static gint ett_ofp_vport_actions_push_mpls_hdr = -1; /* Asynchronous Messages */ static gint ett_ofp_packet_in = -1; static gint ett_ofp_packet_in_data_hdr = -1; static gint ett_ofp_flow_expired = -1; static gint ett_ofp_port_status = -1; static gint ett_ofp_error_msg = -1; static gint ett_ofp_error_msg_data = -1; void proto_reg_handoff_openflow() { openflow_handle = create_dissector_handle(dissect_openflow, proto_openflow); dissector_add(TCP_PORT_FILTER, global_openflow_proto, openflow_handle); } #define NO_STRINGS NULL #define NO_MASK 0x0 /** Returns newly allocated string with two spaces in front of str. */ static inline char* indent( char* str ) { char* ret = malloc( strlen(str) + 3 ); ret[0] = ' '; ret[1] = ' '; memcpy( &ret[2], str, strlen(str) + 1 ); return ret; } void proto_register_openflow() { data_ethernet = find_dissector("eth"); /* initialize uninitialized header fields */ int i; for( i=0; i<NUM_CAPABILITIES_FLAGS; i++ ) { ofp_switch_features_capabilities[i] = -1; } for( i=0; i<NUM_ACTIONS_FLAGS; i++ ) { ofp_switch_features_actions[i] = -1; } for( i=0; i<NUM_VPORT_ACTIONS_FLAGS; i++ ) { ofp_vport_actions[i] = -1; } for( i=0; i<NUM_MPLS_POP_ACTIONS_FLAGS; i++ ) { ofp_vport_action_pop_mpls[i] = -1; } for( i=0; i<NUM_MPLS_PUSH_ACTIONS_FLAGS; i++ ) { ofp_vport_action_push_mpls[i] = -1; } for( i=0; i<NUM_PORT_CONFIG_FLAGS; i++ ) { ofp_phy_port_config[i] = -1; ofp_port_mod_config[i] = -1; ofp_port_mod_mask[i] = -1; } for( i=0; i<NUM_PORT_STATE_FLAGS; i++ ) { ofp_phy_port_state[i] = -1; } for( i=0; i<NUM_PORT_FEATURES_FLAGS; i++ ) { ofp_phy_port_curr[i] = -1; ofp_phy_port_advertised[i] = -1; ofp_phy_port_supported[i] = -1; ofp_phy_port_peer[i] = -1; ofp_port_mod_advertise[i] = -1; } for( i=0; i<NUM_WILDCARDS; i++ ) { ofp_match_wildcards[i] = -1; ofp_table_stats_wildcards[i] = -1; } for( i=0; i<NUM_SF_REPLY_FLAGS; i++ ) { ofp_stats_reply_flag[i] = -1; } /* A header field is something you can search/filter on. * * We create a structure to register our fields. It consists of an * array of register_info structures, each of which are of the format * {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}. */ static hf_register_info hf[] = { /* header fields */ { &ofp, { "Data", "of.data", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "OpenFlow PDU", HFILL }}, { &ofp_pad, { "Pad", "of.pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL }}, { &ofp_header, { "Header", "of.header", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "OpenFlow Header", HFILL }}, { &ofp_header_version, { "Version", "of.ver", FT_UINT8, BASE_HEX, NO_STRINGS, NO_MASK, "Version", HFILL }}, { &ofp_header_type, { "Type", "of.type", FT_UINT8, BASE_DEC, VALS(names_ofp_type), NO_MASK, "Type", HFILL }}, { &ofp_header_length, { "Length", "of.len", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Length (bytes)", HFILL }}, { &ofp_header_xid, { "Transaction ID", "of.id", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Transaction ID", HFILL }}, { &ofp_header_warn_ver, { "Warning", "of.warn_ver", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Version Warning", HFILL }}, { &ofp_header_warn_type, { "Warning", "of.warn_type", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Type Warning", HFILL }}, /* CS: Common Structures */ { &ofp_port, { "Port #", "of.port", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Port #", HFILL }}, /* for searching numerically */ /* CS: Physical Port Information */ { &ofp_phy_port, { "Physical Port", "of.port", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Physical Port", HFILL }}, { &ofp_phy_port_port_no, { "Port #", "of.port_no", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Port #", HFILL }}, { &ofp_phy_port_hw_addr, { "MAC Address", "of.port_hw_addr", FT_ETHER, BASE_NONE, NO_STRINGS, NO_MASK, "MAC Address", HFILL }}, { &ofp_phy_port_name, { "Port Name", "of.port_port_name", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Port Name", HFILL }}, { &ofp_phy_port_config_hdr, { "Port Config Flags", "of.port_config", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Config Flags", HFILL }}, { &ofp_phy_port_config[0], { " Port is administratively down", "of.port_config_port_down", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_PORT_DOWN, "Port is administratively down", HFILL }}, { &ofp_phy_port_config[1], { " Disable 802.1D spanning tree on port", "of.port_config_no_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_STP, "Disable 802.1D spanning tree on port", HFILL }}, { &ofp_phy_port_config[2], { " Drop non-802.1D packets received on port", "of.port_config_no_recv", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_RECV, "Drop non-802.1D packets received on port", HFILL }}, { &ofp_phy_port_config[3], { " Drop received 802.1D STP packets", "of.port_config_no_revc_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_RECV_STP, "Drop received 802.1D STP packets", HFILL }}, { &ofp_phy_port_config[4], { " Do not include this port when flooding", "of.port_config_no_flood", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_FLOOD, "Do not include this port when flooding", HFILL }}, { &ofp_phy_port_config[5], { " Drop packets forwarded to port", "of.port_config_no_fwd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_FWD, "Drop packets forwarded to port", HFILL }}, { &ofp_phy_port_config[6], { " Do not send packet-in msgs for port", "of.port_config_no_packet_in", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_PACKET_IN, "Do not send packet-in msgs for port", HFILL }}, { &ofp_phy_port_state_hdr, { "Port State Flags", "of.port_state", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "State Flags", HFILL }}, /* * { &ofp_phy_port_state[0], { " No physical link present", "of.port_state_link_down", FT_NONE, BASE_NONE, NO_STRINGS, OFPPS_LINK_DOWN, "No physical link present", HFILL }}, */ { &ofp_phy_port_state_not_evil, { " No physical link present", "of.port_state_link_down_not_evil", FT_NONE, BASE_NONE, NO_STRINGS, OFPPS_LINK_DOWN, "No physical link present", HFILL }}, { &ofp_phy_port_state_stp_state, { "STP state", "of.port_state_stp_listen", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "STP state", HFILL }}, { &ofp_phy_port_curr_hdr, { "Port Current Flags", "of.port_curr", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Current Flags", HFILL }}, { &ofp_phy_port_curr[0], { " 10 Mb half-duplex rate support", "of.port_curr_10mb_hd" , FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_HD, "10 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_curr[1], { " 10 Mb full-duplex rate support", "of.port_curr_10mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_FD, "10 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_curr[2], { " 100 Mb half-duplex rate support", "of.port_curr_100mb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_HD, "100 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_curr[3], { " 100 Mb full-duplex rate support", "of.port_curr_100mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_FD, "100 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_curr[4], { " 1 Gb half-duplex rate support", "of.port_curr_1gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_HD, "1 Gb half-duplex rate support", HFILL }}, { &ofp_phy_port_curr[5], { " 1 Gb full-duplex rate support", "of.port_curr_1gb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_FD, "1 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_curr[6], { " 10 Gb full-duplex rate support", "of.port_curr_10gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10GB_FD, "10 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_curr[7], { " Copper medium support", "of.port_curr_copper", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_COPPER, "Copper medium support", HFILL }}, { &ofp_phy_port_curr[8], { " Fiber medium support", "of.port_curr_fiber", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_FIBER, "Fiber medium support", HFILL }}, { &ofp_phy_port_curr[9], { " Auto-negotiation support", "of.port_curr_autoneg", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_AUTONEG, "Auto-negotiation support", HFILL }}, { &ofp_phy_port_curr[10], { " Pause support", "of.port_curr_pause", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE, "Pause support", HFILL }}, { &ofp_phy_port_curr[11], { " Asymmetric pause support", "of.port_curr_pause_asym", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE_ASYM, "Asymmetric pause support", HFILL }}, { &ofp_phy_port_advertised_hdr, { "Port Advertsied Flags", "of.port_advertised", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Advertised Flags", HFILL }}, { &ofp_phy_port_advertised[0], { " 10 Mb half-duplex rate support", "of.port_advertised_10mb_hd" , FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_HD, "10 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[1], { " 10 Mb full-duplex rate support", "of.port_advertised_10mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_FD, "10 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[2], { " 100 Mb half-duplex rate support", "of.port_advertised_100mb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_HD, "100 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[3], { " 100 Mb full-duplex rate support", "of.port_advertised_100mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_FD, "100 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[4], { " 1 Gb half-duplex rate support", "of.port_advertised_1gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_HD, "1 Gb half-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[5], { " 1 Gb full-duplex rate support", "of.port_advertised_1gb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_FD, "1 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[6], { " 10 Gb full-duplex rate support", "of.port_advertised_10gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10GB_FD, "10 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_advertised[7], { " Copper medium support", "of.port_advertised_copper", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_COPPER, "Copper medium support", HFILL }}, { &ofp_phy_port_advertised[8], { " Fiber medium support", "of.port_advertised_fiber", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_FIBER, "Fiber medium support", HFILL }}, { &ofp_phy_port_advertised[9], { " Auto-negotiation support", "of.port_advertised_autoneg", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_AUTONEG, "Auto-negotiation support", HFILL }}, { &ofp_phy_port_advertised[10], { " Pause support", "of.port_advertised_pause", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE, "Pause support", HFILL }}, { &ofp_phy_port_advertised[11], { " Asymmetric pause support", "of.port_advertised_pause_asym", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE_ASYM, "Asymmetric pause support", HFILL }}, { &ofp_phy_port_supported_hdr, { "Port Supported Flags", "of.port_supported", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Supported Flags", HFILL }}, { &ofp_phy_port_supported[0], { " 10 Mb half-duplex rate support", "of.port_supported_10mb_hd" , FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_HD, "10 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_supported[1], { " 10 Mb full-duplex rate support", "of.port_supported_10mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_FD, "10 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_supported[2], { " 100 Mb half-duplex rate support", "of.port_supported_100mb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_HD, "100 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_supported[3], { " 100 Mb full-duplex rate support", "of.port_supported_100mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_FD, "100 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_supported[4], { " 1 Gb half-duplex rate support", "of.port_supported_1gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_HD, "1 Gb half-duplex rate support", HFILL }}, { &ofp_phy_port_supported[5], { " 1 Gb full-duplex rate support", "of.port_supported_1gb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_FD, "1 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_supported[6], { " 10 Gb full-duplex rate support", "of.port_supported_10gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10GB_FD, "10 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_supported[7], { " Copper medium support", "of.port_supported_copper", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_COPPER, "Copper medium support", HFILL }}, { &ofp_phy_port_supported[8], { " Fiber medium support", "of.port_supported_fiber", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_FIBER, "Fiber medium support", HFILL }}, { &ofp_phy_port_supported[9], { " Auto-negotiation support", "of.port_supported_autoneg", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_AUTONEG, "Auto-negotiation support", HFILL }}, { &ofp_phy_port_supported[10], { " Pause support", "of.port_supported_pause", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE, "Pause support", HFILL }}, { &ofp_phy_port_supported[11], { " Asymmetric pause support", "of.port_supported_pause_asym", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE_ASYM, "Asymmetric pause support", HFILL }}, { &ofp_phy_port_peer_hdr, { "Port Peer Flags", "of.port_peer", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Peer Flags", HFILL }}, { &ofp_phy_port_peer[0], { " 10 Mb half-duplex rate support", "of.port_peer_10mb_hd" , FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_HD, "10 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_peer[1], { " 10 Mb full-duplex rate support", "of.port_peer_10mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_FD, "10 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_peer[2], { " 100 Mb half-duplex rate support", "of.port_peer_100mb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_HD, "100 Mb half-duplex rate support", HFILL }}, { &ofp_phy_port_peer[3], { " 100 Mb full-duplex rate support", "of.port_peer_100mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_FD, "100 Mb full-duplex rate support", HFILL }}, { &ofp_phy_port_peer[4], { " 1 Gb half-duplex rate support", "of.port_peer_1gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_HD, "1 Gb half-duplex rate support", HFILL }}, { &ofp_phy_port_peer[5], { " 1 Gb full-duplex rate support", "of.port_peer_1gb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_FD, "1 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_peer[6], { " 10 Gb full-duplex rate support", "of.port_peer_10gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10GB_FD, "10 Gb full-duplex rate support", HFILL }}, { &ofp_phy_port_peer[7], { " Copper medium support", "of.port_peer_copper", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_COPPER, "Copper medium support", HFILL }}, { &ofp_phy_port_peer[8], { " Fiber medium support", "of.port_peer_fiber", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_FIBER, "Fiber medium support", HFILL }}, { &ofp_phy_port_peer[9], { " Auto-negotiation support", "of.port_peer_autoneg", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_AUTONEG, "Auto-negotiation support", HFILL }}, { &ofp_phy_port_peer[10], { " Pause support", "of.port_peer_pause", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE, "Pause support", HFILL }}, { &ofp_phy_port_peer[11], { " Asymmetric pause support", "of.port_peer_pause_asym", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE_ASYM, "Asymmetric pause support", HFILL }}, /* CS: match */ { &ofp_match, { "Match", "of.match", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Match", HFILL }}, { &ofp_match_wildcards_hdr, { "Match Types", "of.wildcards", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Match Types (Wildcards)", HFILL }}, { &ofp_match_wildcards[0], { " Input port", "of.wildcard_in_port" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_IN_PORT, "Input Port", HFILL }}, { &ofp_match_wildcards[1], { " VLAN", "of.wildcard_dl_vlan" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_DL_VLAN, "VLAN", HFILL }}, { &ofp_match_wildcards[2], { " Ethernet Src Addr", "of.wildcard_dl_src" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_DL_SRC, "Ethernet Source Address", HFILL }}, { &ofp_match_wildcards[3], { " Ethernet Dst Addr", "of.wildcard_dl_dst" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_DL_DST, "Ethernet Destination Address", HFILL }}, { &ofp_match_wildcards[4], { " Ethernet Type", "of.wildcard_dl_type" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_DL_TYPE, "Ethernet Type", HFILL }}, { &ofp_match_wildcards[5], { " IP Protocol", "of.wildcard_nw_proto" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_NW_PROTO, "IP Protocol", HFILL }}, { &ofp_match_wildcards[6], { " TCP/UDP Src Port", "of.wildcard_tp_src" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_TP_SRC, "TCP/UDP Source Port", HFILL }}, { &ofp_match_wildcards[7], { " TCP/UDP Dst Port", "of.wildcard_tp_dst" , FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_TP_DST, "TCP/UDP Destinatoin Port", HFILL }}, { &ofp_match_wildcards[8], { " IP Src Addr Mask", "of.wildcard_nw_src" , FT_UINT32, BASE_DEC, VALS(addr_mask), OFPFW_NW_SRC_MASK, "IP Source Address Mask", HFILL }}, { &ofp_match_wildcards[9], { " IP Dst Addr Mask", "of.wildcard_nw_dst" , FT_UINT32, BASE_DEC, VALS(addr_mask), OFPFW_NW_DST_MASK , "IP Destination Address Mask", HFILL }}, { &ofp_match_wildcards[10], { " MPLS label 1", "of.wildcard_mpls_label1", FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_MPLS_L1, "MPLS label 1", HFILL }}, { &ofp_match_wildcards[11], { " MPLS label 2", "of.wildcard_mpls_label2", FT_UINT32, BASE_DEC, VALS(wildcard_choice), OFPFW_MPLS_L2, "MPLS label 2", HFILL }}, { &ofp_table_stats_wildcards[0], { " Input port", "of.wildcard_in_port" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_IN_PORT, "Input Port", HFILL }}, { &ofp_table_stats_wildcards[1], { " VLAN", "of.wildcard_dl_vlan" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_DL_VLAN, "VLAN", HFILL }}, { &ofp_table_stats_wildcards[2], { " Ethernet Src Addr", "of.wildcard_dl_src" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_DL_SRC, "Ethernet Source Address", HFILL }}, { &ofp_table_stats_wildcards[3], { " Ethernet Dst Addr", "of.wildcard_dl_dst" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_DL_DST, "Ethernet Destination Address", HFILL }}, { &ofp_table_stats_wildcards[4], { " Ethernet Type", "of.wildcard_dl_type" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_DL_TYPE, "Ethernet Type", HFILL }}, { &ofp_table_stats_wildcards[5], { " IP Protocol", "of.wildcard_nw_proto" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_NW_PROTO, "IP Protocol", HFILL }}, { &ofp_table_stats_wildcards[6], { " TCP/UDP Src Port", "of.wildcard_tp_src" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_TP_SRC, "TCP/UDP Source Port", HFILL }}, { &ofp_table_stats_wildcards[7], { " TCP/UDP Dst Port", "of.wildcard_tp_dst" , FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_TP_DST, "TCP/UDP Destinatoin Port", HFILL }}, { &ofp_table_stats_wildcards[8], { " IP Src Addr Mask", "of.wildcard_nw_src" , FT_UINT32, BASE_DEC, VALS(ts_addr_mask), OFPFW_NW_SRC_MASK, "IP Source Address Mask", HFILL }}, { &ofp_table_stats_wildcards[9], { " IP Dst Addr Mask", "of.wildcard_nw_dst" , FT_UINT32, BASE_DEC, VALS(ts_addr_mask), OFPFW_NW_DST_MASK , "IP Destination Address Mask", HFILL }}, { &ofp_table_stats_wildcards[10], { "MPLS label 1", "of.wildcard_mpls_label1", FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_MPLS_L1, "MPLS label 1", HFILL }}, { &ofp_table_stats_wildcards[11], { "MPLS label 2", "of.wildcard_mpls_label2", FT_UINT32, BASE_DEC, VALS(ts_wildcard_choice), OFPFW_MPLS_L2, "MPLS label 2", HFILL }}, { &ofp_match_in_port, { "Input Port", "of.match_in_port", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Input Port", HFILL }}, { &ofp_match_dl_src, { "Ethernet Src Addr", "of.match_dl_src", FT_ETHER, BASE_NONE, NO_STRINGS, NO_MASK, "Source MAC Address", HFILL }}, { &ofp_match_dl_dst, { "Ethernet Dst Addr", "of.match_dl_dst", FT_ETHER, BASE_NONE, NO_STRINGS, NO_MASK, "Destination MAC Address", HFILL }}, { &ofp_match_dl_vlan, { "Input VLAN", "of.match_dl_vlan", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Input VLAN", HFILL }}, { &ofp_match_dl_type, { "Ethernet Type", "of.match_dl_type", FT_UINT16, BASE_HEX, NO_STRINGS, NO_MASK, "Ethernet Type", HFILL }}, { &ofp_match_nw_src, { "IP Src Addr", "of.match_nw_src", FT_IPv4, BASE_DEC, NO_STRINGS, NO_MASK, "Source IP Address", HFILL }}, { &ofp_match_nw_dst, { "IP Dst Addr", "of.match_nw_dst", FT_IPv4, BASE_DEC, NO_STRINGS, NO_MASK, "Destination IP Address", HFILL }}, { &ofp_match_nw_proto, { "IP Protocol", "of.match_", FT_UINT8, BASE_HEX, NO_STRINGS, NO_MASK, "IP Protocol", HFILL }}, { &ofp_match_tp_src, { "TCP/UDP Src Port", "of.match_tp_src", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "TCP/UDP Source Port", HFILL }}, { &ofp_match_tp_dst, { "TCP/UDP Dst Port", "of.match_tp_dst", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "TCP/UDP Destination Port", HFILL }}, { &ofp_match_icmp_type, { "ICMP Type", "of.match_tp_src", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "ICMP Type", HFILL }}, { &ofp_match_icmp_code, { "ICMP Code", "of.match_tp_dst", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "ICMP Code", HFILL }}, { &ofp_match_nw_src_mask_bits, { "IP Src Addr Mask Bits", "of.match_nw_src_mask_bits", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Source IP Address Mask Bits", HFILL }}, { &ofp_match_nw_dst_mask_bits, { "IP Dst Addr Mask Bits", "of.match_nw_dst_mask_bits", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Destination IP Address Mask Bits", HFILL }}, { &ofp_match_mpls_label1, { "MPLS Label 1", "of.match_mpls_label1", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "MPLS Label 1", HFILL }}, { &ofp_match_mpls_label2, { "MPLS Label 2", "of.match_mpls_label2", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "MPLS Label 2", HFILL }}, { &ofp_match_mpls_nolabel, { "No MPLS Label", "of.match_mpls_nolabel", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "No MPLS label", HFILL }}, { &ofp_match_mpls_reservedlabel, { "MPLS label is reserved", "of.match_mpls_reservedlabel", FT_NONE, BASE_DEC, NO_STRINGS, NO_MASK, "Reserved MPLS label", HFILL }}, /* CS: action type */ { &ofp_action, { "Action", "of.action", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Action", HFILL }}, { &ofp_action_type, { "Type", "of.action_type", FT_UINT16, BASE_DEC, VALS(names_ofp_action_type), NO_MASK, "Type", HFILL }}, { &ofp_action_len, { "Len", "of.action_len", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Len", HFILL }}, { &ofp_action_vlan_vid, { "VLAN ID", "of.action_vlan_vid", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "VLAN ID", HFILL }}, { &ofp_action_vlan_pcp, { "VLAN priority", "of.action_vlan_pcp", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "VLAN priority", HFILL }}, { &ofp_action_dl_addr, { "MAC Addr", "of.action_dl_addr", FT_ETHER, BASE_NONE, NO_STRINGS, NO_MASK, "MAC Addr", HFILL }}, { &ofp_action_nw_addr, { "IP Addr", "of.action_nw_addr", FT_IPv4, BASE_NONE, NO_STRINGS, NO_MASK, "IP Addr", HFILL }}, { &ofp_action_tp_port, { "Port", "of.action_tp_port", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "TCP/UDP Port", HFILL }}, { &ofp_action_vendor, { "Vendor-defined", "of.action_vendor", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Vendor-defined", HFILL }}, { &ofp_action_unknown, { "Unknown Action Type", "of.action_unknown", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Unknown Action Type", HFILL }}, { &ofp_action_warn, { "Warning", "of.action_warn", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Warning", HFILL }}, { &ofp_action_num, { "# of Actions", "of.action_num", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Number of Actions", HFILL }}, /* CS: ofp_vport_table_features */ { &ofp_vport_table_features, { "Virtual Port Table Features", "of.vf", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Virtual Port Table Features", HFILL }}, { &ofp_vport_table_max_vports, { "Max number of entries supported", "of.vf_max_vports", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Max number of entries supported", HFILL }}, /* CS: ofp_vport_mod */ { &ofp_vport_mod, { "Add or remove a virtual port", "of.vport_mod", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Add or remove a virtual port", HFILL }}, { &ofp_vport_mod_vport, { "Virtual port number", "of.vport_mod_vport", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Virtual port number", HFILL }}, { &ofp_vport_mod_parent_port, { "Parent port number", "of.vport_mod_parent", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Parent port number", HFILL }}, { &ofp_vport_mod_command, { "Flow mod action command", "of.vport_mod_command", FT_UINT16, BASE_DEC, VALS(names_ofp_vport_mod_command), NO_MASK, "Flow mod action command", HFILL }}, /* CS: ofp_vport_actions */ { &ofp_vport_actions_hdr, { "Actions", "of.vf_actions", FT_UINT32, BASE_HEX, NO_STRINGS, NO_MASK, "Actions", HFILL }}, { &ofp_vport_actions[0], { " Output to switch port", "of.vf_actions_output", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPPAT_OUTPUT, "Output to switch port", HFILL }}, { &ofp_vport_actions[1], { " Pop MLPS label", "of.vf_actions_pop_mpls", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPPAT_POP_MPLS, "Pop MLPS label", HFILL }}, { &ofp_vport_actions[2], { " Push MPLS label", "of.vf_actions_push_mpls", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPPAT_PUSH_MPLS, "Push MPLS label", HFILL }}, { &ofp_vport_actions[3], { " Set MPLS label", "of.vf_actions_set_mpls_label", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPPAT_SET_MPLS_LABEL, "Set MPLS label", HFILL }}, { &ofp_vport_actions[4], { " Set MPLS exp bits", "of.vf_actions_set_mpls_exp", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPPAT_SET_MPLS_EXP, "Set MPLS exp bits", HFILL }}, { &ofp_vport_table_max_chain_depth, { "Maximum depth of virtual port chain", "of.vf_max_chain_depth", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Maximum depth of virtual port chain", HFILL }}, { &ofp_vport_table_mixed_chaining, { "Indicates that the virtual port cannot have a parent virtual port that performs a different action", "of.vf_mixed_chain", FT_UINT8, BASE_DEC, VALS(names_choice), NO_MASK, "Virtual port cannot have a parent virtual port that performs a different action", HFILL }}, /* MPLS Pop action flags */ { &ofp_vport_action_pop_mpls_hdr, { "MPLS pop action label flags", "of.vf_mpls_pop", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "MPLS pop action flags", HFILL }}, { &ofp_vport_action_pop_mpls[0], { " Don't pop MPLS label", "of.vf_mpls_pop_dont_pop", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_POP_DONT_POP, "Don't pop", HFILL }}, { &ofp_vport_action_pop_mpls[1], { " Decrement the TTL", "of.vf_mpls_pop_decrement_ttl", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_POP_DECREMENT_TTL, "Decrement the TTL", HFILL }}, { &ofp_vport_action_pop_mpls[2], { " Copy the ttl bits to the next header", "of.vf_mpls_pop_copy_ttl", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_POP_COPY_TTL, "Copy the ttl bits to the next header", HFILL }}, { &ofp_vport_action_pop_mpls[3], { " Copy the exp bits to the next header", "of.vf_mpls_pop_copy_exp", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_POP_COPY_EXP, "Copy the exp bits to the next header", HFILL }}, /* MPLS Push action flags */ { &ofp_vport_action_push_mpls_hdr, { "MPLS push label flags", "of.vf_mpls_push", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "MPLS push action flags", HFILL }}, { &ofp_vport_action_push_mpls[0], { " Decrement the TTL", "of.vf_mpls_push_decrement_ttl", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_PUSH_DECREMENT_TTL, "Decrement the TTL", HFILL }}, { &ofp_vport_action_push_mpls[1], { " Copy the ttl bits from the next header", "of.vf_mpls_push_ttl_next", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_PUSH_TTL_NEXT, "Copy the ttl bits from the next header", HFILL }}, { &ofp_vport_action_push_mpls[2], { " Copy the exp bits from the next header", "of.vf_mpls_push_exp_next", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_PUSH_EXP_NEXT, "Copy the exp bits from the next header", HFILL }}, { &ofp_vport_action_push_mpls[3], { " Copy the ttl bits from the previous label", "of.vf_mpls_push_ttl_prev", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_PUSH_TTL_PREV, "Copy the ttl bits from the previous label", HFILL }}, { &ofp_vport_action_push_mpls[4], { " Copy the exp bits from the previous label", "of.vf_mpls_push_exp_prev", FT_UINT32, BASE_DEC, VALS(names_choice), MPLS_PUSH_EXP_PREV, "Copy the exp bits from the previous label", HFILL }}, /* Rewrite MPLS Label Action */ { &ofp_vport_action_push_mpls_label, { "Outgoing MPLS Label", "of.vf_action_push_mpls_label", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Outgoing MPLS Label", HFILL }}, /* Rewrite MPLS Exp Bits Action */ { &ofp_vport_action_push_mpls_exp, { "Experimental/class of service bits", "of.vport_action_push_mpls_exp", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Experimental/class of service bits", HFILL }}, { &ofp_vport_action_push_mpls_ttl, { "Time to live", "of.vport_action_push_mpls_ttl", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Time to Live", HFILL }}, /* CS: ofp_action_output */ { &ofp_action_output, { "Output Action(s)", "of.action_output", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Output Action(s)", HFILL }}, { &ofp_action_output_port, { "Output port", "of.action_output_port", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Output port", HFILL }}, { &ofp_action_output_max_len, { "Max Bytes to Send", "of.action_output_max_len", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Maximum Bytes to Send", HFILL }}, { &ofp_vport_action_output, { "Output Action(s)", "of.vport_action_output", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Output Action(s)", HFILL }}, { &ofp_vport_action_unknown, { "Unknown Action Type", "of.vport_action_unknown", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Unknown Action Type", HFILL }}, { &ofp_vport_action_warn, { "Warning", "of.vport_action_warn", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Warning", HFILL }}, { &ofp_vport_action_num, { "# of Actions", "of.vport_action_num", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Number of Actions", HFILL }}, { &ofp_vport_action, { "Action", "of.vport_action", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Action", HFILL }}, { &ofp_vport_action_type, { "Type", "of.vport_action_type", FT_UINT16, BASE_DEC, VALS(names_ofp_vport_action_type), NO_MASK, "Type", HFILL }}, { &ofp_vport_action_len, { "Len", "of.vport_action_len", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Len", HFILL }}, { &ofp_vport_mpls_set_label, { "Outgoing MPLS Label", "of.vf_mpls_set_label", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Outgoing MPLS Label", HFILL }}, /* Rewrite MPLS Label Action, CS: ofp_action_mpls_label */ { &ofp_action_mpls_label, { "Rewrite MPLS Label Action", "of.action_mpls_label", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Output Action(s)", HFILL }}, { &ofp_action_mpls_label_out, { "Outgoing mpls label", "of.action_mpls_out", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Outgoing mpls label", HFILL }}, /* Rewrite MPLS EXP action, CS: ofp_action_mpls_exp */ { &ofp_action_mpls_exp, { "Experimental / Class of service bits", "of.action_mpls_exp", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Experimental / Class of service bits", HFILL }}, /* CSM: Features Request */ /* nothing beyond the header */ /* CSM: Features Reply */ { &ofp_switch_features, { "Switch Features", "of.sf", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Switch Features", HFILL }}, { &ofp_switch_features_datapath_id, { "Datapath ID", "of.sf_datapath_id", FT_UINT64, BASE_HEX, NO_STRINGS, NO_MASK, "Datapath ID", HFILL }}, { &ofp_switch_features_n_buffers, { "Max packets buffered", "of.sf_n_buffers", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Max packets buffered", HFILL }}, { &ofp_switch_features_n_tables, { "Number of Tables", "of.sf_n_tables", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Number of tables", HFILL }}, { &ofp_switch_features_capabilities_hdr, { "Capabilities", "of.sf_capabilities", FT_UINT32, BASE_HEX, NO_STRINGS, NO_MASK, "Capabilities", HFILL }}, { &ofp_switch_features_capabilities[0], { " Flow statistics", "of.sf_capabilities_flow_stats", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_FLOW_STATS, "Flow statistics", HFILL }}, { &ofp_switch_features_capabilities[1], { " Table statistics", "of.sf_capabilities_table_stats", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_TABLE_STATS, "Table statistics", HFILL }}, { &ofp_switch_features_capabilities[2], { " Port statistics", "of.sf_capabilities_port_stats", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_PORT_STATS, "Port statistics", HFILL }}, { &ofp_switch_features_capabilities[3], { " 802.11d spanning tree", "of.sf_capabilities_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_STP, "802.11d spanning tree", HFILL }}, { &ofp_switch_features_capabilities[4], { " Supports transmitting through multiple physical interface", "of.sf_capabilities_multi_phy_tx", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_MULTI_PHY_TX, "Supports transmitting through multiple physical interface", HFILL }}, { &ofp_switch_features_capabilities[5], { " Can reassemble IP fragments", "of.sf_capabilities_ip_reasm", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_IP_REASM, "Can reassemble IP fragments", HFILL }}, { &ofp_switch_features_capabilities[6], { " Supports a virtual port table. Rest of virtual port table attributes specified in ofp_vport_table_features", "of.sf_capabilities_vport_table", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_VPORT_TABLE, "Supports a virtual port table", HFILL }}, { &ofp_switch_features_actions_hdr, { "Actions", "of.sf_actions", FT_UINT32, BASE_HEX, NO_STRINGS, NO_MASK, "Actions", HFILL }}, { &ofp_switch_features_actions_warn, { "Warning: Actions are meaningless until version 0x90", "of.sf_actions_warn", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Warning", HFILL }}, { &ofp_switch_features_actions[0], { " Output to switch port", "of.sf_actions_output", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_OUTPUT, "Output to switch port", HFILL }}, { &ofp_switch_features_actions[1], { " Set the 802.1q VLAN id", "of.sf_actions_set_vlan_vid", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_VLAN_VID, "Set the 802.1q VLAN id", HFILL }}, { &ofp_switch_features_actions[2], { " Set the 802.1q priority", "of.sf_actions_set_vlan_pcp", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_VLAN_PCP, "Set the 802.1q VLAN priority", HFILL }}, { &ofp_switch_features_actions[3], { " Strip the 802.1q header", "of.sf_actions_strip_vlan", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_STRIP_VLAN, "Strip the 802.1q header", HFILL }}, { &ofp_switch_features_actions[4], { " Ethernet source address", "of.sf_actions_eth_src_addr", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_DL_SRC, "Ethernet source address", HFILL }}, { &ofp_switch_features_actions[5], { " Ethernet destination address", "of.sf_actions_eth_dst_addr", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_DL_DST, "Ethernet destination address", HFILL }}, { &ofp_switch_features_actions[6], { " IP source address", "of.sf_actions_ip_src_addr", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_NW_SRC, "IP source address", HFILL }}, { &ofp_switch_features_actions[7], { " IP destination address", "of.sf_actions_ip_dst_addr", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_NW_DST, "IP destination address", HFILL }}, { &ofp_switch_features_actions[8], { " TCP/UDP source", "of.sf_actions_src_port", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_TP_SRC, "TCP/UDP source port", HFILL }}, { &ofp_switch_features_actions[9], { " TCP/UDP destination", "of.sf_actions_dst_port", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_TP_DST, "TCP/UDP destination port", HFILL }}, { &ofp_switch_features_actions[10], { " Set the MPLS label.", "of.sf_actions_set_mpls_label", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_MPLS_LABEL, "Set the MPLS label", HFILL }}, { &ofp_switch_features_actions[11], { " Set the MPLS EXP bits.", "of.sf_actions_set_mpls_exp", FT_UINT32, BASE_DEC, VALS(names_choice), 1 << OFPAT_SET_MPLS_EXP, "Set the MPLS EXP bits", HFILL }}, { &ofp_switch_features_ports_hdr, { "Port Definitions", "of.sf_ports", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Port Definitions", HFILL }}, { &ofp_switch_features_ports_num, { "# of Ports", "of.sf_ports_num", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Number of Ports", HFILL }}, { &ofp_switch_features_ports_warn, { "Warning", "of.sf_ports_warn", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Warning", HFILL }}, /* CSM: Get Config Request */ /* nothing beyond the header */ /* CSM: Get Config Reply */ /* CSM: Set Config */ { &ofp_switch_config, { "Switch Configuration", "of.sc", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Switch Configuration", HFILL } }, { &ofp_switch_config_flags_hdr, { "Flags", "of.sc_flags", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flags", HFILL } }, { &ofp_switch_config_flags[0], { " Send flow expirations", "of.sc_flags_send_flow_exp", FT_UINT16, BASE_DEC, VALS(names_choice), OFPC_SEND_FLOW_EXP, "Send flow expirations", HFILL }}, { &ofp_switch_config_flags_ip_frag, { " Handling of IP fragments", "of.sc_flags_ip_frag", FT_UINT16, BASE_DEC, VALS(sc_frag_choices), OFPC_FRAG_MASK, "Handling of IP fragments", HFILL }}, /* { &ofp_switch_config_flags[1], { " No special fragment handling", "of.sc_flags_frag_normal", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_FRAG_NORMAL, "No special fragment handling", HFILL }}, { &ofp_switch_config_flags[2], { " Drop fragments", "of.sc_flags_frag_drop", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_FRAG_DROP, "Drop fragments", HFILL }}, { &ofp_switch_config_flags[3], { " Reassemble (only if OFPC_IP_REASM set)", "of.sc_flags_frag_reasm", FT_UINT32, BASE_DEC, VALS(names_choice), OFPC_FRAG_REASM, "Reassemble (only if OFPC_IP_REASM set)", HFILL }}, */ { &ofp_switch_config_miss_send_len, { "Max Bytes of New Flow to Send to Controller", "of.sc_miss_send_len", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Max Bytes of New Flow to Send to Controller", HFILL } }, /* AM: Packet In */ { &ofp_packet_in, { "Packet In", "of.pktin", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Packet In", HFILL }}, { &ofp_packet_in_buffer_id, { "Buffer ID", "of.pktin_buffer_id", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Buffer ID", HFILL }}, { &ofp_packet_in_total_len, { "Frame Total Length", "of.pktin_total_len", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Frame Total Length (B)", HFILL }}, { &ofp_packet_in_in_port, { "Frame Recv Port", "of.pktin_in_port", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Port Frame was Received On", HFILL }}, { &ofp_packet_in_reason, { "Reason Sent", "of.pktin_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_packet_in_reason), NO_MASK, "Reason Packet Sent", HFILL }}, { &ofp_packet_in_data_hdr, { "Frame Data", "of.pktin_data", FT_BYTES, BASE_NONE, NO_STRINGS, NO_MASK, "Frame Data", HFILL }}, /* CSM: Packet Out */ { &ofp_packet_out, { "Packet Out", "of.pktout", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Packet Out", HFILL }}, { &ofp_packet_out_buffer_id, { "Buffer ID", "of.pktout_buffer_id", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Buffer ID", HFILL }}, { &ofp_packet_out_in_port, { "Frame Recv Port", "of.pktout_in_port", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Port Frame was Received On", HFILL }}, { &ofp_packet_out_actions_len, { "Size of action array in bytes", "of.pktout_actions_len", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Size of action array in bytes", HFILL }}, { &ofp_packet_out_actions_hdr, { "Actions to Apply", "of.pktout_actions", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Actions to Apply to Packet", HFILL }}, { &ofp_packet_out_data_hdr, { "Frame Data", "of.pktout_data", FT_BYTES, BASE_NONE, NO_STRINGS, NO_MASK, "Frame Data", HFILL }}, /* CSM: Flow Mod */ { &ofp_flow_mod, { "Flow Modification", "of.fm", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Modification", HFILL } }, { &ofp_flow_mod_command, { "Command", "of.fm_command", FT_UINT16, BASE_DEC, VALS(names_flow_mod_command), NO_MASK, "Command", HFILL } }, { &ofp_flow_mod_idle_timeout, { "Idle Time (sec) Before Discarding", "of.fm_max_idle", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Idle Time (sec) Before Discarding", HFILL } }, { &ofp_flow_mod_hard_timeout, { "Max Time (sec) Before Discarding", "of.fm_max_idle", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Max Idle Time (sec) Before Discarding", HFILL } }, { &ofp_flow_mod_priority, { "Priority", "of.fm_priority", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Priority", HFILL } }, { &ofp_flow_mod_buffer_id, { "Buffer ID", "of.fm_buffer_id", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Buffer ID", HFILL } }, { &ofp_flow_mod_out_port, { "Out Port (delete* only)", "of.fm_out_port", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Out Port (delete* only)", HFILL } }, { &ofp_flow_mod_reserved, { "Reserved", "of.fm_reserved", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Reserved", HFILL } }, /* AM: Flow Expired */ { &ofp_flow_expired, { "Flow Expired", "of.fe", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Expired", HFILL } }, { &ofp_flow_expired_priority, { "Priority", "of.fe_priority", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Priority", HFILL } }, { &ofp_flow_expired_reason, { "Reason", "of.fe_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_flow_expired_reason), NO_MASK, "Reason", HFILL } }, { &ofp_flow_expired_duration, { "Flow Duration (sec)", "of.fe_duration", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Time Flow was Alive (sec)", HFILL } }, { &ofp_flow_expired_packet_count, { "Packet Count", "of.fe_packet_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Packet Cout", HFILL } }, { &ofp_flow_expired_byte_count, { "Byte Count", "of.fe_byte_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Byte Count", HFILL } }, /* CSM: Table */ /* not yet defined by the spec */ /* CSM: Port Mod */ { &ofp_port_mod, { "Port Modification", "of.pm", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Port Modification", HFILL } }, { &ofp_port_mod_port_no, { "Port #", "of.port_no", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Port #", HFILL }}, { &ofp_port_mod_hw_addr, { "MAC Address", "of.port_hw_addr", FT_ETHER, BASE_NONE, NO_STRINGS, NO_MASK, "MAC Address", HFILL }}, { &ofp_port_mod_config_hdr, { "Port Config Flags", "of.port_config", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Config Flags", HFILL }}, { &ofp_port_mod_config[0], { " Port is administratively down", "of.port_config_port_down", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_PORT_DOWN, "Port is administratively down", HFILL }}, { &ofp_port_mod_config[1], { " Disable 802.1D spanning tree on port", "of.port_config_no_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_STP, "Disable 802.1D spanning tree on port", HFILL }}, { &ofp_port_mod_config[2], { " Drop non-802.1D packets received on port", "of.port_config_no_recv", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_RECV, "Drop non-802.1D packets received on port", HFILL }}, { &ofp_port_mod_config[3], { " Drop received 802.1D STP packets", "of.port_config_no_revc_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_RECV_STP, "Drop received 802.1D STP packets", HFILL }}, { &ofp_port_mod_config[4], { " Do not include this port when flooding", "of.port_config_no_flood", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_FLOOD, "Do not include this port when flooding", HFILL }}, { &ofp_port_mod_config[5], { " Drop packets forwarded to port", "of.port_config_no_fwd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_FWD, "Drop packets forwarded to port", HFILL }}, { &ofp_port_mod_config[6], { " Do not send packet-in msgs for port", "of.port_config_no_packet_in", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_PACKET_IN, "Do not send packet-in msgs for port", HFILL }}, { &ofp_port_mod_mask_hdr, { "Port Config Mask", "of.port_mask", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Config Mask", HFILL }}, { &ofp_port_mod_mask[0], { " Port is administratively down", "of.port_mask_port_down", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_PORT_DOWN, "Port is administratively down", HFILL }}, { &ofp_port_mod_mask[1], { " Disable 802.1D spanning tree on port", "of.port_mask_no_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_STP, "Disable 802.1D spanning tree on port", HFILL }}, { &ofp_port_mod_mask[2], { " Drop non-802.1D packets received on port", "of.port_mask_no_recv", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_RECV, "Drop non-802.1D packets received on port", HFILL }}, { &ofp_port_mod_mask[3], { " Drop received 802.1D STP packets", "of.port_mask_no_revc_stp", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_RECV_STP, "Drop received 802.1D STP packets", HFILL }}, { &ofp_port_mod_mask[4], { " Do not include this port when flooding", "of.port_mask_no_flood", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_FLOOD, "Do not include this port when flooding", HFILL }}, { &ofp_port_mod_mask[5], { " Drop packets forwarded to port", "of.port_mask_no_fwd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_FWD, "Drop packets forwarded to port", HFILL }}, { &ofp_port_mod_mask[6], { " Do not send packet-in msgs for port", "of.port_mask_no_packet_in", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPC_NO_PACKET_IN, "Do not send packet-in msgs for port", HFILL }}, { &ofp_port_mod_advertise_hdr, { "Port Advertise Flags", "of.port_advertise", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Advertise Flags", HFILL }}, { &ofp_port_mod_advertise[0], { " 10 Mb half-duplex rate support", "of.port_advertise_10mb_hd" , FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_HD, "10 Mb half-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[1], { " 10 Mb full-duplex rate support", "of.port_advertise_10mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10MB_FD, "10 Mb full-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[2], { " 100 Mb half-duplex rate support", "of.port_advertise_100mb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_HD, "100 Mb half-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[3], { " 100 Mb full-duplex rate support", "of.port_advertise_100mb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_100MB_FD, "100 Mb full-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[4], { " 1 Gb half-duplex rate support", "of.port_advertise_1gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_HD, "1 Gb half-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[5], { " 1 Gb full-duplex rate support", "of.port_advertise_1gb_fd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_1GB_FD, "1 Gb full-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[6], { " 10 Gb full-duplex rate support", "of.port_advertise_10gb_hd", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_10GB_FD, "10 Gb full-duplex rate support", HFILL }}, { &ofp_port_mod_advertise[7], { " Copper medium support", "of.port_advertise_copper", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_COPPER, "Copper medium support", HFILL }}, { &ofp_port_mod_advertise[8], { " Fiber medium support", "of.port_advertise_fiber", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_FIBER, "Fiber medium support", HFILL }}, { &ofp_port_mod_advertise[9], { " Auto-negotiation support", "of.port_advertise_autoneg", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_AUTONEG, "Auto-negotiation support", HFILL }}, { &ofp_port_mod_advertise[10], { " Pause support", "of.port_advertise_pause", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE, "Pause support", HFILL }}, { &ofp_port_mod_advertise[11], { " Asymmetric pause support", "of.port_advertise_pause_asym", FT_UINT32, BASE_DEC, VALS(names_choice), OFPPF_PAUSE_ASYM, "Asymmetric pause support", HFILL }}, /* AM: Port Status */ { &ofp_port_status, { "Port Status", "of.ps", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Port Status", HFILL } }, { &ofp_port_status_reason, { "Reason", "of.ps_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_port_reason), NO_MASK, "Reason", HFILL } }, /* CSM: Stats Request */ { &ofp_stats_request, { "Stats Request", "of.sreq", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Statistics Request", HFILL } }, { &ofp_stats_request_type, { "Type", "of.sreq_type", FT_UINT16, BASE_HEX, VALS(names_stats_types), NO_MASK, "Type", HFILL } }, { &ofp_stats_request_flags, { "Flags", "of.sreq_flags", FT_UINT16, BASE_HEX, NO_STRINGS, NO_MASK, "Flags", HFILL } }, { &ofp_stats_request_body, { "Body", "of.sreq_body", FT_BYTES, BASE_NONE, NO_STRINGS, NO_MASK, "Body", HFILL } }, /* CSM: Stats Reply */ { &ofp_stats_reply, { "Stats Reply", "of.srep", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Statistics Reply", HFILL } }, { &ofp_stats_reply_type, { "Type", "of.srep_type", FT_UINT16, BASE_HEX, VALS(names_stats_types), NO_MASK, "Type", HFILL } }, { &ofp_stats_reply_flags, { "Flags", "of.srep_flags", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Flags", HFILL } }, { &ofp_stats_reply_flag[0], { " More replies to follow", "of.srep_more", FT_UINT16, BASE_DEC, VALS(names_choice), OFPSF_REPLY_MORE, "More replies to follow", HFILL }}, { &ofp_stats_reply_body, { "Body", "of.srep_body", FT_BYTES, BASE_NONE, NO_STRINGS, NO_MASK, "Body", HFILL } }, /* CSM: Stats: Desc: Reply */ { &ofp_desc_stats, { "Desc Stats Reply", "of.stats_desc", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Desc Statistics Reply", HFILL } }, { &ofp_desc_stats_mfr_desc, { "Mfr Desc", "of.stats_desc_mfr_desc", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Mfr Desc", HFILL } }, { &ofp_desc_stats_hw_desc, { "HW Desc", "of.stats_desc_hw_desc", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "HW Desc", HFILL } }, { &ofp_desc_stats_sw_desc, { "SW Desc", "of.stats_desc_sw_desc", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "SW Desc", HFILL } }, { &ofp_desc_stats_serial_num, { "Serial Num", "of.stats_desc_serial_num", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Serial Num", HFILL } }, /* CSM: Stats: Flow: Request */ { &ofp_flow_stats_request, { "Flow Stats Request", "of.stats_flow", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Statistics Request", HFILL } }, { &ofp_flow_stats_request_table_id, { "Table ID", "of.stats_flow_table_id", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, /* CSM: Stats: Flow: Reply */ { &ofp_flow_stats_reply, { "Flow Stats Reply", "of.stats_flow_", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Statistics Reply", HFILL } }, { &ofp_flow_stats_reply_table_id, { "Table ID", "of.stats_flow_table_id", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, { &ofp_flow_stats_reply_duration, { "Flow Duration (sec)", "of.stats_flow_duration", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Time Flow has Been Alive (sec)", HFILL } }, { &ofp_flow_stats_reply_priority, { "Priority", "of.stats_flow_priority", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Priority", HFILL } }, { &ofp_flow_stats_reply_idle_timeout, { "Number of seconds idle before expiration", "of.stats_flow_idle_timeout", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Number of seconds idle before expiration", HFILL } }, { &ofp_flow_stats_reply_hard_timeout, { "Number of seconds before expiration", "of.stats_flow_hard_timeout", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Number of seconds before expiration", HFILL } }, { &ofp_flow_stats_reply_packet_count, { "Packet Count", "of.stats_flow_packet_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Packet Count", HFILL } }, { &ofp_flow_stats_reply_byte_count, { "Byte Count", "of.stats_flow_byte_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Byte Count", HFILL } }, /* CSM: Stats: Aggregate: Request */ { &ofp_aggr_stats_request, { "Aggregate Stats Request", "of.stats_aggr", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Aggregate Statistics Request", HFILL } }, { &ofp_aggr_stats_request_table_id, { "Table ID", "of.stats_aggr_table_id", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, /* CSM: Stats: Aggregate: Reply */ { &ofp_aggr_stats_reply, { "Aggregate Stats Reply", "of.stats_aggr", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Aggregate Statistics Reply", HFILL } }, { &ofp_aggr_stats_reply_packet_count, { "Packet Count", "of.stats_aggr_packet_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Packet count", HFILL } }, { &ofp_aggr_stats_reply_byte_count, { "Byte Count", "of.stats_aggr_byte_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Byte Count", HFILL } }, { &ofp_aggr_stats_reply_flow_count, { "Flow Count", "of.stats_aggr_flow_count", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Flow Count", HFILL } }, /* CSM: Stats: Port */ { &ofp_port_stats, { "Port Stats", "of.stats_port", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Port Stats", HFILL } }, { &ofp_port_stats_port_no, { "Port #", "of.stats_port_port_no", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "", HFILL } }, { &ofp_port_stats_rx_packets, { "# Received packets", "of.stats_port_rx_packets", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# Received packets", HFILL } }, { &ofp_port_stats_tx_packets, { "# Transmitted packets", "of.stats_port_tx_packets", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# Transmitted packets", HFILL } }, { &ofp_port_stats_rx_bytes, { "# Received bytes", "of.stats_port_rx_bytes", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# Received bytes", HFILL } }, { &ofp_port_stats_tx_bytes, { "# Transmitted bytes", "of.stats_port_tx_bytes", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# Transmitted bytes", HFILL } }, { &ofp_port_stats_rx_dropped, { "# RX dropped", "of.stats_port_rx_dropped", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# RX dropped", HFILL } }, { &ofp_port_stats_tx_dropped, { "# TX dropped", "of.stats_port_tx_dropped", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# TX dropped", HFILL } }, { &ofp_port_stats_rx_errors, { "# RX errors", "of.stats_port_rx_errors", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# RX errors", HFILL } }, { &ofp_port_stats_tx_errors, { "# TX errors", "of.stats_port_tx_errors", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# TX errors", HFILL } }, { &ofp_port_stats_rx_frame_err, { "# RX frame errors", "of.stats_port_rx_frame_err", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# RX frame alignment errors", HFILL } }, { &ofp_port_stats_rx_over_err, { "# RX overrun errors", "of.stats_port_rx_over_err", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# RX overrun errors", HFILL } }, { &ofp_port_stats_rx_crc_err, { "# RX CRC errors", "of.stats_port_rx_crc_err", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "# RX crc errors", HFILL } }, { &ofp_port_stats_collisions, { "# Collisions", "of.stats_port_collisions", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Number of collisions", HFILL } }, { &ofp_port_stats_mpls_ttl0_dropped, { " # MPLS packets dropped due to ttl 0", "of.stats_mpls_ttl0_dropped", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Number of dropped MPLS packets due to ttl 0", HFILL } }, /* CSM: Stats: Port Table */ { &ofp_port_table_stats, { "Port Table Stats", "of.stats_port_table", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Port Table Stats", HFILL } }, { &ofp_port_table_stats_max_vports, { "Max number of entries supported", "of.stats_port_table_max_vports", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Max number of entries supported", HFILL } }, { &ofp_port_table_stats_active_vports, { "Number of active entries", "of.stats_port_table_active_vports", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Number of active entries", HFILL } }, { &ofp_port_table_stats_lookup_count, { "Number of port entries looked up in port table", "of.stats_port_table_lookup_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Number of port entries looked up in port table", HFILL } }, { &ofp_port_table_stats_port_match_count, { "Number of entries looked up in port table", "of.stats_port_table_port_match_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Number of entries looked up in port table", HFILL } }, { &ofp_port_table_stats_chain_match_count, { "Number of entries accessed by chaining", "of.stats_port_table_chain_match_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Number of entries accessed by chaining", HFILL } }, /* CSM: Stats: Table */ { &ofp_table_stats, { "Table Stats", "of.stats_table", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Table Stats", HFILL } }, { &ofp_table_stats_table_id, { "Table ID", "of.stats_table_table_id", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, { &ofp_table_stats_name, { "Name", "of.stats_table_name", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Name", HFILL } }, { &ofp_table_stats_wildcards_hdr, { "Wildcards", "of.stats_table_wildcards", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Wildcards", HFILL } }, { &ofp_table_stats_max_entries, { "Max Supported Entries", "of.stats_table_max_entries", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Max Supported Entries", HFILL } }, { &ofp_table_stats_active_count, { "Active Entry Count", "of.stats_table_active_count", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Active Entry Count", HFILL } }, { &ofp_table_stats_lookup_count, { "Lookup Count", "of.stats_table_lookup_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Lookup Count", HFILL } }, { &ofp_table_stats_matched_count, { "Packet Match Count", "of.stats_table_match_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Packet Match Count", HFILL } }, { &ofp_vendor_stats_vendor, { "Vendor ID", "of.stats_vendor_vendor", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Vendor ID", HFILL } }, { &ofp_vendor_stats_body, { "Vendor Stats Body", "of.stats_vendor_body", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Vendor Stats Body", HFILL } }, /* AM: Error Message */ { &ofp_error_msg, { "Error Message", "of.err", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Error Message", HFILL } }, { &ofp_error_msg_type, { "Type", "of.err_type", FT_UINT16, BASE_DEC, VALS(names_ofp_error_type_reason), NO_MASK, "Type", HFILL } }, { &ofp_error_msg_code, { "Code", "of.err_code", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Code", HFILL } }, { &ofp_error_msg_data_str, { "Data", "of.err_data", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Data", HFILL } }, { &ofp_error_msg_data, { "Data", "of.err_data", FT_BYTES, BASE_NONE, NO_STRINGS, NO_MASK, "Data", HFILL } }, }; static gint *ett[] = { &ett_ofp, &ett_ofp_header, &ett_ofp_phy_port, &ett_ofp_phy_port_config_hdr, &ett_ofp_phy_port_state_hdr, &ett_ofp_phy_port_curr_hdr, &ett_ofp_phy_port_advertised_hdr, &ett_ofp_phy_port_supported_hdr, &ett_ofp_phy_port_peer_hdr, &ett_ofp_match, &ett_ofp_match_wildcards_hdr, &ett_ofp_action, &ett_ofp_action_output, &ett_ofp_switch_features, &ett_ofp_switch_features_capabilities_hdr, &ett_ofp_switch_features_actions_hdr, &ett_ofp_switch_features_ports_hdr, &ett_ofp_switch_config, &ett_ofp_switch_config_flags_hdr, &ett_ofp_flow_mod, &ett_ofp_port_mod, &ett_ofp_port_mod_config_hdr, &ett_ofp_port_mod_mask_hdr, &ett_ofp_port_mod_advertise_hdr, &ett_ofp_stats_request, &ett_ofp_stats_reply, &ett_ofp_stats_reply_flags, &ett_ofp_desc_stats, &ett_ofp_flow_stats_request, &ett_ofp_flow_stats_reply, &ett_ofp_aggr_stats_request, &ett_ofp_aggr_stats_reply, &ett_ofp_table_stats, &ett_ofp_port_stats, &ett_ofp_port_table_stats, &ett_ofp_packet_out, &ett_ofp_packet_out_data_hdr, &ett_ofp_packet_out_actions_hdr, &ett_ofp_packet_in, &ett_ofp_packet_in_data_hdr, &ett_ofp_flow_expired, &ett_ofp_port_status, &ett_ofp_error_msg, &ett_ofp_error_msg_data, &ett_ofp_vport_table_features, &ett_ofp_vport_actions_hdr, &ett_ofp_vport_mod, &ett_ofp_vport_action_output, &ett_ofp_vport_action, &ett_ofp_vport_actions_pop_mpls_hdr, &ett_ofp_vport_actions_push_mpls_hdr, }; proto_openflow = proto_register_protocol( "OpenFlow Protocol", "OFP", "of" ); /* abbreviation for filters */ proto_register_field_array(proto_openflow, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("openflow", dissect_openflow, proto_openflow); } const char* ofp_type_to_string( gint8 type ) { static char str_unknown[17]; if( type <= OFP_TYPE_MAX_VALUE ) return names_ofp_type[type].strptr; else { snprintf( str_unknown, 17, "Unknown Type %u", type ); return str_unknown; } } /** * Adds "hf" to "tree" starting at "offset" into "tvb" and using "length" * bytes. offset is incremented by length. */ static void add_child( proto_item* tree, gint hf, tvbuff_t *tvb, guint32* offset, guint32 len ) { proto_tree_add_item( tree, hf, tvb, *offset, len, FALSE ); *offset += len; } /** * Adds "hf" to "tree" starting at "offset" into "tvb" and using "length" * bytes. offset is incremented by length. The specified string is used as the * field's display value. */ static void add_child_str(proto_item* tree, gint hf, tvbuff_t *tvb, guint32* offset, guint32 len, const char* str) { proto_tree_add_string(tree, hf, tvb, *offset, len, str); *offset += len; } /** * Adds "hf" to "tree" starting at "offset" into "tvb" and using "length" * bytes. The specified string is used as the * field's display value. */ static void add_child_str_const(proto_item* tree, gint hf, tvbuff_t *tvb, guint32 offset, guint32 len, const char* str) { proto_tree_add_string(tree, hf, tvb, offset, len, str); } /** * Adds "hf" to "tree" starting at "offset" into "tvb" and using "length" bytes. */ static void add_child_const( proto_item* tree, gint hf, tvbuff_t *tvb, guint32 offset, guint32 len ) { proto_tree_add_item( tree, hf, tvb, offset, len, FALSE ); } /** returns the length of a PDU which starts at the specified offset in tvb. */ static guint get_openflow_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset) { return (guint)tvb_get_ntohs(tvb, offset+2); /* length is at offset 2 in the header */ } static void dissect_pad(proto_tree* tree, guint32 *offset, guint pad_byte_count) { #if SHOW_PADDING guint i; for( i=0; i<pad_byte_count; i++ ) add_child(tree, ofp_pad, tvb, offset, 1); #else *offset += pad_byte_count; #endif } static void dissect_port(proto_tree* tree, gint hf, tvbuff_t *tvb, guint32 *offset, guint32 port_len) { /* get the port number */ guint32 port = -1; if (port_len == 32) { port = tvb_get_ntohl( tvb, *offset ); // for 32bit length addresses } else { port = tvb_get_ntohs( tvb, *offset ); // for 16bit length addresses }; /* check to see if the port is special (e.g. the name of a fake output ports defined by ofp_port) */ const char* str_port = NULL; char str_num[6]; switch( port ) { case OFPP_IN_PORT: str_port = "In Port (send the packet out the input port; This virtual port must be explicitly used in order to send back out of the input port. )"; break; case OFPP_TABLE: str_port = "Table (perform actions in flow table; only allowed for dst port packet out messages)"; break; case OFPP_NORMAL: str_port = "Normal (process with normal L2/L3 switching)"; break; case OFPP_FLOOD: str_port = "Flood (all physical ports except input port and those disabled by STP)"; break; case OFPP_ALL: str_port = "All (all physical ports except input port)"; break; case OFPP_CONTROLLER: str_port = "Controller (send to controller)"; break; case OFPP_LOCAL: str_port = "Local (local openflow \"port\")"; break; case OFPP_NONE: str_port = "None (not associated with a physical port)"; break; // these are meaningless /*case OFPP_VP_START: str_port = "Start of Virtual Ports"; break; case OFPP_VP_END: str_port = "End of Virtual Ports"; break;*/ default: /* no special name, so just use the number */ str_port = str_num; snprintf(str_num, 6, "%u", port); } /* put the string-representation in the GUI tree */ if (port_len == 32) { add_child_str( tree, hf, tvb, offset, 4, str_port ); } else { add_child_str( tree, hf, tvb, offset, 2, str_port ); }; } static void dissect_phy_ports(proto_tree* tree, proto_item* item, tvbuff_t *tvb, packet_info *pinfo, guint32 *offset, guint num_ports) { proto_item *port_item; proto_tree *port_tree; proto_item *config_item; proto_tree *config_tree; proto_tree *state_item; proto_tree *state_tree; proto_item *curr_item; proto_tree *curr_tree; proto_item *advertised_item; proto_tree *advertised_tree; proto_item *supported_item; proto_tree *supported_tree; proto_item *peer_item; proto_tree *peer_tree; int i; while(num_ports-- > 0) { port_item = proto_tree_add_item(tree, ofp_phy_port, tvb, *offset, sizeof(struct ofp_phy_port), FALSE); port_tree = proto_item_add_subtree(port_item, ett_ofp_phy_port); dissect_port( port_tree, ofp_phy_port_port_no, tvb, offset, 16 ); add_child( port_tree, ofp_phy_port_hw_addr, tvb, offset, OFP_ETH_ALEN ); add_child( port_tree, ofp_phy_port_name, tvb, offset, OFP_MAX_PORT_NAME_LEN ); /* config */ config_item = proto_tree_add_item(port_tree, ofp_phy_port_config_hdr, tvb, *offset, 4, FALSE); config_tree = proto_item_add_subtree(config_item, ett_ofp_phy_port_config_hdr); for(i=0; i<NUM_PORT_CONFIG_FLAGS; i++) { add_child_const(config_tree, ofp_phy_port_config[i], tvb, *offset, 4); } *offset += 4; /* state */ state_item = proto_tree_add_item(port_tree, ofp_phy_port_state_hdr, tvb, *offset, 4, FALSE); state_tree = proto_item_add_subtree(state_item, ett_ofp_phy_port_state_hdr); /* grab the stp state */ guint32 state = tvb_get_ntohl( tvb, *offset ); /* if (state & OFPPS_LINK_DOWN) add_child_const(state_tree, ofp_phy_port_state[0], tvb, *offset, 4); */ if (state & OFPPS_LINK_DOWN) add_child_const(state_tree, ofp_phy_port_state_not_evil, tvb, *offset, 4); guint32 stp_state = state & OFPPS_STP_MASK; if (stp_state == OFPPS_STP_LISTEN) add_child_str_const( state_tree, ofp_phy_port_state_stp_state, tvb, *offset, 4, "Not learning or relaying frames" ); else if (stp_state == OFPPS_STP_LEARN) add_child_str_const( state_tree, ofp_phy_port_state_stp_state, tvb, *offset, 4, "Learning but not relaying frames" ); else if (stp_state == OFPPS_STP_FORWARD) add_child_str_const( state_tree, ofp_phy_port_state_stp_state, tvb, *offset, 4, "Learning and relaying frames" ); else if (stp_state == OFPPS_STP_BLOCK) add_child_str_const( state_tree, ofp_phy_port_state_stp_state, tvb, *offset, 4, "Not part of spanning tree" ); else add_child_str_const( state_tree, ofp_phy_port_state_stp_state, tvb, *offset, 4, "Unknown STP state" ); *offset += 4; /* curr */ curr_item = proto_tree_add_item(port_tree, ofp_phy_port_curr_hdr, tvb, *offset, 4, FALSE); curr_tree = proto_item_add_subtree(curr_item, ett_ofp_phy_port_curr_hdr); for(i=0; i<NUM_PORT_FEATURES_FLAGS; i++) { add_child_const(curr_tree, ofp_phy_port_curr[i], tvb, *offset, 4); } *offset += 4; /* advertised */ advertised_item = proto_tree_add_item(port_tree, ofp_phy_port_advertised_hdr, tvb, *offset, 4, FALSE); advertised_tree = proto_item_add_subtree(advertised_item, ett_ofp_phy_port_advertised_hdr); for(i=0; i<NUM_PORT_FEATURES_FLAGS; i++) { add_child_const(advertised_tree, ofp_phy_port_advertised[i], tvb, *offset, 4); } *offset += 4; /* supported */ supported_item = proto_tree_add_item(port_tree, ofp_phy_port_supported_hdr, tvb, *offset, 4, FALSE); supported_tree = proto_item_add_subtree(supported_item, ett_ofp_phy_port_supported_hdr); for(i=0; i<NUM_PORT_FEATURES_FLAGS; i++) { add_child_const(supported_tree, ofp_phy_port_supported[i], tvb, *offset, 4); } *offset += 4; /* peer */ peer_item = proto_tree_add_item(port_tree, ofp_phy_port_peer_hdr, tvb, *offset, 4, FALSE); peer_tree = proto_item_add_subtree(peer_item, ett_ofp_phy_port_peer_hdr); for(i=0; i<NUM_PORT_FEATURES_FLAGS; i++) { add_child_const(peer_tree, ofp_phy_port_peer[i], tvb, *offset, 4); } *offset += 4; } } static void dissect_port_mod(proto_tree* tree, proto_item* item, tvbuff_t *tvb, packet_info *pinfo, guint32 *offset) { proto_item *config_item; proto_tree *config_tree; proto_item *mask_item; proto_tree *mask_tree; proto_item *advertise_item; proto_tree *advertise_tree; int i; dissect_port( tree, ofp_port_mod_port_no, tvb, offset, 16 ); add_child( tree, ofp_port_mod_hw_addr, tvb, offset, OFP_ETH_ALEN ); /* config */ config_item = proto_tree_add_item(tree, ofp_port_mod_config_hdr, tvb, *offset, 4, FALSE); config_tree = proto_item_add_subtree(config_item, ett_ofp_port_mod_config_hdr); for(i=0; i<NUM_PORT_CONFIG_FLAGS; i++) { add_child_const(config_tree, ofp_port_mod_config[i], tvb, *offset, 4); } *offset += 4; /* mask */ mask_item = proto_tree_add_item(tree, ofp_port_mod_mask_hdr, tvb, *offset, 4, FALSE); mask_tree = proto_item_add_subtree(mask_item, ett_ofp_port_mod_mask_hdr); for(i=0; i<NUM_PORT_CONFIG_FLAGS; i++) { add_child_const(mask_tree, ofp_port_mod_mask[i], tvb, *offset, 4); } *offset += 4; /* advertise */ advertise_item = proto_tree_add_item(tree, ofp_port_mod_advertise_hdr, tvb, *offset, 4, FALSE); advertise_tree = proto_item_add_subtree(advertise_item, ett_ofp_port_mod_advertise_hdr); for(i=0; i<NUM_PORT_FEATURES_FLAGS; i++) { add_child_const(advertise_tree, ofp_port_mod_advertise[i], tvb, *offset, 4); } *offset += 4; /* pad */ dissect_pad(tree, offset, 4); } static void dissect_wildcards(proto_tree* match_tree, proto_item* match_item, tvbuff_t *tvb, packet_info *pinfo, guint32 *offset, gint wildcard_list[]) { proto_item *wild_item = proto_tree_add_item(match_tree, ofp_match_wildcards_hdr, tvb, *offset, 4, FALSE); proto_tree *wild_tree = proto_item_add_subtree(wild_item, ett_ofp_match_wildcards_hdr); /* add wildcard subtree */ int i; for(i=0; i<NUM_WILDCARDS; i++) add_child_const(wild_tree, wildcard_list[i], tvb, *offset, 4 ); *offset += 4; } static void dissect_dl_type(proto_tree* tree, gint hf, tvbuff_t *tvb, guint32 *offset) { /* get the datalink type */ guint16 dl_type = tvb_get_ntohs( tvb, *offset ); const char* description = match_strval(dl_type, etype_vals); /* put the string-representation in the GUI tree */ proto_tree_add_uint_format(tree, hf, tvb, *offset, 2, dl_type, "Ethernet Type: %s (0x%04x)", description, dl_type); *offset += 2; } static void dissect_nw_proto(proto_tree* tree, gint hf, tvbuff_t *tvb, guint32 *offset) { /* get the network protocol */ guint8 nw_proto = tvb_get_guint8( tvb, *offset ); /* put the string-representation in the GUI tree */ proto_tree_add_uint_format(tree, hf, tvb, *offset, 1, nw_proto, "Protocol: %s (0x%02x)", ipprotostr(nw_proto), nw_proto); *offset += 1; } static void dissect_tp_port(proto_tree* tree, gint hf, tvbuff_t *tvb, guint32 *offset) { /* get the transport port */ guint16 port = tvb_get_ntohs( tvb, *offset ); /* Get the header field info corresponding to the field */ header_field_info *hfinfo = proto_registrar_get_nth(hf); /* put the string-representation in the GUI tree */ proto_tree_add_uint_format(tree, hf, tvb, *offset, 2, port, "%s: %s (%u)", hfinfo->name, get_tcp_port(port), port); *offset += 2; } /* Based on: dissect_icmp from wireshark: epan/dissectors/packet-ip.c */ static void dissect_icmp_type_code_match(proto_tree* tree, tvbuff_t *tvb, guint32 *offset, gint show_type, gint show_code) { guint16 icmp_type; guint16 icmp_code; const gchar *type_str, *code_str; type_str=""; code_str=""; /* Get the ICMP type/code */ icmp_type = tvb_get_ntohs(tvb, *offset); icmp_code = tvb_get_ntohs(tvb, *offset + 2); /* Get string representations of the ICMP types/codes */ switch (icmp_type) { case ICMP_ECHOREPLY: type_str="Echo (ping) reply"; break; case ICMP_UNREACH: type_str="Destination unreachable"; if (icmp_code < N_UNREACH) { code_str = unreach_str[icmp_code]; } else { code_str = "Unknown - error?"; } break; case ICMP_SOURCEQUENCH: type_str="Source quench (flow control)"; break; case ICMP_REDIRECT: type_str="Redirect"; if (icmp_code < N_REDIRECT) { code_str = redir_str[icmp_code]; } else { code_str = "Unknown - error?"; } break; case ICMP_ECHO: type_str="Echo (ping) request"; break; case ICMP_RTRADVERT: switch (icmp_code) { case 0: /* Mobile-Ip */ case 16: /* Mobile-Ip */ type_str="Mobile IP Advertisement"; break; default: type_str="Router advertisement"; break; } /* switch icmp_code */ break; case ICMP_RTRSOLICIT: type_str="Router solicitation"; break; case ICMP_TIMXCEED: type_str="Time-to-live exceeded"; if (icmp_code < N_TIMXCEED) { code_str = ttl_str[icmp_code]; } else { code_str = "Unknown - error?"; } break; case ICMP_PARAMPROB: type_str="Parameter problem"; if (icmp_code < N_PARAMPROB) { code_str = par_str[icmp_code]; } else { code_str = "Unknown - error?"; } break; case ICMP_TSTAMP: type_str="Timestamp request"; break; case ICMP_TSTAMPREPLY: type_str="Timestamp reply"; break; case ICMP_IREQ: type_str="Information request"; break; case ICMP_IREQREPLY: type_str="Information reply"; break; case ICMP_MASKREQ: type_str="Address mask request"; break; case ICMP_MASKREPLY: type_str="Address mask reply"; break; default: type_str="Unknown ICMP (obsolete or malformed?)"; break; } if (show_type) proto_tree_add_uint_format(tree, ofp_match_icmp_type, tvb, *offset, 2, icmp_type, "ICMP Type: %u (%s)", icmp_type, type_str); if (show_code) proto_tree_add_uint_format(tree, ofp_match_icmp_code, tvb, *offset, 2, icmp_code, "ICMP Code: %u (%s)", icmp_code, code_str); *offset += 4; } static void dissect_match(proto_tree* tree, proto_item* item, tvbuff_t *tvb, packet_info *pinfo, guint32 *offset) { proto_item *match_item = proto_tree_add_item(tree, ofp_match, tvb, *offset, sizeof(struct ofp_match), FALSE); proto_tree *match_tree = proto_item_add_subtree(match_item, ett_ofp_match); /* save wildcards field for later */ guint32 wildcards = tvb_get_ntohl( tvb, *offset ); dissect_wildcards(match_tree, match_item, tvb, pinfo, offset, ofp_match_wildcards); /* show only items whose corresponding wildcard bit is not set */ if( ~wildcards & OFPFW_IN_PORT ) dissect_port(match_tree, ofp_match_in_port, tvb, offset, 16); else *offset += 2; if( ~wildcards & OFPFW_DL_SRC ) add_child(match_tree, ofp_match_dl_src, tvb, offset, 6); else *offset += 6; if( ~wildcards & OFPFW_DL_DST ) add_child(match_tree, ofp_match_dl_dst, tvb, offset, 6); else *offset += 6; if( ~wildcards & OFPFW_DL_VLAN ) add_child(match_tree, ofp_match_dl_vlan, tvb, offset, 2); else *offset += 2; if( ~wildcards & OFPFW_DL_TYPE ) dissect_dl_type(match_tree, ofp_match_nw_proto, tvb, offset); else *offset += 2; /* Save NW proto for later */ guint8 nw_proto = tvb_get_guint8( tvb, *offset); if( ~wildcards & OFPFW_NW_PROTO ) dissect_nw_proto(match_tree, ofp_match_nw_proto, tvb, offset); else *offset += 1; dissect_pad(match_tree, offset, 1); if( ~wildcards & OFPFW_NW_SRC_MASK ) add_child(match_tree, ofp_match_nw_src, tvb, offset, 4); else *offset += 4; if( ~wildcards & OFPFW_NW_DST_MASK ) add_child(match_tree, ofp_match_nw_dst, tvb, offset, 4); else *offset += 4; /* Display either ICMP type/code or TCP/UDP ports */ if( nw_proto == IP_PROTO_ICMP) { dissect_icmp_type_code_match(match_tree, tvb, offset, ~wildcards & OFPFW_TP_SRC, ~wildcards & OFPFW_TP_DST ); } else { if( ~wildcards & OFPFW_TP_SRC ) dissect_tp_port(match_tree, ofp_match_tp_src, tvb, offset); else *offset += 2; if( ~wildcards & OFPFW_TP_DST ) dissect_tp_port(match_tree, ofp_match_tp_dst, tvb, offset); else *offset += 2; } if ( ~wildcards & OFPFW_MPLS_L1 ) { guint32 label1_value = tvb_get_ntohl( tvb, *offset ); if ( label1_value > 1048575 ) // if value > 2^20-1 add_child(match_tree, ofp_match_mpls_nolabel, tvb, offset, 4); else if (label1_value < 15) add_child(match_tree, ofp_match_mpls_reservedlabel, tvb, offset, 4); else add_child(match_tree, ofp_match_mpls_label1, tvb, offset, 4); } else *offset += 4; if ( ~wildcards & OFPFW_MPLS_L2 ){ guint32 label2_value = tvb_get_ntohl( tvb, *offset ); if ( label2_value > 1048575 ) // if value > 2^20-1 add_child(match_tree, ofp_match_mpls_nolabel, tvb, offset, 4); else if (label2_value < 15) add_child(match_tree, ofp_match_mpls_reservedlabel, tvb, offset, 4); else add_child(match_tree, ofp_match_mpls_label2, tvb, offset, 4); } else *offset += 4; } static void dissect_action_output(proto_tree* tree, tvbuff_t *tvb, guint32 *offset) { /* add the output port */ dissect_port( tree, ofp_action_output_port, tvb, offset, 32 ); /* determine the maximum number of bytes to send (0 => no limit) */ guint16 max_len = tvb_get_ntohs( tvb, *offset ); if( max_len ) { char str[11]; snprintf( str, 11, "%u", max_len ); add_child_str( tree, ofp_action_output_max_len, tvb, offset, 2, str ); } else add_child_str( tree, ofp_action_output_max_len, tvb, offset, 2, "entire packet (no limit)" ); /* pad */ dissect_pad( tree, offset, 6); } /** returns the number of bytes dissected (-1 if an unknown action type is * encountered; and 8/16 for all other actions as of 0x96) */ static gint dissect_action(proto_tree* tree, proto_item* item, tvbuff_t *tvb, packet_info *pinfo, guint32 *offset) { guint32 offset_start = *offset; guint16 type = tvb_get_ntohs( tvb, *offset ); guint16 len = tvb_get_ntohs( tvb, *offset + 2); proto_item *action_item = proto_tree_add_item(tree, ofp_action, tvb, *offset, len, FALSE); proto_tree *action_tree = proto_item_add_subtree(action_item, ett_ofp_action); if (!(len == 8 || len == 16)) { add_child_str(action_tree, ofp_action_unknown, tvb, offset, len, "Invalid Action Length"); return -1; } add_child( action_tree, ofp_action_type, tvb, offset, 2 ); add_child( action_tree, ofp_action_len, tvb, offset, 2 ); switch( type ) { case OFPAT_OUTPUT: dissect_action_output(action_tree, tvb, offset); break; case OFPAT_SET_VLAN_VID: add_child( action_tree, ofp_action_vlan_vid, tvb, offset, 2 ); dissect_pad(action_tree, offset, 2); break; case OFPAT_SET_VLAN_PCP: add_child( action_tree, ofp_action_vlan_pcp, tvb, offset, 1 ); dissect_pad(action_tree, offset, 3); break; case OFPAT_STRIP_VLAN: add_child( action_tree, ofp_action_unknown, tvb, offset, 0 ); dissect_pad(action_tree, offset, 4); break; case OFPAT_SET_DL_SRC: case OFPAT_SET_DL_DST: add_child(action_tree, ofp_action_dl_addr, tvb, offset, 6 ); dissect_pad(action_tree, offset, 6); break; case OFPAT_SET_NW_SRC: case OFPAT_SET_NW_DST: add_child( action_tree, ofp_action_nw_addr, tvb, offset, 4 ); break; case OFPAT_SET_TP_SRC: case OFPAT_SET_TP_DST: add_child( action_tree, ofp_action_tp_port, tvb, offset, 2 ); dissect_pad(action_tree, offset, 2); break; case OFPAT_SET_MPLS_LABEL: add_child( action_tree, ofp_action_mpls_label, tvb, offset, 4 ); dissect_pad(action_tree, offset, 0); break; case OFPAT_SET_MPLS_EXP: add_child( action_tree, ofp_action_mpls_exp, tvb, offset, 4 ); dissect_pad(action_tree, offset, 0); break; default: add_child( action_tree, ofp_action_unknown, tvb, offset, 0 ); return -1; } /* return the number of bytes which were consumed */ return *offset - offset_start; } static void dissect_action_array(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, guint offset) { guint total_len = len - offset; proto_item* action_item = proto_tree_add_item(tree, ofp_action_output, tvb, offset, total_len, FALSE); proto_tree* action_tree = proto_item_add_subtree(action_item, ett_ofp_action_output); if( total_len == 0 ) add_child_str(action_tree, ofp_action_warn, tvb, &offset, 0, "No actions were specified"); else if( offset > len ) { /* not enough bytes => wireshark will already have reported the error */ } else { guint offset_action_start = offset; guint num_actions = 0; while( total_len > 0 ) { num_actions += 1; int ret = dissect_action(action_tree, action_item, tvb, pinfo, &offset); if( ret < 0 ) break; /* stop if we run into an action we couldn't dissect */ else total_len -= ret; } proto_tree_add_uint(action_tree, ofp_action_num, tvb, offset_action_start, 0, num_actions); } } static void dissect_capability_array(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint field_size) { proto_item *sf_cap_item = proto_tree_add_item(tree, ofp_switch_features_capabilities_hdr, tvb, offset, field_size, FALSE); proto_tree *sf_cap_tree = proto_item_add_subtree(sf_cap_item, ett_ofp_switch_features_capabilities_hdr); gint i; for(i=0; i<NUM_CAPABILITIES_FLAGS; i++) add_child_const(sf_cap_tree, ofp_switch_features_capabilities[i], tvb, offset, field_size); } static void dissect_switch_config_flags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset) { proto_item *sf_pc_item = proto_tree_add_item(tree, ofp_switch_config_flags_hdr, tvb, *offset, 2, FALSE); proto_tree *sf_pc_tree = proto_item_add_subtree(sf_pc_item, ett_ofp_switch_config_flags_hdr); add_child_const(sf_pc_tree, ofp_switch_config_flags[0], tvb, *offset, 2); add_child_const(sf_pc_tree, ofp_switch_config_flags_ip_frag, tvb, *offset, 2); *offset += 2; } static void dissect_switch_features_actions(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint field_size) { proto_item *sf_act_item = proto_tree_add_item(tree, ofp_switch_features_actions_hdr, tvb, offset, field_size, FALSE); proto_tree *sf_act_tree = proto_item_add_subtree(sf_act_item, ett_ofp_switch_features_actions_hdr); gint i; for(i=0; i<NUM_ACTIONS_FLAGS; i++) add_child_const(sf_act_tree, ofp_switch_features_actions[i], tvb, offset, field_size); } static void dissect_vport_actions(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint field_size) { proto_item *vf_act_item = proto_tree_add_item(tree, ofp_vport_actions_hdr, tvb, *offset, field_size, FALSE); proto_tree *vf_act_tree = proto_item_add_subtree(vf_act_item, ett_ofp_vport_actions_hdr); gint i; for(i=0; i<NUM_VPORT_ACTIONS_FLAGS; i++){ add_child_const(vf_act_tree, ofp_vport_actions[i], tvb, *offset, field_size); } /* pad */ *offset += 4; } static void dissect_vport_action_pop_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint field_size) { proto_item *vf_act_item = proto_tree_add_item(tree, ofp_vport_action_pop_mpls_hdr, tvb, *offset, field_size, FALSE); proto_tree *vf_act_tree = proto_item_add_subtree(vf_act_item, ett_ofp_vport_actions_pop_mpls_hdr); gint i; for(i=0; i<NUM_MPLS_POP_ACTIONS_FLAGS; i++){ add_child_const(vf_act_tree, ofp_vport_action_pop_mpls[i], tvb, *offset, field_size); } /* pad */ dissect_pad( tree, offset, field_size); } static void dissect_vport_action_push_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint field_size) { proto_item *vf_act_item = proto_tree_add_item(tree, ofp_vport_action_push_mpls_hdr, tvb, *offset, field_size, FALSE); proto_tree *vf_act_tree = proto_item_add_subtree(vf_act_item, ett_ofp_vport_actions_push_mpls_hdr); gint i; for(i=0; i<NUM_MPLS_PUSH_ACTIONS_FLAGS; i++){ add_child_const(vf_act_tree, ofp_vport_action_push_mpls[i], tvb, *offset, field_size); } /* pad */ dissect_pad( tree, offset, field_size); } static gint dissect_vport_action(proto_tree* tree, proto_item* item, tvbuff_t *tvb, packet_info *pinfo, guint32 *offset) { guint32 offset_start = *offset; guint16 type = tvb_get_ntohs( tvb, *offset ); guint16 len = tvb_get_ntohs( tvb, *offset + 2); proto_item *vport_action_item = proto_tree_add_item(tree, ofp_vport_action, tvb, *offset, len, FALSE); proto_tree *vport_action_tree = proto_item_add_subtree(vport_action_item, ett_ofp_vport_action); if (!(len == 8 || len == 16)) { add_child_str(vport_action_tree, ofp_vport_action_unknown, tvb, offset, len, "Invalid Action Length"); return -1; } add_child( vport_action_tree, ofp_vport_action_type, tvb, offset, 2 ); add_child( vport_action_tree, ofp_vport_action_len, tvb, offset, 2 ); switch ( type ) { case OFPPAT_OUTPUT: add_child_str(vport_action_tree, ofp_action_warn, tvb, offset, len, "Unexpected Message, OFPPAT_OUTPUT"); // OR: dissect_action_output(vport_action_tree, tvb, offset); ? break; case OFPPAT_POP_MPLS: dissect_dl_type(vport_action_tree, ofp_match_nw_proto, tvb, offset); /* action_pop_mpls flags */ dissect_vport_action_pop_mpls(tvb, pinfo, vport_action_tree, offset, 1); /* pad[4] */ dissect_pad(vport_action_tree, offset, 4); /* pad[5] */ dissect_pad(vport_action_tree, offset, 5); break; case OFPPAT_PUSH_MPLS: /* label_out */ add_child( vport_action_tree, ofp_vport_action_push_mpls_label, tvb, offset, 4 ); /* exp */ add_child (vport_action_tree, ofp_vport_action_push_mpls_exp, tvb, offset, 1); /* ttl */ add_child (vport_action_tree, ofp_vport_action_push_mpls_ttl, tvb, offset, 1); /* flags */ dissect_vport_action_push_mpls(tvb, pinfo, vport_action_tree, offset, 1); /* pad[1] */ dissect_pad(vport_action_tree, offset, 1); /* pad[4] */ dissect_pad(vport_action_tree, offset, 4); break; case OFPPAT_SET_MPLS_EXP: /* exp */ add_child (vport_action_tree, ofp_vport_action_push_mpls_exp, tvb, offset, 1); // ofp_vport_action_push_mpls_exp has the same struct... /* pad[3] */ dissect_pad(vport_action_tree, offset, 3); break; case OFPPAT_SET_MPLS_LABEL: /* uint32_t label_out; */ add_child( vport_action_tree, ofp_vport_action_push_mpls_label, tvb, offset, 4 ); // ofp_vport_action_push_mpls_label has the same struct... break; default: add_child( vport_action_tree, ofp_vport_action_unknown, tvb, offset, 0 ); return -1; } /* return the number of bytes which were consumed */ return *offset - offset_start; } static void dissect_vport_action_array(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, guint offset) { guint total_len = len - offset; proto_item* vport_action_item = proto_tree_add_item(tree, ofp_vport_action_output, tvb, offset, total_len, FALSE); proto_tree* vport_action_tree = proto_item_add_subtree(vport_action_item, ett_ofp_vport_action_output); if (total_len == 0 ) add_child_str(vport_action_tree, ofp_vport_action_warn, tvb, &offset, 0, "No actions were specified"); else if (offset > len ) { /* not enough bytes => wireshark will already have reported the error */ } else { guint offset_action_start = offset; guint num_actions = 0; while ( total_len > 0 ) { num_actions += 1; int ret = dissect_vport_action(vport_action_tree, vport_action_item, tvb, pinfo, &offset); if (ret < 0 ) break; /* stop if we run into an action we couldn't dissect */ else total_len -= ret; } proto_tree_add_uint(vport_action_tree, ofp_vport_action_num, tvb, offset_action_start, 0, num_actions); } } static void dissect_ethernet(tvbuff_t *next_tvb, packet_info *pinfo, proto_tree *data_tree) { /* add seperators to existing column strings */ if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_append_str( pinfo->cinfo, COL_PROTOCOL, "+" ); if(check_col(pinfo->cinfo,COL_INFO)) col_append_str( pinfo->cinfo, COL_INFO, " => " ); /* set up fences so ethernet dissectors only appends to our column info */ col_set_fence(pinfo->cinfo, COL_PROTOCOL); col_set_fence(pinfo->cinfo, COL_INFO); /* continue the dissection with the ethernet dissector */ call_dissector(data_ethernet, next_tvb, pinfo, data_tree); } static void dissect_error_code(proto_tree* tree, gint hf, tvbuff_t *tvb, guint32 *offset, guint16 err_type) { guint16 err_code; guint8 valid; const gchar *code_str; err_code = tvb_get_ntohs(tvb, *offset); code_str = ""; valid = TRUE; switch (err_type) { case OFPET_HELLO_FAILED: if (err_code < N_HELLOFAILED) { code_str = hello_failed_err_str[err_code]; } else { code_str = "Unknown - error?"; } break; case OFPET_BAD_REQUEST: if (err_code < N_BADREQUEST) { code_str = bad_request_err_str[err_code]; } else { code_str = "Unknown - error?"; } break; case OFPET_BAD_ACTION: if (err_code < N_BADACTION) { code_str = bad_action_err_str[err_code]; } else { code_str = "Unknown - error?"; } break; case OFPET_FLOW_MOD_FAILED: if (err_code < N_FLOWMODFAILED) { code_str = flow_mod_failed_err_str[err_code]; } else { code_str = "Unknown - error?"; } break; default: valid = FALSE; break; } if (valid) proto_tree_add_uint_format(tree, hf, tvb, *offset, 2, err_code, "Code: %s (%u)", code_str, err_code); else proto_tree_add_item(tree, hf, tvb, *offset, 2, FALSE); *offset += 2; } static void dissect_openflow_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { # define STR_LEN 1024 char str[STR_LEN]; /* display our protocol text if the protocol column is visible */ if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_OPENFLOW); /* Clear out stuff in the info column */ if(check_col(pinfo->cinfo,COL_INFO)) col_clear(pinfo->cinfo,COL_INFO); /* get some of the header fields' values for later use */ guint8 ver = tvb_get_guint8( tvb, 0 ); guint8 type = tvb_get_guint8( tvb, 1 ); guint16 len = tvb_get_ntohs( tvb, 2 ); /* add a warning if the version is what the plugin was written to handle */ guint8 ver_warning = 0; if( ver < DISSECTOR_OPENFLOW_MIN_VERSION || ver > DISSECTOR_OPENFLOW_MAX_VERSION || ver >= DISSECTOR_OPENFLOW_VERSION_DRAFT_THRESHOLD ) { if( ver>=DISSECTOR_OPENFLOW_VERSION_DRAFT_THRESHOLD && ver<=DISSECTOR_OPENFLOW_MAX_VERSION ) snprintf( str, STR_LEN, "DRAFT Dissector written for this OpenFlow version v0x%0X", ver ); else { ver_warning = 1; if( DISSECTOR_OPENFLOW_MIN_VERSION == DISSECTOR_OPENFLOW_MAX_VERSION ) snprintf( str, STR_LEN, "Dissector written for OpenFlow v0x%0X (differs from this packet's version v0x%0X)", DISSECTOR_OPENFLOW_MIN_VERSION, ver ); else snprintf( str, STR_LEN, "Dissector written for OpenFlow v0x%0X-v0x%0X (differs from this packet's version v0x%0X)", DISSECTOR_OPENFLOW_MIN_VERSION, DISSECTOR_OPENFLOW_MAX_VERSION, ver ); } } /* clarify protocol name display with version, length, and type information */ if (check_col(pinfo->cinfo, COL_INFO)) { /* special handling so we can put buffer IDs in the description */ char str_extra[32]; str_extra[0] = '\0'; if( type==OFPT_PACKET_IN || type==OFPT_PACKET_OUT ) { guint32 bid = tvb_get_ntohl(tvb, sizeof(struct ofp_header)); if( bid != 0xFFFFFFFF ) snprintf(str_extra, 32, "(BufID=%u) ", bid); } if( ver_warning ) col_add_fstr( pinfo->cinfo, COL_INFO, "%s %s(%uB) Ver Warning!", ofp_type_to_string(type), str_extra, len ); else col_add_fstr( pinfo->cinfo, COL_INFO, "%s %s(%uB)", ofp_type_to_string(type), str_extra, len ); } if (tree) { /* we are being asked for details */ proto_item *item = NULL; proto_item *sub_item = NULL; proto_tree *ofp_tree = NULL; proto_tree *header_tree = NULL; guint32 offset = 0; proto_item *type_item = NULL; proto_tree *type_tree = NULL; /* consume the entire tvb for the openflow packet, and add it to the tree */ item = proto_tree_add_item(tree, proto_openflow, tvb, 0, -1, FALSE); ofp_tree = proto_item_add_subtree(item, ett_ofp); /* put the header in its own node as a child of the openflow node */ sub_item = proto_tree_add_item( ofp_tree, ofp_header, tvb, offset, 8, FALSE ); header_tree = proto_item_add_subtree(sub_item, ett_ofp_header); if( ver_warning ) add_child_str( header_tree, ofp_header_warn_ver, tvb, &offset, 0, str ); /* add the headers field as children of the header node */ add_child( header_tree, ofp_header_version, tvb, &offset, 1 ); add_child( header_tree, ofp_header_type, tvb, &offset, 1 ); add_child( header_tree, ofp_header_length, tvb, &offset, 2 ); add_child( header_tree, ofp_header_xid, tvb, &offset, 4 ); switch( type ) { case OFPT_HELLO: { /* nothing else in this packet type */ break; } case OFPT_ERROR: { type_item = proto_tree_add_item(ofp_tree, ofp_error_msg, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_error_msg); /* Extract the type for use later */ guint16 type = tvb_get_ntohs(tvb, offset); add_child(type_tree, ofp_error_msg_type, tvb, &offset, 2); dissect_error_code(type_tree, ofp_error_msg_code, tvb, &offset, type); if (type == OFPET_HELLO_FAILED) add_child(type_tree, ofp_error_msg_data_str, tvb, &offset, len - offset); else if (type == OFPET_BAD_REQUEST || type == OFPET_BAD_ACTION || type == OFPET_FLOW_MOD_FAILED) { /* Dissect the data as an OpenFlow packet */ proto_item *data_item = proto_tree_add_item(type_tree, ofp_error_msg_data, tvb, offset, -1, FALSE); proto_tree *data_tree = proto_item_add_subtree(data_item, ett_ofp_error_msg_data); tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, len - offset); /* Temporarily disable writing */ gboolean writeable = col_get_writable(pinfo->cinfo); col_set_writable( pinfo->cinfo, FALSE); /* Finally do the dissection */ dissect_openflow_message(next_tvb, pinfo, data_tree); col_set_writable( pinfo->cinfo, writeable); offset += (len - offset); } else add_child(type_tree, ofp_error_msg_data, tvb, &offset, len - offset); break; } case OFPT_ECHO_REQUEST: case OFPT_ECHO_REPLY: { if (len - offset > 0) add_child(tree, ofp_echo, tvb, &offset, len - offset); break; } case OFPT_VENDOR: { add_child(tree, ofp_vendor, tvb, &offset, len - offset); break; } case OFPT_FEATURES_REQUEST: /* nothing else in this packet type */ break; case OFPT_FEATURES_REPLY: { proto_item *sf_port_item = NULL; proto_tree *sf_port_tree = NULL; guint num_ports; gint sz; type_item = proto_tree_add_item(ofp_tree, ofp_switch_features, tvb, offset, -1, FALSE); //break; type_tree = proto_item_add_subtree(type_item, ett_ofp_switch_features); /* fields we'll put directly in the subtree */ add_child(type_tree, ofp_switch_features_datapath_id, tvb, &offset, 8); add_child(type_tree, ofp_switch_features_n_buffers, tvb, &offset, 4); add_child(type_tree, ofp_switch_features_n_tables, tvb, &offset, 1); dissect_pad(type_tree, &offset, 3); /* capabilities */ dissect_capability_array(tvb, pinfo, type_tree, offset, 4); offset += 4; /* actions */ dissect_switch_features_actions(tvb, pinfo, type_tree, offset, 4); offset += 4; /* handle ports */ sf_port_item = proto_tree_add_item(type_tree, ofp_switch_features_ports_hdr, tvb, offset, -1, FALSE); sf_port_tree = proto_item_add_subtree(sf_port_item, ett_ofp_switch_features_ports_hdr); sz = len - sizeof(struct ofp_switch_features); if( sz > 0 ) { num_ports = sz / sizeof(struct ofp_phy_port); /* number of ports */ proto_tree_add_uint(sf_port_tree, ofp_switch_features_ports_num, tvb, offset, num_ports*sizeof(struct ofp_phy_port), num_ports); dissect_phy_ports(sf_port_tree, sf_port_item, tvb, pinfo, &offset, num_ports); if( num_ports * sizeof(struct ofp_phy_port) < sz ) { snprintf(str, STR_LEN, "%uB were leftover at end of packet", sz - num_ports*sizeof(struct ofp_phy_port)); add_child_str(sf_port_tree, ofp_switch_features_ports_warn, tvb, &offset, 0, str); } } else if( sz < 0 ) { /* not enough bytes => wireshark will already have reported the error */ } else { snprintf(str, STR_LEN, "No ports were specified"); add_child_str(sf_port_tree, ofp_switch_features_ports_warn, tvb, &offset, 0, str); } break; } case OFPT_VPORT_TABLE_FEATURES_REQUEST: { /* nothing else in this packet type */ break; } case OFPT_VPORT_TABLE_FEATURES_REPLY: { type_item = proto_tree_add_item(ofp_tree, ofp_vport_table_features, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_vport_table_features); /* Vport table max ports */ add_child(type_tree, ofp_vport_table_max_vports, tvb, &offset, 4); /* actions */ dissect_vport_actions(tvb, pinfo, type_tree, &offset, 4); /* max chain depth */ add_child(type_tree, ofp_vport_table_max_chain_depth, tvb, &offset, 2); /* Mixed chaining */ add_child(type_tree, ofp_vport_table_mixed_chaining, tvb, &offset, 1); /* Pad */ dissect_pad(type_tree, &offset, 5); break; } case OFPT_VPORT_MOD: { type_item = proto_tree_add_item(ofp_tree, ofp_vport_mod, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_vport_mod); /* Vport no. */ add_child(type_tree, ofp_vport_mod_vport, tvb, &offset, 4); /* Parent port no. */ add_child(type_tree, ofp_vport_mod_parent_port, tvb, &offset, 4); /* Command */ add_child(type_tree, ofp_vport_mod_command, tvb, &offset, 2); /* pad */ dissect_pad(tree, &offset, 6); /* Actions */ dissect_vport_action_array(tvb, pinfo, type_tree, len, offset); break; } case OFPT_GET_CONFIG_REQUEST: /* nothing else in this packet type */ break; case OFPT_GET_CONFIG_REPLY: case OFPT_SET_CONFIG: { type_item = proto_tree_add_item(ofp_tree, ofp_switch_config, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_switch_config); dissect_switch_config_flags(tvb, pinfo, type_tree, &offset); add_child(type_tree, ofp_switch_config_miss_send_len, tvb, &offset, 2); break; } case OFPT_PACKET_IN: { type_item = proto_tree_add_item(ofp_tree, ofp_packet_in, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_packet_in); add_child(type_tree, ofp_packet_in_buffer_id, tvb, &offset, 4); /* explicitly pull out the length so we can use it to determine data's size */ guint16 total_len = tvb_get_ntohs( tvb, offset ); proto_tree_add_uint(type_tree, ofp_packet_in_total_len, tvb, offset, 2, total_len); offset += 2; add_child(type_tree, ofp_packet_in_in_port, tvb, &offset, 2); add_child(type_tree, ofp_packet_in_reason, tvb, &offset, 1); dissect_pad(type_tree, &offset, 1); /* continue the dissection with the Ethernet dissector */ if( data_ethernet ) { proto_item *data_item = proto_tree_add_item(type_tree, ofp_packet_in_data_hdr, tvb, offset, -1, FALSE); proto_tree *data_tree = proto_item_add_subtree(data_item, ett_ofp_packet_in_data_hdr); tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, total_len); dissect_ethernet(next_tvb, pinfo, data_tree); } else { /* if we couldn't load the ethernet dissector, just display the bytes */ add_child(type_tree, ofp_packet_in_data_hdr, tvb, &offset, total_len); } break; } case OFPT_FLOW_EXPIRED: { type_item = proto_tree_add_item(ofp_tree, ofp_flow_expired, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_flow_expired); dissect_match(type_tree, type_item, tvb, pinfo, &offset); add_child(type_tree, ofp_flow_expired_priority, tvb, &offset, 2); add_child(type_tree, ofp_flow_expired_reason, tvb, &offset, 1); dissect_pad(type_tree, &offset, 1); add_child(type_tree, ofp_flow_expired_duration, tvb, &offset, 4); dissect_pad(type_tree, &offset, 4); add_child(type_tree, ofp_flow_expired_packet_count, tvb, &offset, 8); add_child(type_tree, ofp_flow_expired_byte_count, tvb, &offset, 8); break; } case OFPT_PORT_STATUS: { type_item = proto_tree_add_item(ofp_tree, ofp_port_status, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_port_status); add_child(type_tree, ofp_port_status_reason, tvb, &offset, 1); dissect_pad(type_tree, &offset, 3); dissect_phy_ports(type_tree, type_item, tvb, pinfo, &offset, 1); break; } case OFPT_PACKET_OUT: { type_item = proto_tree_add_item(ofp_tree, ofp_packet_out, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_packet_out); /* get buffer_id value for later use */ guint32 buffer_id = tvb_get_ntohl( tvb, offset ); if( buffer_id == 0xFFFFFFFF ) add_child_str(type_tree, ofp_packet_out_buffer_id, tvb, &offset, 4, "None"); else { snprintf(str, STR_LEN, "%u", buffer_id); add_child_str(type_tree, ofp_packet_out_buffer_id, tvb, &offset, 4, str); } /* display in port */ // FIXME: bug in dissect_port for latest version dissect_port(type_tree, ofp_packet_out_in_port, tvb, &offset, 16); /* pull out actions len */ guint16 actions_len = tvb_get_ntohs( tvb, offset); add_child(type_tree, ofp_packet_out_actions_len, tvb, &offset, 2); /* dissect action array; will handle no-action case */ dissect_action_array(tvb, pinfo, type_tree, offset + actions_len, offset); offset += actions_len; /* if buffer id == -1, then display the provided packet */ if( buffer_id == -1 ) { /* continue the dissection with the Ethernet dissector */ guint total_len = len - offset; if( data_ethernet ) { proto_item *data_item = proto_tree_add_item(type_tree, ofp_packet_out_data_hdr, tvb, offset, -1, FALSE); proto_tree *data_tree = proto_item_add_subtree(data_item, ett_ofp_packet_out_data_hdr); tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, total_len); dissect_ethernet(next_tvb, pinfo, data_tree); } else { /* if we couldn't load the ethernet dissector, just display the bytes */ add_child(type_tree, ofp_packet_out_data_hdr, tvb, &offset, total_len); } } break; } case OFPT_FLOW_MOD: { type_item = proto_tree_add_item(ofp_tree, ofp_flow_mod, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_flow_mod); dissect_match(type_tree, type_item, tvb, pinfo, &offset); add_child(type_tree, ofp_flow_mod_command, tvb, &offset, 2); add_child(type_tree, ofp_flow_mod_idle_timeout, tvb, &offset, 2); add_child(type_tree, ofp_flow_mod_hard_timeout, tvb, &offset, 2); add_child(type_tree, ofp_flow_mod_priority, tvb, &offset, 2); /* get buffer_id value for later use */ guint32 buffer_id = tvb_get_ntohl( tvb, offset ); if( buffer_id == 0xFFFFFFFF ) add_child_str(type_tree, ofp_flow_mod_buffer_id, tvb, &offset, 4, "None"); else { snprintf(str, STR_LEN, "%u", buffer_id); add_child_str(type_tree, ofp_flow_mod_buffer_id, tvb, &offset, 4, str); } /* add the output port */ dissect_port(type_tree, ofp_flow_mod_out_port, tvb, &offset, 16 ); dissect_pad(type_tree, &offset, 2); add_child(type_tree, ofp_flow_mod_reserved, tvb, &offset, 4); dissect_action_array(tvb, pinfo, type_tree, len, offset); break; } case OFPT_PORT_MOD: { type_item = proto_tree_add_item(ofp_tree, ofp_port_mod, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_port_mod); dissect_port_mod(type_tree, type_item, tvb, pinfo, &offset); break; } case OFPT_STATS_REQUEST: { type_item = proto_tree_add_item(ofp_tree, ofp_stats_request, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_stats_request); guint16 type = tvb_get_ntohs( tvb, offset ); add_child(type_tree, ofp_stats_request_type, tvb, &offset, 2); add_child(type_tree, ofp_stats_request_flags, tvb, &offset, 2); switch( type ) { case OFPST_FLOW: { proto_item *flow_item = proto_tree_add_item(type_tree, ofp_flow_stats_request, tvb, offset, -1, FALSE); proto_tree *flow_tree = proto_item_add_subtree(flow_item, ett_ofp_flow_stats_request); dissect_match(flow_tree, flow_item, tvb, pinfo, &offset); guint8 id = tvb_get_guint8( tvb, offset ); if( id == 0xFF ) add_child_str(flow_tree, ofp_flow_stats_request_table_id, tvb, &offset, 1, "All Tables"); else { snprintf(str, STR_LEN, "%u", id); add_child_str(flow_tree, ofp_flow_stats_request_table_id, tvb, &offset, 1, str); } dissect_pad(flow_tree, &offset, 3); break; } case OFPST_AGGREGATE: { proto_item *aggr_item = proto_tree_add_item(type_tree, ofp_aggr_stats_request, tvb, offset, -1, FALSE); proto_tree *aggr_tree = proto_item_add_subtree(aggr_item, ett_ofp_aggr_stats_request); dissect_match(aggr_tree, aggr_item, tvb, pinfo, &offset); guint8 id = tvb_get_guint8( tvb, offset ); if( id == 0xFF ) add_child_str(aggr_tree, ofp_aggr_stats_request_table_id, tvb, &offset, 1, "All Tables"); else { snprintf(str, STR_LEN, "%u", id); add_child_str(aggr_tree, ofp_aggr_stats_request_table_id, tvb, &offset, 1, str); } dissect_pad(aggr_tree, &offset, 3); break; } case OFPST_TABLE: case OFPST_PORT: case OFPST_PORT_TABLE: /* no body for these types of requests */ break; default: /* add as bytes if type isn't one we know how to dissect */ add_child(type_tree, ofp_stats_request_body, tvb, &offset, len - offset); } break; } case OFPT_STATS_REPLY: { type_item = proto_tree_add_item(ofp_tree, ofp_stats_reply, tvb, offset, -1, FALSE); type_tree = proto_item_add_subtree(type_item, ett_ofp_stats_reply); guint16 type = tvb_get_ntohs( tvb, offset ); add_child(type_tree, ofp_stats_reply_type, tvb, &offset, 2); add_child(type_tree, ofp_stats_reply_flags, tvb, &offset, 2); switch( type ) { case OFPST_DESC: { // FIXME: add desc stats proto_item* desc_item = proto_tree_add_item(type_tree, ofp_desc_stats, tvb, offset, -1, FALSE); proto_tree* desc_tree = proto_item_add_subtree(desc_item, ett_ofp_desc_stats); add_child( desc_tree, ofp_desc_stats_mfr_desc, tvb, &offset, DESC_STR_LEN ); add_child( desc_tree, ofp_desc_stats_hw_desc, tvb, &offset, DESC_STR_LEN ); add_child( desc_tree, ofp_desc_stats_sw_desc, tvb, &offset, DESC_STR_LEN ); add_child( desc_tree, ofp_desc_stats_serial_num, tvb, &offset, SERIAL_NUM_LEN ); break; } case OFPST_FLOW: { /* process each flow stats struct in the packet */ while( offset < len ) { proto_item* flow_item = proto_tree_add_item(type_tree, ofp_flow_stats_reply, tvb, offset, -1, FALSE); proto_tree* flow_tree = proto_item_add_subtree(flow_item, ett_ofp_flow_stats_reply); /* just get the length of this part of the packet; no need to put it in the tree */ guint16 total_len = tvb_get_ntohs( tvb, offset ); guint offset_start = offset; offset += 2; add_child(flow_tree, ofp_flow_stats_reply_table_id, tvb, &offset, 1); dissect_pad(flow_tree, &offset, 1); dissect_match(flow_tree, flow_item, tvb, pinfo, &offset); add_child(flow_tree, ofp_flow_stats_reply_duration, tvb, &offset, 4); add_child(flow_tree, ofp_flow_stats_reply_priority, tvb, &offset, 2); add_child(flow_tree, ofp_flow_stats_reply_idle_timeout, tvb, &offset, 2); add_child(flow_tree, ofp_flow_stats_reply_hard_timeout, tvb, &offset, 2); dissect_pad(flow_tree, &offset, 6); add_child(flow_tree, ofp_flow_stats_reply_packet_count, tvb, &offset, 8); add_child(flow_tree, ofp_flow_stats_reply_byte_count, tvb, &offset, 8); /* parse the actions for this flow */ dissect_action_array(tvb, pinfo, flow_tree, total_len + offset_start, offset); offset = total_len + offset_start; } break; } case OFPST_AGGREGATE: { proto_item* aggr_item = proto_tree_add_item(type_tree, ofp_aggr_stats_reply, tvb, offset, -1, FALSE); proto_tree* aggr_tree = proto_item_add_subtree(aggr_item, ett_ofp_aggr_stats_reply); add_child(aggr_tree, ofp_aggr_stats_reply_packet_count, tvb, &offset, 8); add_child(aggr_tree, ofp_aggr_stats_reply_byte_count, tvb, &offset, 8); add_child(aggr_tree, ofp_aggr_stats_reply_flow_count, tvb, &offset, 4); dissect_pad(aggr_tree, &offset, 4); break; } case OFPST_TABLE: { /* process each table stats struct in the packet */ while( offset < len ) { proto_item *table_item = proto_tree_add_item(type_tree, ofp_table_stats, tvb, offset, -1, FALSE); proto_tree *table_tree = proto_item_add_subtree(table_item, ett_ofp_table_stats); add_child(table_tree, ofp_table_stats_table_id, tvb, &offset, 1); dissect_pad(table_tree, &offset, 3); add_child( table_tree, ofp_table_stats_name, tvb, &offset, OFP_MAX_TABLE_NAME_LEN); dissect_wildcards(table_tree, table_item, tvb, pinfo, &offset, ofp_table_stats_wildcards); add_child(table_tree, ofp_table_stats_max_entries, tvb, &offset, 4); add_child(table_tree, ofp_table_stats_active_count, tvb, &offset, 4); add_child(table_tree, ofp_table_stats_lookup_count, tvb, &offset, 8); add_child(table_tree, ofp_table_stats_matched_count, tvb, &offset, 8); } break; } case OFPST_PORT: { /* process each port stats struct in the packet */ while( offset < len ) { proto_item *port_item = proto_tree_add_item(type_tree, ofp_port_stats, tvb, offset, -1, FALSE); proto_tree *port_tree = proto_item_add_subtree(port_item, ett_ofp_port_stats); dissect_port(port_tree, ofp_port_stats_port_no, tvb, &offset, 32); dissect_pad(port_tree, &offset, 4); add_child(port_tree, ofp_port_stats_rx_packets, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_tx_packets, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_rx_bytes, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_tx_bytes, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_rx_dropped, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_tx_dropped, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_rx_errors, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_tx_errors, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_rx_frame_err, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_rx_over_err, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_rx_crc_err, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_collisions, tvb, &offset, 8); add_child(port_tree, ofp_port_stats_mpls_ttl0_dropped, tvb, &offset, 8); } break; } case OFPST_PORT_TABLE: { proto_item *port_table_item = proto_tree_add_item(type_tree, ofp_port_table_stats, tvb, offset, -1, FALSE); proto_tree *port_table_tree = proto_item_add_subtree(port_table_item, ett_ofp_port_table_stats); add_child(port_table_tree, ofp_port_table_stats_max_vports, tvb, &offset, 4); add_child(port_table_tree, ofp_port_table_stats_active_vports, tvb, &offset, 4); add_child(port_table_tree, ofp_port_table_stats_lookup_count, tvb, &offset, 8); add_child(port_table_tree, ofp_port_table_stats_port_match_count, tvb, &offset, 8); add_child(port_table_tree, ofp_port_table_stats_chain_match_count, tvb, &offset, 8); break; } case OFPST_VENDOR: { proto_item* vendor_item = proto_tree_add_item(type_tree, ofp_vendor_stats, tvb, offset, -1, FALSE); proto_tree* vendor_tree = proto_item_add_subtree(vendor_item, ett_ofp_vendor_stats); add_child(vendor_tree, ofp_vendor_stats_vendor, tvb, &offset, 4); add_child(vendor_tree, ofp_vendor_stats_body, tvb, &offset, len - offset); break; } default: /* add as bytes if type isn't one we know how to dissect */ add_child(type_tree, ofp_stats_reply_body, tvb, &offset, len - offset); } break; } default: /* add a warning if we encounter an unrecognized packet type */ snprintf(str, STR_LEN, "Dissector does not recognize type %u", type); add_child_str(tree, ofp_header_warn_type, tvb, &offset, len - offset, str); } } } static void dissect_openflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* have wireshark reassemble our PDUs; call dissect_openflow_when full PDU assembled */ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_openflow_message_len, dissect_openflow_message); }
493823.c
/* copyright 2016 wanghongyu. The project page:https://github.com/hardman/AWLive My blog page: http://blog.csdn.net/hard_man/ */ #include "aw_sw_x264_encoder.h" #include "aw_all.h" static aw_x264_context *s_x264_ctx = NULL; static aw_x264_config *s_x264_config = NULL; //debug使用 static int32_t video_count = 0; //创建flv video tag static aw_flv_video_tag *aw_sw_encoder_create_flv_video_tag(){ aw_flv_video_tag *video_tag = alloc_aw_flv_video_tag(); video_tag->codec_id = aw_flv_v_codec_id_H264; video_tag->common_tag.header_size = 5; return video_tag; } //将采集到的video yuv数据,编码为flv video tag extern aw_flv_video_tag * aw_sw_encoder_encode_x264_data(int8_t *yuv_data, long len, uint32_t timeStamp){ if (!aw_sw_x264_encoder_is_valid()) { aw_log("[E] aw_sw_encoder_encode_video_data when video encoder is not inited"); return NULL; } aw_encode_yuv_frame_2_x264(s_x264_ctx, yuv_data, (int32_t)len); if (s_x264_ctx->encoded_h264_data->size <= 0) { return NULL; } x264_picture_t *pic_out = s_x264_ctx->pic_out; aw_flv_video_tag *video_tag = aw_encoder_create_video_tag((int8_t *)s_x264_ctx->encoded_h264_data->data, s_x264_ctx->encoded_h264_data->size, timeStamp, (uint32_t)((pic_out->i_pts - pic_out->i_dts) * 1000.0 / s_x264_ctx->config.fps), pic_out->b_keyframe); // aw_log("----------------timestamp=%d, composition_time=%d, s_video_time_stamp=%d", video_tag->common_tag.timestamp, video_tag->h264_composition_time, s_video_time_stamp); video_count++; return video_tag; } //根据flv/h264/aac协议创建video/audio首帧tag extern aw_flv_video_tag *aw_sw_encoder_create_x264_sps_pps_tag(){ if(!aw_sw_x264_encoder_is_valid()){ aw_log("[E] aw_sw_encoder_create_video_sps_pps_tag when video encoder is not inited"); return NULL; } //创建 sps pps aw_flv_video_tag *sps_pps_tag = aw_sw_encoder_create_flv_video_tag(); sps_pps_tag->frame_type = aw_flv_v_frame_type_key; sps_pps_tag->h264_package_type = aw_flv_v_h264_packet_type_seq_header; sps_pps_tag->h264_composition_time = 0; sps_pps_tag->config_record_data = copy_aw_data(s_x264_ctx->sps_pps_data); sps_pps_tag->common_tag.timestamp = 0; sps_pps_tag->common_tag.data_size = s_x264_ctx->sps_pps_data->size + 11 + sps_pps_tag->common_tag.header_size; return sps_pps_tag; } //打开编码器 extern void aw_sw_encoder_open_x264_encoder(aw_x264_config *x264_config){ if (aw_sw_x264_encoder_is_valid()) { aw_log("[E] aw_sw_encoder_open_video_encoder when video encoder is not inited"); return; } int32_t x264_cfg_len = sizeof(aw_x264_config); if (!s_x264_config) { s_x264_config = aw_alloc(x264_cfg_len); } memcpy(s_x264_config, x264_config, x264_cfg_len); s_x264_ctx = alloc_aw_x264_context(*x264_config); } //关闭编码器 extern void aw_sw_encoder_close_x264_encoder(){ if (!aw_sw_x264_encoder_is_valid()) { aw_log("[E] aw_sw_encoder_close_video_encoder s_faac_ctx is NULL"); return; } if (s_x264_config) { aw_free(s_x264_config); s_x264_config = NULL; } free_aw_x264_context(&s_x264_ctx); } //是否video encoder 已经创建 extern int8_t aw_sw_x264_encoder_is_valid(){ return s_x264_ctx != NULL; } //创建 flv tag 跟编码无关。 //将h264数据转为flv_video_tag extern aw_flv_video_tag *aw_encoder_create_video_tag(int8_t *h264_data, long len, uint32_t timeStamp, long composition_time, int8_t is_key_frame){ aw_flv_video_tag *video_tag = aw_sw_encoder_create_flv_video_tag(); video_tag->frame_type = is_key_frame; video_tag->h264_package_type = aw_flv_v_h264_packet_type_nalu; video_tag->h264_composition_time = (uint32_t)(composition_time); video_tag->common_tag.timestamp = timeStamp; aw_data *frame_data = alloc_aw_data((uint32_t)len); memcpy(frame_data->data, h264_data, len); frame_data->size = (uint32_t)len; video_tag->frame_data = frame_data; video_tag->common_tag.data_size = video_tag->frame_data->size + 11 + video_tag->common_tag.header_size; return video_tag; } //创建sps_pps_tag extern aw_flv_video_tag *aw_encoder_create_sps_pps_tag(aw_data *sps_pps_data){ //创建 sps pps aw_flv_video_tag *sps_pps_tag = aw_sw_encoder_create_flv_video_tag(); sps_pps_tag->frame_type = aw_flv_v_frame_type_key; sps_pps_tag->h264_package_type = aw_flv_v_h264_packet_type_seq_header; sps_pps_tag->h264_composition_time = 0; sps_pps_tag->config_record_data = copy_aw_data(sps_pps_data); sps_pps_tag->common_tag.timestamp = 0; sps_pps_tag->common_tag.data_size = sps_pps_data->size + 11 + sps_pps_tag->common_tag.header_size; return sps_pps_tag; }
173538.c
#include "stdlib.h" #include "atomics.h" //@ #include "listex.gh" #include "queue.h" /* A lock-free queue. Multiple enqueueers, single dequeueer. * Should be memory-safe, data-race-free, functionally correct, and not leak memory. * Time complexity: enqueue: O(1) (assuming no contention). Dequeue: amortized O(1) * Progress: * - enqueue: obstruction-free (one thread always makes progress) but not wait-free (starvation is possible if there are multiple enqueueers) * - dequeue: wait-free (assuming there is an element available, of course) */ struct node { struct node *next; void *value; }; struct queue { struct node *first; struct node *middle; struct node *last; //@ struct node *ghost_middle; //@ list<void *> front_values; }; /*@ predicate lseg(struct node *first, struct node *last, list<void *> values) = first == last ? values == nil : first->next |-> ?next &*& first->value |-> ?head &*& malloc_block_node(first) &*& first != 0 &*& lseg(next, last, ?tail) &*& values == cons(head, tail); predicate lseg2(struct node *first, struct node *middle, void *value0, list<void *> values) = first->value |-> value0 &*& malloc_block_node(first) &*& [1/2]first->next |-> ?next &*& (first == middle ? values == nil : [1/2]first->next |-> next &*& lseg2(next, middle, ?head, ?tail) &*& values == cons(head, tail)); lemma void lseg2_distinct(struct node *first, struct node *middle, struct node *n) requires lseg2(first, middle, ?value0, ?values) &*& n->next |-> ?nNext; ensures lseg2(first, middle, value0, values) &*& n->next |-> nNext &*& n != middle; { open lseg2(first, middle, value0, values); if (first != middle) { assert [1/2]first->next |-> ?next; lseg2_distinct(next, middle, n); split_fraction node_next(first, _); } close lseg2(first, middle, value0, values); } predicate queue_consumer(struct queue *queue) = queue->first |-> ?first &*& queue->middle |-> ?middle &*& [1/2]queue->ghost_middle |-> middle &*& malloc_block_queue(queue) &*& lseg2(first, middle, _, ?frontValues) &*& [1/2]queue->front_values |-> frontValues; predicate queue_state(struct queue *queue, list<void *> values) = [1/2]queue->ghost_middle |-> ?middle &*& queue->last |-> ?last &*& lseg(last, middle, ?backValues) &*& [1/2]middle->next |-> _ &*& [1/2]queue->front_values |-> ?frontValues &*& values == append(frontValues, reverse(backValues)); @*/ struct queue *create_queue() //@ requires emp; //@ ensures queue_consumer(result) &*& queue_state(result, nil); { struct node *middle = malloc(sizeof(struct node)); if (middle == 0) { abort(); } struct queue *queue = malloc(sizeof(struct queue)); if (queue == 0) { abort(); } queue->first = middle; queue->middle = middle; queue->last = middle; //@ queue->ghost_middle = middle; //@ split_fraction queue_ghost_middle(queue, _); //@ close lseg(middle, middle, nil); //@ split_fraction node_next(middle, _); //@ void *middleValue = middle->value; //@ close lseg2(middle, middle, middleValue, nil); //@ queue->front_values = nil; //@ split_fraction queue_front_values(queue, _); //@ close queue_consumer(queue); //@ close queue_state(queue, nil); return queue; } void queue_enqueue(struct queue *queue, void *value) /*@ requires [?f]atomic_space(?inv) &*& is_queue_enqueue_context(?ctxt, inv, queue, value, ?pre, ?post) &*& pre(); @*/ /*@ ensures [f]atomic_space(inv) &*& is_queue_enqueue_context(ctxt, inv, queue, value, pre, post) &*& post(); @*/ { struct node *n = malloc(sizeof(struct node)); if (n == 0) { abort(); } n->value = value; bool done = false; while (!done) //@ invariant is_queue_enqueue_context(ctxt, inv, queue, value, pre, post) &*& [f]atomic_space(inv) &*& (done ? post() : n->next |-> _ &*& n->value |-> value &*& malloc_block_node(n) &*& pre()); { struct node *last = 0; { /*@ predicate pre_() = is_queue_enqueue_context(ctxt, inv, queue, value, pre, post) &*& pre(); predicate post_(void *value_) = is_queue_enqueue_context(ctxt, inv, queue, value, pre, post) &*& pre(); @*/ /*@ produce_lemma_function_pointer_chunk atomic_load_pointer_context(inv, &queue->last, pre_, post_)() { assert is_atomic_load_pointer_operation(?op, _, ?P, ?Q); open pre_(); { predicate pre__() = is_atomic_load_pointer_operation(op, &queue->last, P, Q) &*& P(); predicate post__(bool result) = is_atomic_load_pointer_operation(op, &queue->last, P, Q) &*& Q(_) &*& result == false; produce_lemma_function_pointer_chunk queue_enqueue_operation(queue, value, pre__, post__)() { open pre__(); open queue_state(queue, ?values); op(); close queue_state(queue, values); close post__(false); } { close pre__(); ctxt(); open post__(_); } } assert Q(?value_); close post_(value_); }; @*/ //@ close pre_(); last = atomic_load_pointer(&queue->last); //@ leak is_atomic_load_pointer_context(_, _, _, _, _); //@ open post_(_); } n->next = last; { /*@ predicate pre_() = is_queue_enqueue_context(ctxt, inv, queue, value, pre, post) &*& pre() &*& n->value |-> value &*& n->next |-> last &*& malloc_block_node(n); predicate post_(bool result) = is_queue_enqueue_context(ctxt, inv, queue, value, pre, post) &*& result ? post() : pre() &*& n->value |-> value &*& n->next |-> last &*& malloc_block_node(n); @*/ /*@ produce_lemma_function_pointer_chunk atomic_compare_and_store_pointer_context(inv, &queue->last, last, n, pre_, post_)() { assert is_atomic_compare_and_store_pointer_operation(?op, _, _, _, ?P, ?Q); open pre_(); { predicate pre__() = is_atomic_compare_and_store_pointer_operation(op, &queue->last, last, n, P, Q) &*& P() &*& n->value |-> value &*& n->next |-> last &*& malloc_block_node(n); predicate post__(bool result) = is_atomic_compare_and_store_pointer_operation(op, &queue->last, last, n, P, Q) &*& Q(result) &*& result ? true : n->value |-> value &*& n->next |-> last &*& malloc_block_node(n); produce_lemma_function_pointer_chunk queue_enqueue_operation(queue, value, pre__, post__)() { open pre__(); open queue_state(queue, ?values); bool result = op(); if (result) { assert lseg(last, ?middle, ?backValues); close lseg(n, middle, cons(value, backValues)); append_assoc(queue->front_values, reverse(backValues), {value}); close queue_state(queue, append(values, {value})); } else { close queue_state(queue, values); } close post__(result); } { close pre__(); ctxt(); open post__(?result); }; } assert Q(?result); close post_(result); }; @*/ //@ close pre_(); done = atomic_compare_and_store_pointer(&queue->last, last, n); //@ leak is_atomic_compare_and_store_pointer_context(_, _, _, _, _, _, _); //@ open post_(done); } } } bool queue_try_dequeue(struct queue *queue, void **pvalue) /*@ requires [?f]atomic_space(?inv) &*& is_queue_try_dequeue_context(?ctxt, inv, queue, ?pre, ?post) &*& pre() &*& queue_consumer(queue) &*& pointer(pvalue, _); @*/ /*@ ensures [f]atomic_space(inv) &*& is_queue_try_dequeue_context(ctxt, inv, queue, pre, post) &*& post(result, ?value0) &*& pointer(pvalue, ?value) &*& queue_consumer(queue) &*& result ? value0 == value : true; @*/ { //@ open queue_consumer(queue); struct node *first = queue->first; struct node *middle = queue->middle; //@ open lseg2(first, middle, ?firstValue, ?frontValues); //@ close lseg2(first, middle, firstValue, frontValues); if (first == middle) { struct node *last; { /*@ predicate pre_() = is_queue_try_dequeue_context(ctxt, inv, queue, pre, post) &*& pre() &*& [1/2]queue->ghost_middle |-> middle &*& [1/2]queue->front_values |-> frontValues; predicate post_(void *last__) = is_queue_try_dequeue_context(ctxt, inv, queue, pre, post) &*& [1/2]queue->ghost_middle |-> ?last_ &*& last_ == last__ &*& post(last_ != middle, ?value) &*& last_ != middle ? last_->value |-> ?lastValue &*& [1/2]last_->next |-> ?lastNext &*& malloc_block_node(last_) &*& lseg(lastNext, middle, ?backValues1) &*& [1/2]queue->front_values |-> tail(reverse(cons(lastValue, backValues1))) &*& value == head(reverse(cons(lastValue, backValues1))) &*& [1/2]middle->next |-> _ : [1/2]queue->front_values |-> nil; @*/ /*@ produce_lemma_function_pointer_chunk atomic_load_pointer_context(inv, &queue->last, pre_, post_)() { assert is_atomic_load_pointer_operation(?op, &queue->last, ?P, ?Q); open pre_(); { predicate pre__() = is_atomic_load_pointer_operation(op, &queue->last, P, Q) &*& P() &*& [1/2]queue->ghost_middle |-> middle &*& [1/2]queue->front_values |-> frontValues; predicate post__(bool result, void *value) = is_atomic_load_pointer_operation(op, &queue->last, P, Q) &*& Q(?last__) &*& {(struct node *)last__} == cons(?last_, nil) &*& result == (middle != last_) &*& [1/2]queue->ghost_middle |-> last_ &*& result ? last_->value |-> ?lastValue &*& [1/2]last_->next |-> ?lastNext &*& malloc_block_node(last_) &*& lseg(lastNext, middle, ?backValues1) &*& [1/2]queue->front_values |-> tail(reverse(cons(lastValue, backValues1))) &*& value == head(reverse(cons(lastValue, backValues1))) &*& [1/2]middle->next |-> _ : [1/2]queue->front_values |-> nil; produce_lemma_function_pointer_chunk queue_try_dequeue_operation(queue, pre__, post__)() { open pre__(); open queue_state(queue, ?values); op(); assert queue->last |-> ?last_ &*& lseg(last_, middle, ?backValues); if (queue->last == middle) { open lseg(last_, middle, backValues); close post__(last_ != middle, head(reverse(backValues))); close lseg(last_, last_, nil); close queue_state(queue, nil); } else { queue->ghost_middle = last_; queue->front_values = tail(reverse(backValues)); open lseg(last_, middle, backValues); close post__(last_ != middle, head(reverse(backValues))); close lseg(last_, last_, nil); close queue_state(queue, tail(reverse(backValues))); } } { close pre__(); ctxt(); open post__(?result, ?value); } } assert Q(?last__); close post_(last__); }; @*/ //@ close pre_(); last = atomic_load_pointer(&queue->last); //@ leak is_atomic_load_pointer_context(_, _, _, _, _); //@ open post_(last); } if (last == middle) { //@ close queue_consumer(queue); return false; } //@ open lseg2(first, middle, _, nil); struct node *node = last; //@ assert last->value |-> ?lastValue; struct node *prev = last->next; //@ close lseg2(node, last, lastValue, nil); //@ assert [1/2]queue->front_values |-> ?backValuesReverseTail; //@ assert lseg(prev, middle, ?backValuesTail); //@ append_nil(backValuesReverseTail); //@ reverse_head_tail_lemma(lastValue, backValuesTail); while (prev != middle) //@ invariant lseg(prev, middle, ?frontBackValues) &*& lseg2(node, last, ?backBackValuesReverseHead, ?backBackValuesReverseTail) &*& cons(lastValue, backValuesTail) == append(reverse(backBackValuesReverseTail), cons(backBackValuesReverseHead, frontBackValues)); { //@ open lseg(prev, middle, _); //@ void *prevValue = prev->value; struct node *prevPrev = prev->next; //@ assert node_value(prev, ?frontBackValuesHead) &*& lseg(prevPrev, middle, ?frontBackValuesTail); prev->next = node; //@ lseg2_distinct(node, last, prev); node = prev; prev = prevPrev; //@ split_fraction node_next(node, _); //@ close lseg2(node, last, prevValue, cons(backBackValuesReverseHead, backBackValuesReverseTail)); //@ append_assoc(reverse(backBackValuesReverseTail), cons(backBackValuesReverseHead, nil), frontBackValues); } //@ open lseg(prev, middle, _); first->next = node; //@ split_fraction node_next(first, _); middle = last; queue->middle = middle; //@ append_nil(reverse(cons(backBackValuesReverseHead, backBackValuesReverseTail))); //@ assert cons(lastValue, backValuesTail) == reverse(cons(backBackValuesReverseHead, backBackValuesReverseTail)); //@ reverse_reverse(cons(backBackValuesReverseHead, backBackValuesReverseTail)); //@ close lseg2(first, last, firstValue, reverse(cons(lastValue, backValuesTail))); } else { //@ open lseg2(first, middle, _, _); //@ assert [1/2]first->next |-> ?firstNext &*& lseg2(firstNext, middle, ?frontValuesHead, ?frontValuesTail); //@ close lseg2(first, middle, firstValue, frontValues); { /*@ predicate pre_() = is_queue_try_dequeue_context(ctxt, inv, queue, pre, post) &*& pre() &*& [1/2]queue->front_values |-> frontValues; predicate post_() = is_queue_try_dequeue_context(ctxt, inv, queue, pre, post) &*& post(true, frontValuesHead) &*& [1/2]queue->front_values |-> frontValuesTail; @*/ /*@ produce_lemma_function_pointer_chunk atomic_noop_context(inv, pre_, post_)() { open pre_(); { predicate pre__() = [1/2]queue->front_values |-> frontValues; predicate post__(bool result, void *value) = [1/2]queue->front_values |-> frontValuesTail &*& result == true &*& value == frontValuesHead; produce_lemma_function_pointer_chunk queue_try_dequeue_operation(queue, pre__, post__)() { open queue_state(queue, ?values); open pre__(); queue->front_values = frontValuesTail; close post__(true, frontValuesHead); close queue_state(queue, tail(values)); } { close pre__(); ctxt(); open post__(_, _); } } close post_(); }; @*/ //@ close pre_(); atomic_noop(); //@ leak is_atomic_noop_context(_, _, _, _); //@ open post_(); } } //@ open lseg2(first, middle, _, _); struct node *firstNext = first->next; //@ open lseg2(firstNext, middle, ?firstNextValue, ?firstNextTail); *pvalue = firstNext->value; //@ close lseg2(firstNext, middle, firstNextValue, firstNextTail); queue->first = firstNext; free(first); //@ close queue_consumer(queue); return true; } void queue_dispose(struct queue *queue) //@ requires queue_consumer(queue) &*& queue_state(queue, _); //@ ensures emp; { //@ open queue_consumer(queue); //@ open queue_state(queue, _); struct node *first = queue->first; struct node *middle = queue->middle; struct node *last = queue->last; while (first != middle) //@ invariant lseg2(first, middle, _, _); { //@ open lseg2(first, middle, _, _); struct node *next = first->next; free(first); first = next; } while (last != middle) //@ invariant lseg(last, middle, _); { //@ open lseg(last, middle, _); struct node *next = last->next; free(last); last = next; } //@ open lseg(last, middle, _); //@ open lseg2(middle, middle, _, _); free(middle); free(queue); }
795700.c
/** * @file startup.c * * @brief * ARM R5 start-up code * * \par * ============================================================================ * @n (C) Copyright 2017-2020, Texas Instruments, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of 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. * */ #include <startup.h> #include <csl_error.h> #include <csl_types.h> #pragma SET_CODE_SECTION(".startupCode") #pragma SET_DATA_SECTION(".startupData") #define CSL_MCU_ARMSS_STARTUP_VIM_NULL_ADDR ((void *) 0 ) #define CSL_FMK(PER_REG_FIELD, val) \ (((val) << CSL_##PER_REG_FIELD##_SHIFT) & CSL_##PER_REG_FIELD##_MASK) /* Declarations */ /** * \brief TEX[2:0], C and B values. * CSL_ArmR5MemAttr is used as intex here. * gMemAttr[x][0]: TEX[2:0] values * gMemAttr[x][1]: C bit value * gMemAttr[x][2]: B bit value */ static const uint32_t gMemAttr[CSL_ARM_R5_MEM_ATTR_MAX][3U] = { /* TEX[2:0], C, B bits */ { 0x0U, 0x0U, 0x0U,}, /* Strongly-ordered.*/ { 0x0U, 0x0U, 0x1U,}, /* Shareable Device.*/ { 0x0U, 0x1U, 0x0U,}, /* Outer and Inner write-through, no write-allocate. */ { 0x0U, 0x1U, 0x1U,}, /* Outer and Inner write-back, no write-allocate. */ { 0x1U, 0x0U, 0x0U,}, /* Outer and Inner Non-cacheable. */ { 0x1U, 0x1U, 0x1U,}, /* Outer and Inner write-back, write-allocate.*/ { 0x2U, 0x0U, 0x0U,}, /* Non-shareable Device.*/ }; extern const CSL_ArmR5MpuRegionCfg __attribute__((weak)) gCslR5MpuCfg[CSL_ARM_R5F_MPU_REGIONS_MAX] = { #if defined (SOC_TPR12) { /* Region 0 configuration: complete 32 bit address space = 4Gbits */ .regionId = 0U, .enable = 1U, .baseAddr = 0x0U, .size = CSL_ARM_R5_MPU_REGION_SIZE_4GB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 1U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)FALSE, .cachePolicy = 0U, .memAttr = 0U, }, { /* Region 1 configuration: 4M L3 */ .regionId = 1U, .enable = 1U, .baseAddr = 0x88000000U, .size = CSL_ARM_R5_MPU_REGION_SIZE_4MB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 2 configuration: 32 KB TCMA */ .regionId = 2U, .enable = 1U, .baseAddr = 0x00000000, .size = CSL_ARM_R5_MPU_REGION_SIZE_32KB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 3 configuration: 32 KB TCMB */ .regionId = 3U, .enable = 1U, .baseAddr = 0x00080000, .size = CSL_ARM_R5_MPU_REGION_SIZE_32KB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 4 configuration: 1 MB L2 RAM */ .regionId = 4U, .enable = 1U, .baseAddr = 0x10200000, .size = CSL_ARM_R5_MPU_REGION_SIZE_1MB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, #else { /* Region 0 configuration: complete 32 bit address space = 4Gbits */ .regionId = 0U, .enable = 1U, .baseAddr = 0x0U, .size = CSL_ARM_R5_MPU_REGION_SIZE_4GB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 1U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)FALSE, .cachePolicy = 0U, .memAttr = 0U, }, { /* Region 1 configuration: 128 bytes memory for exception vector execution */ .regionId = 1U, .enable = 1U, .baseAddr = 0x0U, .size = CSL_ARM_R5_MPU_REGION_SIZE_128B, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 2 configuration: 512 KB OCMS RAM */ .regionId = 2U, .enable = 1U, .baseAddr = 0x41C00000, .size = CSL_ARM_R5_MPU_REGION_SIZE_512KB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 3 configuration: 2 MB MCMS3 RAM */ .regionId = 3U, .enable = 1U, .baseAddr = 0x70000000, #if defined (SOC_J721E) .size = CSL_ARM_R5_MPU_REGION_SIZE_8MB, #else .size = CSL_ARM_R5_MPU_REGION_SIZE_2MB, #endif .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 4 configuration: 2 GB DDR RAM */ .regionId = 4U, .enable = 1U, .baseAddr = 0x80000000, .size = CSL_ARM_R5_MPU_REGION_SIZE_2GB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 5 configuration: 32 KB BTCM */ /* Address of ATCM/BTCM are configured via MCU_SEC_MMR registers It can either be '0x0' or '0x41010000'. Application/Boot-loader shall take care this configurations and linker command file shall be in sync with this. For either of the above configurations, MPU configurations will not changes as both regions will have same set of permissions in almost all scenarios. Application can chose to overwrite this MPU configuration if needed. The same is true for the region corresponding to ATCM. */ .regionId = 5U, .enable = 1U, .baseAddr = 0x41010000, .size = CSL_ARM_R5_MPU_REGION_SIZE_32KB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_NON_CACHEABLE, .memAttr = 0U, }, { /* Region 6 configuration: 128 MB FSS DAT */ .regionId = 6U, .enable = 0U, .baseAddr = 0x50000000, .size = CSL_ARM_R5_MPU_REGION_SIZE_128MB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_WB_WA, .memAttr = 0U, }, { /* Region 7 configuration: 32 KB ATCM */ .regionId = 7U, .enable = 1U, .baseAddr = 0x0, .size = CSL_ARM_R5_MPU_REGION_SIZE_32KB, .subRegionEnable = CSL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL, .exeNeverControl = 0U, .accessPermission = CSL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR, .shareable = 0U, .cacheable = (uint32_t)TRUE, .cachePolicy = CSL_ARM_R5_CACHE_POLICY_NON_CACHEABLE, .memAttr = 0U, }, #endif }; #pragma SET_DATA_SECTION() __attribute__((weak)) void __mpu_init(void); int _system_pre_init(void); void _system_post_cinit(void); void CSL_armR5MPUCfg(void); static void _enable_mpu() { CSL_armR5MPUCfg(); /* Custom MPU configuration */ } static void _enable_cache() { CSL_armR5StartupCacheEnableAllCache( 0 ); /* Disable I/D caches */ CSL_armR5StartupCacheEnableForceWrThru( 0 ); /* Disable force write-thru */ CSL_armR5StartupCacheInvalidateAllCache(); /* Invalidate I/D caches */ CSL_armR5StartupCacheEnableAllCache( 1 ); /* Enable I/D caches */ } void CSL_armR5MPUCfg(void) { uint32_t loopCnt = 0U; uint32_t baseAddrRegVal = 0U, sizeRegVal = 0U, accessCtrlRegVal = 0U, tex; CSL_armR5StartupCacheInvalidateAllCache(); /* Invalidate caches */ CSL_armR5StartupCacheEnableDCache(0); /* Disable D-cache */ /* Disable MPU */ CSL_armR5StartupMpuEnable(0U); /* Disable all MPU regions */ for (loopCnt = 0U ; loopCnt < CSL_ARM_R5F_MPU_REGIONS_MAX ; loopCnt++) { CSL_armR5StartupMpuCfgRegion(loopCnt, baseAddrRegVal, sizeRegVal, accessCtrlRegVal); } /* Configure MPU regions only for provided configuration */ for (loopCnt = 0U ; loopCnt < CSL_ARM_R5F_MPU_REGIONS_MAX ; loopCnt++) { if (CSL_ARM_R5_MPU_REGION_SIZE_32B <= gCslR5MpuCfg[loopCnt].size) { baseAddrRegVal = 0U; sizeRegVal = 0U; accessCtrlRegVal = 0U; baseAddrRegVal |= ( gCslR5MpuCfg[loopCnt].baseAddr & CSL_ARM_R5_MPU_REGION_BASE_ADDR_MASK); sizeRegVal |= ( gCslR5MpuCfg[loopCnt].enable << CSL_ARM_R5_MPU_REGION_SZEN_EN_SHIFT); sizeRegVal |= ( gCslR5MpuCfg[loopCnt].size << CSL_ARM_R5_MPU_REGION_SZEN_SZ_SHIFT); sizeRegVal |= ( gCslR5MpuCfg[loopCnt].subRegionEnable << CSL_ARM_R5_MPU_REGION_SZEN_SRD_SHIFT); accessCtrlRegVal |= ( gCslR5MpuCfg[loopCnt].exeNeverControl << CSL_ARM_R5_MPU_REGION_AC_XN_SHIFT); accessCtrlRegVal |= ( gCslR5MpuCfg[loopCnt].accessPermission << CSL_ARM_R5_MPU_REGION_AC_AP_SHIFT); accessCtrlRegVal |= ( gCslR5MpuCfg[loopCnt].shareable << CSL_ARM_R5_MPU_REGION_AC_S_SHIFT); if (gCslR5MpuCfg[loopCnt].cacheable == (uint32_t)TRUE) { tex = (1U << 2U); tex |= (gCslR5MpuCfg[loopCnt].cachePolicy); accessCtrlRegVal |= ( tex << CSL_ARM_R5_MPU_REGION_AC_TEX_SHIFT); accessCtrlRegVal |= ( gCslR5MpuCfg[loopCnt].cachePolicy << CSL_ARM_R5_MPU_REGION_AC_CB_SHIFT); } else { tex = gMemAttr[gCslR5MpuCfg[loopCnt].memAttr][0U]; accessCtrlRegVal |= ( tex << CSL_ARM_R5_MPU_REGION_AC_TEX_SHIFT); accessCtrlRegVal |= ( gMemAttr[gCslR5MpuCfg[loopCnt].memAttr][1U] << CSL_ARM_R5_MPU_REGION_AC_B_SHIFT); accessCtrlRegVal |= ( gMemAttr[gCslR5MpuCfg[loopCnt].memAttr][2U] << CSL_ARM_R5_MPU_REGION_AC_C_SHIFT); } /* configure MPU region here */ CSL_armR5StartupMpuCfgRegion(gCslR5MpuCfg[loopCnt].regionId, baseAddrRegVal, sizeRegVal, accessCtrlRegVal); } } CSL_armR5StartupCacheInvalidateAllCache(); /* Invalidate caches */ CSL_armR5StartupCacheEnableDCache(0); /* Disable D-cache */ /* Enable MPU */ CSL_armR5StartupMpuEnable(1U); } /*****************************************************************************/ /* \brief __MPU_INIT() - __mpu_init() is called in the C/C++ startup routine,*/ /* _c_int00(), and provides a mechanism for tailoring mpu init by device */ /* prior to calling main(). */ /* */ /*****************************************************************************/ /* Usage notes: On entry to this function from boot, R5F must be in System (privileged) mode. */ void __mpu_init(void) { uint32_t loopCnt = 0U, regAddr; CSL_ArmR5CPUInfo info; CSL_armR5StartupGetCpuID(&info); if (info.grpId == (uint32_t)CSL_ARM_R5_CLUSTER_GROUP_ID_0) { /* MCU SS Pulsar R5 SS */ regAddr = (info.cpuID == CSL_ARM_R5_CPU_ID_0)? CSL_MCU_DOMAIN_VIM_BASE_ADDR0: CSL_MCU_DOMAIN_VIM_BASE_ADDR1; } else { /* MAIN SS Pulsar R5 SS */ regAddr = (info.cpuID == CSL_ARM_R5_CPU_ID_0)? CSL_MAIN_DOMAIN_VIM_BASE_ADDR0: CSL_MAIN_DOMAIN_VIM_BASE_ADDR1; } CSL_armR5SetDLFOBit(); _enable_mpu(); /* Enable MPU */ _enable_cache(); /* Enable all caches */ CSL_armR5StartupFpuEnable( 1 ); /* Enable FPU */ CSL_armR5StartupIntrEnableVic(1); /* Enable VIC */ /* Disable/Clear pending Interrupts in VIM before enabling CPU Interrupts */ /* This is done to prevent serving any bogus interrupt */ for (loopCnt = 0U ; loopCnt < R5_VIM_INTR_NUM; loopCnt++) { /* Disable interrupt in vim */ CSL_startupVimSetIntrEnable((CSL_vimRegs *)(uintptr_t)regAddr, loopCnt, false); /* Clear interrupt status */ CSL_startupVimClrIntrPending((CSL_vimRegs *)(uintptr_t)regAddr, loopCnt); } CSL_armR5StartupIntrEnableFiq(1); /* Enable FIQ */ CSL_armR5StartupIntrEnableIrq(1); /* Enable IRQ */ } /*****************************************************************************/ /* _SYSTEM_PRE_INIT() - _system_pre_init() is called in the C/C++ startup */ /* routine (_c_int00()) and provides a mechanism for the user to */ /* insert application specific low level initialization instructions prior */ /* to calling main(). The return value of _system_pre_init() is used to */ /* determine whether or not C/C++ global data initialization will be */ /* performed (return value of 0 to bypass C/C++ auto-initialization). */ /* */ /* PLEASE NOTE THAT BYPASSING THE C/C++ AUTO-INITIALIZATION ROUTINE MAY */ /* RESULT IN PROGRAM FAILURE. */ /* */ /*****************************************************************************/ int _system_pre_init(void) { return 1; } /*****************************************************************************/ /* _SYSTEM_POST_CINIT() - _system_post_cinit() is a hook function called in */ /* the C/C++ auto-initialization function after cinit() and before pinit(). */ /* */ /*****************************************************************************/ void _system_post_cinit(void) { } void CSL_armR5StartupGetCpuID( CSL_ArmR5CPUInfo *cpuInfo ) { uint32_t regVal; regVal = CSL_armR5StartupReadMpidrReg(); cpuInfo->cpuID = (uint32_t)((regVal & CSL_R5_MPIDR_AFF0_MASK) >> CSL_R5_MPIDR_AFF0_SHIFT); cpuInfo->grpId = (uint32_t)((regVal & CSL_R5_MPIDR_AFF1_MASK) >> CSL_R5_MPIDR_AFF1_SHIFT); cpuInfo->multiprocessingExt = (uint32_t)( (regVal & CSL_R5_MPIDR_MULEXT_MASK) >> CSL_R5_MPIDR_MULEXT_SHIFT); } int32_t CSL_startupVimSetIntrEnable( CSL_vimRegs *pRegs, uint32_t intrNum, bool bEnable ) { int32_t retVal = CSL_PASS; uint32_t bitNum, groupNum, mask; void *pChkRegs = (void *) pRegs; if (pChkRegs == CSL_MCU_ARMSS_STARTUP_VIM_NULL_ADDR) { /* No actions - API fails functionality */ retVal = CSL_EFAIL; } groupNum = intrNum / CSL_VIM_NUM_INTRS_PER_GROUP; if( ( groupNum < CSL_VIM_MAX_INTR_GROUPS ) && ( retVal == CSL_PASS) ) { bitNum = intrNum & (CSL_VIM_NUM_INTRS_PER_GROUP-1U); mask = (((uint32_t)(1U)) << bitNum); if( bEnable == (bool) true) { CSL_REG32_WR(&pRegs->GRP[groupNum].INTR_EN_SET, mask ); } else { CSL_REG32_WR( &pRegs->GRP[groupNum].INTR_EN_CLR, mask ); } } else { retVal = CSL_EFAIL; } return retVal; } int32_t CSL_startupVimClrIntrPending( CSL_vimRegs *pRegs, uint32_t intrNum ) { int32_t retVal = CSL_PASS; uint32_t bitNum, groupNum, mask; void *pChkRegs = (void *) pRegs; groupNum = intrNum / CSL_VIM_NUM_INTRS_PER_GROUP; bitNum = intrNum & (CSL_VIM_NUM_INTRS_PER_GROUP-1U); mask = (((uint32_t)(1U)) << bitNum); if ( (pChkRegs != CSL_MCU_ARMSS_STARTUP_VIM_NULL_ADDR) && (groupNum < CSL_VIM_MAX_INTR_GROUPS ) ) { CSL_REG32_WR( &pRegs->GRP[groupNum].STS, mask ); } else { retVal = CSL_EFAIL; } return retVal; } #pragma SET_CODE_SECTION()
753688.c
/** * \file * \brief Unidirectional bulk data transfer via shared memory */ /* * Copyright (c) 2009, 2010, 2011, 2012, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #include <barrelfish/barrelfish.h> #include <bulk_transfer/bulk_transfer.h>
85264.c
#include <stdio.h> #include "platform.h" #include "xil_printf.h" #include "PmodACL2.h" #include "xparameters.h" #ifdef XPAR_MICROBLAZE_ID #include "microblaze_sleep.h" #endif void DemoInitialize(); void DemoRun(); void SamplesExample(); void FIFOexample(); PmodACL2 myDevice; int main(void) { DemoInitialize(); DemoRun(); return 0; } void DemoInitialize() { init_platform(); ACL2_begin(&myDevice, XPAR_PMODACL2_0_AXI_LITE_GPIO_BASEADDR, XPAR_PMODACL2_0_AXI_LITE_SPI_BASEADDR); } void DemoRun() { print("Starting...\n\r"); // SamplesExample(); FIFOexample(); ACL2_end(&myDevice); cleanup_platform(); } void SamplesExample() { int x, y, z; int status; while(1) { xil_printf("\x1B[2J"); // clear screen xil_printf("\x1B[H"); // reset cursor to 0,0 status = ACL2_getStatus(&myDevice); xil_printf("Status: %x\n\r", status); x = ACL2_getX(&myDevice); y = ACL2_getY(&myDevice); z = ACL2_getZ(&myDevice); xil_printf("X= %d, Y= %d, Z= %d\n\r", x, y, z); #ifdef XPAR_MICROBLAZE_ID MB_Sleep(500); #else usleep(100000); #endif } } void FIFOexample() { int fifoEnt, status; while(1) { xil_printf("\x1B[2J"); // clear screen xil_printf("\x1B[H"); // reset cursor to 0,0 status = ACL2_getStatus(&myDevice); xil_printf("Status: %x\n\r", status); fifoEnt = ACL2_getFIFOentries(&myDevice); xil_printf("FIFO: %d\n\r", fifoEnt); if(fifoEnt == 512) { xil_printf("Threshold triggered.\n\r"); ACL2_fillFIFO(&myDevice); #ifdef XPAR_MICROBLAZE_ID MB_Sleep(10); #else usleep(1000000); #endif xil_printf("FIFO: %d\n\r", ACL2_getFIFOentries(&myDevice)); ACL2_printQueue(&myDevice); ACL2_myQueueEmptyAll(&myDevice); #ifdef XPAR_MICROBLAZE_ID MB_Sleep(5000); #else usleep(1000000); #endif } } }
614871.c
/* * Copyright (c) 2007-2015 Freescale Semiconductor, Inc. * Copyright 2018-2019 NXP * * License: NXP LA_OPT_NXP_Software_License * * NXP Confidential. This software is owned or controlled by NXP and may * only be used strictly in accordance with the applicable license terms. * By expressly accepting such terms or by downloading, installing, * activating and/or otherwise using the software, you are agreeing that * you have read, and that you agree to comply with and are bound by, * such license terms. If you do not agree to be bound by the applicable * license terms, then you may not retain, install, activate or otherwise * use the software. This code may only be used in a microprocessor, * microcontroller, sensor or digital signal processor ("NXP Product") * supplied directly or indirectly from NXP. See the full NXP Software * License Agreement in license/LA_OPT_NXP_Software_License.pdf * * FreeMASTER Communication Driver - utility code */ #include "App.h" #include "freemaster.h" #include "freemaster_private.h" #include "freemaster_utils.h" #if !(FMSTR_DISABLE) /******************************************************** * optimized memory copy helper macros ********************************************************/ #if FMSTR_MEMCPY_MAX_SIZE >= 8 /* Copy variable to destination by bytes from an aligned source address */ FMSTR_INLINE void _FMSTR_CopySrcAligned_U64(FMSTR_U8 *dest, FMSTR_U64 *src) { TX_INTERRUPT_SAVE_AREA TX_DISABLE; union { FMSTR_U64 n; FMSTR_U8 raw[8]; } value; FMSTR_U8 *raw = value.raw; value.n =*src; /* read aligned source value with a single operation */ *dest++=*raw++; /* copy all bytes to generally unaligned destination */ *dest++=*raw++; *dest++=*raw++; *dest++=*raw++; *dest++=*raw++; *dest++=*raw++; *dest++=*raw++; *dest++=*raw++; TX_RESTORE; } /* Copy variable from source by bytes to an aligned destination address */ FMSTR_INLINE void _FMSTR_CopyDstAligned_U64(FMSTR_U64 *dest, FMSTR_U8 *src) { TX_INTERRUPT_SAVE_AREA TX_DISABLE; union { FMSTR_U64 n; FMSTR_U8 raw[8]; } value; FMSTR_U8 *raw = value.raw; *raw++=*src++; /* copy all bytes from generally unaligned source */ *raw++=*src++; *raw++=*src++; *raw++=*src++; *raw++=*src++; *raw++=*src++; *raw++=*src++; *raw++=*src++; *dest = value.n; /* write aligned destination with a single operation */ TX_RESTORE; } /* Masked copy variable from source by bytes to an aligned destination address */ FMSTR_INLINE void _FMSTR_CopyMaskedDstAligned_U64(FMSTR_U64 *dest, FMSTR_U8 *src, FMSTR_U8 *mask) { FMSTR_U64 v, m, x; _FMSTR_CopyDstAligned_U64(&v, src); _FMSTR_CopyDstAligned_U64(&m, mask); x =*dest; x =(x & ~m) | (v & m); *dest = x; } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 4 /* Copy variable to destination by bytes from an aligned source address */ FMSTR_INLINE void _FMSTR_CopySrcAligned_U32(FMSTR_U8 *dest, FMSTR_U32 *src) { TX_INTERRUPT_SAVE_AREA TX_DISABLE; union { FMSTR_U32 n; FMSTR_U8 raw[4]; } value; FMSTR_U8 *raw = value.raw; value.n =*src; /* read aligned source value with a single operation */ *dest++=*raw++; /* copy all bytes to generally unaligned destination */ *dest++=*raw++; *dest++=*raw++; *dest++=*raw++; TX_RESTORE; } /* Copy variable from source by bytes to an aligned destination address */ FMSTR_INLINE void _FMSTR_CopyDstAligned_U32(FMSTR_U32 *dest, FMSTR_U8 *src) { TX_INTERRUPT_SAVE_AREA TX_DISABLE; union { FMSTR_U32 n; FMSTR_U8 raw[4]; } value; FMSTR_U8 *raw = value.raw; *raw++=*src++; /* copy all bytes from generally unaligned source */ *raw++=*src++; *raw++=*src++; *raw++=*src++; *dest = value.n; /* write aligned destination with a single operation */ TX_RESTORE; } /* Masked copy variable from source by bytes to an aligned destination address */ FMSTR_INLINE void _FMSTR_CopyMaskedDstAligned_U32(FMSTR_U32 *dest, FMSTR_U8 *src, FMSTR_U8 *mask) { FMSTR_U32 v, m, x; _FMSTR_CopyDstAligned_U32(&v, src); _FMSTR_CopyDstAligned_U32(&m, mask); x =*dest; x =(x & ~m) | (v & m); *dest = x; } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 2 /* Copy variable to destination by bytes from an aligned source address */ FMSTR_INLINE void _FMSTR_CopySrcAligned_U16(FMSTR_U8 *dest, FMSTR_U16 *src) { TX_INTERRUPT_SAVE_AREA TX_DISABLE; union { FMSTR_U16 n; FMSTR_U8 raw[2]; } value; FMSTR_U8 *raw = value.raw; value.n =*src; /* read aligned source value with a single operation */ *dest++=*raw++; /* copy all bytes to generally unaligned destination */ *dest++=*raw++; TX_RESTORE; } /* Copy variable from source by bytes to an aligned destination address */ FMSTR_INLINE void _FMSTR_CopyDstAligned_U16(FMSTR_U16 *dest, FMSTR_U8 *src) { TX_INTERRUPT_SAVE_AREA TX_DISABLE; union { FMSTR_U16 n; FMSTR_U8 raw[2]; } value; FMSTR_U8 *raw = value.raw; *raw++=*src++; /* copy all bytes from generally unaligned source */ *raw++=*src++; *dest = value.n; /* write aligned destination with a single operation */ TX_RESTORE; } /* Masked copy variable from source by bytes to an aligned destination address */ FMSTR_INLINE void _FMSTR_CopyMaskedDstAligned_U16(FMSTR_U16 *dest, FMSTR_U8 *src, FMSTR_U8 *mask) { FMSTR_U16 v, m, x; _FMSTR_CopyDstAligned_U16(&v, src); _FMSTR_CopyDstAligned_U16(&m, mask); x =*dest; x =(x & ~m) | (v & m); *dest = x; } #endif /* Test if FMSTR_ADDR address is mis-aligned for given number of bits */ #define TEST_MISALIGNED(addr, bits) ( (((FMSTR_U32)(addr)) & ((1<<(bits))-1)) != 0 ) /* in this helper call, we are already sure that the destination pointer is 64-bit aligned */ static void _FMSTR_MemCpyDstAligned(FMSTR_ADDR dest, FMSTR_ADDR src, FMSTR_SIZE size) { FMSTR_U8 *src8 = (FMSTR_U8 *) src; #if FMSTR_MEMCPY_MAX_SIZE >= 8 { /* 64-bit aligned part */ FMSTR_U64 *d64 = (FMSTR_U64 *) dest; while (size >= sizeof(FMSTR_U64)) { _FMSTR_CopyDstAligned_U64(d64, src8); size -= sizeof(FMSTR_U64); src8 += sizeof(FMSTR_U64); d64++; } dest = (FMSTR_ADDR)(d64); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 4 { /* remaining word(s) */ FMSTR_U32 *d32 = (FMSTR_U32 *) dest; while (size >= sizeof(FMSTR_U32)) { _FMSTR_CopyDstAligned_U32(d32, src8); size -= sizeof(FMSTR_U32); src8 += sizeof(FMSTR_U32); d32++; } dest = (FMSTR_ADDR)(d32); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 2 { /* remaining halfword(s) */ FMSTR_U16 *d16 = (FMSTR_U16 *) dest; while (size >= sizeof(FMSTR_U16)) { _FMSTR_CopyDstAligned_U16(d16, src8); size -= sizeof(FMSTR_U16); src8 += sizeof(FMSTR_U16); d16++; } dest = (FMSTR_ADDR)(d16); } #endif { volatile FMSTR_U8 *d8 = (FMSTR_U8 *) dest; TX_INTERRUPT_SAVE_AREA TX_DISABLE; /* remaining byte(s) */ while (size >= 1) { *d8++=*src8++; size--; } TX_RESTORE; } FMSTR_ASSERT(size == 0); } /* in this helper call, we are already sure that the source pointer is 64-bit aligned */ static void _FMSTR_MemCpySrcAligned(FMSTR_ADDR dest, FMSTR_ADDR src, FMSTR_SIZE size) { FMSTR_U8 *dest8 = (FMSTR_U8 *) dest; #if FMSTR_MEMCPY_MAX_SIZE >= 8 { /* 64-bit aligned part */ FMSTR_U64 *s64 = (FMSTR_U64 *) src; while (size >= sizeof(FMSTR_U64)) { _FMSTR_CopySrcAligned_U64(dest8, s64); size -= sizeof(FMSTR_U64); dest8 += sizeof(FMSTR_U64); s64++; } src = (FMSTR_ADDR)(s64); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 4 { /* remaining word(s) */ FMSTR_U32 *s32 = (FMSTR_U32 *) src; while (size >= sizeof(FMSTR_U32)) { _FMSTR_CopySrcAligned_U32(dest8, s32); size -= sizeof(FMSTR_U32); dest8 += sizeof(FMSTR_U32); s32++; } src = (FMSTR_ADDR)(s32); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 2 { /* remaining halfword(s) */ FMSTR_U16 *s16 = (FMSTR_U16 *) src; while (size >= sizeof(FMSTR_U16)) { _FMSTR_CopySrcAligned_U16(dest8, s16); size -= sizeof(FMSTR_U16); dest8 += sizeof(FMSTR_U16); s16++; } src = (FMSTR_ADDR)(s16); } #endif { volatile FMSTR_U8 *s8 = (FMSTR_U8 *) src; TX_INTERRUPT_SAVE_AREA TX_DISABLE; /* remaining byte(s) */ while (size >= 1) { *dest8++=*s8++; size--; } TX_RESTORE; } FMSTR_ASSERT(size == 0); } /* in this helper call, we are already sure that the required pointer is aligned */ static void _FMSTR_MemCpyMaskedDstAligned(FMSTR_ADDR dest, FMSTR_ADDR src, FMSTR_ADDR mask, FMSTR_SIZE size) { FMSTR_U8 *src8 = (FMSTR_U8 *) src; FMSTR_U8 *mask8 = (FMSTR_U8 *) mask; #if FMSTR_MEMCPY_MAX_SIZE >= 8 { /* 64-bit aligned part */ FMSTR_U64 *d64 = (FMSTR_U64 *) dest; while (size >= sizeof(FMSTR_U64)) { _FMSTR_CopyMaskedDstAligned_U64(d64, src8, mask8); size -= sizeof(FMSTR_U64); src8 += sizeof(FMSTR_U64); mask8 += sizeof(FMSTR_U64); d64++; } dest = (FMSTR_ADDR)(d64); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 4 { /* remaining word(s) */ FMSTR_U32 *d32 = (FMSTR_U32 *) dest; while (size >= sizeof(FMSTR_U32)) { _FMSTR_CopyMaskedDstAligned_U32(d32, src8, mask8); size -= sizeof(FMSTR_U32); src8 += sizeof(FMSTR_U32); mask8 += sizeof(FMSTR_U32); d32++; } dest = (FMSTR_ADDR)(d32); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 2 { /* remaining halfword(s) */ FMSTR_U16 *d16 = (FMSTR_U16 *) dest; while (size >= sizeof(FMSTR_U16)) { _FMSTR_CopyMaskedDstAligned_U16(d16, src8, mask8); size -= sizeof(FMSTR_U16); src8 += sizeof(FMSTR_U16); mask8 += sizeof(FMSTR_U16); d16++; } dest = (FMSTR_ADDR)(d16); } #endif { volatile FMSTR_U8 *d8 = (FMSTR_U8 *) dest; FMSTR_U8 m, s; TX_INTERRUPT_SAVE_AREA TX_DISABLE; /* remaining byte(s) */ while (size >= 1) { m =*mask8++; s = (FMSTR_U8)(*src8++ & m); s |= (FMSTR_U8)(*d8 & (~m)); *d8++= s; size--; } TX_RESTORE; } FMSTR_ASSERT(size == 0); } /**************************************************************************//*! * * @brief Generic memory copy routine without alignment and transfer size requirements * * @param destAddr - destination memory address * @param srcBuff - pointer to source memory in communication buffer * @param size - buffer size (always in bytes) * ******************************************************************************/ void _FMSTR_MemCpy(void *dest, const void *src, FMSTR_SIZE size) { FMSTR_MemCpyTo((FMSTR_ADDR)(dest), (FMSTR_ADDR)(src), size); } /**************************************************************************//*! * * @brief Copy data. Reading from source memory is as aligned as it can be. * * @param destAddr - destination memory address * @param srcAddr - source memory address * @param size - buffer size in bytes * ******************************************************************************/ FMSTR_WEAK void FMSTR_MemCpyFrom(FMSTR_ADDR destAddr, FMSTR_ADDR srcAddr, FMSTR_SIZE size) { FMSTR_U8 *dest8 = (FMSTR_U8 *) destAddr; #if FMSTR_MEMCPY_MAX_SIZE >= 2 /* misaligned odd byte */ if (TEST_MISALIGNED(srcAddr, 1) && size >= sizeof(FMSTR_U8)) { FMSTR_U8 *s8 = (FMSTR_U8 *) srcAddr; *dest8++=*s8++; size -= sizeof(FMSTR_U8); srcAddr = (FMSTR_ADDR)(s8); } #if FMSTR_MEMCPY_MAX_SIZE >= 4 /* misaligned odd halfword */ if (TEST_MISALIGNED(srcAddr, 2) && size >= sizeof(FMSTR_U16)) { FMSTR_U16 *s16 = (FMSTR_U16 *) srcAddr; _FMSTR_CopySrcAligned_U16(dest8, s16); size -= sizeof(FMSTR_U16); dest8 += sizeof(FMSTR_U16); s16++; srcAddr = (FMSTR_ADDR)(s16); } #if FMSTR_MEMCPY_MAX_SIZE >= 8 /* misaligned odd word */ if (TEST_MISALIGNED(srcAddr, 3) && size >= sizeof(FMSTR_U32)) { FMSTR_U32 *s32 = (FMSTR_U32 *) srcAddr; _FMSTR_CopySrcAligned_U32(dest8, s32); size -= sizeof(FMSTR_U32); dest8 += sizeof(FMSTR_U32); s32++; srcAddr = (FMSTR_ADDR)(s32); } #endif #endif #endif /* the rest is already aligned */ _FMSTR_MemCpySrcAligned((FMSTR_ADDR)(dest8), srcAddr, size); } /**************************************************************************//*! * * @brief Copy data. Writing to destination memory is as aligned as it can be. * * @param destAddr - destination memory address * @param srcAddr - source memory address * @param size - buffer size in bytes * ******************************************************************************/ FMSTR_WEAK void FMSTR_MemCpyTo(FMSTR_ADDR destAddr, FMSTR_ADDR srcAddr, FMSTR_SIZE size) { FMSTR_U8 *src8 = (FMSTR_U8 *) srcAddr; #if FMSTR_MEMCPY_MAX_SIZE >= 2 /* misaligned odd byte */ if (TEST_MISALIGNED(destAddr, 1) && size >= sizeof(FMSTR_U8)) { FMSTR_U8 *d8 = (FMSTR_U8 *) destAddr; *d8++=*src8++; size -= sizeof(FMSTR_U8); destAddr = (FMSTR_ADDR)(d8); } #if FMSTR_MEMCPY_MAX_SIZE >= 4 /* misaligned odd halfword */ if (TEST_MISALIGNED(destAddr, 2) && size >= sizeof(FMSTR_U16)) { FMSTR_U16 *d16 = (FMSTR_U16 *) destAddr; _FMSTR_CopyDstAligned_U16(d16, src8); size -= sizeof(FMSTR_U16); src8 += sizeof(FMSTR_U16); d16++; destAddr = (FMSTR_ADDR)(d16); } #if FMSTR_MEMCPY_MAX_SIZE >= 8 /* misaligned odd word */ if (TEST_MISALIGNED(destAddr, 3) && size >= sizeof(FMSTR_U32)) { FMSTR_U32 *d32 = (FMSTR_U32 *) destAddr; _FMSTR_CopyDstAligned_U32(d32, src8); size -= sizeof(FMSTR_U32); src8 += sizeof(FMSTR_U32); d32++; destAddr = (FMSTR_ADDR)(d32); } #endif #endif #endif /* the rest is already aligned */ _FMSTR_MemCpyDstAligned(destAddr, (FMSTR_ADDR)(src8), size); } /**************************************************************************//*! * * @brief Copy data with mask. Write to destination memory is as aligned as it can be. * * @param destAddr - destination memory address * @param srcAddr - source memory address * @param maskAddr - source mask address * @param size - buiffer size in bytes * ******************************************************************************/ FMSTR_WEAK void FMSTR_MemCpyToMasked(FMSTR_ADDR destAddr, FMSTR_ADDR srcAddr, FMSTR_ADDR maskAddr, FMSTR_SIZE size) { FMSTR_U8 *src8 = (FMSTR_U8 *) srcAddr; FMSTR_U8 *mask8 = (FMSTR_U8 *) maskAddr; #if FMSTR_MEMCPY_MAX_SIZE >= 2 /* misaligned odd byte */ if (TEST_MISALIGNED(destAddr, 1) && size >= sizeof(FMSTR_U8)) { FMSTR_U8 *d8 = (FMSTR_U8 *) destAddr; FMSTR_U8 m, s; m =*mask8++; s =*src8++ & m; s |=*d8 & (~m); *d8++= s; size -= sizeof(FMSTR_U8); destAddr = (FMSTR_ADDR)(d8); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 4 /* misaligned odd halfword */ if (TEST_MISALIGNED(destAddr, 2) && size >= sizeof(FMSTR_U16)) { FMSTR_U16 *d16 = (FMSTR_U16 *) destAddr; _FMSTR_CopyMaskedDstAligned_U16(d16, src8, mask8); size -= sizeof(FMSTR_U16); src8 += sizeof(FMSTR_U16); mask8 += sizeof(FMSTR_U16); d16++; destAddr = (FMSTR_ADDR)(d16); } #endif #if FMSTR_MEMCPY_MAX_SIZE >= 8 /* misaligned odd word */ if (TEST_MISALIGNED(destAddr, 3) && size >= sizeof(FMSTR_U32)) { FMSTR_U32 *d32 = (FMSTR_U32 *) destAddr; _FMSTR_CopyMaskedDstAligned_U32(d32, src8, mask8); size -= sizeof(FMSTR_U32); src8 += sizeof(FMSTR_U32); mask8 += sizeof(FMSTR_U32); d32++; destAddr = (FMSTR_ADDR)(d32); } #endif /* the rest is already aligned */ _FMSTR_MemCpyMaskedDstAligned(destAddr, (FMSTR_ADDR)(src8), (FMSTR_ADDR)(mask8), size); } /**************************************************************************//*! * * @brief Write to the communication buffer memory * * @param destBuff - pointer to destination memory in communication buffer * @param srcAddr - source memory address * @param size - buffer size in bytes * * @return This function returns a pointer to next byte in comm. buffer * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_CopyToBuffer(FMSTR_BPTR destBuff, FMSTR_ADDR srcAddr, FMSTR_SIZE size) { FMSTR_MemCpyFrom((FMSTR_ADDR)(destBuff), srcAddr, size); return destBuff+size; } /**************************************************************************//*! * * @brief Read from communication buffer memory * * @param destAddr - destination memory address * @param srcBuff - pointer to source memory in communication buffer * @param size - buffer size in bytes * * @return This function returns a pointer to next byte in comm. buffer * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_CopyFromBuffer(FMSTR_ADDR destAddr, FMSTR_BPTR srcBuff, FMSTR_SIZE size) { FMSTR_MemCpyTo(destAddr, (FMSTR_ADDR)(srcBuff), size); return srcBuff+size; } /**************************************************************************//*! * * @brief Read from communication buffer memory and copy bytes with masking * * @param destAddr - destination memory address * @param srcBuff - pointer to source memory and mask in communication buffer * @param size - buffer size in bytes * * @return This function returns a pointer to next byte in comm. buffer * ******************************************************************************/ FMSTR_WEAK void FMSTR_CopyFromBufferWithMask(FMSTR_ADDR destAddr, FMSTR_BPTR srcBuff, FMSTR_SIZE size) { FMSTR_MemCpyToMasked(destAddr, (FMSTR_ADDR)(srcBuff), (FMSTR_ADDR)(srcBuff+size), size); } /**************************************************************************//*! * * @brief Store address in LEB format to communication buffer. * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_AddressToBuffer(FMSTR_BPTR dest, FMSTR_ADDR addr) { return FMSTR_UlebEncode(dest,&addr, sizeof(addr)); } /**************************************************************************//*! * * @brief Fetch address in LEB format from communication buffer * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_AddressFromBuffer(FMSTR_ADDR *paddr, FMSTR_BPTR src) { return FMSTR_UlebDecode(src, paddr, sizeof(*paddr)); } /**************************************************************************//*! * * @brief Store size in LEB format to communication buffer. * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_SizeToBuffer(FMSTR_BPTR dest, FMSTR_SIZE size) { return FMSTR_UlebEncode(dest,&size, sizeof(size)); } /**************************************************************************//*! * * @brief Fetch size in LEB format from communication buffer * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_SizeFromBuffer(FMSTR_SIZE *psize, FMSTR_BPTR src) { return FMSTR_UlebDecode(src, psize, sizeof(*psize)); } /**************************************************************************//*! * * @brief Fetch index in signed LEB format from communication buffer * ******************************************************************************/ FMSTR_WEAK FMSTR_BPTR FMSTR_IndexFromBuffer(FMSTR_INDEX *pindex, FMSTR_BPTR src) { return FMSTR_SlebDecode(src, pindex, sizeof(*pindex)); } /**************************************************************************//*! * * @brief Store generic U32 number to communication buffer as ULEB * ******************************************************************************/ FMSTR_BPTR FMSTR_ULebToBuffer(FMSTR_BPTR dest, FMSTR_U32 num) { return FMSTR_UlebEncode(dest,&num, sizeof(num)); } /**************************************************************************//*! * * @brief Fetch generic U32 value as ULEB from communication buffer * ******************************************************************************/ FMSTR_BPTR FMSTR_ULebFromBuffer(FMSTR_U32 *pnum, FMSTR_BPTR src) { return FMSTR_UlebDecode(src, pnum, sizeof(*pnum)); } /**************************************************************************//*! * * @brief Return number of bytes that given address needs to add in order to * get properly aligned. * ******************************************************************************/ FMSTR_WEAK FMSTR_SIZE FMSTR_GetAlignmentCorrection(FMSTR_ADDR addr, FMSTR_SIZE size) { FMSTR_U32 addrn = (FMSTR_U32)addr; FMSTR_U32 aligned = addrn; FMSTR_ASSERT(size == 0 || size == 1 || size == 2 || size == 4 || size == 8); if (size > 0) { aligned += size-1; aligned &= ~(size-1); } return (FMSTR_SIZE)(aligned - addrn); } /**************************************************************************//*! * * @brief Decode LEB number to destination variable * * @param in Pointer to input data * @param result Pointer to destination variable * @param size Size of the destination variable * @param sleb True when decoding SLEB format * ******************************************************************************/ static FMSTR_BPTR FMSTR_LebDecode(FMSTR_BPTR in, void *result, FMSTR_SIZE size, FMSTR_BOOL sleb) { FMSTR_BCHR b; FMSTR_U8 v; FMSTR_U8 *dest; FMSTR_INDEX dadd; FMSTR_INDEX shift = 0; /* Initialize result to 0 value */ FMSTR_MemSet(result, 0, size); #if FMSTR_PLATFORM_BIG_ENDIAN dest =((FMSTR_U8 *)result)+ size - 1; dadd = -1; #else dest = (FMSTR_U8 *)result; dadd = 1; #endif do { b =*in++; v = (FMSTR_U8)(b & 0x7f); if (size > 0) { *dest |= (FMSTR_U8)((v << shift)); shift += 7; if (shift >= 8) { shift -= 8; dest += dadd; size--; if (size > 0 && shift > 0) *dest |= (FMSTR_U8)(v >>(7-shift)); } } } while (b & 0x80); /* negative number? */ if (sleb && (b & 0x40)) { if (size-- > 0) { *dest |= (FMSTR_U8)(0xff << shift); dest += dadd; } while (size-- > 0) { *dest = 0xff; dest += dadd; } } return in; } FMSTR_BPTR FMSTR_UlebDecode(FMSTR_BPTR in, void *result, FMSTR_SIZE size) { return FMSTR_LebDecode(in, result, size, FMSTR_FALSE); } FMSTR_BPTR FMSTR_SlebDecode(FMSTR_BPTR in, void *result, FMSTR_SIZE size) { return FMSTR_LebDecode(in, result, size, FMSTR_TRUE); } /**************************************************************************//*! * * @brief Encode unsigned variable to ULEB record * ******************************************************************************/ FMSTR_BPTR FMSTR_UlebEncode(FMSTR_BPTR out, void *source, FMSTR_SIZE size) { FMSTR_BCHR b; FMSTR_U8 v; FMSTR_U8 *src; FMSTR_INDEX sadd; FMSTR_INDEX shift = 0; FMSTR_SIZE zeroes = 0; #if FMSTR_PLATFORM_BIG_ENDIAN src = (FMSTR_U8 *)source; while (zeroes < size && !*src++) zeroes++; src =((FMSTR_U8 *)source)+ size - 1; sadd = -1; #else src =((FMSTR_U8 *)source)+ size - 1; while (zeroes < size && !*src--) zeroes++; src = (FMSTR_U8 *)source; sadd = 1; #endif /* now: 'zeroes' is number of useless most-significant zero bytes * 'src' points to least-significant byte and 'sadd' is a direction */ if (zeroes < size) { /* we will not encode the zero bytes */ size -= zeroes; /* start with zero (will be or-ing to it) */ *out = 0; while (size--) { v =*src; src += sadd; b = (FMSTR_BCHR)((v << shift) & 0x7F); *out |= b; // shift is number of bits remaining in v v = (FMSTR_U8)(v >>(7-shift)); // other bits to the next out byte if (size || v) { *out++|= 0x80; *out = (FMSTR_BCHR)(v & 0x7f); } shift++; if (shift >= 8) { v >>= 7; if (size || v) { *out++|= 0x80; *out = (FMSTR_BCHR)(v & 0x7f); } shift = 1; } } out++; } else { /* variable is equal to 0, this encodes as a single 0 byte */ *out++= 0; } return out; } /**************************************************************************//*! * * @brief Skip the LEB field in buffer (it doesn't matter if signed or unsigned) * * @param dest - Pointer to LEB field * * @return pointer to buffer just behind LEB field * ******************************************************************************/ FMSTR_BPTR FMSTR_SkipInBufferLeb(FMSTR_BPTR dest) { FMSTR_BCHR b; do { b =*(dest++); } while (b & 0x80); return dest; } /**************************************************************************//*! * * @brief Get string from incomming buffer * ******************************************************************************/ FMSTR_BPTR FMSTR_StringFromBuffer(FMSTR_BPTR in, FMSTR_CHAR *pStr, FMSTR_SIZE maxSize) { FMSTR_BCHR b; do { in = FMSTR_ValueFromBuffer8(&b, in); if (maxSize > 0) { maxSize--; *pStr++= (FMSTR_CHAR)(maxSize ? b : 0); } } while (b); return in; } /**************************************************************************//*! * * @brief Copy string from memory to outcomming buffer * ******************************************************************************/ FMSTR_BPTR FMSTR_StringCopyToBuffer(FMSTR_BPTR out, const FMSTR_CHAR *pStr) { while (*pStr) { out = FMSTR_ValueToBuffer8(out, (FMSTR_U8)*(pStr++)); } out = FMSTR_ValueToBuffer8(out, (FMSTR_U8)0); return out; } /**************************************************************************//*! * * @brief Initialize CRC16 calculation * ******************************************************************************/ void FMSTR_Crc16Init(FMSTR_U16 *crc) { *crc = FMSTR_CRC16_CCITT_SEED; } /**************************************************************************//*! * * @brief Add new byte to CRC16 calculation * ******************************************************************************/ void FMSTR_Crc16AddByte(FMSTR_U16 *crc, FMSTR_U8 data) { FMSTR_INDEX x; *crc ^= data << 8; /* XOR hi-byte of CRC w/dat */ for (x = 8; x; --x) /* Then, for 8 bit shifts... */ { if (*crc & 0x8000) /* Test hi order bit of CRC */ *crc =*crc << 1 ^ 0x1021; /* if set, shift & XOR w/$1021 */ else *crc <<= 1; /* Else, just shift left once. */ } } /**************************************************************************//*! * * @brief Initialize CRC8 calculation * ******************************************************************************/ void FMSTR_Crc8Init(FMSTR_U8 *crc) { *crc = FMSTR_CRC8_CCITT_SEED; } /**************************************************************************//*! * * @brief Add new byte to CRC8 calculation * ******************************************************************************/ void FMSTR_Crc8AddByte(FMSTR_U8 *crc, FMSTR_U8 data) { FMSTR_INDEX x; *crc ^= data; /* XOR hi-byte of CRC w/dat */ for (x = 8; x; --x) /* Then, for 8 bit shifts... */ { if (*crc & 0x80) /* Test hi order bit of CRC */ *crc = (FMSTR_U8)((*crc << 1)^ 0x07); /* if set, shift & XOR w/$07 */ else *crc <<= 1; /* Else, just shift left once. */ } } /**************************************************************************//*! * * @brief Get array of random numbers * ******************************************************************************/ #if FMSTR_CFG_F1_RESTRICTED_ACCESS FMSTR_BPTR FMSTR_RandomNumbersToBuffer(FMSTR_U8 *out, FMSTR_SIZE length) { FMSTR_INDEX i; FMSTR_SIZE sz; FMSTR_U32 r; FMSTR_U8 *dest = out; FMSTR_U8 *ret = out; FMSTR_U8 div; for (i=0; i < length; i+=4) { /* TODO: this generator uses stdlib rand implemntation by default, which is weak. * replace this by defining your own FMSTR_Rand() macro and replace it by * a true random number engine. */ /* Achieve somewhat better entropy by skipping random number of sequenced numbers */ div = (FMSTR_U8)FMSTR_Rand(); while (div-- > 0) r = FMSTR_Rand(); sz = length - i; if (sz > 4) sz = 4; ret = FMSTR_CopyToBuffer(&dest[i], (FMSTR_ADDR)&r, sz); } return ret; } #endif /* FMSTR_CFG_F1_RESTRICTED_ACCESS */ /**************************************************************************//*! * * @brief Get array of random numbers * ******************************************************************************/ #if FMSTR_CFG_F1_RESTRICTED_ACCESS void FMSTR_Randomize(FMSTR_U32 entropy) { /* skip next few numbers in rand sequence to achieve a better behavior */ entropy &= 15; do { FMSTR_Rand(); } while (entropy-- > 0); } #endif /* FMSTR_CFG_F1_RESTRICTED_ACCESS */ /**************************************************************************//*! * * @brief The function prepares ring buffer * ******************************************************************************/ void _FMSTR_RingBuffCreate(FMSTR_RING_BUFFER *ringBuff, FMSTR_BPTR buffer, FMSTR_U32 size) { FMSTR_ASSERT(ringBuff != NULL); FMSTR_ASSERT(buffer != NULL); FMSTR_MemSet(ringBuff, 0, sizeof(FMSTR_RING_BUFFER)); ringBuff->buffer = buffer; ringBuff->size = size; ringBuff->rp = buffer; ringBuff->wp = buffer; } /**************************************************************************//*! * * @brief The function adds character into ring buffer * ******************************************************************************/ void _FMSTR_RingBuffPut(FMSTR_RING_BUFFER *ringBuff, FMSTR_BCHR nRxChar) { FMSTR_BPTR wpnext; FMSTR_ASSERT(ringBuff != NULL); /* future value of write pointer */ wpnext = ringBuff->wp + 1; if (wpnext >= (ringBuff->buffer + ringBuff->size)) wpnext = ringBuff->buffer; /* any space in queue? */ if (wpnext != ringBuff->rp) { *ringBuff->wp = (FMSTR_U8) nRxChar; ringBuff->wp = wpnext; } } /**************************************************************************//*! * * @brief The function gets character from ring buffer * ******************************************************************************/ FMSTR_BCHR _FMSTR_RingBuffGet(FMSTR_RING_BUFFER *ringBuff) { FMSTR_BCHR nChar = 0U; FMSTR_ASSERT(ringBuff != NULL); /* get all queued characters */ if (ringBuff->rp != ringBuff->wp) { FMSTR_BPTR rpnext = ringBuff->rp; nChar =*rpnext++; if (rpnext >= (ringBuff->buffer + ringBuff->size)) rpnext = ringBuff->buffer; ringBuff->rp = rpnext; } return nChar; } /**************************************************************************//*! * * @brief The function returns true, when is space in ring buffer * ******************************************************************************/ FMSTR_BOOL _FMSTR_RingBuffIsSpace(FMSTR_RING_BUFFER *ringBuff) { FMSTR_BPTR wpnext; FMSTR_ASSERT(ringBuff != NULL); wpnext = ringBuff->wp + 1; /* Is any space in buffer? */ if (wpnext != ringBuff->rp) return FMSTR_TRUE; return FMSTR_FALSE; } /**************************************************************************//*! * * @brief The function returns true, when some data in ring buffer * ******************************************************************************/ FMSTR_BOOL _FMSTR_RingBuffHasData(FMSTR_RING_BUFFER *ringBuff) { FMSTR_ASSERT(ringBuff != NULL); /* Is any data available to get from buffer? */ if (ringBuff->rp != ringBuff->wp) return FMSTR_TRUE; return FMSTR_FALSE; } /**************************************************************************//*! * * @brief Compare helper * ******************************************************************************/ FMSTR_INLINE FMSTR_INDEX _FMSTR_Compare(FMSTR_U8 c1, FMSTR_U8 c2) { if (c1 < c2) return -1; if (c1 > c2) return +1; return 0; } /**************************************************************************//*! * * @brief Standard strcmp library function * ******************************************************************************/ FMSTR_INDEX _FMSTR_StrCmp(const FMSTR_CHAR *str1, const FMSTR_CHAR *str2) { FMSTR_INDEX cmp = 0; FMSTR_CHAR c1, c2; if (str1 == str2) return 0; FMSTR_ASSERT_RETURN(str1 != NULL, 1); FMSTR_ASSERT_RETURN(str2 != NULL, -1); do { c1 =*str1++; c2 =*str2++; cmp = _FMSTR_Compare((FMSTR_U8)c1, (FMSTR_U8)c2); if (cmp) return cmp; }while (c1 && c2); return 0; } FMSTR_INDEX _FMSTR_MemCmp(const void *b1, const void *b2, FMSTR_SIZE size) { FMSTR_INDEX cmp = 0; FMSTR_U8 *p1 = (FMSTR_U8 *)b1; FMSTR_U8 *p2 = (FMSTR_U8 *)b2; FMSTR_U8 c1, c2; if (p1 == p2) return 0; FMSTR_ASSERT_RETURN(p1 != NULL, 1); FMSTR_ASSERT_RETURN(p2 != NULL, -1); while (size-- > 0) { c1 =*p1++; c2 =*p2++; cmp = _FMSTR_Compare(c1, c2); if (cmp) return cmp; } return 0; } FMSTR_SIZE _FMSTR_StrLen(const FMSTR_CHAR *str) { const FMSTR_CHAR *s = str; while (*s) s++; return (FMSTR_SIZE)(s - str); } void _FMSTR_MemSet(void *dest, FMSTR_U8 fill, FMSTR_SIZE size) { FMSTR_U8 *d = dest; while (size-- > 0) *d++= fill; } /* Random number generation not yet implemented, use stdlib function FMSTR_U32 _FMSTR_Rand(void) { return 0; } */ #endif /* !FMSTR_DISABLE */
920895.c
static inline int CVE_2011_3973_VULN_check_for_slice(AVSContext *h) { GetBitContext *gb = &h->s.gb; int align; if(h->mbx) return 0; align = (-get_bits_count(gb)) & 7; /* check for stuffing byte */ if(!align && (show_bits(gb,8) == 0x80)) align = 8; if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) { skip_bits_long(gb,24+align); h->stc = get_bits(gb,8); decode_slice_header(h,gb); return 1; } return 0; }
659826.c
/******************************************************************************* * * Copyright (c) 2009, Ron Iovine, 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 Ron Iovine 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 Ron Iovine ''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 Ron Iovine 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 <stdio.h> #include <unistd.h> #include <TraceFilter.h> #include <PshellServer.h> /* * This module honors the complete public API of the PshellServer and * TraceFilter modules but with all the underlying functionality stubbed * out, link with this module (or the corresponding "stub" library) to * easily remove all PSHELL functionality from a program without makeing * any changes to actual source code */ /* private "member" data */ static PshellTokens _dummyTokens; /* public "member" functions */ void pshell_setLogLevel(unsigned level_){}; void pshell_registerLogFunction(PshellLogFunction logFunction_){}; const char *pshell_getResultsString(int results_){return ("PSHELL_UNKNOWN_RESULT");}; void pshell_startServer(const char *serverName_, PshellServerType serverType_, PshellServerMode serverMode_, const char *hostnameOrIpAddr_, unsigned port_) { printf("PSHELL_INFO: STUB Server: %s Started\n", serverName_); if (serverMode_ == PSHELL_BLOCKING) for (;;) sleep(300); } void pshell_addCommand(PshellFunction function_, const char *command_, const char *description_, const char *usage_, unsigned char minArgs_, unsigned char maxArgs_, bool showUsage_){} void pshell_runCommand(const char *command_, ...){} void pshell_printf(const char *format_, ...){} void pshell_flush(void){} void pshell_wheel(const char *string_){} void pshell_march(const char *string_){} bool pshell_isHelp(void){return (true);} void pshell_showUsage(void){} PshellTokens *pshell_tokenize(const char *string_, const char *delimeter_){return (&_dummyTokens);} unsigned pshell_getLength(const char *string_){return (0);} bool pshell_isEqual(const char *string1_, const char *string2_){return (true);} bool pshell_isEqualNoCase(const char *string1_, const char *string2_){return (true);} bool pshell_isSubString(const char *string1_, const char *string2_, unsigned minChars_){return (true);} bool pshell_isAlpha(const char *string_){return (true);} bool pshell_isNumeric(const char *string_){return (true);} bool pshell_isAlphaNumeric(const char *string_){return (true);} bool pshell_isDec(const char *string_){return (true);} bool isHex(const char *string_){return (true);} bool pshell_isFloat(const char *string_){return (true);} bool pshell_getOption(const char *string_, char *option_, char *value_){return (false);} void *pshell_getAddress(const char *string_){return ((void*)0);} bool pshell_getBool(const char *string_){return (false);} long pshell_getLong(const char *string_){return ((long)0);} int pshell_getInt(const char *string_){return ((int)0);} short pshell_getShort(const char *string_){return ((short)0);} char pshell_getChar(const char *string_){return ((char)0);} unsigned pshell_getUnsigned(const char *string_){return ((unsigned)0);} unsigned long pshell_getUnsignedLong(const char *string_){return ((unsigned long)0);} unsigned short pshell_getUnsignedShort(const char *string_){return ((unsigned short)0);} unsigned char pshell_getUnsignedChar(const char *string_){return ((unsigned char)0);} float pshell_getFloat(const char *string_){return ((float)0.0);} double pshell_getDouble(const char *string_){return ((double)0.0);} #ifdef TF_FAST_FILENAME_LOOKUP int TraceSymbols::_numSymbols = 0; const char *TraceSymbols::_symbolTable[TF_MAX_TRACE_SYMBOLS]; #endif void tf_init(const char *configFile_){} void tf_registerThread(const char *threadName_){} bool tf_isFilterPassed(const char *file_, int line_, const char *function_, unsigned level_){return (true);} void tf_watch(const char *file_, int line_, const char *function_, const char *symbol_, void *address_, int width_, const char *format_, tf_TraceControl control_){} void tf_callback(const char *file_, int line_, const char *function_, const char *callbackName_, tf_TraceCallback callbackFunction_, tf_TraceControl control_){}
491570.c
/* * lib/krb5/keytab/srvtab/kts_resolv.c * * Copyright 1990 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. * * * This is an implementation specific resolver. It returns a keytab id * initialized with srvtab keytab routines. */ #include "k5-int.h" #include "ktsrvtab.h" krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_resolve(context, name, id) krb5_context context; const char *name; krb5_keytab *id; { krb5_ktsrvtab_data *data; FILE *fp; /* Make sure we can open the srvtab file for reading. */ fp = fopen(name, "r"); if (!fp) return(errno); fclose(fp); if ((*id = (krb5_keytab) malloc(sizeof(**id))) == NULL) return(ENOMEM); (*id)->ops = &krb5_kts_ops; data = (krb5_ktsrvtab_data *)malloc(sizeof(krb5_ktsrvtab_data)); if (data == NULL) { krb5_xfree(*id); return(ENOMEM); } data->name = (char *)malloc(strlen(name) + 1); if (data->name == NULL) { krb5_xfree(data); krb5_xfree(*id); return(ENOMEM); } (void) strcpy(data->name, name); data->openf = 0; (*id)->data = (krb5_pointer)data; (*id)->magic = KV5M_KEYTAB; return(0); }
904108.c
/* * Various utilities for command line tools * Copyright (c) 2000-2003 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <string.h> #include <stdint.h> #include <stdlib.h> #include <errno.h> #include <math.h> /* Include only the enabled headers since some compilers (namely, Sun Studio) will not omit unused inline functions and create undefined references to libraries that are not being built. */ #include "config.h" #include "compat/va_copy.h" #include "libavformat/avformat.h" #include "libavfilter/avfilter.h" #include "libavdevice/avdevice.h" #include "libavresample/avresample.h" #include "libswscale/swscale.h" #include "libswresample/swresample.h" #include "libpostproc/postprocess.h" #include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/display.h" #include "libavutil/mathematics.h" #include "libavutil/imgutils.h" #include "libavutil/libm.h" #include "libavutil/parseutils.h" #include "libavutil/pixdesc.h" #include "libavutil/eval.h" #include "libavutil/dict.h" #include "libavutil/opt.h" #include "libavutil/cpu.h" #include "libavutil/ffversion.h" #include "libavutil/version.h" #include "cmdutils.h" #if CONFIG_NETWORK #include "libavformat/network.h" #endif #if HAVE_SYS_RESOURCE_H #include <sys/time.h> #include <sys/resource.h> #endif static int init_report(const char *env); AVDictionary *sws_dict; AVDictionary *swr_opts; AVDictionary *format_opts, *codec_opts, *resample_opts; static FILE *report_file; static int report_file_level = AV_LOG_DEBUG; int hide_banner = 0; void init_opts(void) { av_dict_set(&sws_dict, "flags", "bicubic", 0); } void uninit_opts(void) { av_dict_free(&swr_opts); av_dict_free(&sws_dict); av_dict_free(&format_opts); av_dict_free(&codec_opts); av_dict_free(&resample_opts); } void log_callback_help(void *ptr, int level, const char *fmt, va_list vl) { vfprintf(stdout, fmt, vl); } static void log_callback_report(void *ptr, int level, const char *fmt, va_list vl) { va_list vl2; char line[1024]; static int print_prefix = 1; va_copy(vl2, vl); av_log_default_callback(ptr, level, fmt, vl); av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix); va_end(vl2); if (report_file_level >= level) { fputs(line, report_file); fflush(report_file); } } static void (*program_exit)(int ret); void register_exit(void (*cb)(int ret)) { program_exit = cb; } void exit_program(int ret) { if (program_exit) program_exit(ret); exit(ret); } double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max) { char *tail; const char *error; double d = av_strtod(numstr, &tail); if (*tail) error = "Expected number for %s but found: %s\n"; else if (d < min || d > max) error = "The value for %s was %s which is not within %f - %f\n"; else if (type == OPT_INT64 && (int64_t)d != d) error = "Expected int64 for %s but found %s\n"; else if (type == OPT_INT && (int)d != d) error = "Expected int for %s but found %s\n"; else return d; av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max); exit_program(1); return 0; } int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration) { int64_t us; if (av_parse_time(&us, timestr, is_duration) < 0) { av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n", is_duration ? "duration" : "date", context, timestr); exit_program(1); } return us; } void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags, int alt_flags) { const OptionDef *po; int first; first = 1; for (po = options; po->name; po++) { char buf[64]; if (((po->flags & req_flags) != req_flags) || (alt_flags && !(po->flags & alt_flags)) || (po->flags & rej_flags)) continue; if (first) { printf("%s\n", msg); first = 0; } av_strlcpy(buf, po->name, sizeof(buf)); if (po->argname) { av_strlcat(buf, " ", sizeof(buf)); av_strlcat(buf, po->argname, sizeof(buf)); } printf("-%-17s %s\n", buf, po->help); } printf("\n"); } void show_help_children(const AVClass *class, int flags) { const AVClass *child = NULL; if (class->option) { av_opt_show2(&class, NULL, flags, 0); printf("\n"); } while (child = av_opt_child_class_next(class, child)) show_help_children(child, flags); } static const OptionDef *find_option(const OptionDef *po, const char *name) { const char *p = strchr(name, ':'); int len = p ? p - name : strlen(name); while (po->name) { if (!strncmp(name, po->name, len) && strlen(po->name) == len) break; po++; } return po; } /* _WIN32 means using the windows libc - cygwin doesn't define that * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while * it doesn't provide the actual command line via GetCommandLineW(). */ #if HAVE_COMMANDLINETOARGVW && defined(_WIN32) #include <windows.h> #include <shellapi.h> /* Will be leaked on exit */ static char** win32_argv_utf8 = NULL; static int win32_argc = 0; /** * Prepare command line arguments for executable. * For Windows - perform wide-char to UTF-8 conversion. * Input arguments should be main() function arguments. * @param argc_ptr Arguments number (including executable) * @param argv_ptr Arguments list. */ static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr) { char *argstr_flat; wchar_t **argv_w; int i, buffsize = 0, offset = 0; if (win32_argv_utf8) { *argc_ptr = win32_argc; *argv_ptr = win32_argv_utf8; return; } win32_argc = 0; argv_w = CommandLineToArgvW(GetCommandLineW(), &win32_argc); if (win32_argc <= 0 || !argv_w) return; /* determine the UTF-8 buffer size (including NULL-termination symbols) */ for (i = 0; i < win32_argc; i++) buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, NULL, 0, NULL, NULL); win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize); argstr_flat = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1); if (!win32_argv_utf8) { LocalFree(argv_w); return; } for (i = 0; i < win32_argc; i++) { win32_argv_utf8[i] = &argstr_flat[offset]; offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, &argstr_flat[offset], buffsize - offset, NULL, NULL); } win32_argv_utf8[i] = NULL; LocalFree(argv_w); *argc_ptr = win32_argc; *argv_ptr = win32_argv_utf8; } #else static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr) { /* nothing to do */ } #endif /* HAVE_COMMANDLINETOARGVW */ static int write_option(void *optctx, const OptionDef *po, const char *opt, const char *arg) { /* new-style options contain an offset into optctx, old-style address of * a global var*/ void *dst = po->flags & (OPT_OFFSET | OPT_SPEC) ? (uint8_t *)optctx + po->u.off : po->u.dst_ptr; int *dstcount; if (po->flags & OPT_SPEC) { SpecifierOpt **so = dst; char *p = strchr(opt, ':'); char *str; dstcount = (int *)(so + 1); *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1); str = av_strdup(p ? p + 1 : ""); if (!str) return AVERROR(ENOMEM); (*so)[*dstcount - 1].specifier = str; dst = &(*so)[*dstcount - 1].u; } if (po->flags & OPT_STRING) { char *str; str = av_strdup(arg); av_freep(dst); if (!str) return AVERROR(ENOMEM); *(char **)dst = str; } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) { *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX); } else if (po->flags & OPT_INT64) { *(int64_t *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX); } else if (po->flags & OPT_TIME) { *(int64_t *)dst = parse_time_or_die(opt, arg, 1); } else if (po->flags & OPT_FLOAT) { *(float *)dst = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY); } else if (po->flags & OPT_DOUBLE) { *(double *)dst = parse_number_or_die(opt, arg, OPT_DOUBLE, -INFINITY, INFINITY); } else if (po->u.func_arg) { int ret = po->u.func_arg(optctx, opt, arg); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Failed to set value '%s' for option '%s': %s\n", arg, opt, av_err2str(ret)); return ret; } } if (po->flags & OPT_EXIT) exit_program(0); return 0; } int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options) { const OptionDef *po; int ret; po = find_option(options, opt); if (!po->name && opt[0] == 'n' && opt[1] == 'o') { /* handle 'no' bool option */ po = find_option(options, opt + 2); if ((po->name && (po->flags & OPT_BOOL))) arg = "0"; } else if (po->flags & OPT_BOOL) arg = "1"; if (!po->name) po = find_option(options, "default"); if (!po->name) { av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt); return AVERROR(EINVAL); } if (po->flags & HAS_ARG && !arg) { av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'\n", opt); return AVERROR(EINVAL); } ret = write_option(optctx, po, opt, arg); if (ret < 0) return ret; return !!(po->flags & HAS_ARG); } void parse_options(void *optctx, int argc, char **argv, const OptionDef *options, void (*parse_arg_function)(void *, const char*)) { const char *opt; int optindex, handleoptions = 1, ret; /* perform system-dependent conversions for arguments list */ prepare_app_arguments(&argc, &argv); /* parse options */ optindex = 1; while (optindex < argc) { opt = argv[optindex++]; if (handleoptions && opt[0] == '-' && opt[1] != '\0') { if (opt[1] == '-' && opt[2] == '\0') { handleoptions = 0; continue; } opt++; if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0) exit_program(1); optindex += ret; } else { if (parse_arg_function) parse_arg_function(optctx, opt); } } } int parse_optgroup(void *optctx, OptionGroup *g) { int i, ret; av_log(NULL, AV_LOG_DEBUG, "Parsing a group of options: %s %s.\n", g->group_def->name, g->arg); for (i = 0; i < g->nb_opts; i++) { Option *o = &g->opts[i]; if (g->group_def->flags && !(g->group_def->flags & o->opt->flags)) { av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to " "%s %s -- you are trying to apply an input option to an " "output file or vice versa. Move this option before the " "file it belongs to.\n", o->key, o->opt->help, g->group_def->name, g->arg); return AVERROR(EINVAL); } av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n", o->key, o->opt->help, o->val); ret = write_option(optctx, o->opt, o->key, o->val); if (ret < 0) return ret; } av_log(NULL, AV_LOG_DEBUG, "Successfully parsed a group of options.\n"); return 0; } int locate_option(int argc, char **argv, const OptionDef *options, const char *optname) { const OptionDef *po; int i; for (i = 1; i < argc; i++) { const char *cur_opt = argv[i]; if (*cur_opt++ != '-') continue; po = find_option(options, cur_opt); if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o') po = find_option(options, cur_opt + 2); if ((!po->name && !strcmp(cur_opt, optname)) || (po->name && !strcmp(optname, po->name))) return i; if (!po->name || po->flags & HAS_ARG) i++; } return 0; } static void dump_argument(const char *a) { const unsigned char *p; for (p = a; *p; p++) if (!((*p >= '+' && *p <= ':') || (*p >= '@' && *p <= 'Z') || *p == '_' || (*p >= 'a' && *p <= 'z'))) break; if (!*p) { fputs(a, report_file); return; } fputc('"', report_file); for (p = a; *p; p++) { if (*p == '\\' || *p == '"' || *p == '$' || *p == '`') fprintf(report_file, "\\%c", *p); else if (*p < ' ' || *p > '~') fprintf(report_file, "\\x%02x", *p); else fputc(*p, report_file); } fputc('"', report_file); } static void check_options(const OptionDef *po) { while (po->name) { if (po->flags & OPT_PERFILE) av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT)); po++; } } void parse_loglevel(int argc, char **argv, const OptionDef *options) { int idx = locate_option(argc, argv, options, "loglevel"); const char *env; check_options(options); if (!idx) idx = locate_option(argc, argv, options, "v"); if (idx && argv[idx + 1]) opt_loglevel(NULL, "loglevel", argv[idx + 1]); idx = locate_option(argc, argv, options, "report"); if ((env = getenv("FFREPORT")) || idx) { init_report(env); if (report_file) { int i; fprintf(report_file, "Command line:\n"); for (i = 0; i < argc; i++) { dump_argument(argv[i]); fputc(i < argc - 1 ? ' ' : '\n', report_file); } fflush(report_file); } } idx = locate_option(argc, argv, options, "hide_banner"); if (idx) hide_banner = 1; } static const AVOption *opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags) { const AVOption *o = av_opt_find(obj, name, unit, opt_flags, search_flags); if(o && !o->flags) return NULL; return o; } #define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0 int opt_default(void *optctx, const char *opt, const char *arg) { const AVOption *o; int consumed = 0; char opt_stripped[128]; const char *p; const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(); #if CONFIG_AVRESAMPLE const AVClass *rc = avresample_get_class(); #endif #if CONFIG_SWSCALE const AVClass *sc = sws_get_class(); #endif #if CONFIG_SWRESAMPLE const AVClass *swr_class = swr_get_class(); #endif if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug")) av_log_set_level(AV_LOG_DEBUG); if (!(p = strchr(opt, ':'))) p = opt + strlen(opt); av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1)); if ((o = opt_find(&cc, opt_stripped, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) || ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') && (o = opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)))) { av_dict_set(&codec_opts, opt, arg, FLAGS); consumed = 1; } if ((o = opt_find(&fc, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { av_dict_set(&format_opts, opt, arg, FLAGS); if (consumed) av_log(NULL, AV_LOG_VERBOSE, "Routing option %s to both codec and muxer layer\n", opt); consumed = 1; } #if CONFIG_SWSCALE if (!consumed && (o = opt_find(&sc, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { struct SwsContext *sws = sws_alloc_context(); int ret = av_opt_set(sws, opt, arg, 0); sws_freeContext(sws); if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") || !strcmp(opt, "dstw") || !strcmp(opt, "dsth") || !strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) { av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n"); return AVERROR(EINVAL); } if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); return ret; } av_dict_set(&sws_dict, opt, arg, FLAGS); consumed = 1; } #else if (!consumed && !strcmp(opt, "sws_flags")) { av_log(NULL, AV_LOG_WARNING, "Ignoring %s %s, due to disabled swscale\n", opt, arg); consumed = 1; } #endif #if CONFIG_SWRESAMPLE if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { struct SwrContext *swr = swr_alloc(); int ret = av_opt_set(swr, opt, arg, 0); swr_free(&swr); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); return ret; } av_dict_set(&swr_opts, opt, arg, FLAGS); consumed = 1; } #endif #if CONFIG_AVRESAMPLE if ((o=opt_find(&rc, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { av_dict_set(&resample_opts, opt, arg, FLAGS); consumed = 1; } #endif if (consumed) return 0; return AVERROR_OPTION_NOT_FOUND; } /* * Check whether given option is a group separator. * * @return index of the group definition that matched or -1 if none */ static int match_group_separator(const OptionGroupDef *groups, int nb_groups, const char *opt) { int i; for (i = 0; i < nb_groups; i++) { const OptionGroupDef *p = &groups[i]; if (p->sep && !strcmp(p->sep, opt)) return i; } return -1; } /* * Finish parsing an option group. * * @param group_idx which group definition should this group belong to * @param arg argument of the group delimiting option */ static void finish_group(OptionParseContext *octx, int group_idx, const char *arg) { OptionGroupList *l = &octx->groups[group_idx]; OptionGroup *g; GROW_ARRAY(l->groups, l->nb_groups); g = &l->groups[l->nb_groups - 1]; *g = octx->cur_group; g->arg = arg; g->group_def = l->group_def; g->sws_dict = sws_dict; g->swr_opts = swr_opts; g->codec_opts = codec_opts; g->format_opts = format_opts; g->resample_opts = resample_opts; codec_opts = NULL; format_opts = NULL; resample_opts = NULL; sws_dict = NULL; swr_opts = NULL; init_opts(); memset(&octx->cur_group, 0, sizeof(octx->cur_group)); } /* * Add an option instance to currently parsed group. */ static void add_opt(OptionParseContext *octx, const OptionDef *opt, const char *key, const char *val) { int global = !(opt->flags & (OPT_PERFILE | OPT_SPEC | OPT_OFFSET)); OptionGroup *g = global ? &octx->global_opts : &octx->cur_group; GROW_ARRAY(g->opts, g->nb_opts); g->opts[g->nb_opts - 1].opt = opt; g->opts[g->nb_opts - 1].key = key; g->opts[g->nb_opts - 1].val = val; } static void init_parse_context(OptionParseContext *octx, const OptionGroupDef *groups, int nb_groups) { static const OptionGroupDef global_group = { "global" }; int i; memset(octx, 0, sizeof(*octx)); octx->nb_groups = nb_groups; octx->groups = av_mallocz_array(octx->nb_groups, sizeof(*octx->groups)); if (!octx->groups) exit_program(1); for (i = 0; i < octx->nb_groups; i++) octx->groups[i].group_def = &groups[i]; octx->global_opts.group_def = &global_group; octx->global_opts.arg = ""; init_opts(); } void uninit_parse_context(OptionParseContext *octx) { int i, j; for (i = 0; i < octx->nb_groups; i++) { OptionGroupList *l = &octx->groups[i]; for (j = 0; j < l->nb_groups; j++) { av_freep(&l->groups[j].opts); av_dict_free(&l->groups[j].codec_opts); av_dict_free(&l->groups[j].format_opts); av_dict_free(&l->groups[j].resample_opts); av_dict_free(&l->groups[j].sws_dict); av_dict_free(&l->groups[j].swr_opts); } av_freep(&l->groups); } av_freep(&octx->groups); av_freep(&octx->cur_group.opts); av_freep(&octx->global_opts.opts); uninit_opts(); } int split_commandline(OptionParseContext *octx, int argc, char *argv[], const OptionDef *options, const OptionGroupDef *groups, int nb_groups) { int optindex = 1; int dashdash = -2; /* perform system-dependent conversions for arguments list */ prepare_app_arguments(&argc, &argv); init_parse_context(octx, groups, nb_groups); av_log(NULL, AV_LOG_DEBUG, "Splitting the commandline.\n"); while (optindex < argc) { const char *opt = argv[optindex++], *arg; const OptionDef *po; int ret; av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt); if (opt[0] == '-' && opt[1] == '-' && !opt[2]) { dashdash = optindex; continue; } /* unnamed group separators, e.g. output filename */ if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) { finish_group(octx, 0, opt); av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name); continue; } opt++; #define GET_ARG(arg) \ do { \ arg = argv[optindex++]; \ if (!arg) { \ av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'.\n", opt);\ return AVERROR(EINVAL); \ } \ } while (0) /* named group separators, e.g. -i */ if ((ret = match_group_separator(groups, nb_groups, opt)) >= 0) { GET_ARG(arg); finish_group(octx, ret, arg); av_log(NULL, AV_LOG_DEBUG, " matched as %s with argument '%s'.\n", groups[ret].name, arg); continue; } /* normal options */ po = find_option(options, opt); if (po->name) { if (po->flags & OPT_EXIT) { /* optional argument, e.g. -h */ arg = argv[optindex++]; } else if (po->flags & HAS_ARG) { GET_ARG(arg); } else { arg = "1"; } add_opt(octx, po, opt, arg); av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with " "argument '%s'.\n", po->name, po->help, arg); continue; } /* AVOptions */ if (argv[optindex]) { ret = opt_default(NULL, opt, argv[optindex]); if (ret >= 0) { av_log(NULL, AV_LOG_DEBUG, " matched as AVOption '%s' with " "argument '%s'.\n", opt, argv[optindex]); optindex++; continue; } else if (ret != AVERROR_OPTION_NOT_FOUND) { av_log(NULL, AV_LOG_ERROR, "Error parsing option '%s' " "with argument '%s'.\n", opt, argv[optindex]); return ret; } } /* boolean -nofoo options */ if (opt[0] == 'n' && opt[1] == 'o' && (po = find_option(options, opt + 2)) && po->name && po->flags & OPT_BOOL) { add_opt(octx, po, opt, "0"); av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with " "argument 0.\n", po->name, po->help); continue; } av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'.\n", opt); return AVERROR_OPTION_NOT_FOUND; } if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts) av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the " "commandline.\n"); av_log(NULL, AV_LOG_DEBUG, "Finished splitting the commandline.\n"); return 0; } int opt_cpuflags(void *optctx, const char *opt, const char *arg) { int ret; unsigned flags = av_get_cpu_flags(); if ((ret = av_parse_cpu_caps(&flags, arg)) < 0) return ret; av_force_cpu_flags(flags); return 0; } int opt_loglevel(void *optctx, const char *opt, const char *arg) { const struct { const char *name; int level; } log_levels[] = { { "quiet" , AV_LOG_QUIET }, { "panic" , AV_LOG_PANIC }, { "fatal" , AV_LOG_FATAL }, { "error" , AV_LOG_ERROR }, { "warning", AV_LOG_WARNING }, { "info" , AV_LOG_INFO }, { "verbose", AV_LOG_VERBOSE }, { "debug" , AV_LOG_DEBUG }, { "trace" , AV_LOG_TRACE }, }; char *tail; int level; int flags; int i; flags = av_log_get_flags(); tail = strstr(arg, "repeat"); if (tail) flags &= ~AV_LOG_SKIP_REPEATED; else flags |= AV_LOG_SKIP_REPEATED; av_log_set_flags(flags); if (tail == arg) arg += 6 + (arg[6]=='+'); if(tail && !*arg) return 0; for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) { if (!strcmp(log_levels[i].name, arg)) { av_log_set_level(log_levels[i].level); return 0; } } level = strtol(arg, &tail, 10); if (*tail) { av_log(NULL, AV_LOG_FATAL, "Invalid loglevel \"%s\". " "Possible levels are numbers or:\n", arg); for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) av_log(NULL, AV_LOG_FATAL, "\"%s\"\n", log_levels[i].name); exit_program(1); } av_log_set_level(level); return 0; } static void expand_filename_template(AVBPrint *bp, const char *template, struct tm *tm) { int c; while ((c = *(template++))) { if (c == '%') { if (!(c = *(template++))) break; switch (c) { case 'p': av_bprintf(bp, "%s", program_name); break; case 't': av_bprintf(bp, "%04d%02d%02d-%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); break; case '%': av_bprint_chars(bp, c, 1); break; } } else { av_bprint_chars(bp, c, 1); } } } static int init_report(const char *env) { char *filename_template = NULL; char *key, *val; int ret, count = 0; time_t now; struct tm *tm; AVBPrint filename; if (report_file) /* already opened */ return 0; time(&now); tm = localtime(&now); while (env && *env) { if ((ret = av_opt_get_key_value(&env, "=", ":", 0, &key, &val)) < 0) { if (count) av_log(NULL, AV_LOG_ERROR, "Failed to parse FFREPORT environment variable: %s\n", av_err2str(ret)); break; } if (*env) env++; count++; if (!strcmp(key, "file")) { av_free(filename_template); filename_template = val; val = NULL; } else if (!strcmp(key, "level")) { char *tail; report_file_level = strtol(val, &tail, 10); if (*tail) { av_log(NULL, AV_LOG_FATAL, "Invalid report file level\n"); exit_program(1); } } else { av_log(NULL, AV_LOG_ERROR, "Unknown key '%s' in FFREPORT\n", key); } av_free(val); av_free(key); } av_bprint_init(&filename, 0, 1); expand_filename_template(&filename, av_x_if_null(filename_template, "%p-%t.log"), tm); av_free(filename_template); if (!av_bprint_is_complete(&filename)) { av_log(NULL, AV_LOG_ERROR, "Out of memory building report file name\n"); return AVERROR(ENOMEM); } report_file = fopen(filename.str, "w"); if (!report_file) { int ret = AVERROR(errno); av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n", filename.str, strerror(errno)); return ret; } av_log_set_callback(log_callback_report); av_log(NULL, AV_LOG_INFO, "%s started on %04d-%02d-%02d at %02d:%02d:%02d\n" "Report written to \"%s\"\n", program_name, tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, filename.str); av_bprint_finalize(&filename, NULL); return 0; } int opt_report(const char *opt) { return init_report(NULL); } int opt_max_alloc(void *optctx, const char *opt, const char *arg) { char *tail; size_t max; max = strtol(arg, &tail, 10); if (*tail) { av_log(NULL, AV_LOG_FATAL, "Invalid max_alloc \"%s\".\n", arg); exit_program(1); } av_max_alloc(max); return 0; } int opt_timelimit(void *optctx, const char *opt, const char *arg) { #if HAVE_SETRLIMIT int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); struct rlimit rl = { lim, lim + 1 }; if (setrlimit(RLIMIT_CPU, &rl)) perror("setrlimit"); #else av_log(NULL, AV_LOG_WARNING, "-%s not implemented on this OS\n", opt); #endif return 0; } void print_error(const char *filename, int err) { char errbuf[128]; const char *errbuf_ptr = errbuf; if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) errbuf_ptr = strerror(AVUNERROR(err)); av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); } static int warned_cfg = 0; #define INDENT 1 #define SHOW_VERSION 2 #define SHOW_CONFIG 4 #define SHOW_COPYRIGHT 8 #define PRINT_LIB_INFO(libname, LIBNAME, flags, level) \ if (CONFIG_##LIBNAME) { \ const char *indent = flags & INDENT? " " : ""; \ if (flags & SHOW_VERSION) { \ unsigned int version = libname##_version(); \ av_log(NULL, level, \ "%slib%-11s %2d.%3d.%3d / %2d.%3d.%3d\n", \ indent, #libname, \ LIB##LIBNAME##_VERSION_MAJOR, \ LIB##LIBNAME##_VERSION_MINOR, \ LIB##LIBNAME##_VERSION_MICRO, \ AV_VERSION_MAJOR(version), AV_VERSION_MINOR(version),\ AV_VERSION_MICRO(version)); \ } \ if (flags & SHOW_CONFIG) { \ const char *cfg = libname##_configuration(); \ if (strcmp(FFMPEG_CONFIGURATION, cfg)) { \ if (!warned_cfg) { \ av_log(NULL, level, \ "%sWARNING: library configuration mismatch\n", \ indent); \ warned_cfg = 1; \ } \ av_log(NULL, level, "%s%-11s configuration: %s\n", \ indent, #libname, cfg); \ } \ } \ } \ static void print_all_libs_info(int flags, int level) { PRINT_LIB_INFO(avutil, AVUTIL, flags, level); PRINT_LIB_INFO(avcodec, AVCODEC, flags, level); PRINT_LIB_INFO(avformat, AVFORMAT, flags, level); PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); PRINT_LIB_INFO(avfilter, AVFILTER, flags, level); PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level); PRINT_LIB_INFO(swscale, SWSCALE, flags, level); PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level); PRINT_LIB_INFO(postproc, POSTPROC, flags, level); } static void print_program_info(int flags, int level) { const char *indent = flags & INDENT? " " : ""; av_log(NULL, level, "%s version " FFMPEG_VERSION, program_name); if (flags & SHOW_COPYRIGHT) av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers", program_birth_year, CONFIG_THIS_YEAR); av_log(NULL, level, "\n"); av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT); av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent); } static void print_buildconf(int flags, int level) { const char *indent = flags & INDENT ? " " : ""; char str[] = { FFMPEG_CONFIGURATION }; char *conflist, *remove_tilde, *splitconf; // Change all the ' --' strings to '~--' so that // they can be identified as tokens. while ((conflist = strstr(str, " --")) != NULL) { strncpy(conflist, "~--", 3); } // Compensate for the weirdness this would cause // when passing 'pkg-config --static'. while ((remove_tilde = strstr(str, "pkg-config~")) != NULL) { strncpy(remove_tilde, "pkg-config ", 11); } splitconf = strtok(str, "~"); av_log(NULL, level, "\n%sconfiguration:\n", indent); while (splitconf != NULL) { av_log(NULL, level, "%s%s%s\n", indent, indent, splitconf); splitconf = strtok(NULL, "~"); } } void show_banner(int argc, char **argv, const OptionDef *options) { int idx = locate_option(argc, argv, options, "version"); if (hide_banner || idx) return; print_program_info (INDENT|SHOW_COPYRIGHT, AV_LOG_INFO); print_all_libs_info(INDENT|SHOW_CONFIG, AV_LOG_INFO); print_all_libs_info(INDENT|SHOW_VERSION, AV_LOG_INFO); } int show_version(void *optctx, const char *opt, const char *arg) { av_log_set_callback(log_callback_help); print_program_info (SHOW_COPYRIGHT, AV_LOG_INFO); print_all_libs_info(SHOW_VERSION, AV_LOG_INFO); return 0; } int show_buildconf(void *optctx, const char *opt, const char *arg) { av_log_set_callback(log_callback_help); print_buildconf (INDENT|0, AV_LOG_INFO); return 0; } int show_license(void *optctx, const char *opt, const char *arg) { #if CONFIG_NONFREE printf( "This version of %s has nonfree parts compiled in.\n" "Therefore it is not legally redistributable.\n", program_name ); #elif CONFIG_GPLV3 printf( "%s is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 3 of the License, or\n" "(at your option) any later version.\n" "\n" "%s is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with %s. If not, see <http://www.gnu.org/licenses/>.\n", program_name, program_name, program_name ); #elif CONFIG_GPL printf( "%s is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2 of the License, or\n" "(at your option) any later version.\n" "\n" "%s is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with %s; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n", program_name, program_name, program_name ); #elif CONFIG_LGPLV3 printf( "%s is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU Lesser General Public License as published by\n" "the Free Software Foundation; either version 3 of the License, or\n" "(at your option) any later version.\n" "\n" "%s is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU Lesser General Public License for more details.\n" "\n" "You should have received a copy of the GNU Lesser General Public License\n" "along with %s. If not, see <http://www.gnu.org/licenses/>.\n", program_name, program_name, program_name ); #else printf( "%s is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU Lesser General Public\n" "License as published by the Free Software Foundation; either\n" "version 2.1 of the License, or (at your option) any later version.\n" "\n" "%s is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" "Lesser General Public License for more details.\n" "\n" "You should have received a copy of the GNU Lesser General Public\n" "License along with %s; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n", program_name, program_name, program_name ); #endif return 0; } static int is_device(const AVClass *avclass) { if (!avclass) return 0; return AV_IS_INPUT_DEVICE(avclass->category) || AV_IS_OUTPUT_DEVICE(avclass->category); } static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only) { AVInputFormat *ifmt = NULL; AVOutputFormat *ofmt = NULL; const char *last_name; int is_dev; printf("%s\n" " D. = Demuxing supported\n" " .E = Muxing supported\n" " --\n", device_only ? "Devices:" : "File formats:"); last_name = "000"; for (;;) { int decode = 0; int encode = 0; const char *name = NULL; const char *long_name = NULL; while ((ofmt = av_oformat_next(ofmt))) { is_dev = is_device(ofmt->priv_class); if (!is_dev && device_only) continue; if ((!name || strcmp(ofmt->name, name) < 0) && strcmp(ofmt->name, last_name) > 0) { name = ofmt->name; long_name = ofmt->long_name; encode = 1; } } while ((ifmt = av_iformat_next(ifmt))) { is_dev = is_device(ifmt->priv_class); if (!is_dev && device_only) continue; if ((!name || strcmp(ifmt->name, name) < 0) && strcmp(ifmt->name, last_name) > 0) { name = ifmt->name; long_name = ifmt->long_name; encode = 0; } if (name && strcmp(ifmt->name, name) == 0) decode = 1; } if (!name) break; last_name = name; printf(" %s%s %-15s %s\n", decode ? "D" : " ", encode ? "E" : " ", name, long_name ? long_name:" "); } return 0; } int show_formats(void *optctx, const char *opt, const char *arg) { return show_formats_devices(optctx, opt, arg, 0); } int show_devices(void *optctx, const char *opt, const char *arg) { return show_formats_devices(optctx, opt, arg, 1); } #define PRINT_CODEC_SUPPORTED(codec, field, type, list_name, term, get_name) \ if (codec->field) { \ const type *p = codec->field; \ \ printf(" Supported " list_name ":"); \ while (*p != term) { \ get_name(*p); \ printf(" %s", name); \ p++; \ } \ printf("\n"); \ } \ static void print_codec(const AVCodec *c) { int encoder = av_codec_is_encoder(c); printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name, c->long_name ? c->long_name : ""); printf(" General capabilities: "); if (c->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND) printf("horizband "); if (c->capabilities & AV_CODEC_CAP_DR1) printf("dr1 "); if (c->capabilities & AV_CODEC_CAP_TRUNCATED) printf("trunc "); if (c->capabilities & AV_CODEC_CAP_DELAY) printf("delay "); if (c->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME) printf("small "); if (c->capabilities & AV_CODEC_CAP_SUBFRAMES) printf("subframes "); if (c->capabilities & AV_CODEC_CAP_EXPERIMENTAL) printf("exp "); if (c->capabilities & AV_CODEC_CAP_CHANNEL_CONF) printf("chconf "); if (c->capabilities & AV_CODEC_CAP_PARAM_CHANGE) printf("paramchange "); if (c->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) printf("variable "); if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_AUTO_THREADS)) printf("threads "); if (!c->capabilities) printf("none"); printf("\n"); if (c->type == AVMEDIA_TYPE_VIDEO || c->type == AVMEDIA_TYPE_AUDIO) { printf(" Threading capabilities: "); switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_AUTO_THREADS)) { case AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break; case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break; case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break; case AV_CODEC_CAP_AUTO_THREADS : printf("auto"); break; default: printf("none"); break; } printf("\n"); } if (c->supported_framerates) { const AVRational *fps = c->supported_framerates; printf(" Supported framerates:"); while (fps->num) { printf(" %d/%d", fps->num, fps->den); fps++; } printf("\n"); } PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats", AV_PIX_FMT_NONE, GET_PIX_FMT_NAME); PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0, GET_SAMPLE_RATE_NAME); PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats", AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME); PRINT_CODEC_SUPPORTED(c, channel_layouts, uint64_t, "channel layouts", 0, GET_CH_LAYOUT_DESC); if (c->priv_class) { show_help_children(c->priv_class, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM); } } static char get_media_type_char(enum AVMediaType type) { switch (type) { case AVMEDIA_TYPE_VIDEO: return 'V'; case AVMEDIA_TYPE_AUDIO: return 'A'; case AVMEDIA_TYPE_DATA: return 'D'; case AVMEDIA_TYPE_SUBTITLE: return 'S'; case AVMEDIA_TYPE_ATTACHMENT:return 'T'; default: return '?'; } } static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev, int encoder) { while ((prev = av_codec_next(prev))) { if (prev->id == id && (encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev))) return prev; } return NULL; } static int compare_codec_desc(const void *a, const void *b) { const AVCodecDescriptor * const *da = a; const AVCodecDescriptor * const *db = b; return (*da)->type != (*db)->type ? FFDIFFSIGN((*da)->type, (*db)->type) : strcmp((*da)->name, (*db)->name); } static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs) { const AVCodecDescriptor *desc = NULL; const AVCodecDescriptor **codecs; unsigned nb_codecs = 0, i = 0; while ((desc = avcodec_descriptor_next(desc))) nb_codecs++; if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) { av_log(NULL, AV_LOG_ERROR, "Out of memory\n"); exit_program(1); } desc = NULL; while ((desc = avcodec_descriptor_next(desc))) codecs[i++] = desc; av_assert0(i == nb_codecs); qsort(codecs, nb_codecs, sizeof(*codecs), compare_codec_desc); *rcodecs = codecs; return nb_codecs; } static void print_codecs_for_id(enum AVCodecID id, int encoder) { const AVCodec *codec = NULL; printf(" (%s: ", encoder ? "encoders" : "decoders"); while ((codec = next_codec_for_id(id, codec, encoder))) printf("%s ", codec->name); printf(")"); } int show_codecs(void *optctx, const char *opt, const char *arg) { const AVCodecDescriptor **codecs; unsigned i, nb_codecs = get_codecs_sorted(&codecs); printf("Codecs:\n" " D..... = Decoding supported\n" " .E.... = Encoding supported\n" " ..V... = Video codec\n" " ..A... = Audio codec\n" " ..S... = Subtitle codec\n" " ...I.. = Intra frame-only codec\n" " ....L. = Lossy compression\n" " .....S = Lossless compression\n" " -------\n"); for (i = 0; i < nb_codecs; i++) { const AVCodecDescriptor *desc = codecs[i]; const AVCodec *codec = NULL; if (strstr(desc->name, "_deprecated")) continue; printf(" "); printf(avcodec_find_decoder(desc->id) ? "D" : "."); printf(avcodec_find_encoder(desc->id) ? "E" : "."); printf("%c", get_media_type_char(desc->type)); printf((desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : "."); printf((desc->props & AV_CODEC_PROP_LOSSY) ? "L" : "."); printf((desc->props & AV_CODEC_PROP_LOSSLESS) ? "S" : "."); printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : ""); /* print decoders/encoders when there's more than one or their * names are different from codec name */ while ((codec = next_codec_for_id(desc->id, codec, 0))) { if (strcmp(codec->name, desc->name)) { print_codecs_for_id(desc->id, 0); break; } } codec = NULL; while ((codec = next_codec_for_id(desc->id, codec, 1))) { if (strcmp(codec->name, desc->name)) { print_codecs_for_id(desc->id, 1); break; } } printf("\n"); } av_free(codecs); return 0; } static void print_codecs(int encoder) { const AVCodecDescriptor **codecs; unsigned i, nb_codecs = get_codecs_sorted(&codecs); printf("%s:\n" " V..... = Video\n" " A..... = Audio\n" " S..... = Subtitle\n" " .F.... = Frame-level multithreading\n" " ..S... = Slice-level multithreading\n" " ...X.. = Codec is experimental\n" " ....B. = Supports draw_horiz_band\n" " .....D = Supports direct rendering method 1\n" " ------\n", encoder ? "Encoders" : "Decoders"); for (i = 0; i < nb_codecs; i++) { const AVCodecDescriptor *desc = codecs[i]; const AVCodec *codec = NULL; while ((codec = next_codec_for_id(desc->id, codec, encoder))) { printf(" %c", get_media_type_char(desc->type)); printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : "."); printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : "."); printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : "."); printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : "."); printf((codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : "."); printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : ""); if (strcmp(codec->name, desc->name)) printf(" (codec %s)", desc->name); printf("\n"); } } av_free(codecs); } int show_decoders(void *optctx, const char *opt, const char *arg) { print_codecs(0); return 0; } int show_encoders(void *optctx, const char *opt, const char *arg) { print_codecs(1); return 0; } int show_bsfs(void *optctx, const char *opt, const char *arg) { AVBitStreamFilter *bsf = NULL; printf("Bitstream filters:\n"); while ((bsf = av_bitstream_filter_next(bsf))) printf("%s\n", bsf->name); printf("\n"); return 0; } int show_protocols(void *optctx, const char *opt, const char *arg) { void *opaque = NULL; const char *name; printf("Supported file protocols:\n" "Input:\n"); while ((name = avio_enum_protocols(&opaque, 0))) printf(" %s\n", name); printf("Output:\n"); while ((name = avio_enum_protocols(&opaque, 1))) printf(" %s\n", name); return 0; } int show_filters(void *optctx, const char *opt, const char *arg) { #if CONFIG_AVFILTER const AVFilter *filter = NULL; char descr[64], *descr_cur; int i, j; const AVFilterPad *pad; printf("Filters:\n" " T.. = Timeline support\n" " .S. = Slice threading\n" " ..C = Command support\n" " A = Audio input/output\n" " V = Video input/output\n" " N = Dynamic number and/or type of input/output\n" " | = Source or sink filter\n"); while ((filter = avfilter_next(filter))) { descr_cur = descr; for (i = 0; i < 2; i++) { if (i) { *(descr_cur++) = '-'; *(descr_cur++) = '>'; } pad = i ? filter->outputs : filter->inputs; for (j = 0; pad && avfilter_pad_get_name(pad, j); j++) { if (descr_cur >= descr + sizeof(descr) - 4) break; *(descr_cur++) = get_media_type_char(avfilter_pad_get_type(pad, j)); } if (!j) *(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) || ( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|'; } *descr_cur = 0; printf(" %c%c%c %-16s %-10s %s\n", filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.', filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.', filter->process_command ? 'C' : '.', filter->name, descr, filter->description); } #else printf("No filters available: libavfilter disabled\n"); #endif return 0; } int show_colors(void *optctx, const char *opt, const char *arg) { const char *name; const uint8_t *rgb; int i; printf("%-32s #RRGGBB\n", "name"); for (i = 0; name = av_get_known_color_name(i, &rgb); i++) printf("%-32s #%02x%02x%02x\n", name, rgb[0], rgb[1], rgb[2]); return 0; } int show_pix_fmts(void *optctx, const char *opt, const char *arg) { const AVPixFmtDescriptor *pix_desc = NULL; printf("Pixel formats:\n" "I.... = Supported Input format for conversion\n" ".O... = Supported Output format for conversion\n" "..H.. = Hardware accelerated format\n" "...P. = Paletted format\n" "....B = Bitstream format\n" "FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n" "-----\n"); #if !CONFIG_SWSCALE # define sws_isSupportedInput(x) 0 # define sws_isSupportedOutput(x) 0 #endif while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) { enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc); printf("%c%c%c%c%c %-16s %d %2d\n", sws_isSupportedInput (pix_fmt) ? 'I' : '.', sws_isSupportedOutput(pix_fmt) ? 'O' : '.', pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL ? 'H' : '.', pix_desc->flags & AV_PIX_FMT_FLAG_PAL ? 'P' : '.', pix_desc->flags & AV_PIX_FMT_FLAG_BITSTREAM ? 'B' : '.', pix_desc->name, pix_desc->nb_components, av_get_bits_per_pixel(pix_desc)); } return 0; } int show_layouts(void *optctx, const char *opt, const char *arg) { int i = 0; uint64_t layout, j; const char *name, *descr; printf("Individual channels:\n" "NAME DESCRIPTION\n"); for (i = 0; i < 63; i++) { name = av_get_channel_name((uint64_t)1 << i); if (!name) continue; descr = av_get_channel_description((uint64_t)1 << i); printf("%-14s %s\n", name, descr); } printf("\nStandard channel layouts:\n" "NAME DECOMPOSITION\n"); for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) { if (name) { printf("%-14s ", name); for (j = 1; j; j <<= 1) if ((layout & j)) printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j)); printf("\n"); } } return 0; } int show_sample_fmts(void *optctx, const char *opt, const char *arg) { int i; char fmt_str[128]; for (i = -1; i < AV_SAMPLE_FMT_NB; i++) printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i)); return 0; } static void show_help_codec(const char *name, int encoder) { const AVCodecDescriptor *desc; const AVCodec *codec; if (!name) { av_log(NULL, AV_LOG_ERROR, "No codec name specified.\n"); return; } codec = encoder ? avcodec_find_encoder_by_name(name) : avcodec_find_decoder_by_name(name); if (codec) print_codec(codec); else if ((desc = avcodec_descriptor_get_by_name(name))) { int printed = 0; while ((codec = next_codec_for_id(desc->id, codec, encoder))) { printed = 1; print_codec(codec); } if (!printed) { av_log(NULL, AV_LOG_ERROR, "Codec '%s' is known to FFmpeg, " "but no %s for it are available. FFmpeg might need to be " "recompiled with additional external libraries.\n", name, encoder ? "encoders" : "decoders"); } } else { av_log(NULL, AV_LOG_ERROR, "Codec '%s' is not recognized by FFmpeg.\n", name); } } static void show_help_demuxer(const char *name) { const AVInputFormat *fmt = av_find_input_format(name); if (!fmt) { av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); return; } printf("Demuxer %s [%s]:\n", fmt->name, fmt->long_name); if (fmt->extensions) printf(" Common extensions: %s.\n", fmt->extensions); if (fmt->priv_class) show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM); } static void show_help_muxer(const char *name) { const AVCodecDescriptor *desc; const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL); if (!fmt) { av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); return; } printf("Muxer %s [%s]:\n", fmt->name, fmt->long_name); if (fmt->extensions) printf(" Common extensions: %s.\n", fmt->extensions); if (fmt->mime_type) printf(" Mime type: %s.\n", fmt->mime_type); if (fmt->video_codec != AV_CODEC_ID_NONE && (desc = avcodec_descriptor_get(fmt->video_codec))) { printf(" Default video codec: %s.\n", desc->name); } if (fmt->audio_codec != AV_CODEC_ID_NONE && (desc = avcodec_descriptor_get(fmt->audio_codec))) { printf(" Default audio codec: %s.\n", desc->name); } if (fmt->subtitle_codec != AV_CODEC_ID_NONE && (desc = avcodec_descriptor_get(fmt->subtitle_codec))) { printf(" Default subtitle codec: %s.\n", desc->name); } if (fmt->priv_class) show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM); } #if CONFIG_AVFILTER static void show_help_filter(const char *name) { #if CONFIG_AVFILTER const AVFilter *f = avfilter_get_by_name(name); int i, count; if (!name) { av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n"); return; } else if (!f) { av_log(NULL, AV_LOG_ERROR, "Unknown filter '%s'.\n", name); return; } printf("Filter %s\n", f->name); if (f->description) printf(" %s\n", f->description); if (f->flags & AVFILTER_FLAG_SLICE_THREADS) printf(" slice threading supported\n"); printf(" Inputs:\n"); count = avfilter_pad_count(f->inputs); for (i = 0; i < count; i++) { printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i), media_type_string(avfilter_pad_get_type(f->inputs, i))); } if (f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS) printf(" dynamic (depending on the options)\n"); else if (!count) printf(" none (source filter)\n"); printf(" Outputs:\n"); count = avfilter_pad_count(f->outputs); for (i = 0; i < count; i++) { printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i), media_type_string(avfilter_pad_get_type(f->outputs, i))); } if (f->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS) printf(" dynamic (depending on the options)\n"); else if (!count) printf(" none (sink filter)\n"); if (f->priv_class) show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM); if (f->flags & AVFILTER_FLAG_SUPPORT_TIMELINE) printf("This filter has support for timeline through the 'enable' option.\n"); #else av_log(NULL, AV_LOG_ERROR, "Build without libavfilter; " "can not to satisfy request\n"); #endif } #endif int show_help(void *optctx, const char *opt, const char *arg) { char *topic, *par; av_log_set_callback(log_callback_help); topic = av_strdup(arg ? arg : ""); if (!topic) return AVERROR(ENOMEM); par = strchr(topic, '='); if (par) *par++ = 0; if (!*topic) { show_help_default(topic, par); } else if (!strcmp(topic, "decoder")) { show_help_codec(par, 0); } else if (!strcmp(topic, "encoder")) { show_help_codec(par, 1); } else if (!strcmp(topic, "demuxer")) { show_help_demuxer(par); } else if (!strcmp(topic, "muxer")) { show_help_muxer(par); #if CONFIG_AVFILTER } else if (!strcmp(topic, "filter")) { show_help_filter(par); #endif } else { show_help_default(topic, par); } av_freep(&topic); return 0; } int read_yesno(void) { int c = getchar(); int yesno = (av_toupper(c) == 'Y'); while (c != '\n' && c != EOF) c = getchar(); return yesno; } FILE *get_preset_file(char *filename, size_t filename_size, const char *preset_name, int is_path, const char *codec_name) { FILE *f = NULL; int i; const char *base[3] = { getenv("FFMPEG_DATADIR"), getenv("HOME"), FFMPEG_DATADIR, }; if (is_path) { av_strlcpy(filename, preset_name, filename_size); f = fopen(filename, "r"); } else { #ifdef _WIN32 char datadir[MAX_PATH], *ls; base[2] = NULL; if (GetModuleFileNameA(GetModuleHandleA(NULL), datadir, sizeof(datadir) - 1)) { for (ls = datadir; ls < datadir + strlen(datadir); ls++) if (*ls == '\\') *ls = '/'; if (ls = strrchr(datadir, '/')) { *ls = 0; strncat(datadir, "/ffpresets", sizeof(datadir) - 1 - strlen(datadir)); base[2] = datadir; } } #endif for (i = 0; i < 3 && !f; i++) { if (!base[i]) continue; snprintf(filename, filename_size, "%s%s/%s.ffpreset", base[i], i != 1 ? "" : "/.ffmpeg", preset_name); f = fopen(filename, "r"); if (!f && codec_name) { snprintf(filename, filename_size, "%s%s/%s-%s.ffpreset", base[i], i != 1 ? "" : "/.ffmpeg", codec_name, preset_name); f = fopen(filename, "r"); } } } return f; } int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec) { int ret = avformat_match_stream_specifier(s, st, spec); if (ret < 0) av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec); return ret; } AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, AVCodec *codec) { AVDictionary *ret = NULL; AVDictionaryEntry *t = NULL; int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM : AV_OPT_FLAG_DECODING_PARAM; char prefix = 0; const AVClass *cc = avcodec_get_class(); if (!codec) codec = s->oformat ? avcodec_find_encoder(codec_id) : avcodec_find_decoder(codec_id); switch (st->codec->codec_type) { case AVMEDIA_TYPE_VIDEO: prefix = 'v'; flags |= AV_OPT_FLAG_VIDEO_PARAM; break; case AVMEDIA_TYPE_AUDIO: prefix = 'a'; flags |= AV_OPT_FLAG_AUDIO_PARAM; break; case AVMEDIA_TYPE_SUBTITLE: prefix = 's'; flags |= AV_OPT_FLAG_SUBTITLE_PARAM; break; } while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) { char *p = strchr(t->key, ':'); /* check stream specification in opt name */ if (p) switch (check_stream_specifier(s, st, p + 1)) { case 1: *p = 0; break; case 0: continue; default: exit_program(1); } if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) || !codec || (codec->priv_class && av_opt_find(&codec->priv_class, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ))) av_dict_set(&ret, t->key, t->value, 0); else if (t->key[0] == prefix && av_opt_find(&cc, t->key + 1, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ)) av_dict_set(&ret, t->key + 1, t->value, 0); if (p) *p = ':'; } return ret; } AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts) { int i; AVDictionary **opts; if (!s->nb_streams) return NULL; opts = av_mallocz_array(s->nb_streams, sizeof(*opts)); if (!opts) { av_log(NULL, AV_LOG_ERROR, "Could not alloc memory for stream options.\n"); return NULL; } for (i = 0; i < s->nb_streams; i++) opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codec->codec_id, s, s->streams[i], NULL); return opts; } void *grow_array(void *array, int elem_size, int *size, int new_size) { if (new_size >= INT_MAX / elem_size) { av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); exit_program(1); } if (*size < new_size) { uint8_t *tmp = av_realloc_array(array, new_size, elem_size); if (!tmp) { av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); exit_program(1); } memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); *size = new_size; return tmp; } return array; } double get_rotation(AVStream *st) { AVDictionaryEntry *rotate_tag = av_dict_get(st->metadata, "rotate", NULL, 0); uint8_t* displaymatrix = av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL); double theta = 0; if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) { char *tail; theta = av_strtod(rotate_tag->value, &tail); if (*tail) theta = 0; } if (displaymatrix && !theta) theta = -av_display_rotation_get((int32_t*) displaymatrix); theta -= 360*floor(theta/360 + 0.9/360); if (fabs(theta - 90*round(theta/90)) > 2) av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n" "If you want to help, upload a sample " "of this file to ftp://upload.ffmpeg.org/incoming/ " "and contact the ffmpeg-devel mailing list. ([email protected])"); return theta; } #if CONFIG_AVDEVICE static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts) { int ret, i; AVDeviceInfoList *device_list = NULL; if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category)) return AVERROR(EINVAL); printf("Audo-detected sources for %s:\n", fmt->name); if (!fmt->get_device_list) { ret = AVERROR(ENOSYS); printf("Cannot list sources. Not implemented.\n"); goto fail; } if ((ret = avdevice_list_input_sources(fmt, NULL, opts, &device_list)) < 0) { printf("Cannot list sources.\n"); goto fail; } for (i = 0; i < device_list->nb_devices; i++) { printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ", device_list->devices[i]->device_name, device_list->devices[i]->device_description); } fail: avdevice_free_list_devices(&device_list); return ret; } static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts) { int ret, i; AVDeviceInfoList *device_list = NULL; if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category)) return AVERROR(EINVAL); printf("Audo-detected sinks for %s:\n", fmt->name); if (!fmt->get_device_list) { ret = AVERROR(ENOSYS); printf("Cannot list sinks. Not implemented.\n"); goto fail; } if ((ret = avdevice_list_output_sinks(fmt, NULL, opts, &device_list)) < 0) { printf("Cannot list sinks.\n"); goto fail; } for (i = 0; i < device_list->nb_devices; i++) { printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ", device_list->devices[i]->device_name, device_list->devices[i]->device_description); } fail: avdevice_free_list_devices(&device_list); return ret; } static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionary **opts) { int ret; if (arg) { char *opts_str = NULL; av_assert0(dev && opts); *dev = av_strdup(arg); if (!*dev) return AVERROR(ENOMEM); if ((opts_str = strchr(*dev, ','))) { *(opts_str++) = '\0'; if (opts_str[0] && ((ret = av_dict_parse_string(opts, opts_str, "=", ":", 0)) < 0)) { av_freep(dev); return ret; } } } else printf("\nDevice name is not provided.\n" "You can pass devicename[,opt1=val1[,opt2=val2...]] as an argument.\n\n"); return 0; } int show_sources(void *optctx, const char *opt, const char *arg) { AVInputFormat *fmt = NULL; char *dev = NULL; AVDictionary *opts = NULL; int ret = 0; int error_level = av_log_get_level(); av_log_set_level(AV_LOG_ERROR); if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0) goto fail; do { fmt = av_input_audio_device_next(fmt); if (fmt) { if (!strcmp(fmt->name, "lavfi")) continue; //it's pointless to probe lavfi if (dev && !av_match_name(dev, fmt->name)) continue; print_device_sources(fmt, opts); } } while (fmt); do { fmt = av_input_video_device_next(fmt); if (fmt) { if (dev && !av_match_name(dev, fmt->name)) continue; print_device_sources(fmt, opts); } } while (fmt); fail: av_dict_free(&opts); av_free(dev); av_log_set_level(error_level); return ret; } int show_sinks(void *optctx, const char *opt, const char *arg) { AVOutputFormat *fmt = NULL; char *dev = NULL; AVDictionary *opts = NULL; int ret = 0; int error_level = av_log_get_level(); av_log_set_level(AV_LOG_ERROR); if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0) goto fail; do { fmt = av_output_audio_device_next(fmt); if (fmt) { if (dev && !av_match_name(dev, fmt->name)) continue; print_device_sinks(fmt, opts); } } while (fmt); do { fmt = av_output_video_device_next(fmt); if (fmt) { if (dev && !av_match_name(dev, fmt->name)) continue; print_device_sinks(fmt, opts); } } while (fmt); fail: av_dict_free(&opts); av_free(dev); av_log_set_level(error_level); return ret; } #endif
598505.c
/* mbed Microcontroller Library * Copyright (c) 2006-2015 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "mbed_assert.h" #include "spi_api.h" #include "cmsis.h" #include "pinmap.h" #include "sercom.h" #include "pinmap_function.h" #define SERCOM_SPI_STATUS_SYNCBUSY_Pos 15 #define SERCOM_SPI_STATUS_SYNCBUSY (0x1u << SERCOM_SPI_STATUS_SYNCBUSY_Pos) #define SPI_MOSI_INDEX 0 #define SPI_MISO_INDEX 1 #define SPI_SCLK_INDEX 2 #define SPI_SSEL_INDEX 3 /** * \brief SPI modes enum * * SPI mode selection. */ enum spi_mode { /** Master mode. */ SPI_MODE_MASTER = 1, /** Slave mode. */ SPI_MODE_SLAVE = 0, }; #if DEVICE_SPI_ASYNCH #define pSPI_S(obj) (&obj->spi) #define pSPI_SERCOM(obj) obj->spi.spi #else #define pSPI_S(obj) (obj) #define pSPI_SERCOM(obj) (obj->spi) #endif #define _SPI(obj) pSPI_SERCOM(obj)->SPI /** SPI default baud rate. */ #define SPI_DEFAULT_BAUD 100000 /** SPI timeout value. */ # define SPI_TIMEOUT 10000 extern uint8_t g_sys_init; uint16_t dummy_fill_word = 0xFFFF; static inline bool spi_is_syncing(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); # ifdef FEATURE_SPI_SYNC_SCHEME_VERSION_2 /* Return synchronization status */ return (_SPI(obj).SYNCBUSY.reg); # else /* Return synchronization status */ return (_SPI(obj).STATUS.reg & SERCOM_SPI_STATUS_SYNCBUSY); # endif } static inline void spi_enable(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Wait until the synchronization is complete */ while (spi_is_syncing(obj)); /* Enable SPI */ _SPI(obj).CTRLA.reg |= SERCOM_SPI_CTRLA_ENABLE; } static inline void spi_disable(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Wait until the synchronization is complete */ while (spi_is_syncing(obj)); /* Disable SPI */ _SPI(obj).CTRLA.reg &= ~SERCOM_SPI_CTRLA_ENABLE; } static inline bool spi_is_write_complete(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Check interrupt flag */ return (_SPI(obj).INTFLAG.reg & SERCOM_SPI_INTFLAG_TXC); } static inline bool spi_is_ready_to_write(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Check interrupt flag */ return (_SPI(obj).INTFLAG.reg & SERCOM_SPI_INTFLAG_DRE); } static inline bool spi_is_ready_to_read(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Check interrupt flag */ return (_SPI(obj).INTFLAG.reg & SERCOM_SPI_INTFLAG_RXC); } static inline bool spi_write(spi_t *obj, uint16_t tx_data) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Check if the data register has been copied to the shift register */ if (!spi_is_ready_to_write(obj)) { /* Data register has not been copied to the shift register, return */ return false; } /* Write the character to the DATA register */ _SPI(obj).DATA.reg = tx_data & SERCOM_SPI_DATA_MASK; return true; } static inline bool spi_read(spi_t *obj, uint16_t *rx_data) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Check if data is ready to be read */ if (!spi_is_ready_to_read(obj)) { /* No data has been received, return */ return false; } /* Check if data is overflown */ if (_SPI(obj).STATUS.reg & SERCOM_SPI_STATUS_BUFOVF) { /* Clear overflow flag */ _SPI(obj).STATUS.reg |= SERCOM_SPI_STATUS_BUFOVF; } /* Read the character from the DATA register */ if (_SPI(obj).CTRLB.bit.CHSIZE == 1) { *rx_data = (_SPI(obj).DATA.reg & SERCOM_SPI_DATA_MASK); } else { *rx_data = (uint8_t)_SPI(obj).DATA.reg; } return true; } static uint32_t spi_find_mux_settings(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); uint8_t i_dipo; uint8_t i_dopo; uint32_t dipo = 0; uint32_t dopo = 0; uint32_t mux_pad; uint32_t mux_settings = 0; uint32_t sercom_index = _sercom_get_sercom_inst_index(pSPI_SERCOM(obj)); if (pSPI_S(obj)->mode == SPI_MODE_MASTER) { i_dipo = SPI_MISO_INDEX; i_dopo = SPI_MOSI_INDEX; } else { i_dipo = SPI_MOSI_INDEX; i_dopo = SPI_MISO_INDEX; } /* Find MUX setting */ if (pSPI_S(obj)->pins[i_dipo] != NC) { /* Set Data input MUX padding for master */ mux_pad = pinmap_pad_sercom(pSPI_S(obj)->pins[i_dipo], sercom_index); if (mux_pad != (uint32_t)NC) { /* MUX pad value is same as DIPO value */ dipo = mux_pad; mux_settings |= ((dipo << SERCOM_SPI_CTRLA_DIPO_Pos) & SERCOM_SPI_CTRLA_DIPO_Msk); } } if (pSPI_S(obj)->pins[i_dopo] != NC) { /* Set Data output MUX padding for master */ mux_pad = pinmap_pad_sercom(pSPI_S(obj)->pins[i_dopo], sercom_index); if (mux_pad != (uint32_t)NC) { if (mux_pad != 0) { dopo = mux_pad - 1; } else { if (3 == pinmap_pad_sercom(pSPI_S(obj)->pins[SPI_SCLK_INDEX], sercom_index)) { dopo = 3; } else { dopo = 0; } } mux_settings |= ((dopo << SERCOM_SPI_CTRLA_DOPO_Pos) & SERCOM_SPI_CTRLA_DOPO_Msk); } } return mux_settings; } /** * \defgroup GeneralSPI SPI Configuration Functions * @{ */ /** Initialize the SPI peripheral * * Configures the pins used by SPI, sets a default format and frequency, and enables the peripheral * @param[out] obj The SPI object to initialize * @param[in] mosi The pin to use for MOSI * @param[in] miso The pin to use for MISO * @param[in] sclk The pin to use for SCLK * @param[in] ssel The pin to use for SSEL */ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel) { /* Sanity check arguments */ MBED_ASSERT(obj); MBED_ASSERT(sclk != NC); uint16_t baud = 0; uint32_t ctrla = 0; uint32_t ctrlb = 0; enum status_code error_code; if (g_sys_init == 0) { system_init(); g_sys_init = 1; } /* Calculate SERCOM instance from pins */ uint32_t sercom_index = pinmap_find_sercom(mosi, miso, sclk, ssel); pSPI_SERCOM(obj) = (Sercom*)pinmap_peripheral_sercom(NC, sercom_index); /* Disable SPI */ spi_disable(obj); /* Check if reset is in progress. */ if (_SPI(obj).CTRLA.reg & SERCOM_SPI_CTRLA_SWRST) { return; } uint32_t pm_index, gclk_index; #if (SAML21) if (sercom_index == 5) { # ifdef ID_SERCOM5 pm_index = MCLK_APBDMASK_SERCOM5_Pos; gclk_index = SERCOM5_GCLK_ID_CORE; # else return STATUS_ERR_INVALID_ARG; # endif } else { pm_index = sercom_index + MCLK_APBCMASK_SERCOM0_Pos; gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; } #elif (SAMC21) if (sercom_index == 5) { # ifdef ID_SERCOM5 pm_index = MCLK_APBCMASK_SERCOM5_Pos; gclk_index = SERCOM5_GCLK_ID_CORE; # else return STATUS_ERR_INVALID_ARG; # endif } else { pm_index = sercom_index + MCLK_APBCMASK_SERCOM0_Pos; gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; } #elif (SAMC20) pm_index = sercom_index + MCLK_APBCMASK_SERCOM0_Pos; gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; #else pm_index = sercom_index + PM_APBCMASK_SERCOM0_Pos; gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; #endif /* Turn on module in PM */ #if (SAML21) if (sercom_index == 5) { # ifdef ID_SERCOM5 system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBD, 1 << pm_index); # else return STATUS_ERR_INVALID_ARG; # endif } else { system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBC, 1 << pm_index); } #else system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBC, 1 << pm_index); #endif /* Set up the GCLK for the module */ struct system_gclk_chan_config gclk_chan_conf; system_gclk_chan_get_config_defaults(&gclk_chan_conf); gclk_chan_conf.source_generator = GCLK_GENERATOR_0; system_gclk_chan_set_config(gclk_index, &gclk_chan_conf); system_gclk_chan_enable(gclk_index); sercom_set_gclk_generator(GCLK_GENERATOR_0, false); /* Set the SERCOM in SPI master mode */ _SPI(obj).CTRLA.reg |= SERCOM_SPI_CTRLA_MODE(0x3); pSPI_S(obj)->mode = SPI_MODE_MASTER; /* TODO: Do pin muxing here */ struct system_pinmux_config pin_conf; system_pinmux_get_config_defaults(&pin_conf); pin_conf.direction = SYSTEM_PINMUX_PIN_DIR_INPUT; pSPI_S(obj)->pins[SPI_MOSI_INDEX] = mosi; pSPI_S(obj)->pins[SPI_MISO_INDEX] = miso; pSPI_S(obj)->pins[SPI_SCLK_INDEX] = sclk; pSPI_S(obj)->pins[SPI_SSEL_INDEX] = ssel; /* Configure the SERCOM pins according to the user configuration */ for (uint8_t pad = 0; pad < 4; pad++) { uint32_t current_pin = pSPI_S(obj)->pins[pad]; if (current_pin != (uint32_t)NC) { pin_conf.mux_position = pinmap_function_sercom((PinName)current_pin, sercom_index); if ((uint8_t)NC != pin_conf.mux_position) { system_pinmux_pin_set_config(current_pin, &pin_conf); } } } /* Get baud value, based on baudrate and the internal clock frequency */ uint32_t internal_clock = system_gclk_chan_get_hz(gclk_index); //internal_clock = 8000000; error_code = _sercom_get_sync_baud_val(SPI_DEFAULT_BAUD, internal_clock, &baud); if (error_code != STATUS_OK) { /* Baud rate calculation error */ return; } _SPI(obj).BAUD.reg = (uint8_t)baud; /* TODO: Find MUX settings */ ctrla |= spi_find_mux_settings(obj); /* Set SPI character size */ ctrlb |= SERCOM_SPI_CTRLB_CHSIZE(0); /* Enable receiver */ ctrlb |= SERCOM_SPI_CTRLB_RXEN; /* Write CTRLA register */ _SPI(obj).CTRLA.reg |= ctrla; /* Write CTRLB register */ _SPI(obj).CTRLB.reg |= ctrlb; /* Enable SPI */ spi_enable(obj); } /** Release a SPI object * * TODO: spi_free is currently unimplemented * This will require reference counting at the C++ level to be safe * * Return the pins owned by the SPI object to their reset state * Disable the SPI peripheral * Disable the SPI clock * @param[in] obj The SPI object to deinitialize */ void spi_free(spi_t *obj) { // [TODO] } /** Configure the SPI format * * Set the number of bits per frame, configure clock polarity and phase, shift order and master/slave mode * @param[in,out] obj The SPI object to configure * @param[in] bits The number of bits per frame * @param[in] mode The SPI mode (clock polarity, phase, and shift direction) * @param[in] slave Zero for master mode or non-zero for slave mode */ void spi_format(spi_t *obj, int bits, int mode, int slave) { PinMode pull_mode; /* Sanity check arguments */ MBED_ASSERT(obj); /* Disable SPI */ spi_disable(obj); if (slave) { /* Set the SERCOM in SPI mode */ _SPI(obj).CTRLA.bit.MODE = 0x2; pSPI_S(obj)->mode = SPI_MODE_SLAVE; pull_mode = PullNone; /* Enable PLOADEN to avoid sending dummy character by slave */ _SPI(obj).CTRLB.bit.PLOADEN = 1; } else { /* Set the SERCOM in SPI mode */ _SPI(obj).CTRLA.bit.MODE = 0x3; pSPI_S(obj)->mode = SPI_MODE_MASTER; pull_mode = PullUp; } /* Change pull mode of pins */ for (uint8_t pad = 0; pad < 4; pad++) { if (pSPI_S(obj)->pins[pad] != NC) { pin_mode(pSPI_S(obj)->pins[pad], pull_mode); } } /* Change MUX settings */ uint32_t ctrla = _SPI(obj).CTRLA.reg; ctrla &= ~(SERCOM_SPI_CTRLA_DIPO_Msk | SERCOM_SPI_CTRLA_DOPO_Msk); ctrla |= spi_find_mux_settings(obj); _SPI(obj).CTRLA.reg = ctrla; /* Set SPI Frame size - only 8-bit and 9-bit supported now */ _SPI(obj).CTRLB.bit.CHSIZE = (bits > 8)? 1 : 0; /* Set SPI Clock Phase */ _SPI(obj).CTRLA.bit.CPHA = (mode & 0x01)? 1 : 0; /* Set SPI Clock Polarity */ _SPI(obj).CTRLA.bit.CPOL = (mode & 0x02)? 1 : 0; /* Enable SPI */ spi_enable(obj); } /** Set the SPI baud rate * * Actual frequency may differ from the desired frequency due to available dividers and bus clock * Configures the SPI peripheral's baud rate * @param[in,out] obj The SPI object to configure * @param[in] hz The baud rate in Hz */ void spi_frequency(spi_t *obj, int hz) { uint16_t baud = 0; uint32_t gclk_index = 0; /* Sanity check arguments */ MBED_ASSERT(obj); /* Disable SPI */ spi_disable(obj); /* Find frequency of the internal SERCOMi_GCLK_ID_CORE */ uint32_t sercom_index = _sercom_get_sercom_inst_index(pSPI_SERCOM(obj)); #if (SAML21) if (sercom_index == 5) { # ifdef ID_SERCOM5 gclk_index = SERCOM5_GCLK_ID_CORE; # else return STATUS_ERR_INVALID_ARG; # endif } else { gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; } #elif (SAMC21) if (sercom_index == 5) { # ifdef ID_SERCOM5 gclk_index = SERCOM5_GCLK_ID_CORE; # else return STATUS_ERR_INVALID_ARG; # endif } else { gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; } #elif (SAMC20) gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; #else gclk_index = sercom_index + SERCOM0_GCLK_ID_CORE; #endif uint32_t internal_clock = system_gclk_chan_get_hz(gclk_index); /* Get baud value, based on baudrate and the internal clock frequency */ enum status_code error_code = _sercom_get_sync_baud_val(hz, internal_clock, &baud); if (error_code != STATUS_OK) { /* Baud rate calculation error, return status code */ /* Enable SPI */ spi_enable(obj); return; } _SPI(obj).BAUD.reg = (uint8_t)baud; /* Enable SPI */ spi_enable(obj); } /**@}*/ /** * \defgroup SynchSPI Synchronous SPI Hardware Abstraction Layer * @{ */ /** Write a byte out in master mode and receive a value * * @param[in] obj The SPI peripheral to use for sending * @param[in] value The value to send * @return Returns the value received during send */ int spi_master_write(spi_t *obj, int value) { uint16_t rx_data = 0; /* Sanity check arguments */ MBED_ASSERT(obj); #if DEVICE_SPI_ASYNCH if (obj->spi.status == STATUS_BUSY) { /* Check if the SPI module is busy with a job */ return 0; } #endif /* Wait until the module is ready to write the character */ while (!spi_is_ready_to_write(obj)); /* Write data */ spi_write(obj, value); if (!(_SPI(obj).CTRLB.bit.RXEN)) { return 0; } /* Wait until the module is ready to read the character */ while (!spi_is_ready_to_read(obj)); /* Read data */ spi_read(obj, &rx_data); return rx_data; } int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, char write_fill) { int total = (tx_length > rx_length) ? tx_length : rx_length; for (int i = 0; i < total; i++) { char out = (i < tx_length) ? tx_buffer[i] : write_fill; char in = spi_master_write(obj, out); if (i < rx_length) { rx_buffer[i] = in; } } return total; } /** Check if a value is available to read * * @param[in] obj The SPI peripheral to check * @return non-zero if a value is available */ int spi_slave_receive(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); return spi_is_ready_to_read(obj); } /** Get a received value out of the SPI receive buffer in slave mode * * Blocks until a value is available * @param[in] obj The SPI peripheral to read * @return The value received */ int spi_slave_read(spi_t *obj) { int i; uint16_t rx_data = 0; /* Sanity check arguments */ MBED_ASSERT(obj); /* Check for timeout period */ for (i = 0; i < SPI_TIMEOUT; i++) { if (spi_is_ready_to_read(obj)) { break; } } if (i == SPI_TIMEOUT) { /* Not ready to read data within timeout period */ return 0; } /* Read data */ spi_read(obj, &rx_data); return rx_data; } /** Write a value to the SPI peripheral in slave mode * * Blocks until the SPI peripheral can be written to * @param[in] obj The SPI peripheral to write * @param[in] value The value to write */ void spi_slave_write(spi_t *obj, int value) { int i; /* Sanity check arguments */ MBED_ASSERT(obj); /* Check for timeout period */ for (i = 0; i < SPI_TIMEOUT; i++) { if (spi_is_ready_to_write(obj)) { break; } } if (i == SPI_TIMEOUT) { /* Not ready to write data within timeout period */ return; } /* Write data */ spi_write(obj, value); } /** Checks if the specified SPI peripheral is in use * * @param[in] obj The SPI peripheral to check * @return non-zero if the peripheral is currently transmitting */ int spi_busy(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); return spi_is_write_complete(obj); } /** Get the module number * * @param[in] obj The SPI peripheral to check * @return The module number */ uint8_t spi_get_module(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); return _sercom_get_sercom_inst_index(pSPI_SERCOM(obj)); } #if DEVICE_SPI_ASYNCH /** * \defgroup AsynchSPI Asynchronous SPI Hardware Abstraction Layer * @{ */ /** * \internal * Writes a character from the TX buffer to the Data register. * * \param[in,out] module Pointer to SPI software instance struct */ static void _spi_write_async(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); uint16_t data_to_send; uint8_t *tx_buffer = obj->tx_buff.buffer; /* Do nothing if we are at the end of buffer */ if (obj->tx_buff.pos < obj->tx_buff.length) { /* Write value will be at least 8-bits long */ if (tx_buffer) { data_to_send = tx_buffer[obj->tx_buff.pos]; } else { data_to_send = dummy_fill_word; } /* Increment 8-bit index */ obj->tx_buff.pos++; if (_SPI(obj).CTRLB.bit.CHSIZE == 1) { if (tx_buffer) data_to_send |= (tx_buffer[obj->tx_buff.pos] << 8); /* Increment 8-bit index */ obj->tx_buff.pos++; } } else { /* Write a dummy packet */ /* TODO: Current implementation do not enter this condition, remove if not needed */ data_to_send = dummy_fill_word; } /* Write the data to send*/ _SPI(obj).DATA.reg = data_to_send & SERCOM_SPI_DATA_MASK; /* Check for error */ if ((_SPI(obj).INTFLAG.reg & SERCOM_SPI_INTFLAG_ERROR) && (obj->spi.mask & SPI_EVENT_ERROR)) { obj->spi.event |= SPI_EVENT_ERROR; } } /** * \internal * Reads a character from the Data register to the RX buffer. * * \param[in,out] module Pointer to SPI software instance struct */ static void _spi_read_async(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); uint8_t *rx_buffer = obj->rx_buff.buffer; /* Check if data is overflown */ if (_SPI(obj).STATUS.reg & SERCOM_SPI_STATUS_BUFOVF) { /* Clear overflow flag */ _SPI(obj).STATUS.reg |= SERCOM_SPI_STATUS_BUFOVF; if (obj->spi.mask & SPI_EVENT_RX_OVERFLOW) { /* Set overflow error */ obj->spi.event |= SPI_EVENT_RX_OVERFLOW; return; } } /* Read data, either valid, or dummy */ uint16_t received_data = (_SPI(obj).DATA.reg & SERCOM_SPI_DATA_MASK); /* Do nothing if we are at the end of buffer */ if ((obj->rx_buff.pos >= obj->rx_buff.length) && rx_buffer) { return; } /* Read value will be at least 8-bits long */ rx_buffer[obj->rx_buff.pos] = received_data; /* Increment 8-bit index */ obj->rx_buff.pos++; if (_SPI(obj).CTRLB.bit.CHSIZE == 1) { /* 9-bit data, write next received byte to the buffer */ rx_buffer[obj->rx_buff.pos] = (received_data >> 8); /* Increment 8-bit index */ obj->rx_buff.pos++; } /* Check for error */ if ((_SPI(obj).INTFLAG.reg & SERCOM_SPI_INTFLAG_ERROR) && (obj->spi.mask & SPI_EVENT_ERROR)) { obj->spi.event |= SPI_EVENT_ERROR; } } /** * \internal * Clears all interrupt flags of SPI * * \param[in,out] module Pointer to SPI software instance struct */ static void _spi_clear_interrupts(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); uint8_t sercom_index = _sercom_get_sercom_inst_index(obj->spi.spi); /* Clear all interrupts */ _SPI(obj).INTENCLR.reg = SERCOM_SPI_INTFLAG_DRE | SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_RXC | SERCOM_SPI_INTFLAG_ERROR; NVIC_DisableIRQ((IRQn_Type)((uint8_t)SERCOM0_IRQn + sercom_index)); NVIC_SetVector((IRQn_Type)((uint8_t)SERCOM0_IRQn + sercom_index), (uint32_t)NULL); } /** * \internal * Starts transceive of buffers with a given length * * \param[in,out] obj Pointer to SPI software instance struct * */ static enum status_code _spi_transceive_buffer(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); uint16_t interrupt_status = _SPI(obj).INTFLAG.reg; interrupt_status &= _SPI(obj).INTENSET.reg; if (interrupt_status & SERCOM_SPI_INTFLAG_DRE) { /* Clear DRE interrupt */ _SPI(obj).INTENCLR.reg = SERCOM_SPI_INTFLAG_DRE; /* Write data */ _spi_write_async(obj); /* Set TXC interrupt */ _SPI(obj).INTENSET.reg |= SERCOM_SPI_INTFLAG_TXC; } if (interrupt_status & SERCOM_SPI_INTFLAG_TXC) { /* Clear TXC interrupt */ _SPI(obj).INTENCLR.reg = SERCOM_SPI_INTFLAG_TXC; if ((obj->rx_buff.buffer) && (obj->rx_buff.pos < obj->rx_buff.length)) { while (!spi_is_ready_to_read(obj)); _spi_read_async(obj); if ((obj->tx_buff.pos >= obj->tx_buff.length) && (obj->tx_buff.length < obj->rx_buff.length)) { obj->tx_buff.length = obj->rx_buff.length; obj->tx_buff.buffer = 0; } } if (obj->tx_buff.pos < obj->tx_buff.length) { /* Set DRE interrupt */ _SPI(obj).INTENSET.reg |= SERCOM_SPI_INTFLAG_DRE; } } if (obj->spi.event & (SPI_EVENT_ERROR | SPI_EVENT_RX_OVERFLOW) || (interrupt_status & SERCOM_SPI_INTFLAG_ERROR)) { /* Clear all interrupts */ _spi_clear_interrupts(obj); if (interrupt_status & SERCOM_SPI_INTFLAG_ERROR) { obj->spi.event = STATUS_ERR_BAD_DATA; } /* Transfer interrupted, invoke the callback function */ if (obj->spi.event & SPI_EVENT_RX_OVERFLOW) { obj->spi.status = STATUS_ERR_OVERFLOW; } else { obj->spi.status = STATUS_ERR_BAD_DATA; } return (enum status_code)obj->spi.status; } if ((obj->tx_buff.pos >= obj->tx_buff.length) && (obj->rx_buff.pos >= obj->rx_buff.length) && (interrupt_status & SERCOM_SPI_INTFLAG_TXC)) { /* Clear all interrupts */ _spi_clear_interrupts(obj); /* Transfer complete, invoke the callback function */ obj->spi.event = SPI_EVENT_INTERNAL_TRANSFER_COMPLETE; obj->spi.status = STATUS_OK; } return (enum status_code)(obj->spi.status); } /** Begin the SPI transfer. Buffer pointers and lengths are specified in tx_buff and rx_buff * * @param[in] obj The SPI object which holds the transfer information * @param[in] tx The buffer to send * @param[in] tx_length The number of words to transmit * @param[out]rx The buffer to receive * @param[in] rx_length The number of words to receive * @param[in] bit_width The bit width of buffer words * @param[in] event The logical OR of events to be registered * @param[in] handler SPI interrupt handler * @param[in] hint A suggestion for how to use DMA with this transfer **< DMA currently not implemented >** */ void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint) { uint16_t dummy_read; (void) dummy_read; /* Sanity check arguments */ MBED_ASSERT(obj); uint8_t sercom_index = _sercom_get_sercom_inst_index(obj->spi.spi); obj->spi.tx_buffer = (void *)tx; obj->tx_buff.buffer =(void *)tx; obj->tx_buff.pos = 0; if (tx) { /* Only two bit rates supported now */ obj->tx_buff.length = tx_length * ((bit_width > 8)? 2 : 1); } else { if (rx) { obj->tx_buff.length = rx_length * ((bit_width > 8)? 2 : 1); } else { /* Nothing to transfer */ return; } } obj->spi.rx_buffer = rx; obj->rx_buff.buffer = rx; obj->rx_buff.pos = 0; if (rx) { /* Only two bit rates supported now */ obj->rx_buff.length = rx_length * ((bit_width > 8)? 2 : 1); } else { /* Disable RXEN */ spi_disable(obj); _SPI(obj).CTRLB.bit.RXEN = 0; spi_enable(obj); obj->rx_buff.length = 0; } /* Clear data buffer if there is anything pending to read */ while (spi_is_ready_to_read(obj)) { dummy_read = _SPI(obj).DATA.reg; } obj->spi.mask = event; obj->spi.dma_usage = hint; /*if (hint == DMA_USAGE_NEVER) {** TEMP: Commented as DMA is not implemented now */ /* Use irq method */ uint16_t irq_mask = 0; obj->spi.status = STATUS_BUSY; /* Enable interrupt */ NVIC_SetVector((IRQn_Type)((uint8_t)SERCOM0_IRQn + sercom_index), handler); NVIC_EnableIRQ((IRQn_Type)((uint8_t)SERCOM0_IRQn + sercom_index)); /* Clear all interrupts */ _SPI(obj).INTENCLR.reg = SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_RXC | SERCOM_SPI_INTFLAG_ERROR; _SPI(obj).INTFLAG.reg = SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_ERROR; _SPI(obj).STATUS.reg |= SERCOM_SPI_STATUS_BUFOVF; /* Set SPI interrupts */ /* Set DRE flag to kick start transmission */ irq_mask |= SERCOM_SPI_INTFLAG_DRE; if (event & SPI_EVENT_ERROR) { irq_mask |= SERCOM_SPI_INTFLAG_ERROR; } _SPI(obj).INTENSET.reg = irq_mask; /*} ** TEMP: Commented as DMA is not implemented now */ } /** The asynchronous IRQ handler * * Reads the received values out of the RX FIFO, writes values into the TX FIFO and checks for transfer termination * conditions, such as buffer overflows or transfer complete. * @param[in] obj The SPI object which holds the transfer information * @return event flags if a transfer termination condition was met or 0 otherwise. */ uint32_t spi_irq_handler_asynch(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); enum status_code tmp_status; uint32_t transfer_event = 0; /*if (obj->spi.dma_usage == DMA_USAGE_NEVER) {** TEMP: Commented as DMA is not implemented now */ /* IRQ method */ tmp_status = _spi_transceive_buffer(obj); if (STATUS_BUSY != tmp_status) { if ((obj->spi.event & SPI_EVENT_INTERNAL_TRANSFER_COMPLETE) && (tmp_status == STATUS_OK)) { obj->spi.event |= SPI_EVENT_COMPLETE; } transfer_event = obj->spi.event & (obj->spi.mask | SPI_EVENT_INTERNAL_TRANSFER_COMPLETE); } /*}** TEMP: Commented as DMA is not implemented now */ return transfer_event; } /** Attempts to determine if the SPI peripheral is already in use. * @param[in] obj The SPI object to check for activity * @return non-zero if the SPI port is active or zero if it is not. */ uint8_t spi_active(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); /* Check if the SPI module is busy with a job */ return (obj->spi.status == STATUS_BUSY); } /** Abort an SPI transfer * * @param obj The SPI peripheral to stop */ void spi_abort_asynch(spi_t *obj) { /* Sanity check arguments */ MBED_ASSERT(obj); uint8_t sercom_index = _sercom_get_sercom_inst_index(obj->spi.spi); /* Clear all interrupts */ _SPI(obj).INTENCLR.reg = SERCOM_SPI_INTFLAG_DRE | SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_RXC | SERCOM_SPI_INTFLAG_ERROR; // TODO: Disable and remove irq handler NVIC_DisableIRQ((IRQn_Type)((uint8_t)SERCOM0_IRQn + sercom_index)); NVIC_SetVector((IRQn_Type)((uint8_t)SERCOM0_IRQn + sercom_index), (uint32_t)NULL); obj->spi.status = STATUS_ABORTED; } #endif /* DEVICE_SPI_ASYNCH */
739199.c
/* * Copyright 2009 Vincent Povirk for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" #include <stdarg.h> #define COBJMACROS #include "windef.h" #include "winbase.h" #include "winreg.h" #include "wingdi.h" #include "objbase.h" #include "wincodecs_private.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); struct bmp_pixelformat { const WICPixelFormatGUID *guid; UINT bpp; DWORD compression; DWORD redmask; DWORD greenmask; DWORD bluemask; DWORD alphamask; }; static const struct bmp_pixelformat formats[] = { {&GUID_WICPixelFormat24bppBGR, 24, BI_RGB}, {&GUID_WICPixelFormat16bppBGR555, 16, BI_RGB}, {&GUID_WICPixelFormat16bppBGR565, 16, BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0}, {&GUID_WICPixelFormat32bppBGR, 32, BI_RGB}, #if 0 /* Windows doesn't seem to support this one. */ {&GUID_WICPixelFormat32bppBGRA, 32, BI_BITFIELDS, 0xff0000, 0xff00, 0xff, 0xff000000}, #endif {NULL} }; typedef struct BmpFrameEncode { IWICBitmapFrameEncode IWICBitmapFrameEncode_iface; LONG ref; IStream *stream; BOOL initialized; UINT width, height; BYTE *bits; const struct bmp_pixelformat *format; double xres, yres; UINT lineswritten; UINT stride; WICColor palette[256]; UINT colors; BOOL committed; } BmpFrameEncode; static const WCHAR wszEnableV5Header32bppBGRA[] = {'E','n','a','b','l','e','V','5','H','e','a','d','e','r','3','2','b','p','p','B','G','R','A',0}; static inline BmpFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface) { return CONTAINING_RECORD(iface, BmpFrameEncode, IWICBitmapFrameEncode_iface); } static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid, void **ppv) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapFrameEncode, iid)) { *ppv = &This->IWICBitmapFrameEncode_iface; } else { *ppv = NULL; return E_NOINTERFACE; } IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } static ULONG WINAPI BmpFrameEncode_AddRef(IWICBitmapFrameEncode *iface) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); return ref; } static ULONG WINAPI BmpFrameEncode_Release(IWICBitmapFrameEncode *iface) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); if (ref == 0) { if (This->stream) IStream_Release(This->stream); HeapFree(GetProcessHeap(), 0, This->bits); HeapFree(GetProcessHeap(), 0, This); } return ref; } static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface, IPropertyBag2 *pIEncoderOptions) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); TRACE("(%p,%p)\n", iface, pIEncoderOptions); if (This->initialized) return WINCODEC_ERR_WRONGSTATE; if (pIEncoderOptions) WARN("ignoring encoder options.\n"); This->initialized = TRUE; return S_OK; } static HRESULT WINAPI BmpFrameEncode_SetSize(IWICBitmapFrameEncode *iface, UINT uiWidth, UINT uiHeight) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); TRACE("(%p,%u,%u)\n", iface, uiWidth, uiHeight); if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE; This->width = uiWidth; This->height = uiHeight; return S_OK; } static HRESULT WINAPI BmpFrameEncode_SetResolution(IWICBitmapFrameEncode *iface, double dpiX, double dpiY) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); TRACE("(%p,%0.2f,%0.2f)\n", iface, dpiX, dpiY); if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE; This->xres = dpiX; This->yres = dpiY; return S_OK; } static HRESULT WINAPI BmpFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface, WICPixelFormatGUID *pPixelFormat) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); int i; TRACE("(%p,%s)\n", iface, debugstr_guid(pPixelFormat)); if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE; for (i=0; formats[i].guid; i++) { if (memcmp(formats[i].guid, pPixelFormat, sizeof(GUID)) == 0) break; } if (!formats[i].guid) i = 0; This->format = &formats[i]; memcpy(pPixelFormat, This->format->guid, sizeof(GUID)); return S_OK; } static HRESULT WINAPI BmpFrameEncode_SetColorContexts(IWICBitmapFrameEncode *iface, UINT cCount, IWICColorContext **ppIColorContext) { FIXME("(%p,%u,%p): stub\n", iface, cCount, ppIColorContext); return E_NOTIMPL; } static HRESULT WINAPI BmpFrameEncode_SetPalette(IWICBitmapFrameEncode *iface, IWICPalette *palette) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); TRACE("(%p,%p)\n", iface, palette); if (!palette) return E_INVALIDARG; if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; return IWICPalette_GetColors(palette, 256, This->palette, &This->colors); } static HRESULT WINAPI BmpFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIThumbnail) { FIXME("(%p,%p): stub\n", iface, pIThumbnail); return WINCODEC_ERR_UNSUPPORTEDOPERATION; } static HRESULT BmpFrameEncode_AllocateBits(BmpFrameEncode *This) { if (!This->bits) { if (!This->initialized || !This->width || !This->height || !This->format) return WINCODEC_ERR_WRONGSTATE; This->stride = (((This->width * This->format->bpp)+31)/32)*4; This->bits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->stride * This->height); if (!This->bits) return E_OUTOFMEMORY; } return S_OK; } static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, UINT lineCount, UINT cbStride, UINT cbBufferSize, BYTE *pbPixels) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); UINT dstbuffersize, bytesperrow, row; BYTE *dst, *src; HRESULT hr; TRACE("(%p,%u,%u,%u,%p)\n", iface, lineCount, cbStride, cbBufferSize, pbPixels); if (!This->initialized || !This->width || !This->height || !This->format) return WINCODEC_ERR_WRONGSTATE; hr = BmpFrameEncode_AllocateBits(This); if (FAILED(hr)) return hr; bytesperrow = ((This->format->bpp * This->width) + 7) / 8; if (This->stride < bytesperrow) return E_INVALIDARG; dstbuffersize = This->stride * (This->height - This->lineswritten); if ((This->stride * (lineCount - 1)) + bytesperrow > dstbuffersize) return E_INVALIDARG; src = pbPixels; dst = This->bits + This->stride * (This->height - This->lineswritten - 1); for (row = 0; row < lineCount; row++) { memcpy(dst, src, bytesperrow); src += cbStride; dst -= This->stride; } This->lineswritten += lineCount; return S_OK; } static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIBitmapSource, WICRect *prc) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); HRESULT hr; TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc); if (!This->initialized) return WINCODEC_ERR_WRONGSTATE; hr = configure_write_source(iface, pIBitmapSource, prc, This->format ? This->format->guid : NULL, This->width, This->height, This->xres, This->yres); if (SUCCEEDED(hr)) { hr = write_source(iface, pIBitmapSource, prc, This->format->guid, This->format->bpp, This->width, This->height); } return hr; } static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); BITMAPFILEHEADER bfh; BITMAPV5HEADER bih; UINT info_size; LARGE_INTEGER pos; ULONG byteswritten; HRESULT hr; TRACE("(%p)\n", iface); if (!This->bits || This->committed || This->height != This->lineswritten) return WINCODEC_ERR_WRONGSTATE; bfh.bfType = 0x4d42; /* "BM" */ bfh.bfReserved1 = 0; bfh.bfReserved2 = 0; bih.bV5Size = info_size = sizeof(BITMAPINFOHEADER); bih.bV5Width = This->width; bih.bV5Height = This->height; bih.bV5Planes = 1; bih.bV5BitCount = This->format->bpp; bih.bV5Compression = This->format->compression; bih.bV5SizeImage = This->stride*This->height; bih.bV5XPelsPerMeter = (This->xres+0.0127) / 0.0254; bih.bV5YPelsPerMeter = (This->yres+0.0127) / 0.0254; bih.bV5ClrUsed = 0; bih.bV5ClrImportant = 0; if (This->format->compression == BI_BITFIELDS) { if (This->format->alphamask) bih.bV5Size = info_size = sizeof(BITMAPV4HEADER); else info_size = sizeof(BITMAPINFOHEADER)+12; bih.bV5RedMask = This->format->redmask; bih.bV5GreenMask = This->format->greenmask; bih.bV5BlueMask = This->format->bluemask; bih.bV5AlphaMask = This->format->alphamask; bih.bV5CSType = LCS_DEVICE_RGB; } bfh.bfSize = sizeof(BITMAPFILEHEADER) + info_size + bih.bV5SizeImage; bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + info_size; pos.QuadPart = 0; hr = IStream_Seek(This->stream, pos, STREAM_SEEK_SET, NULL); if (FAILED(hr)) return hr; hr = IStream_Write(This->stream, &bfh, sizeof(BITMAPFILEHEADER), &byteswritten); if (FAILED(hr)) return hr; if (byteswritten != sizeof(BITMAPFILEHEADER)) return E_FAIL; hr = IStream_Write(This->stream, &bih, info_size, &byteswritten); if (FAILED(hr)) return hr; if (byteswritten != info_size) return E_FAIL; hr = IStream_Write(This->stream, This->bits, bih.bV5SizeImage, &byteswritten); if (FAILED(hr)) return hr; if (byteswritten != bih.bV5SizeImage) return E_FAIL; This->committed = TRUE; return S_OK; } static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter) { FIXME("(%p, %p): stub\n", iface, ppIMetadataQueryWriter); return E_NOTIMPL; } static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl = { BmpFrameEncode_QueryInterface, BmpFrameEncode_AddRef, BmpFrameEncode_Release, BmpFrameEncode_Initialize, BmpFrameEncode_SetSize, BmpFrameEncode_SetResolution, BmpFrameEncode_SetPixelFormat, BmpFrameEncode_SetColorContexts, BmpFrameEncode_SetPalette, BmpFrameEncode_SetThumbnail, BmpFrameEncode_WritePixels, BmpFrameEncode_WriteSource, BmpFrameEncode_Commit, BmpFrameEncode_GetMetadataQueryWriter }; typedef struct BmpEncoder { IWICBitmapEncoder IWICBitmapEncoder_iface; LONG ref; IStream *stream; BmpFrameEncode *frame; } BmpEncoder; static inline BmpEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface) { return CONTAINING_RECORD(iface, BmpEncoder, IWICBitmapEncoder_iface); } static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, void **ppv) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapEncoder, iid)) { *ppv = &This->IWICBitmapEncoder_iface; } else { *ppv = NULL; return E_NOINTERFACE; } IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } static ULONG WINAPI BmpEncoder_AddRef(IWICBitmapEncoder *iface) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); return ref; } static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) refcount=%u\n", iface, ref); if (ref == 0) { if (This->stream) IStream_Release(This->stream); if (This->frame) IWICBitmapFrameEncode_Release(&This->frame->IWICBitmapFrameEncode_iface); HeapFree(GetProcessHeap(), 0, This); } return ref; } static HRESULT WINAPI BmpEncoder_Initialize(IWICBitmapEncoder *iface, IStream *pIStream, WICBitmapEncoderCacheOption cacheOption) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOption); IStream_AddRef(pIStream); This->stream = pIStream; return S_OK; } static HRESULT WINAPI BmpEncoder_GetContainerFormat(IWICBitmapEncoder *iface, GUID *pguidContainerFormat) { memcpy(pguidContainerFormat, &GUID_ContainerFormatBmp, sizeof(GUID)); return S_OK; } static HRESULT WINAPI BmpEncoder_GetEncoderInfo(IWICBitmapEncoder *iface, IWICBitmapEncoderInfo **ppIEncoderInfo) { FIXME("(%p,%p): stub\n", iface, ppIEncoderInfo); return E_NOTIMPL; } static HRESULT WINAPI BmpEncoder_SetColorContexts(IWICBitmapEncoder *iface, UINT cCount, IWICColorContext **ppIColorContext) { FIXME("(%p,%u,%p): stub\n", iface, cCount, ppIColorContext); return E_NOTIMPL; } static HRESULT WINAPI BmpEncoder_SetPalette(IWICBitmapEncoder *iface, IWICPalette *palette) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p,%p)\n", iface, palette); return This->stream ? WINCODEC_ERR_UNSUPPORTEDOPERATION : WINCODEC_ERR_NOTINITIALIZED; } static HRESULT WINAPI BmpEncoder_SetThumbnail(IWICBitmapEncoder *iface, IWICBitmapSource *pIThumbnail) { TRACE("(%p,%p)\n", iface, pIThumbnail); return WINCODEC_ERR_UNSUPPORTEDOPERATION; } static HRESULT WINAPI BmpEncoder_SetPreview(IWICBitmapEncoder *iface, IWICBitmapSource *pIPreview) { TRACE("(%p,%p)\n", iface, pIPreview); return WINCODEC_ERR_UNSUPPORTEDOPERATION; } static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBitmapFrameEncode **ppIFrameEncode, IPropertyBag2 **ppIEncoderOptions) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); BmpFrameEncode *encode; HRESULT hr; static const PROPBAG2 opts[1] = { { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszEnableV5Header32bppBGRA }, }; TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions); if (This->frame) return WINCODEC_ERR_UNSUPPORTEDOPERATION; if (!This->stream) return WINCODEC_ERR_NOTINITIALIZED; if (ppIEncoderOptions) { hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions); if (FAILED(hr)) return hr; } encode = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpFrameEncode)); if (!encode) { IPropertyBag2_Release(*ppIEncoderOptions); *ppIEncoderOptions = NULL; return E_OUTOFMEMORY; } encode->IWICBitmapFrameEncode_iface.lpVtbl = &BmpFrameEncode_Vtbl; encode->ref = 2; IStream_AddRef(This->stream); encode->stream = This->stream; encode->initialized = FALSE; encode->width = 0; encode->height = 0; encode->bits = NULL; encode->format = NULL; encode->xres = 0.0; encode->yres = 0.0; encode->lineswritten = 0; encode->colors = 0; encode->committed = FALSE; *ppIFrameEncode = &encode->IWICBitmapFrameEncode_iface; This->frame = encode; return S_OK; } static HRESULT WINAPI BmpEncoder_Commit(IWICBitmapEncoder *iface) { BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); TRACE("(%p)\n", iface); if (!This->frame || !This->frame->committed) return WINCODEC_ERR_WRONGSTATE; return S_OK; } static HRESULT WINAPI BmpEncoder_GetMetadataQueryWriter(IWICBitmapEncoder *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter) { FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryWriter); return E_NOTIMPL; } static const IWICBitmapEncoderVtbl BmpEncoder_Vtbl = { BmpEncoder_QueryInterface, BmpEncoder_AddRef, BmpEncoder_Release, BmpEncoder_Initialize, BmpEncoder_GetContainerFormat, BmpEncoder_GetEncoderInfo, BmpEncoder_SetColorContexts, BmpEncoder_SetPalette, BmpEncoder_SetThumbnail, BmpEncoder_SetPreview, BmpEncoder_CreateNewFrame, BmpEncoder_Commit, BmpEncoder_GetMetadataQueryWriter }; HRESULT BmpEncoder_CreateInstance(REFIID iid, void** ppv) { BmpEncoder *This; HRESULT ret; TRACE("(%s,%p)\n", debugstr_guid(iid), ppv); *ppv = NULL; This = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpEncoder)); if (!This) return E_OUTOFMEMORY; This->IWICBitmapEncoder_iface.lpVtbl = &BmpEncoder_Vtbl; This->ref = 1; This->stream = NULL; This->frame = NULL; ret = IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv); IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface); return ret; }
251386.c
/* * MIT License * * chkstr.c (c) 2022 Da'Jour J. Christophe. All rights reserved. * (c) 2022 Harpont, Inc. All rights reserved. * * Provide an example of the how to implement a call to chkstr. */ #include "sencillez/string.h" int main(void) { char *ptr = NULL; chkstr(ptr); return 0; }
750853.c
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE457_Use_of_Uninitialized_Variable__wchar_t_pointer_16.c Label Definition File: CWE457_Use_of_Uninitialized_Variable.c.label.xml Template File: sources-sinks-16.tmpl.c */ /* * @description * CWE: 457 Use of Uninitialized Variable * BadSource: no_init Don't initialize data * GoodSource: Initialize data * Sinks: use * GoodSink: Initialize then use data * BadSink : Use data * Flow Variant: 16 Control flow: while(1) and while(0) * * */ #include "std_testcase.h" # include <wchar.h> #ifndef OMITBAD void CWE457_Use_of_Uninitialized_Variable__wchar_t_pointer_16_bad() { wchar_t * data; while(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = L"string"; break; } while(1) { /* Don't initialize data */ ; /* empty statement needed for some flow variants */ break; } while(1) { printWLine(data); break; } while(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = L"string"; printWLine(data); break; } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodB2G() - use badsource and goodsink by changing the conditions on the third and fourth while statements */ static void goodB2G() { wchar_t * data; while(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = L"string"; break; } while(1) { /* Don't initialize data */ ; /* empty statement needed for some flow variants */ break; } while(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printWLine(data); break; } while(1) { data = L"string"; printWLine(data); break; } } /* goodG2B() - use goodsource and badsink by changing the conditions on the first and second while statements */ static void goodG2B() { wchar_t * data; while(1) { data = L"string"; break; } while(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* Don't initialize data */ ; /* empty statement needed for some flow variants */ break; } while(1) { printWLine(data); break; } while(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = L"string"; printWLine(data); break; } } void CWE457_Use_of_Uninitialized_Variable__wchar_t_pointer_16_good() { goodB2G(); goodG2B(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE457_Use_of_Uninitialized_Variable__wchar_t_pointer_16_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE457_Use_of_Uninitialized_Variable__wchar_t_pointer_16_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
1003032.c
/* ** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ #define LUAC_CROSS_FILE #include "lua.h" #include C_HEADER_CTYPE #include C_HEADER_ERRNO #include C_HEADER_STDIO #include C_HEADER_STDLIB #include C_HEADER_STRING #ifndef LUA_CROSS_COMPILER #include "flash_fs.h" #else #endif /* This file uses only the official API of Lua. ** Any function declared here could be written as an application function. */ #define lauxlib_c #define LUA_LIB #include "lrotable.h" #include "lauxlib.h" #include "lgc.h" #include "ldo.h" #include "lobject.h" #include "lstate.h" #include "legc.h" #define FREELIST_REF 0 /* free list of references */ /* convert a stack index to positive */ #define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \ lua_gettop(L) + (i) + 1) // Parameters for luaI_openlib #define LUA_USECCLOSURES 0 #define LUA_USELIGHTFUNCTIONS 1 /* ** {====================================================== ** Error-report functions ** ======================================================= */ LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { lua_Debug ar; if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); lua_getinfo(L, "n", &ar); if (c_strcmp(ar.namewhat, "method") == 0) { narg--; /* do not count `self' */ if (narg == 0) /* error is in the self argument itself? */ return luaL_error(L, "calling " LUA_QS " on bad self (%s)", ar.name, extramsg); } if (ar.name == NULL) ar.name = "?"; return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", narg, ar.name, extramsg); } LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg)); return luaL_argerror(L, narg, msg); } static void tag_error (lua_State *L, int narg, int tag) { luaL_typerror(L, narg, lua_typename(L, tag)); } LUALIB_API void luaL_where (lua_State *L, int level) { lua_Debug ar; if (lua_getstack(L, level, &ar)) { /* check function at level */ lua_getinfo(L, "Sl", &ar); /* get info about it */ if (ar.currentline > 0) { /* is there info? */ lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); return; } } lua_pushliteral(L, ""); /* else, no information available... */ } LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { va_list argp; va_start(argp, fmt); luaL_where(L, 1); lua_pushvfstring(L, fmt, argp); va_end(argp); lua_concat(L, 2); return lua_error(L); } /* }====================================================== */ LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, const char *const lst[]) { const char *name = (def) ? luaL_optstring(L, narg, def) : luaL_checkstring(L, narg); int i; for (i=0; lst[i]; i++) if (c_strcmp(lst[i], name) == 0) return i; return luaL_argerror(L, narg, lua_pushfstring(L, "invalid option " LUA_QS, name)); } LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */ if (!lua_isnil(L, -1)) /* name already in use? */ return 0; /* leave previous value on top, but return 0 */ lua_pop(L, 1); lua_newtable(L); /* create metatable */ lua_pushvalue(L, -1); lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ return 1; } LUALIB_API int luaL_rometatable (lua_State *L, const char* tname, void *p) { lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */ if (!lua_isnil(L, -1)) /* name already in use? */ return 0; /* leave previous value on top, but return 0 */ lua_pop(L, 1); lua_pushrotable(L, p); lua_pushvalue(L, -1); lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ return 1; } LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { void *p = lua_touserdata(L, ud); if (p != NULL) { /* value is a userdata? */ if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */ if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ lua_pop(L, 2); /* remove both metatables */ return p; } } } luaL_typerror(L, ud, tname); /* else error */ return NULL; /* to avoid warnings */ } LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) { if (!lua_checkstack(L, space)) luaL_error(L, "stack overflow (%s)", mes); } LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { if (lua_type(L, narg) != t) tag_error(L, narg, t); } LUALIB_API void luaL_checkanyfunction (lua_State *L, int narg) { if (lua_type(L, narg) != LUA_TFUNCTION && lua_type(L, narg) != LUA_TLIGHTFUNCTION) { const char *msg = lua_pushfstring(L, "function or lightfunction expected, got %s", luaL_typename(L, narg)); luaL_argerror(L, narg, msg); } } LUALIB_API void luaL_checkanytable (lua_State *L, int narg) { if (lua_type(L, narg) != LUA_TTABLE && lua_type(L, narg) != LUA_TROTABLE) { const char *msg = lua_pushfstring(L, "table or rotable expected, got %s", luaL_typename(L, narg)); luaL_argerror(L, narg, msg); } } LUALIB_API void luaL_checkany (lua_State *L, int narg) { if (lua_type(L, narg) == LUA_TNONE) luaL_argerror(L, narg, "value expected"); } LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { const char *s = lua_tolstring(L, narg, len); if (!s) tag_error(L, narg, LUA_TSTRING); return s; } LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, const char *def, size_t *len) { if (lua_isnoneornil(L, narg)) { if (len) *len = (def ? c_strlen(def) : 0); return def; } else return luaL_checklstring(L, narg, len); } LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { lua_Number d = lua_tonumber(L, narg); if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ tag_error(L, narg, LUA_TNUMBER); return d; } LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { return luaL_opt(L, luaL_checknumber, narg, def); } LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { lua_Integer d = lua_tointeger(L, narg); if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ tag_error(L, narg, LUA_TNUMBER); return d; } LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, lua_Integer def) { return luaL_opt(L, luaL_checkinteger, narg, def); } LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { if (!lua_getmetatable(L, obj)) /* no metatable? */ return 0; lua_pushstring(L, event); lua_rawget(L, -2); if (lua_isnil(L, -1)) { lua_pop(L, 2); /* remove metatable and metafield */ return 0; } else { lua_remove(L, -2); /* remove only metatable */ return 1; } } LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { obj = abs_index(L, obj); if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ return 0; lua_pushvalue(L, obj); lua_call(L, 1, 1); return 1; } LUALIB_API void (luaL_register) (lua_State *L, const char *libname, const luaL_Reg *l) { luaI_openlib(L, libname, l, 0, LUA_USECCLOSURES); } LUALIB_API void (luaL_register_light) (lua_State *L, const char *libname, const luaL_Reg *l) { #if LUA_OPTIMIZE_MEMORY > 0 luaI_openlib(L, libname, l, 0, LUA_USELIGHTFUNCTIONS); #else luaI_openlib(L, libname, l, 0, LUA_USECCLOSURES); #endif } static int libsize (const luaL_Reg *l) { int size = 0; for (; l->name; l++) size++; return size; } LUALIB_API void luaI_openlib (lua_State *L, const char *libname, const luaL_Reg *l, int nup, int ftype) { if (libname) { int size = libsize(l); /* check whether lib already exists */ luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); lua_getfield(L, -1, libname); /* get _LOADED[libname] */ if (!lua_istable(L, -1)) { /* not found? */ lua_pop(L, 1); /* remove previous result */ /* try global variable (and create one if it does not exist) */ if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL) luaL_error(L, "name conflict for module " LUA_QS, libname); lua_pushvalue(L, -1); lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ } lua_remove(L, -2); /* remove _LOADED table */ lua_insert(L, -(nup+1)); /* move library table to below upvalues */ } for (; l->name; l++) { int i; for (i=0; i<nup; i++) /* copy upvalues to the top */ lua_pushvalue(L, -nup); if (ftype == LUA_USELIGHTFUNCTIONS) lua_pushlightfunction(L, l->func); else lua_pushcclosure(L, l->func, nup); lua_setfield(L, -(nup+2), l->name); } lua_pop(L, nup); /* remove upvalues */ } /* ** {====================================================== ** getn-setn: size for arrays ** ======================================================= */ #if defined(LUA_COMPAT_GETN) static int checkint (lua_State *L, int topop) { int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1; lua_pop(L, topop); return n; } static void getsizes (lua_State *L) { lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); if (lua_isnil(L, -1)) { /* no `size' table? */ lua_pop(L, 1); /* remove nil */ lua_newtable(L); /* create it */ lua_pushvalue(L, -1); /* `size' will be its own metatable */ lua_setmetatable(L, -2); lua_pushliteral(L, "kv"); lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ lua_pushvalue(L, -1); lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ } } LUALIB_API void luaL_setn (lua_State *L, int t, int n) { t = abs_index(L, t); lua_pushliteral(L, "n"); lua_rawget(L, t); if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ lua_pushliteral(L, "n"); /* use it */ lua_pushinteger(L, n); lua_rawset(L, t); } else { /* use `sizes' */ getsizes(L); lua_pushvalue(L, t); lua_pushinteger(L, n); lua_rawset(L, -3); /* sizes[t] = n */ lua_pop(L, 1); /* remove `sizes' */ } } LUALIB_API int luaL_getn (lua_State *L, int t) { int n; t = abs_index(L, t); lua_pushliteral(L, "n"); /* try t.n */ lua_rawget(L, t); if ((n = checkint(L, 1)) >= 0) return n; getsizes(L); /* else try sizes[t] */ lua_pushvalue(L, t); lua_rawget(L, -2); if ((n = checkint(L, 2)) >= 0) return n; return (int)lua_objlen(L, t); } #endif /* }====================================================== */ LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, const char *r) { const char *wild; size_t l = c_strlen(p); luaL_Buffer b; luaL_buffinit(L, &b); while ((wild = c_strstr(s, p)) != NULL) { luaL_addlstring(&b, s, wild - s); /* push prefix */ luaL_addstring(&b, r); /* push replacement in place of pattern */ s = wild + l; /* continue after `p' */ } luaL_addstring(&b, s); /* push last suffix */ luaL_pushresult(&b); return lua_tostring(L, -1); } LUALIB_API const char *luaL_findtable (lua_State *L, int idx, const char *fname, int szhint) { const char *e; lua_pushvalue(L, idx); do { e = c_strchr(fname, '.'); if (e == NULL) e = fname + c_strlen(fname); lua_pushlstring(L, fname, e - fname); lua_rawget(L, -2); if (lua_isnil(L, -1)) { /* If looking for a global variable, check the rotables too */ void *ptable = luaR_findglobal(fname, e - fname); if (ptable) { lua_pop(L, 1); lua_pushrotable(L, ptable); } } if (lua_isnil(L, -1)) { /* no such field? */ lua_pop(L, 1); /* remove this nil */ lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ lua_pushlstring(L, fname, e - fname); lua_pushvalue(L, -2); lua_settable(L, -4); /* set new table into field */ } else if (!lua_istable(L, -1) && !lua_isrotable(L, -1)) { /* field has a non-table value? */ lua_pop(L, 2); /* remove table and value */ return fname; /* return problematic part of the name */ } lua_remove(L, -2); /* remove previous table */ fname = e + 1; } while (*e == '.'); return NULL; } /* ** {====================================================== ** Generic Buffer manipulation ** ======================================================= */ #define bufflen(B) ((B)->p - (B)->buffer) #define bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B))) #define LIMIT (LUA_MINSTACK/2) static int emptybuffer (luaL_Buffer *B) { size_t l = bufflen(B); if (l == 0) return 0; /* put nothing on stack */ else { lua_pushlstring(B->L, B->buffer, l); B->p = B->buffer; B->lvl++; return 1; } } static void adjuststack (luaL_Buffer *B) { if (B->lvl > 1) { lua_State *L = B->L; int toget = 1; /* number of levels to concat */ size_t toplen = lua_strlen(L, -1); do { size_t l = lua_strlen(L, -(toget+1)); if (B->lvl - toget + 1 >= LIMIT || toplen > l) { toplen += l; toget++; } else break; } while (toget < B->lvl); lua_concat(L, toget); B->lvl = B->lvl - toget + 1; } } LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) { if (emptybuffer(B)) adjuststack(B); return B->buffer; } LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { while (l--) luaL_addchar(B, *s++); } LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { luaL_addlstring(B, s, c_strlen(s)); } LUALIB_API void luaL_pushresult (luaL_Buffer *B) { emptybuffer(B); lua_concat(B->L, B->lvl); B->lvl = 1; } LUALIB_API void luaL_addvalue (luaL_Buffer *B) { lua_State *L = B->L; size_t vl; const char *s = lua_tolstring(L, -1, &vl); if (vl <= bufffree(B)) { /* fit into buffer? */ c_memcpy(B->p, s, vl); /* put it there */ B->p += vl; lua_pop(L, 1); /* remove from stack */ } else { if (emptybuffer(B)) lua_insert(L, -2); /* put buffer before new value */ B->lvl++; /* add new value into B stack */ adjuststack(B); } } LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { B->L = L; B->p = B->buffer; B->lvl = 0; } /* }====================================================== */ LUALIB_API int luaL_ref (lua_State *L, int t) { int ref; t = abs_index(L, t); if (lua_isnil(L, -1)) { lua_pop(L, 1); /* remove from stack */ return LUA_REFNIL; /* `nil' has a unique fixed reference */ } lua_rawgeti(L, t, FREELIST_REF); /* get first free element */ ref = (int)lua_tointeger(L, -1); /* ref = t[FREELIST_REF] */ lua_pop(L, 1); /* remove it from stack */ if (ref != 0) { /* any free element? */ lua_rawgeti(L, t, ref); /* remove it from list */ lua_rawseti(L, t, FREELIST_REF); /* (t[FREELIST_REF] = t[ref]) */ } else { /* no free elements */ ref = (int)lua_objlen(L, t); ref++; /* create new reference */ } lua_rawseti(L, t, ref); return ref; } LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { if (ref >= 0) { t = abs_index(L, t); lua_rawgeti(L, t, FREELIST_REF); lua_rawseti(L, t, ref); /* t[ref] = t[FREELIST_REF] */ lua_pushinteger(L, ref); lua_rawseti(L, t, FREELIST_REF); /* t[FREELIST_REF] = ref */ } } /* ** {====================================================== ** Load functions ** ======================================================= */ #ifdef LUA_CROSS_COMPILER typedef struct LoadF { int extraline; FILE *f; char buff[LUAL_BUFFERSIZE]; } LoadF; static const char *getF (lua_State *L, void *ud, size_t *size) { LoadF *lf = (LoadF *)ud; (void)L; if (lf->extraline) { lf->extraline = 0; *size = 1; return "\n"; } if (c_feof(lf->f)) return NULL; *size = c_fread(lf->buff, 1, sizeof(lf->buff), lf->f); return (*size > 0) ? lf->buff : NULL; } static int errfile (lua_State *L, const char *what, int fnameindex) { const char *serr = c_strerror(errno); const char *filename = lua_tostring(L, fnameindex) + 1; lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); lua_remove(L, fnameindex); return LUA_ERRFILE; } LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { LoadF lf; int status, readstatus; int c; int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ lf.extraline = 0; if (filename == NULL) { lua_pushliteral(L, "=stdin"); lf.f = c_stdin; } else { lua_pushfstring(L, "@%s", filename); lf.f = c_fopen(filename, "r"); if (lf.f == NULL) return errfile(L, "open", fnameindex); } c = c_getc(lf.f); if (c == '#') { /* Unix exec. file? */ lf.extraline = 1; while ((c = c_getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ if (c == '\n') c = c_getc(lf.f); } if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ lf.f = c_freopen(filename, "rb", lf.f); /* reopen in binary mode */ if (lf.f == NULL) return errfile(L, "reopen", fnameindex); /* skip eventual `#!...' */ while ((c = c_getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; lf.extraline = 0; } c_ungetc(c, lf.f); status = lua_load(L, getF, &lf, lua_tostring(L, -1)); readstatus = c_ferror(lf.f); if (filename) c_fclose(lf.f); /* close file (even in case of errors) */ if (readstatus) { lua_settop(L, fnameindex); /* ignore results from `lua_load' */ return errfile(L, "read", fnameindex); } lua_remove(L, fnameindex); return status; } #else #include C_HEADER_FCNTL typedef struct LoadFSF { int extraline; int f; char buff[LUAL_BUFFERSIZE]; } LoadFSF; static const char *getFSF (lua_State *L, void *ud, size_t *size) { LoadFSF *lf = (LoadFSF *)ud; (void)L; if (L == NULL && size == NULL) // Direct mode check return NULL; if (lf->extraline) { lf->extraline = 0; *size = 1; return "\n"; } if (fs_eof(lf->f)) return NULL; *size = fs_read(lf->f, lf->buff, sizeof(lf->buff)); return (*size > 0) ? lf->buff : NULL; } static int errfsfile (lua_State *L, const char *what, int fnameindex) { const char *filename = lua_tostring(L, fnameindex) + 1; lua_pushfstring(L, "cannot %s %s", what, filename); lua_remove(L, fnameindex); return LUA_ERRFILE; } LUALIB_API int luaL_loadfsfile (lua_State *L, const char *filename) { LoadFSF lf; int status, readstatus; int c; int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ lf.extraline = 0; if (filename == NULL) { return luaL_error(L, "filename is NULL"); } else { lua_pushfstring(L, "@%s", filename); lf.f = fs_open(filename, FS_RDONLY); if (lf.f < FS_OPEN_OK) return errfsfile(L, "open", fnameindex); } // if(fs_size(lf.f)>LUAL_BUFFERSIZE) // return luaL_error(L, "file is too big"); c = fs_getc(lf.f); if (c == '#') { /* Unix exec. file? */ lf.extraline = 1; while ((c = fs_getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ if (c == '\n') c = fs_getc(lf.f); } if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ fs_close(lf.f); lf.f = fs_open(filename, FS_RDONLY); /* reopen in binary mode */ if (lf.f < FS_OPEN_OK) return errfsfile(L, "reopen", fnameindex); /* skip eventual `#!...' */ while ((c = fs_getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; lf.extraline = 0; } fs_ungetc(c, lf.f); status = lua_load(L, getFSF, &lf, lua_tostring(L, -1)); if (filename) fs_close(lf.f); /* close file (even in case of errors) */ lua_remove(L, fnameindex); return status; } #endif typedef struct LoadS { const char *s; size_t size; } LoadS; static const char *getS (lua_State *L, void *ud, size_t *size) { LoadS *ls = (LoadS *)ud; (void)L; if (L == NULL && size == NULL) // direct mode check return NULL; if (ls->size == 0) return NULL; *size = ls->size; ls->size = 0; return ls->s; } LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size, const char *name) { LoadS ls; ls.s = buff; ls.size = size; return lua_load(L, getS, &ls, name); } LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) { return luaL_loadbuffer(L, s, c_strlen(s), s); } /* }====================================================== */ static int l_check_memlimit(lua_State *L, size_t needbytes) { global_State *g = G(L); int cycle_count = 0; lu_mem limit = g->memlimit - needbytes; /* don't allow allocation if it requires more memory then the total limit. */ if (needbytes > g->memlimit) return 1; /* make sure the GC is not disabled. */ if (!is_block_gc(L)) { while (g->totalbytes >= limit) { /* only allow the GC to finished atleast 1 full cycle. */ if (g->gcstate == GCSpause && ++cycle_count > 1) break; luaC_step(L); } } return (g->totalbytes >= limit) ? 1 : 0; } static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { lua_State *L = (lua_State *)ud; int mode = L == NULL ? 0 : G(L)->egcmode; void *nptr; if (nsize == 0) { c_free(ptr); return NULL; } if (L != NULL && (mode & EGC_ALWAYS)) /* always collect memory if requested */ luaC_fullgc(L); if(nsize > osize && L != NULL) { #if defined(LUA_STRESS_EMERGENCY_GC) luaC_fullgc(L); #endif if(G(L)->memlimit > 0 && (mode & EGC_ON_MEM_LIMIT) && l_check_memlimit(L, nsize - osize)) return NULL; } nptr = (void *)c_realloc(ptr, nsize); if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) { luaC_fullgc(L); /* emergency full collection. */ nptr = (void *)c_realloc(ptr, nsize); /* try allocation again */ } return nptr; } static int panic (lua_State *L) { (void)L; /* to avoid warnings */ #if defined(LUA_USE_STDIO) c_fprintf(c_stderr, "PANIC: unprotected error in call to Lua API (%s)\n", lua_tostring(L, -1)); #else luai_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", lua_tostring(L, -1)); #endif return 0; } LUALIB_API lua_State *luaL_newstate (void) { lua_State *L = lua_newstate(l_alloc, NULL); lua_setallocf(L, l_alloc, L); /* allocator need lua_State. */ if (L) lua_atpanic(L, &panic); return L; }
616522.c
/************************************************************************************ * configs/shenzhou/src/stm32_touchscreen.c * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <[email protected]> * * 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 NuttX 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. * ************************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <stdbool.h> #include <stdio.h> #include <debug.h> #include <assert.h> #include <errno.h> #include <nuttx/board.h> #include <nuttx/irq.h> #include <nuttx/spi/spi.h> #include <nuttx/input/touchscreen.h> #include <nuttx/input/ads7843e.h> #include "stm32.h" #include "shenzhou.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ #ifdef CONFIG_INPUT_ADS7843E #ifndef CONFIG_INPUT # error "Touchscreen support requires CONFIG_INPUT" #endif #ifndef CONFIG_STM32_SPI3 # error "Touchscreen support requires CONFIG_STM32_SPI3" #endif #ifndef CONFIG_ADS7843E_FREQUENCY # define CONFIG_ADS7843E_FREQUENCY 500000 #endif #ifndef CONFIG_ADS7843E_SPIDEV # define CONFIG_ADS7843E_SPIDEV 3 #endif #if CONFIG_ADS7843E_SPIDEV != 3 # error "CONFIG_ADS7843E_SPIDEV must be three" #endif #ifndef CONFIG_ADS7843E_DEVMINOR # define CONFIG_ADS7843E_DEVMINOR 0 #endif /**************************************************************************** * Private Types ****************************************************************************/ struct stm32_config_s { struct ads7843e_config_s dev; xcpt_t handler; }; /**************************************************************************** * Private Function Prototypes ****************************************************************************/ /* IRQ/GPIO access callbacks. These operations all hidden behind * callbacks to isolate the ADS7843E driver from differences in GPIO * interrupt handling by varying boards and MCUs. If possible, * interrupts should be configured on both rising and falling edges * so that contact and loss-of-contact events can be detected. * * attach - Attach the ADS7843E interrupt handler to the GPIO interrupt * enable - Enable or disable the GPIO interrupt * clear - Acknowledge/clear any pending GPIO interrupt * pendown - Return the state of the pen down GPIO input */ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr); static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable); static void tsc_clear(FAR struct ads7843e_config_s *state); static bool tsc_busy(FAR struct ads7843e_config_s *state); static bool tsc_pendown(FAR struct ads7843e_config_s *state); /**************************************************************************** * Private Data ****************************************************************************/ /* A reference to a structure of this type must be passed to the ADS7843E * driver. This structure provides information about the configuration * of the ADS7843E and provides some board-specific hooks. * * Memory for this structure is provided by the caller. It is not copied * by the driver and is presumed to persist while the driver is active. The * memory must be writable because, under certain circumstances, the driver * may modify frequency or X plate resistance values. */ static struct stm32_config_s g_tscinfo = { { .frequency = CONFIG_ADS7843E_FREQUENCY, .attach = tsc_attach, .enable = tsc_enable, .clear = tsc_clear, .busy = tsc_busy, .pendown = tsc_pendown, }, .handler = NULL, }; /**************************************************************************** * Private Functions ****************************************************************************/ /* IRQ/GPIO access callbacks. These operations all hidden behind * callbacks to isolate the ADS7843E driver from differences in GPIO * interrupt handling by varying boards and MCUs. If possible, * interrupts should be configured on both rising and falling edges * so that contact and loss-of-contact events can be detected. * * attach - Attach the ADS7843E interrupt handler to the GPIO interrupt * enable - Enable or disable the GPIO interrupt * clear - Acknowledge/clear any pending GPIO interrupt * pendown - Return the state of the pen down GPIO input */ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t handler) { FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state; /* Just save the handler for use when the interrupt is enabled */ priv->handler = handler; return OK; } static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) { FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state; /* The caller should not attempt to enable interrupts if the handler * has not yet been 'attached' */ DEBUGASSERT(priv->handler || !enable); /* Attach and enable, or detach and disable */ iinfo("enable:%d\n", enable); if (enable) { (void)stm32_gpiosetevent(GPIO_TP_INT, true, true, false, priv->handler, NULL); } else { (void)stm32_gpiosetevent(GPIO_TP_INT, false, false, false, NULL, NULL); } } static void tsc_clear(FAR struct ads7843e_config_s *state) { /* Does nothing */ } static bool tsc_busy(FAR struct ads7843e_config_s *state) { /* Hmmm... The ADS7843E BUSY pin is not brought out on the Shenzhou board. * We will most certainly have to revisit this. There is this cryptic * statement in the XPT2046 spec: "No DCLK delay required with dedicated * serial port." * * The busy state is used by the ADS7843E driver to control the delay * between sending the command, then reading the returned data. */ return false; } static bool tsc_pendown(FAR struct ads7843e_config_s *state) { /* XPT2046 uses an an internal pullup resistor. The PENIRQ output goes low * due to the current path through the touch screen to ground, which * initiates an interrupt to the processor via TP_INT. */ bool pendown = !stm32_gpioread(GPIO_TP_INT); iinfo("pendown:%d\n", pendown); return pendown; } /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: stm32_tsc_setup * * Description: * This function is called by board-bringup logic to configure the * touchscreen device. This function will register the driver as * /dev/inputN where N is the minor device number. * * Input Parameters: * minor - The input device minor number * * Returned Value: * Zero is returned on success. Otherwise, a negated errno value is * returned to indicate the nature of the failure. * ****************************************************************************/ int stm32_tsc_setup(int minor) { FAR struct spi_dev_s *dev; int ret; iinfo("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Configure and enable the ADS7843E interrupt pin as an input. */ (void)stm32_configgpio(GPIO_TP_INT); /* Get an instance of the SPI interface */ dev = stm32_spibus_initialize(CONFIG_ADS7843E_SPIDEV); if (!dev) { ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); return -ENODEV; } /* Initialize and register the SPI touschscreen device */ ret = ads7843e_register(dev, &g_tscinfo.dev, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); /* up_spiuninitialize(dev); */ return -ENODEV; } return OK; } #endif /* CONFIG_INPUT_ADS7843E */
119229.c
/* +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ | Copyright (c) 1998-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [email protected] so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov <[email protected]> | +----------------------------------------------------------------------+ */ #include "zend.h" #include "zend_virtual_cwd.h" #include "zend_compile.h" #include "zend_vm.h" #include "zend_interfaces.h" #include "php.h" #ifdef ZEND_WIN32 #include "ext/standard/md5.h" #endif #ifdef HAVE_OPCACHE_FILE_CACHE #include "ZendAccelerator.h" #include "zend_file_cache.h" #include "zend_shared_alloc.h" #include "zend_accelerator_util_funcs.h" #include "zend_accelerator_hash.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #if HAVE_UNISTD_H #include <unistd.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_SYS_FILE_H # include <sys/file.h> #endif #ifndef ZEND_WIN32 #define zend_file_cache_unlink unlink #define zend_file_cache_open open #else #define zend_file_cache_unlink php_win32_ioutil_unlink #define zend_file_cache_open php_win32_ioutil_open #endif #ifdef ZEND_WIN32 # define LOCK_SH 0 # define LOCK_EX 1 # define LOCK_UN 2 static int zend_file_cache_flock(int fd, int op) { OVERLAPPED offset = {0,0,0,0,NULL}; if (op == LOCK_EX) { if (LockFileEx((HANDLE)_get_osfhandle(fd), LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &offset) == TRUE) { return 0; } } else if (op == LOCK_SH) { if (LockFileEx((HANDLE)_get_osfhandle(fd), 0, 0, 1, 0, &offset) == TRUE) { return 0; } } else if (op == LOCK_UN) { if (UnlockFileEx((HANDLE)_get_osfhandle(fd), 0, 1, 0, &offset) == TRUE) { return 0; } } return -1; } #elif defined(HAVE_FLOCK) # define zend_file_cache_flock flock #else # define LOCK_SH 0 # define LOCK_EX 1 # define LOCK_UN 2 static int zend_file_cache_flock(int fd, int type) { return 0; } #endif #ifndef O_BINARY # define O_BINARY 0 #endif #define SUFFIX ".bin" #define IS_SERIALIZED_INTERNED(ptr) \ ((size_t)(ptr) & Z_UL(1)) /* Allowing == here to account for a potential empty allocation at the end of the memory */ #define IS_SERIALIZED(ptr) \ ((char*)(ptr) <= (char*)script->size) #define IS_UNSERIALIZED(ptr) \ (((char*)(ptr) >= (char*)script->mem && (char*)(ptr) < (char*)script->mem + script->size) || \ IS_ACCEL_INTERNED(ptr)) #define SERIALIZE_PTR(ptr) do { \ if (ptr) { \ ZEND_ASSERT(IS_UNSERIALIZED(ptr)); \ (ptr) = (void*)((char*)(ptr) - (char*)script->mem); \ } \ } while (0) #define UNSERIALIZE_PTR(ptr) do { \ if (ptr) { \ ZEND_ASSERT(IS_SERIALIZED(ptr)); \ (ptr) = (void*)((char*)buf + (size_t)(ptr)); \ } \ } while (0) #define SERIALIZE_STR(ptr) do { \ if (ptr) { \ if (IS_ACCEL_INTERNED(ptr)) { \ (ptr) = zend_file_cache_serialize_interned((zend_string*)(ptr), info); \ } else { \ ZEND_ASSERT(IS_UNSERIALIZED(ptr)); \ /* script->corrupted shows if the script in SHM or not */ \ if (EXPECTED(script->corrupted)) { \ GC_ADD_FLAGS(ptr, IS_STR_INTERNED); \ GC_DEL_FLAGS(ptr, IS_STR_PERMANENT); \ } \ (ptr) = (void*)((char*)(ptr) - (char*)script->mem); \ } \ } \ } while (0) #define UNSERIALIZE_STR(ptr) do { \ if (ptr) { \ if (IS_SERIALIZED_INTERNED(ptr)) { \ (ptr) = (void*)zend_file_cache_unserialize_interned((zend_string*)(ptr), !script->corrupted); \ } else { \ ZEND_ASSERT(IS_SERIALIZED(ptr)); \ (ptr) = (void*)((char*)buf + (size_t)(ptr)); \ /* script->corrupted shows if the script in SHM or not */ \ if (EXPECTED(!script->corrupted)) { \ GC_ADD_FLAGS(ptr, IS_STR_INTERNED | IS_STR_PERMANENT); \ } else { \ GC_ADD_FLAGS(ptr, IS_STR_INTERNED); \ GC_DEL_FLAGS(ptr, IS_STR_PERMANENT); \ } \ } \ } \ } while (0) static const uint32_t uninitialized_bucket[-HT_MIN_MASK] = {HT_INVALID_IDX, HT_INVALID_IDX}; typedef struct _zend_file_cache_metainfo { char magic[8]; char system_id[32]; size_t mem_size; size_t str_size; size_t script_offset; accel_time_t timestamp; uint32_t checksum; } zend_file_cache_metainfo; static int zend_file_cache_mkdir(char *filename, size_t start) { char *s = filename + start; while (*s) { if (IS_SLASH(*s)) { char old = *s; *s = '\000'; #ifndef ZEND_WIN32 if (mkdir(filename, S_IRWXU) < 0 && errno != EEXIST) { #else if (php_win32_ioutil_mkdir(filename, 0700) < 0 && errno != EEXIST) { #endif *s = old; return FAILURE; } *s = old; } s++; } return SUCCESS; } typedef void (*serialize_callback_t)(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf); typedef void (*unserialize_callback_t)(zval *zv, zend_persistent_script *script, void *buf); static void zend_file_cache_serialize_zval(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf); static void zend_file_cache_unserialize_zval(zval *zv, zend_persistent_script *script, void *buf); static void *zend_file_cache_serialize_interned(zend_string *str, zend_file_cache_metainfo *info) { size_t len; void *ret; /* check if the same interned string was already stored */ ret = zend_shared_alloc_get_xlat_entry(str); if (ret) { return ret; } len = ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); ret = (void*)(info->str_size | Z_UL(1)); zend_shared_alloc_register_xlat_entry(str, ret); if (info->str_size + len > ZSTR_LEN((zend_string*)ZCG(mem))) { size_t new_len = info->str_size + len; ZCG(mem) = (void*)zend_string_realloc( (zend_string*)ZCG(mem), ((_ZSTR_HEADER_SIZE + 1 + new_len + 4095) & ~0xfff) - (_ZSTR_HEADER_SIZE + 1), 0); } memcpy(ZSTR_VAL((zend_string*)ZCG(mem)) + info->str_size, str, len); info->str_size += len; return ret; } static void *zend_file_cache_unserialize_interned(zend_string *str, int in_shm) { zend_string *ret; str = (zend_string*)((char*)ZCG(mem) + ((size_t)(str) & ~Z_UL(1))); if (in_shm) { ret = accel_new_interned_string(str); if (ret == str) { /* We have to create new SHM allocated string */ size_t size = _ZSTR_STRUCT_SIZE(ZSTR_LEN(str)); ret = zend_shared_alloc(size); if (!ret) { zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM); LONGJMP(*EG(bailout), FAILURE); } memcpy(ret, str, size); /* String wasn't interned but we will use it as interned anyway */ GC_SET_REFCOUNT(ret, 1); GC_TYPE_INFO(ret) = IS_STRING | ((IS_STR_INTERNED | IS_STR_PERSISTENT | IS_STR_PERMANENT) << GC_FLAGS_SHIFT); } } else { ret = str; GC_ADD_FLAGS(ret, IS_STR_INTERNED); GC_DEL_FLAGS(ret, IS_STR_PERMANENT); } return ret; } static void zend_file_cache_serialize_hash(HashTable *ht, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf, serialize_callback_t func) { Bucket *p, *end; if (!(HT_FLAGS(ht) & HASH_FLAG_INITIALIZED)) { ht->arData = NULL; return; } if (IS_SERIALIZED(ht->arData)) { return; } SERIALIZE_PTR(ht->arData); p = ht->arData; UNSERIALIZE_PTR(p); end = p + ht->nNumUsed; while (p < end) { if (Z_TYPE(p->val) != IS_UNDEF) { SERIALIZE_STR(p->key); func(&p->val, script, info, buf); } p++; } } static void zend_file_cache_serialize_ast(zend_ast *ast, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { uint32_t i; zend_ast *tmp; if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) { zend_file_cache_serialize_zval(&((zend_ast_zval*)ast)->val, script, info, buf); } else if (zend_ast_is_list(ast)) { zend_ast_list *list = zend_ast_get_list(ast); for (i = 0; i < list->children; i++) { if (list->child[i] && !IS_SERIALIZED(list->child[i])) { SERIALIZE_PTR(list->child[i]); tmp = list->child[i]; UNSERIALIZE_PTR(tmp); zend_file_cache_serialize_ast(tmp, script, info, buf); } } } else { uint32_t children = zend_ast_get_num_children(ast); for (i = 0; i < children; i++) { if (ast->child[i] && !IS_SERIALIZED(ast->child[i])) { SERIALIZE_PTR(ast->child[i]); tmp = ast->child[i]; UNSERIALIZE_PTR(tmp); zend_file_cache_serialize_ast(tmp, script, info, buf); } } } } static void zend_file_cache_serialize_zval(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { switch (Z_TYPE_P(zv)) { case IS_STRING: if (!IS_SERIALIZED(Z_STR_P(zv))) { SERIALIZE_STR(Z_STR_P(zv)); } break; case IS_ARRAY: if (!IS_SERIALIZED(Z_ARR_P(zv))) { HashTable *ht; SERIALIZE_PTR(Z_ARR_P(zv)); ht = Z_ARR_P(zv); UNSERIALIZE_PTR(ht); zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval); } break; case IS_REFERENCE: if (!IS_SERIALIZED(Z_REF_P(zv))) { zend_reference *ref; SERIALIZE_PTR(Z_REF_P(zv)); ref = Z_REF_P(zv); UNSERIALIZE_PTR(ref); zend_file_cache_serialize_zval(&ref->val, script, info, buf); } break; case IS_CONSTANT_AST: if (!IS_SERIALIZED(Z_AST_P(zv))) { zend_ast_ref *ast; SERIALIZE_PTR(Z_AST_P(zv)); ast = Z_AST_P(zv); UNSERIALIZE_PTR(ast); zend_file_cache_serialize_ast(GC_AST(ast), script, info, buf); } break; } } static void zend_file_cache_serialize_op_array(zend_op_array *op_array, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { if (op_array->static_variables && !IS_SERIALIZED(op_array->static_variables)) { HashTable *ht; SERIALIZE_PTR(op_array->static_variables); ht = op_array->static_variables; UNSERIALIZE_PTR(ht); zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval); } if (op_array->scope && !IS_SERIALIZED(op_array->opcodes)) { if (UNEXPECTED(zend_shared_alloc_get_xlat_entry(op_array->opcodes))) { op_array->refcount = (uint32_t*)(intptr_t)-1; SERIALIZE_PTR(op_array->literals); SERIALIZE_PTR(op_array->opcodes); SERIALIZE_PTR(op_array->arg_info); SERIALIZE_PTR(op_array->vars); SERIALIZE_STR(op_array->function_name); SERIALIZE_STR(op_array->filename); SERIALIZE_PTR(op_array->live_range); SERIALIZE_PTR(op_array->scope); SERIALIZE_STR(op_array->doc_comment); SERIALIZE_PTR(op_array->try_catch_array); SERIALIZE_PTR(op_array->prototype); return; } zend_shared_alloc_register_xlat_entry(op_array->opcodes, op_array->opcodes); } if (op_array->literals && !IS_SERIALIZED(op_array->literals)) { zval *p, *end; SERIALIZE_PTR(op_array->literals); p = op_array->literals; UNSERIALIZE_PTR(p); end = p + op_array->last_literal; while (p < end) { zend_file_cache_serialize_zval(p, script, info, buf); p++; } } if (!IS_SERIALIZED(op_array->opcodes)) { zend_op *opline, *end; #if !ZEND_USE_ABS_CONST_ADDR zval *literals = op_array->literals; UNSERIALIZE_PTR(literals); #endif SERIALIZE_PTR(op_array->opcodes); opline = op_array->opcodes; UNSERIALIZE_PTR(opline); end = opline + op_array->last; while (opline < end) { #if ZEND_USE_ABS_CONST_ADDR if (opline->op1_type == IS_CONST) { SERIALIZE_PTR(opline->op1.zv); } if (opline->op2_type == IS_CONST) { SERIALIZE_PTR(opline->op2.zv); } #else if (opline->op1_type == IS_CONST) { opline->op1.constant = RT_CONSTANT(opline, opline->op1) - literals; } if (opline->op2_type == IS_CONST) { opline->op2.constant = RT_CONSTANT(opline, opline->op2) - literals; } #endif #if ZEND_USE_ABS_JMP_ADDR switch (opline->opcode) { case ZEND_JMP: case ZEND_FAST_CALL: SERIALIZE_PTR(opline->op1.jmp_addr); break; case ZEND_JMPZNZ: /* relative extended_value don't have to be changed */ /* break omitted intentionally */ case ZEND_JMPZ: case ZEND_JMPNZ: case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: case ZEND_COALESCE: case ZEND_FE_RESET_R: case ZEND_FE_RESET_RW: case ZEND_ASSERT_CHECK: SERIALIZE_PTR(opline->op2.jmp_addr); break; case ZEND_CATCH: if (!(opline->extended_value & ZEND_LAST_CATCH)) { SERIALIZE_PTR(opline->op2.jmp_addr); } break; case ZEND_DECLARE_ANON_CLASS: case ZEND_DECLARE_ANON_INHERITED_CLASS: case ZEND_FE_FETCH_R: case ZEND_FE_FETCH_RW: case ZEND_SWITCH_LONG: case ZEND_SWITCH_STRING: /* relative extended_value don't have to be changed */ break; } #endif zend_serialize_opcode_handler(opline); opline++; } if (op_array->arg_info) { zend_arg_info *p, *end; SERIALIZE_PTR(op_array->arg_info); p = op_array->arg_info; UNSERIALIZE_PTR(p); end = p + op_array->num_args; if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { p--; } if (op_array->fn_flags & ZEND_ACC_VARIADIC) { end++; } while (p < end) { if (!IS_SERIALIZED(p->name)) { SERIALIZE_STR(p->name); } if (ZEND_TYPE_IS_CLASS(p->type)) { zend_bool allow_null = ZEND_TYPE_ALLOW_NULL(p->type); zend_string *type_name = ZEND_TYPE_NAME(p->type); SERIALIZE_STR(type_name); p->type = (Z_UL(1) << (sizeof(zend_type)*8-1)) | /* type is class */ (allow_null ? (Z_UL(1) << (sizeof(zend_type)*8-2)) : Z_UL(0)) | /* type allow null */ (zend_type)type_name; } p++; } } if (op_array->vars) { zend_string **p, **end; SERIALIZE_PTR(op_array->vars); p = op_array->vars; UNSERIALIZE_PTR(p); end = p + op_array->last_var; while (p < end) { if (!IS_SERIALIZED(*p)) { SERIALIZE_STR(*p); } p++; } } SERIALIZE_STR(op_array->function_name); SERIALIZE_STR(op_array->filename); SERIALIZE_PTR(op_array->live_range); SERIALIZE_PTR(op_array->scope); SERIALIZE_STR(op_array->doc_comment); SERIALIZE_PTR(op_array->try_catch_array); SERIALIZE_PTR(op_array->prototype); ZEND_MAP_PTR_INIT(op_array->static_variables_ptr, &op_array->static_variables); if (op_array->fn_flags & ZEND_ACC_IMMUTABLE) { ZEND_MAP_PTR_INIT(op_array->run_time_cache, NULL); } else { SERIALIZE_PTR(ZEND_MAP_PTR(op_array->run_time_cache)); } } } static void zend_file_cache_serialize_func(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { zend_op_array *op_array; SERIALIZE_PTR(Z_PTR_P(zv)); op_array = Z_PTR_P(zv); UNSERIALIZE_PTR(op_array); zend_file_cache_serialize_op_array(op_array, script, info, buf); } static void zend_file_cache_serialize_prop_info(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { if (!IS_SERIALIZED(Z_PTR_P(zv))) { zend_property_info *prop; SERIALIZE_PTR(Z_PTR_P(zv)); prop = Z_PTR_P(zv); UNSERIALIZE_PTR(prop); ZEND_ASSERT(prop->ce != NULL && prop->name != NULL); if (!IS_SERIALIZED(prop->ce)) { SERIALIZE_PTR(prop->ce); SERIALIZE_STR(prop->name); if (prop->doc_comment) { SERIALIZE_STR(prop->doc_comment); } } } } static void zend_file_cache_serialize_class_constant(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { if (!IS_SERIALIZED(Z_PTR_P(zv))) { zend_class_constant *c; SERIALIZE_PTR(Z_PTR_P(zv)); c = Z_PTR_P(zv); UNSERIALIZE_PTR(c); ZEND_ASSERT(c->ce != NULL); if (!IS_SERIALIZED(c->ce)) { SERIALIZE_PTR(c->ce); zend_file_cache_serialize_zval(&c->value, script, info, buf); if (c->doc_comment) { SERIALIZE_STR(c->doc_comment); } } } } static void zend_file_cache_serialize_class(zval *zv, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { zend_class_entry *ce; zend_class_entry *parent = NULL; SERIALIZE_PTR(Z_PTR_P(zv)); ce = Z_PTR_P(zv); UNSERIALIZE_PTR(ce); SERIALIZE_STR(ce->name); if (ce->parent) { if (!(ce->ce_flags & ZEND_ACC_LINKED)) { SERIALIZE_STR(ce->parent_name); } else { parent = ce->parent; SERIALIZE_PTR(ce->parent); } } zend_file_cache_serialize_hash(&ce->function_table, script, info, buf, zend_file_cache_serialize_func); if (ce->default_properties_table) { zval *p, *end; SERIALIZE_PTR(ce->default_properties_table); p = ce->default_properties_table; UNSERIALIZE_PTR(p); end = p + ce->default_properties_count; while (p < end) { zend_file_cache_serialize_zval(p, script, info, buf); p++; } } if (ce->default_static_members_table) { zval *table, *p, *end; SERIALIZE_PTR(ce->default_static_members_table); table = ce->default_static_members_table; UNSERIALIZE_PTR(table); /* Serialize only static properties in this class. * Static properties from parent classes will be handled in class_copy_ctor */ p = table + (parent ? parent->default_static_members_count : 0); end = table + ce->default_static_members_count; while (p < end) { zend_file_cache_serialize_zval(p, script, info, buf); p++; } } zend_file_cache_serialize_hash(&ce->constants_table, script, info, buf, zend_file_cache_serialize_class_constant); SERIALIZE_STR(ce->info.user.filename); SERIALIZE_STR(ce->info.user.doc_comment); zend_file_cache_serialize_hash(&ce->properties_info, script, info, buf, zend_file_cache_serialize_prop_info); if (ce->num_interfaces) { uint32_t i; zend_class_name *interface_names; ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_LINKED)); SERIALIZE_PTR(ce->interface_names); interface_names = ce->interface_names; UNSERIALIZE_PTR(interface_names); for (i = 0; i < ce->num_interfaces; i++) { SERIALIZE_STR(interface_names[i].name); SERIALIZE_STR(interface_names[i].lc_name); } } if (ce->num_traits) { uint32_t i; zend_class_name *trait_names; SERIALIZE_PTR(ce->trait_names); trait_names = ce->trait_names; UNSERIALIZE_PTR(trait_names); for (i = 0; i < ce->num_traits; i++) { SERIALIZE_STR(trait_names[i].name); SERIALIZE_STR(trait_names[i].lc_name); } if (ce->trait_aliases) { zend_trait_alias **p, *q; SERIALIZE_PTR(ce->trait_aliases); p = ce->trait_aliases; UNSERIALIZE_PTR(p); while (*p) { SERIALIZE_PTR(*p); q = *p; UNSERIALIZE_PTR(q); if (q->trait_method.method_name) { SERIALIZE_STR(q->trait_method.method_name); } if (q->trait_method.class_name) { SERIALIZE_STR(q->trait_method.class_name); } if (q->alias) { SERIALIZE_STR(q->alias); } p++; } } if (ce->trait_precedences) { zend_trait_precedence **p, *q; int j; SERIALIZE_PTR(ce->trait_precedences); p = ce->trait_precedences; UNSERIALIZE_PTR(p); while (*p) { SERIALIZE_PTR(*p); q = *p; UNSERIALIZE_PTR(q); if (q->trait_method.method_name) { SERIALIZE_STR(q->trait_method.method_name); } if (q->trait_method.class_name) { SERIALIZE_STR(q->trait_method.class_name); } for (j = 0; j < q->num_excludes; j++) { SERIALIZE_STR(q->exclude_class_names[j]); } p++; } } } SERIALIZE_PTR(ce->constructor); SERIALIZE_PTR(ce->destructor); SERIALIZE_PTR(ce->clone); SERIALIZE_PTR(ce->__get); SERIALIZE_PTR(ce->__set); SERIALIZE_PTR(ce->__call); SERIALIZE_PTR(ce->serialize_func); SERIALIZE_PTR(ce->unserialize_func); SERIALIZE_PTR(ce->__isset); SERIALIZE_PTR(ce->__unset); SERIALIZE_PTR(ce->__tostring); SERIALIZE_PTR(ce->__callstatic); SERIALIZE_PTR(ce->__debugInfo); if (ce->iterator_funcs_ptr) { SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_new_iterator); SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_rewind); SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_valid); SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_key); SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_current); SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_next); SERIALIZE_PTR(ce->iterator_funcs_ptr); } ZEND_MAP_PTR_INIT(ce->static_members_table, &ce->default_static_members_table); } static void zend_file_cache_serialize(zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) { zend_persistent_script *new_script; memcpy(info->magic, "OPCACHE", 8); memcpy(info->system_id, ZCG(system_id), 32); info->mem_size = script->size; info->str_size = 0; info->script_offset = (char*)script - (char*)script->mem; info->timestamp = script->timestamp; memcpy(buf, script->mem, script->size); new_script = (zend_persistent_script*)((char*)buf + info->script_offset); SERIALIZE_STR(new_script->script.filename); zend_file_cache_serialize_hash(&new_script->script.class_table, script, info, buf, zend_file_cache_serialize_class); zend_file_cache_serialize_hash(&new_script->script.function_table, script, info, buf, zend_file_cache_serialize_func); zend_file_cache_serialize_op_array(&new_script->script.main_op_array, script, info, buf); SERIALIZE_PTR(new_script->arena_mem); new_script->mem = NULL; } static char *zend_file_cache_get_bin_file_path(zend_string *script_path) { size_t len; char *filename; #ifndef ZEND_WIN32 len = strlen(ZCG(accel_directives).file_cache); filename = emalloc(len + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX)); memcpy(filename, ZCG(accel_directives).file_cache, len); filename[len] = '/'; memcpy(filename + len + 1, ZCG(system_id), 32); memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path)); memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX)); #else PHP_MD5_CTX ctx; char md5uname[32]; unsigned char digest[16], c; size_t i; char *uname = php_win32_get_username(); PHP_MD5Init(&ctx); PHP_MD5Update(&ctx, uname, strlen(uname)); PHP_MD5Final(digest, &ctx); for (i = 0; i < 16; i++) { c = digest[i] >> 4; c = (c <= 9) ? c + '0' : c - 10 + 'a'; md5uname[i * 2] = c; c = digest[i] & 0x0f; c = (c <= 9) ? c + '0' : c - 10 + 'a'; md5uname[(i * 2) + 1] = c; } len = strlen(ZCG(accel_directives).file_cache); filename = emalloc(len + 33 + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX)); memcpy(filename, ZCG(accel_directives).file_cache, len); filename[len] = '\\'; memcpy(filename + 1 + len, md5uname, 32); len += 32; filename[len] = '\\'; memcpy(filename + len + 1, ZCG(system_id), 32); if (ZSTR_LEN(script_path) >= 2 && ':' == ZSTR_VAL(script_path)[1]) { /* local fs */ *(filename + len + 33) = '\\'; *(filename + len + 34) = ZSTR_VAL(script_path)[0]; memcpy(filename + len + 35, ZSTR_VAL(script_path) + 2, ZSTR_LEN(script_path) - 2); memcpy(filename + len + 35 + ZSTR_LEN(script_path) - 2, SUFFIX, sizeof(SUFFIX)); } else { /* network path */ memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path)); memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX)); } free(uname); #endif return filename; } int zend_file_cache_script_store(zend_persistent_script *script, int in_shm) { int fd; char *filename; zend_file_cache_metainfo info; #ifdef HAVE_SYS_UIO_H struct iovec vec[3]; #endif void *mem, *buf; filename = zend_file_cache_get_bin_file_path(script->script.filename); if (zend_file_cache_mkdir(filename, strlen(ZCG(accel_directives).file_cache)) != SUCCESS) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot create directory for file '%s', %s\n", filename, strerror(errno)); efree(filename); return FAILURE; } fd = zend_file_cache_open(filename, O_CREAT | O_EXCL | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR); if (fd < 0) { if (errno != EEXIST) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot create file '%s', %s\n", filename, strerror(errno)); } efree(filename); return FAILURE; } if (zend_file_cache_flock(fd, LOCK_EX) != 0) { close(fd); efree(filename); return FAILURE; } #if defined(__AVX__) || defined(__SSE2__) /* Align to 64-byte boundary */ mem = emalloc(script->size + 64); buf = (void*)(((zend_uintptr_t)mem + 63L) & ~63L); #else mem = buf = emalloc(script->size); #endif ZCG(mem) = zend_string_alloc(4096 - (_ZSTR_HEADER_SIZE + 1), 0); zend_shared_alloc_init_xlat_table(); if (!in_shm) { script->corrupted = 1; /* used to check if script restored to SHM or process memory */ } zend_file_cache_serialize(script, &info, buf); if (!in_shm) { script->corrupted = 0; } zend_shared_alloc_destroy_xlat_table(); info.checksum = zend_adler32(ADLER32_INIT, buf, script->size); info.checksum = zend_adler32(info.checksum, (signed char*)ZSTR_VAL((zend_string*)ZCG(mem)), info.str_size); #ifdef HAVE_SYS_UIO_H vec[0].iov_base = &info; vec[0].iov_len = sizeof(info); vec[1].iov_base = buf; vec[1].iov_len = script->size; vec[2].iov_base = ZSTR_VAL((zend_string*)ZCG(mem)); vec[2].iov_len = info.str_size; if (writev(fd, vec, 3) != (ssize_t)(sizeof(info) + script->size + info.str_size)) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot write to file '%s'\n", filename); zend_string_release_ex((zend_string*)ZCG(mem), 0); close(fd); efree(mem); zend_file_cache_unlink(filename); efree(filename); return FAILURE; } #else if (ZEND_LONG_MAX < (zend_long)(sizeof(info) + script->size + info.str_size) || write(fd, &info, sizeof(info)) != sizeof(info) || write(fd, buf, script->size) != script->size || write(fd, ((zend_string*)ZCG(mem))->val, info.str_size) != info.str_size ) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot write to file '%s'\n", filename); zend_string_release_ex((zend_string*)ZCG(mem), 0); close(fd); efree(mem); zend_file_cache_unlink(filename); efree(filename); return FAILURE; } #endif zend_string_release_ex((zend_string*)ZCG(mem), 0); efree(mem); if (zend_file_cache_flock(fd, LOCK_UN) != 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot unlock file '%s'\n", filename); } close(fd); efree(filename); return SUCCESS; } static void zend_file_cache_unserialize_hash(HashTable *ht, zend_persistent_script *script, void *buf, unserialize_callback_t func, dtor_func_t dtor) { Bucket *p, *end; ht->pDestructor = dtor; if (!(HT_FLAGS(ht) & HASH_FLAG_INITIALIZED)) { if (EXPECTED(!file_cache_only)) { HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket)); } else { HT_SET_DATA_ADDR(ht, &uninitialized_bucket); } return; } if (IS_UNSERIALIZED(ht->arData)) { return; } UNSERIALIZE_PTR(ht->arData); p = ht->arData; end = p + ht->nNumUsed; while (p < end) { if (Z_TYPE(p->val) != IS_UNDEF) { UNSERIALIZE_STR(p->key); func(&p->val, script, buf); } p++; } } static void zend_file_cache_unserialize_ast(zend_ast *ast, zend_persistent_script *script, void *buf) { uint32_t i; if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) { zend_file_cache_unserialize_zval(&((zend_ast_zval*)ast)->val, script, buf); } else if (zend_ast_is_list(ast)) { zend_ast_list *list = zend_ast_get_list(ast); for (i = 0; i < list->children; i++) { if (list->child[i] && !IS_UNSERIALIZED(list->child[i])) { UNSERIALIZE_PTR(list->child[i]); zend_file_cache_unserialize_ast(list->child[i], script, buf); } } } else { uint32_t children = zend_ast_get_num_children(ast); for (i = 0; i < children; i++) { if (ast->child[i] && !IS_UNSERIALIZED(ast->child[i])) { UNSERIALIZE_PTR(ast->child[i]); zend_file_cache_unserialize_ast(ast->child[i], script, buf); } } } } static void zend_file_cache_unserialize_zval(zval *zv, zend_persistent_script *script, void *buf) { switch (Z_TYPE_P(zv)) { case IS_STRING: if (!IS_UNSERIALIZED(Z_STR_P(zv))) { UNSERIALIZE_STR(Z_STR_P(zv)); } break; case IS_ARRAY: if (!IS_UNSERIALIZED(Z_ARR_P(zv))) { HashTable *ht; UNSERIALIZE_PTR(Z_ARR_P(zv)); ht = Z_ARR_P(zv); zend_file_cache_unserialize_hash(ht, script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR); } break; case IS_REFERENCE: if (!IS_UNSERIALIZED(Z_REF_P(zv))) { zend_reference *ref; UNSERIALIZE_PTR(Z_REF_P(zv)); ref = Z_REF_P(zv); zend_file_cache_unserialize_zval(&ref->val, script, buf); } break; case IS_CONSTANT_AST: if (!IS_UNSERIALIZED(Z_AST_P(zv))) { UNSERIALIZE_PTR(Z_AST_P(zv)); zend_file_cache_unserialize_ast(Z_ASTVAL_P(zv), script, buf); } break; } } static void zend_file_cache_unserialize_op_array(zend_op_array *op_array, zend_persistent_script *script, void *buf) { if (op_array->static_variables && !IS_UNSERIALIZED(op_array->static_variables)) { HashTable *ht; UNSERIALIZE_PTR(op_array->static_variables); ht = op_array->static_variables; zend_file_cache_unserialize_hash(ht, script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR); } if (op_array->refcount) { op_array->refcount = NULL; UNSERIALIZE_PTR(op_array->literals); UNSERIALIZE_PTR(op_array->opcodes); UNSERIALIZE_PTR(op_array->arg_info); UNSERIALIZE_PTR(op_array->vars); UNSERIALIZE_STR(op_array->function_name); UNSERIALIZE_STR(op_array->filename); UNSERIALIZE_PTR(op_array->live_range); UNSERIALIZE_PTR(op_array->scope); UNSERIALIZE_STR(op_array->doc_comment); UNSERIALIZE_PTR(op_array->try_catch_array); UNSERIALIZE_PTR(op_array->prototype); return; } if (op_array->literals && !IS_UNSERIALIZED(op_array->literals)) { zval *p, *end; UNSERIALIZE_PTR(op_array->literals); p = op_array->literals; end = p + op_array->last_literal; while (p < end) { zend_file_cache_unserialize_zval(p, script, buf); p++; } } if (!IS_UNSERIALIZED(op_array->opcodes)) { zend_op *opline, *end; UNSERIALIZE_PTR(op_array->opcodes); opline = op_array->opcodes; end = opline + op_array->last; while (opline < end) { #if ZEND_USE_ABS_CONST_ADDR if (opline->op1_type == IS_CONST) { UNSERIALIZE_PTR(opline->op1.zv); } if (opline->op2_type == IS_CONST) { UNSERIALIZE_PTR(opline->op2.zv); } #else if (opline->op1_type == IS_CONST) { ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op1); } if (opline->op2_type == IS_CONST) { ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op2); } #endif #if ZEND_USE_ABS_JMP_ADDR switch (opline->opcode) { case ZEND_JMP: case ZEND_FAST_CALL: UNSERIALIZE_PTR(opline->op1.jmp_addr); break; case ZEND_JMPZNZ: /* relative extended_value don't have to be changed */ /* break omitted intentionally */ case ZEND_JMPZ: case ZEND_JMPNZ: case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: case ZEND_COALESCE: case ZEND_FE_RESET_R: case ZEND_FE_RESET_RW: case ZEND_ASSERT_CHECK: UNSERIALIZE_PTR(opline->op2.jmp_addr); break; case ZEND_CATCH: if (!(opline->extended_value & ZEND_LAST_CATCH)) { UNSERIALIZE_PTR(opline->op2.jmp_addr); } break; case ZEND_DECLARE_ANON_CLASS: case ZEND_DECLARE_ANON_INHERITED_CLASS: case ZEND_FE_FETCH_R: case ZEND_FE_FETCH_RW: case ZEND_SWITCH_LONG: case ZEND_SWITCH_STRING: /* relative extended_value don't have to be changed */ break; } #endif zend_deserialize_opcode_handler(opline); opline++; } if (op_array->arg_info) { zend_arg_info *p, *end; UNSERIALIZE_PTR(op_array->arg_info); p = op_array->arg_info; end = p + op_array->num_args; if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { p--; } if (op_array->fn_flags & ZEND_ACC_VARIADIC) { end++; } while (p < end) { if (!IS_UNSERIALIZED(p->name)) { UNSERIALIZE_STR(p->name); } if (p->type & (Z_UL(1) << (sizeof(zend_type)*8-1))) { /* type is class */ zend_bool allow_null = (p->type & (Z_UL(1) << (sizeof(zend_type)*8-2))) != 0; /* type allow null */ zend_string *type_name = (zend_string*)(p->type & ~(((Z_UL(1) << (sizeof(zend_type)*8-1))) | ((Z_UL(1) << (sizeof(zend_type)*8-2))))); UNSERIALIZE_STR(type_name); p->type = ZEND_TYPE_ENCODE_CLASS(type_name, allow_null); } p++; } } if (op_array->vars) { zend_string **p, **end; UNSERIALIZE_PTR(op_array->vars); p = op_array->vars; end = p + op_array->last_var; while (p < end) { if (!IS_UNSERIALIZED(*p)) { UNSERIALIZE_STR(*p); } p++; } } UNSERIALIZE_STR(op_array->function_name); UNSERIALIZE_STR(op_array->filename); UNSERIALIZE_PTR(op_array->live_range); UNSERIALIZE_PTR(op_array->scope); UNSERIALIZE_STR(op_array->doc_comment); UNSERIALIZE_PTR(op_array->try_catch_array); UNSERIALIZE_PTR(op_array->prototype); if (op_array->fn_flags & ZEND_ACC_IMMUTABLE) { if (op_array->static_variables) { ZEND_MAP_PTR_NEW(op_array->static_variables_ptr); } else { ZEND_MAP_PTR_INIT(op_array->static_variables_ptr, &op_array->static_variables); } ZEND_MAP_PTR_NEW(op_array->run_time_cache); } else { ZEND_MAP_PTR_INIT(op_array->static_variables_ptr, &op_array->static_variables); UNSERIALIZE_PTR(ZEND_MAP_PTR(op_array->run_time_cache)); } } } static void zend_file_cache_unserialize_func(zval *zv, zend_persistent_script *script, void *buf) { zend_op_array *op_array; UNSERIALIZE_PTR(Z_PTR_P(zv)); op_array = Z_PTR_P(zv); zend_file_cache_unserialize_op_array(op_array, script, buf); } static void zend_file_cache_unserialize_prop_info(zval *zv, zend_persistent_script *script, void *buf) { if (!IS_UNSERIALIZED(Z_PTR_P(zv))) { zend_property_info *prop; UNSERIALIZE_PTR(Z_PTR_P(zv)); prop = Z_PTR_P(zv); ZEND_ASSERT(prop->ce != NULL && prop->name != NULL); if (!IS_UNSERIALIZED(prop->ce)) { UNSERIALIZE_PTR(prop->ce); UNSERIALIZE_STR(prop->name); if (prop->doc_comment) { UNSERIALIZE_STR(prop->doc_comment); } } } } static void zend_file_cache_unserialize_class_constant(zval *zv, zend_persistent_script *script, void *buf) { if (!IS_UNSERIALIZED(Z_PTR_P(zv))) { zend_class_constant *c; UNSERIALIZE_PTR(Z_PTR_P(zv)); c = Z_PTR_P(zv); ZEND_ASSERT(c->ce != NULL); if (!IS_UNSERIALIZED(c->ce)) { UNSERIALIZE_PTR(c->ce); zend_file_cache_unserialize_zval(&c->value, script, buf); if (c->doc_comment) { UNSERIALIZE_STR(c->doc_comment); } } } } static void zend_file_cache_unserialize_class(zval *zv, zend_persistent_script *script, void *buf) { zend_class_entry *ce; zend_class_entry *parent = NULL; UNSERIALIZE_PTR(Z_PTR_P(zv)); ce = Z_PTR_P(zv); UNSERIALIZE_STR(ce->name); if (ce->parent) { if (!(ce->ce_flags & ZEND_ACC_LINKED)) { UNSERIALIZE_STR(ce->parent_name); } else { UNSERIALIZE_PTR(ce->parent); parent = ce->parent; } } zend_file_cache_unserialize_hash(&ce->function_table, script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR); if (ce->default_properties_table) { zval *p, *end; UNSERIALIZE_PTR(ce->default_properties_table); p = ce->default_properties_table; end = p + ce->default_properties_count; while (p < end) { zend_file_cache_unserialize_zval(p, script, buf); p++; } } if (ce->default_static_members_table) { zval *table, *p, *end; /* Unserialize only static properties in this class. * Static properties from parent classes will be handled in class_copy_ctor */ UNSERIALIZE_PTR(ce->default_static_members_table); table = ce->default_static_members_table; p = table + (parent ? parent->default_static_members_count : 0); end = table + ce->default_static_members_count; while (p < end) { zend_file_cache_unserialize_zval(p, script, buf); p++; } } zend_file_cache_unserialize_hash(&ce->constants_table, script, buf, zend_file_cache_unserialize_class_constant, NULL); UNSERIALIZE_STR(ce->info.user.filename); UNSERIALIZE_STR(ce->info.user.doc_comment); zend_file_cache_unserialize_hash(&ce->properties_info, script, buf, zend_file_cache_unserialize_prop_info, NULL); if (ce->num_interfaces) { uint32_t i; ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_LINKED)); UNSERIALIZE_PTR(ce->interface_names); for (i = 0; i < ce->num_interfaces; i++) { UNSERIALIZE_STR(ce->interface_names[i].name); UNSERIALIZE_STR(ce->interface_names[i].lc_name); } } if (ce->num_traits) { uint32_t i; UNSERIALIZE_PTR(ce->trait_names); for (i = 0; i < ce->num_traits; i++) { UNSERIALIZE_STR(ce->trait_names[i].name); UNSERIALIZE_STR(ce->trait_names[i].lc_name); } if (ce->trait_aliases) { zend_trait_alias **p, *q; UNSERIALIZE_PTR(ce->trait_aliases); p = ce->trait_aliases; while (*p) { UNSERIALIZE_PTR(*p); q = *p; if (q->trait_method.method_name) { UNSERIALIZE_STR(q->trait_method.method_name); } if (q->trait_method.class_name) { UNSERIALIZE_STR(q->trait_method.class_name); } if (q->alias) { UNSERIALIZE_STR(q->alias); } p++; } } if (ce->trait_precedences) { zend_trait_precedence **p, *q; int j; UNSERIALIZE_PTR(ce->trait_precedences); p = ce->trait_precedences; while (*p) { UNSERIALIZE_PTR(*p); q = *p; if (q->trait_method.method_name) { UNSERIALIZE_STR(q->trait_method.method_name); } if (q->trait_method.class_name) { UNSERIALIZE_STR(q->trait_method.class_name); } for (j = 0; j < q->num_excludes; j++) { UNSERIALIZE_STR(q->exclude_class_names[j]); } p++; } } } UNSERIALIZE_PTR(ce->constructor); UNSERIALIZE_PTR(ce->destructor); UNSERIALIZE_PTR(ce->clone); UNSERIALIZE_PTR(ce->__get); UNSERIALIZE_PTR(ce->__set); UNSERIALIZE_PTR(ce->__call); UNSERIALIZE_PTR(ce->serialize_func); UNSERIALIZE_PTR(ce->unserialize_func); UNSERIALIZE_PTR(ce->__isset); UNSERIALIZE_PTR(ce->__unset); UNSERIALIZE_PTR(ce->__tostring); UNSERIALIZE_PTR(ce->__callstatic); UNSERIALIZE_PTR(ce->__debugInfo); if (UNEXPECTED((ce->ce_flags & ZEND_ACC_ANON_CLASS))) { ce->serialize = zend_class_serialize_deny; ce->unserialize = zend_class_unserialize_deny; } if (ce->iterator_funcs_ptr) { UNSERIALIZE_PTR(ce->iterator_funcs_ptr); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_new_iterator); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_rewind); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_valid); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_key); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_current); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_next); } if (ce->ce_flags & ZEND_ACC_IMMUTABLE && ce->default_static_members_table) { ZEND_MAP_PTR_NEW(ce->static_members_table); } else { ZEND_MAP_PTR_INIT(ce->static_members_table, &ce->default_static_members_table); } } static void zend_file_cache_unserialize(zend_persistent_script *script, void *buf) { script->mem = buf; UNSERIALIZE_STR(script->script.filename); zend_file_cache_unserialize_hash(&script->script.class_table, script, buf, zend_file_cache_unserialize_class, ZEND_CLASS_DTOR); zend_file_cache_unserialize_hash(&script->script.function_table, script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR); zend_file_cache_unserialize_op_array(&script->script.main_op_array, script, buf); UNSERIALIZE_PTR(script->arena_mem); } zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handle) { zend_string *full_path = file_handle->opened_path; int fd; char *filename; zend_persistent_script *script; zend_file_cache_metainfo info; zend_accel_hash_entry *bucket; void *mem, *checkpoint, *buf; int cache_it = 1; int ok; if (!full_path) { return NULL; } filename = zend_file_cache_get_bin_file_path(full_path); fd = zend_file_cache_open(filename, O_RDONLY | O_BINARY); if (fd < 0) { efree(filename); return NULL; } if (zend_file_cache_flock(fd, LOCK_SH) != 0) { close(fd); efree(filename); return NULL; } if (read(fd, &info, sizeof(info)) != sizeof(info)) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (info)\n", filename); zend_file_cache_flock(fd, LOCK_UN); close(fd); zend_file_cache_unlink(filename); efree(filename); return NULL; } /* verify header */ if (memcmp(info.magic, "OPCACHE", 8) != 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (wrong header)\n", filename); zend_file_cache_flock(fd, LOCK_UN); close(fd); zend_file_cache_unlink(filename); efree(filename); return NULL; } if (memcmp(info.system_id, ZCG(system_id), 32) != 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (wrong \"system_id\")\n", filename); zend_file_cache_flock(fd, LOCK_UN); close(fd); zend_file_cache_unlink(filename); efree(filename); return NULL; } /* verify timestamp */ if (ZCG(accel_directives).validate_timestamps && zend_get_file_handle_timestamp(file_handle, NULL) != info.timestamp) { if (zend_file_cache_flock(fd, LOCK_UN) != 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot unlock file '%s'\n", filename); } close(fd); zend_file_cache_unlink(filename); efree(filename); return NULL; } checkpoint = zend_arena_checkpoint(CG(arena)); #if defined(__AVX__) || defined(__SSE2__) /* Align to 64-byte boundary */ mem = zend_arena_alloc(&CG(arena), info.mem_size + info.str_size + 64); mem = (void*)(((zend_uintptr_t)mem + 63L) & ~63L); #else mem = zend_arena_alloc(&CG(arena), info.mem_size + info.str_size); #endif if (read(fd, mem, info.mem_size + info.str_size) != (ssize_t)(info.mem_size + info.str_size)) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (mem)\n", filename); zend_file_cache_flock(fd, LOCK_UN); close(fd); zend_file_cache_unlink(filename); zend_arena_release(&CG(arena), checkpoint); efree(filename); return NULL; } if (zend_file_cache_flock(fd, LOCK_UN) != 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot unlock file '%s'\n", filename); } close(fd); /* verify checksum */ if (ZCG(accel_directives).file_cache_consistency_checks && zend_adler32(ADLER32_INIT, mem, info.mem_size + info.str_size) != info.checksum) { zend_accel_error(ACCEL_LOG_WARNING, "corrupted file '%s'\n", filename); zend_file_cache_unlink(filename); zend_arena_release(&CG(arena), checkpoint); efree(filename); return NULL; } if (!file_cache_only && !ZCSG(restart_in_progress) && !ZSMMG(memory_exhausted) && accelerator_shm_read_lock() == SUCCESS) { /* exclusive lock */ zend_shared_alloc_lock(); /* Check if we still need to put the file into the cache (may be it was * already stored by another process. This final check is done under * exclusive lock) */ bucket = zend_accel_hash_find_entry(&ZCSG(hash), full_path); if (bucket) { script = (zend_persistent_script *)bucket->data; if (!script->corrupted) { zend_shared_alloc_unlock(); zend_arena_release(&CG(arena), checkpoint); efree(filename); return script; } } if (zend_accel_hash_is_full(&ZCSG(hash))) { zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!"); ZSMMG(memory_exhausted) = 1; zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH); zend_shared_alloc_unlock(); goto use_process_mem; } #if defined(__AVX__) || defined(__SSE2__) /* Align to 64-byte boundary */ buf = zend_shared_alloc(info.mem_size + 64); buf = (void*)(((zend_uintptr_t)buf + 63L) & ~63L); #else buf = zend_shared_alloc(info.mem_size); #endif if (!buf) { zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM); zend_shared_alloc_unlock(); goto use_process_mem; } memcpy(buf, mem, info.mem_size); zend_map_ptr_extend(ZCSG(map_ptr_last)); } else { use_process_mem: buf = mem; cache_it = 0; } ZCG(mem) = ((char*)mem + info.mem_size); script = (zend_persistent_script*)((char*)buf + info.script_offset); script->corrupted = !cache_it; /* used to check if script restored to SHM or process memory */ ok = 1; zend_try { zend_file_cache_unserialize(script, buf); } zend_catch { ok = 0; } zend_end_try(); if (!ok) { if (cache_it) { zend_shared_alloc_unlock(); goto use_process_mem; } else { zend_arena_release(&CG(arena), checkpoint); efree(filename); return NULL; } } script->corrupted = 0; if (cache_it) { ZCSG(map_ptr_last) = CG(map_ptr_last); script->dynamic_members.checksum = zend_accel_script_checksum(script); script->dynamic_members.last_used = ZCG(request_time); zend_accel_hash_update(&ZCSG(hash), ZSTR_VAL(script->script.filename), ZSTR_LEN(script->script.filename), 0, script); zend_shared_alloc_unlock(); zend_arena_release(&CG(arena), checkpoint); } efree(filename); return script; } void zend_file_cache_invalidate(zend_string *full_path) { char *filename; filename = zend_file_cache_get_bin_file_path(full_path); zend_file_cache_unlink(filename); efree(filename); } #endif /* HAVE_OPCACHE_FILE_CACHE */
905280.c
/* * Copyright (C) 2020 Intel Corporation * SPDX-License-Identifier: MIT */ #include "vmi.h" extern addr_t target_pagetable; extern addr_t start_rip; extern os_t os; extern int interrupted; extern page_mode_t pm; bool setup_vmi(vmi_instance_t *vmi, char* domain, uint64_t domid, char* json, bool init_events, bool init_paging) { printf("Init vmi, init_events: %i init_paging %i domain %s domid %lu json %s\n", init_events, init_paging, domain, domid, json); vmi_mode_t mode = (init_events ? VMI_INIT_EVENTS : 0) | (domain ? VMI_INIT_DOMAINNAME : VMI_INIT_DOMAINID); const void *d = domain ?: (void*)&domid; if ( VMI_FAILURE == vmi_init(vmi, VMI_XEN, d, mode, NULL, NULL) ) return false; if ( json ) { if ( VMI_OS_UNKNOWN == (os = vmi_init_os(*vmi, VMI_CONFIG_JSON_PATH, json, NULL)) ) { vmi_destroy(*vmi); return false; } pm = vmi_get_page_mode(*vmi, 0); } else if ( init_paging && VMI_PM_UNKNOWN == (pm = vmi_init_paging(*vmi, 0)) ) { vmi_destroy(*vmi); return false; } registers_t regs = {0}; if ( VMI_FAILURE == vmi_get_vcpuregs(*vmi, &regs, 0) ) { vmi_destroy(*vmi); return false; } target_pagetable = regs.x86.cr3; start_rip = regs.x86.rip; return true; } void loop(vmi_instance_t vmi) { if ( !vmi ) return; vmi_resume_vm(vmi); while (!interrupted) { if ( vmi_events_listen(vmi, 500) == VMI_FAILURE ) { fprintf(stderr, "Error in vmi_events_listen!\n"); break; } } interrupted = 0; }
631264.c
/*-----------------------------------------------------------------------*/ /* MMC/SDC (in SPI mode) control module (C)ChaN, 2007 */ /*-----------------------------------------------------------------------*/ /* Only rcvr_spi(), xmit_spi(), disk_timerproc() and some macros */ /* are platform dependent. */ /*-----------------------------------------------------------------------*/ /* * This file was modified from a sample available from the FatFs * web site. It was modified to work with an DK-TM4C123G development * board. */ #include <stdint.h> #include <stdbool.h> #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/rom.h" #include "driverlib/rom_map.h" #include "driverlib/ssi.h" #include "driverlib/sysctl.h" #include "fatfs/src/diskio.h" /* Definitions for MMC/SDC command */ #define CMD0 (0x40+0) /* GO_IDLE_STATE */ #define CMD1 (0x40+1) /* SEND_OP_COND */ #define CMD8 (0x40+8) /* SEND_IF_COND */ #define CMD9 (0x40+9) /* SEND_CSD */ #define CMD10 (0x40+10) /* SEND_CID */ #define CMD12 (0x40+12) /* STOP_TRANSMISSION */ #define CMD16 (0x40+16) /* SET_BLOCKLEN */ #define CMD17 (0x40+17) /* READ_SINGLE_BLOCK */ #define CMD18 (0x40+18) /* READ_MULTIPLE_BLOCK */ #define CMD23 (0x40+23) /* SET_BLOCK_COUNT */ #define CMD24 (0x40+24) /* WRITE_BLOCK */ #define CMD25 (0x40+25) /* WRITE_MULTIPLE_BLOCK */ #define CMD41 (0x40+41) /* SEND_OP_COND (ACMD) */ #define CMD55 (0x40+55) /* APP_CMD */ #define CMD58 (0x40+58) /* READ_OCR */ /* Peripheral definitions for DK-TM4C123G board */ // SSI port #define SDC_SSI_BASE SSI0_BASE #define SDC_SSI_SYSCTL_PERIPH SYSCTL_PERIPH_SSI0 // GPIO for SSI pins #define SDC_GPIO_PORT_BASE GPIO_PORTA_BASE #define SDC_GPIO_SYSCTL_PERIPH SYSCTL_PERIPH_GPIOA #define SDC_SSI_CLK GPIO_PIN_2 #define SDC_SSI_TX GPIO_PIN_5 #define SDC_SSI_RX GPIO_PIN_4 #define SDC_SSI_FSS GPIO_PIN_3 #define SDC_SSI_PINS (SDC_SSI_TX | SDC_SSI_RX | SDC_SSI_CLK | \ SDC_SSI_FSS) // asserts the CS pin to the card static void SELECT (void) { ROM_GPIOPinWrite(SDC_GPIO_PORT_BASE, SDC_SSI_FSS, 0); } // de-asserts the CS pin to the card static void DESELECT (void) { ROM_GPIOPinWrite(SDC_GPIO_PORT_BASE, SDC_SSI_FSS, SDC_SSI_FSS); } /*-------------------------------------------------------------------------- Module Private Functions ---------------------------------------------------------------------------*/ static volatile DSTATUS Stat = STA_NOINIT; /* Disk status */ static volatile BYTE Timer1, Timer2; /* 100Hz decrement timer */ static BYTE CardType; /* b0:MMC, b1:SDC, b2:Block addressing */ static BYTE PowerFlag = 0; /* indicates if "power" is on */ /*-----------------------------------------------------------------------*/ /* Transmit a byte to MMC via SPI (Platform dependent) */ /*-----------------------------------------------------------------------*/ static void xmit_spi(BYTE dat) { uint32_t ui32RcvDat; ROM_SSIDataPut(SDC_SSI_BASE, dat); /* Write the data to the tx fifo */ ROM_SSIDataGet(SDC_SSI_BASE, &ui32RcvDat); /* flush data read during the write */ } /*-----------------------------------------------------------------------*/ /* Receive a byte from MMC via SPI (Platform dependent) */ /*-----------------------------------------------------------------------*/ static BYTE rcvr_spi (void) { uint32_t ui32RcvDat; ROM_SSIDataPut(SDC_SSI_BASE, 0xFF); /* write dummy data */ ROM_SSIDataGet(SDC_SSI_BASE, &ui32RcvDat); /* read data frm rx fifo */ return (BYTE)ui32RcvDat; } static void rcvr_spi_m (BYTE *dst) { *dst = rcvr_spi(); } /*-----------------------------------------------------------------------*/ /* Wait for card ready */ /*-----------------------------------------------------------------------*/ static BYTE wait_ready (void) { BYTE res; Timer2 = 50; /* Wait for ready in timeout of 500ms */ rcvr_spi(); do res = rcvr_spi(); while ((res != 0xFF) && Timer2); return res; } /*-----------------------------------------------------------------------*/ /* Send 80 or so clock transitions with CS and DI held high. This is */ /* required after card power up to get it into SPI mode */ /*-----------------------------------------------------------------------*/ static void send_initial_clock_train(void) { unsigned int i; uint32_t ui32Dat; /* Ensure CS is held high. */ DESELECT(); /* Switch the SSI TX line to a GPIO and drive it high too. */ ROM_GPIOPinTypeGPIOOutput(SDC_GPIO_PORT_BASE, SDC_SSI_TX); ROM_GPIOPinWrite(SDC_GPIO_PORT_BASE, SDC_SSI_TX, SDC_SSI_TX); /* Send 10 bytes over the SSI. This causes the clock to wiggle the */ /* required number of times. */ for(i = 0 ; i < 10 ; i++) { /* Write DUMMY data. SSIDataPut() waits until there is room in the */ /* FIFO. */ ROM_SSIDataPut(SDC_SSI_BASE, 0xFF); /* Flush data read during data write. */ ROM_SSIDataGet(SDC_SSI_BASE, &ui32Dat); } /* Revert to hardware control of the SSI TX line. */ ROM_GPIOPinTypeSSI(SDC_GPIO_PORT_BASE, SDC_SSI_TX); } /*-----------------------------------------------------------------------*/ /* Power Control (Platform dependent) */ /*-----------------------------------------------------------------------*/ /* When the target system does not support socket power control, there */ /* is nothing to do in these functions and chk_power always returns 1. */ static void power_on (void) { /* * This doesn't really turn the power on, but initializes the * SSI port and pins needed to talk to the card. */ /* Enable the peripherals used to drive the SDC on SSI */ ROM_SysCtlPeripheralEnable(SDC_SSI_SYSCTL_PERIPH); ROM_SysCtlPeripheralEnable(SDC_GPIO_SYSCTL_PERIPH); /* * Configure the appropriate pins to be SSI instead of GPIO. The FSS (CS) * signal is directly driven to ensure that we can hold it low through a * complete transaction with the SD card. */ ROM_GPIOPinTypeSSI(SDC_GPIO_PORT_BASE, SDC_SSI_TX | SDC_SSI_RX | SDC_SSI_CLK); ROM_GPIOPinTypeGPIOOutput(SDC_GPIO_PORT_BASE, SDC_SSI_FSS); /* * Set the SSI output pins to 4MA drive strength and engage the * pull-up on the receive line. */ MAP_GPIOPadConfigSet(SDC_GPIO_PORT_BASE, SDC_SSI_RX, GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU); MAP_GPIOPadConfigSet(SDC_GPIO_PORT_BASE, SDC_SSI_CLK | SDC_SSI_TX | SDC_SSI_FSS, GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD); /* Configure the SSI0 port */ ROM_SSIConfigSetExpClk(SDC_SSI_BASE, ROM_SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 400000, 8); ROM_SSIEnable(SDC_SSI_BASE); /* Set DI and CS high and apply more than 74 pulses to SCLK for the card */ /* to be able to accept a native command. */ send_initial_clock_train(); PowerFlag = 1; } // set the SSI speed to the max setting static void set_max_speed(void) { unsigned long i; /* Disable the SSI */ ROM_SSIDisable(SDC_SSI_BASE); /* Set the maximum speed as half the system clock, with a max of 12.5 MHz. */ i = ROM_SysCtlClockGet() / 2; if(i > 12500000) { i = 12500000; } /* Configure the SSI0 port to run at 12.5MHz */ ROM_SSIConfigSetExpClk(SDC_SSI_BASE, ROM_SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, i, 8); /* Enable the SSI */ ROM_SSIEnable(SDC_SSI_BASE); } static void power_off (void) { PowerFlag = 0; } static int chk_power(void) /* Socket power state: 0=off, 1=on */ { return PowerFlag; } /*-----------------------------------------------------------------------*/ /* Receive a data packet from MMC */ /*-----------------------------------------------------------------------*/ static BOOL rcvr_datablock ( BYTE *buff, /* Data buffer to store received data */ UINT btr /* Byte count (must be even number) */ ) { BYTE token; Timer1 = 100; do { /* Wait for data packet in timeout of 100ms */ token = rcvr_spi(); } while ((token == 0xFF) && Timer1); if(token != 0xFE) return FALSE; /* If not valid data token, retutn with error */ do { /* Receive the data block into buffer */ rcvr_spi_m(buff++); rcvr_spi_m(buff++); } while (btr -= 2); rcvr_spi(); /* Discard CRC */ rcvr_spi(); return TRUE; /* Return with success */ } /*-----------------------------------------------------------------------*/ /* Send a data packet to MMC */ /*-----------------------------------------------------------------------*/ #if _READONLY == 0 static BOOL xmit_datablock ( const BYTE *buff, /* 512 byte data block to be transmitted */ BYTE token /* Data/Stop token */ ) { BYTE resp, wc; if (wait_ready() != 0xFF) return FALSE; xmit_spi(token); /* Xmit data token */ if (token != 0xFD) { /* Is data token */ wc = 0; do { /* Xmit the 512 byte data block to MMC */ xmit_spi(*buff++); xmit_spi(*buff++); } while (--wc); xmit_spi(0xFF); /* CRC (Dummy) */ xmit_spi(0xFF); resp = rcvr_spi(); /* Reveive data response */ if ((resp & 0x1F) != 0x05) /* If not accepted, return with error */ return FALSE; } return TRUE; } #endif /* _READONLY */ /*-----------------------------------------------------------------------*/ /* Send a command packet to MMC */ /*-----------------------------------------------------------------------*/ static BYTE send_cmd ( BYTE cmd, /* Command byte */ DWORD arg /* Argument */ ) { BYTE n, res; if (wait_ready() != 0xFF) return 0xFF; /* Send command packet */ xmit_spi(cmd); /* Command */ xmit_spi((BYTE)(arg >> 24)); /* Argument[31..24] */ xmit_spi((BYTE)(arg >> 16)); /* Argument[23..16] */ xmit_spi((BYTE)(arg >> 8)); /* Argument[15..8] */ xmit_spi((BYTE)arg); /* Argument[7..0] */ n = 0xff; if (cmd == CMD0) n = 0x95; /* CRC for CMD0(0) */ if (cmd == CMD8) n = 0x87; /* CRC for CMD8(0x1AA) */ xmit_spi(n); /* Receive command response */ if (cmd == CMD12) rcvr_spi(); /* Skip a stuff byte when stop reading */ n = 10; /* Wait for a valid response in timeout of 10 attempts */ do res = rcvr_spi(); while ((res & 0x80) && --n); return res; /* Return with the response value */ } /*-----------------------------------------------------------------------* * Send the special command used to terminate a multi-sector read. * * This is the only command which can be sent while the SDCard is sending * data. The SDCard spec indicates that the data transfer will stop 2 bytes * after the 6 byte CMD12 command is sent and that the card will then send * 0xFF for between 2 and 6 more bytes before the R1 response byte. This * response will be followed by another 0xFF byte. In testing, however, it * seems that some cards don't send the 2 to 6 0xFF bytes between the end of * data transmission and the response code. This function, therefore, merely * reads 10 bytes and, if the last one read is 0xFF, returns the value of the * latest non-0xFF byte as the response code. * *-----------------------------------------------------------------------*/ static BYTE send_cmd12 (void) { BYTE n, res, val; /* For CMD12, we don't wait for the card to be idle before we send * the new command. */ /* Send command packet - the argument for CMD12 is ignored. */ xmit_spi(CMD12); xmit_spi(0); xmit_spi(0); xmit_spi(0); xmit_spi(0); xmit_spi(0); /* Read up to 10 bytes from the card, remembering the value read if it's not 0xFF */ for(n = 0; n < 10; n++) { val = rcvr_spi(); if(val != 0xFF) { res = val; } } return res; /* Return with the response value */ } /*-------------------------------------------------------------------------- Public Functions ---------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/ /* Initialize Disk Drive */ /*-----------------------------------------------------------------------*/ DSTATUS disk_initialize ( BYTE drv /* Physical drive nmuber (0) */ ) { BYTE n, ty, ocr[4]; if (drv) return STA_NOINIT; /* Supports only single drive */ if (Stat & STA_NODISK) return Stat; /* No card in the socket */ power_on(); /* Force socket power on */ send_initial_clock_train(); /* Ensure the card is in SPI mode */ SELECT(); /* CS = L */ ty = 0; if (send_cmd(CMD0, 0) == 1) { /* Enter Idle state */ Timer1 = 100; /* Initialization timeout of 1000 msec */ if (send_cmd(CMD8, 0x1AA) == 1) { /* SDC Ver2+ */ for (n = 0; n < 4; n++) ocr[n] = rcvr_spi(); if (ocr[2] == 0x01 && ocr[3] == 0xAA) { /* The card can work at vdd range of 2.7-3.6V */ do { if (send_cmd(CMD55, 0) <= 1 && send_cmd(CMD41, 1UL << 30) == 0) break; /* ACMD41 with HCS bit */ } while (Timer1); if (Timer1 && send_cmd(CMD58, 0) == 0) { /* Check CCS bit */ for (n = 0; n < 4; n++) ocr[n] = rcvr_spi(); ty = (ocr[0] & 0x40) ? 6 : 2; } } } else { /* SDC Ver1 or MMC */ ty = (send_cmd(CMD55, 0) <= 1 && send_cmd(CMD41, 0) <= 1) ? 2 : 1; /* SDC : MMC */ do { if (ty == 2) { if (send_cmd(CMD55, 0) <= 1 && send_cmd(CMD41, 0) == 0) break; /* ACMD41 */ } else { if (send_cmd(CMD1, 0) == 0) break; /* CMD1 */ } } while (Timer1); if (!Timer1 || send_cmd(CMD16, 512) != 0) /* Select R/W block length */ ty = 0; } } CardType = ty; DESELECT(); /* CS = H */ rcvr_spi(); /* Idle (Release DO) */ if (ty) { /* Initialization succeded */ Stat &= ~STA_NOINIT; /* Clear STA_NOINIT */ set_max_speed(); } else { /* Initialization failed */ power_off(); } return Stat; } /*-----------------------------------------------------------------------*/ /* Get Disk Status */ /*-----------------------------------------------------------------------*/ DSTATUS disk_status ( BYTE drv /* Physical drive nmuber (0) */ ) { if (drv) return STA_NOINIT; /* Supports only single drive */ return Stat; } /*-----------------------------------------------------------------------*/ /* Read Sector(s) */ /*-----------------------------------------------------------------------*/ DRESULT disk_read ( BYTE drv, /* Physical drive nmuber (0) */ BYTE *buff, /* Pointer to the data buffer to store read data */ DWORD sector, /* Start sector number (LBA) */ BYTE count /* Sector count (1..255) */ ) { if (drv || !count) return RES_PARERR; if (Stat & STA_NOINIT) return RES_NOTRDY; if (!(CardType & 4)) sector *= 512; /* Convert to byte address if needed */ SELECT(); /* CS = L */ if (count == 1) { /* Single block read */ if ((send_cmd(CMD17, sector) == 0) /* READ_SINGLE_BLOCK */ && rcvr_datablock(buff, 512)) count = 0; } else { /* Multiple block read */ if (send_cmd(CMD18, sector) == 0) { /* READ_MULTIPLE_BLOCK */ do { if (!rcvr_datablock(buff, 512)) break; buff += 512; } while (--count); send_cmd12(); /* STOP_TRANSMISSION */ } } DESELECT(); /* CS = H */ rcvr_spi(); /* Idle (Release DO) */ return count ? RES_ERROR : RES_OK; } /*-----------------------------------------------------------------------*/ /* Write Sector(s) */ /*-----------------------------------------------------------------------*/ #if _READONLY == 0 DRESULT disk_write ( BYTE drv, /* Physical drive nmuber (0) */ const BYTE *buff, /* Pointer to the data to be written */ DWORD sector, /* Start sector number (LBA) */ BYTE count /* Sector count (1..255) */ ) { if (drv || !count) return RES_PARERR; if (Stat & STA_NOINIT) return RES_NOTRDY; if (Stat & STA_PROTECT) return RES_WRPRT; if (!(CardType & 4)) sector *= 512; /* Convert to byte address if needed */ SELECT(); /* CS = L */ if (count == 1) { /* Single block write */ if ((send_cmd(CMD24, sector) == 0) /* WRITE_BLOCK */ && xmit_datablock(buff, 0xFE)) count = 0; } else { /* Multiple block write */ if (CardType & 2) { send_cmd(CMD55, 0); send_cmd(CMD23, count); /* ACMD23 */ } if (send_cmd(CMD25, sector) == 0) { /* WRITE_MULTIPLE_BLOCK */ do { if (!xmit_datablock(buff, 0xFC)) break; buff += 512; } while (--count); if (!xmit_datablock(0, 0xFD)) /* STOP_TRAN token */ count = 1; } } DESELECT(); /* CS = H */ rcvr_spi(); /* Idle (Release DO) */ return count ? RES_ERROR : RES_OK; } #endif /* _READONLY */ /*-----------------------------------------------------------------------*/ /* Miscellaneous Functions */ /*-----------------------------------------------------------------------*/ DRESULT disk_ioctl ( BYTE drv, /* Physical drive nmuber (0) */ BYTE ctrl, /* Control code */ void *buff /* Buffer to send/receive control data */ ) { DRESULT res; BYTE n, csd[16], *ptr = buff; WORD csize; if (drv) return RES_PARERR; res = RES_ERROR; if (ctrl == CTRL_POWER) { switch (*ptr) { case 0: /* Sub control code == 0 (POWER_OFF) */ if (chk_power()) power_off(); /* Power off */ res = RES_OK; break; case 1: /* Sub control code == 1 (POWER_ON) */ power_on(); /* Power on */ res = RES_OK; break; case 2: /* Sub control code == 2 (POWER_GET) */ *(ptr+1) = (BYTE)chk_power(); res = RES_OK; break; default : res = RES_PARERR; } } else { if (Stat & STA_NOINIT) return RES_NOTRDY; SELECT(); /* CS = L */ switch (ctrl) { case GET_SECTOR_COUNT : /* Get number of sectors on the disk (DWORD) */ if ((send_cmd(CMD9, 0) == 0) && rcvr_datablock(csd, 16)) { if ((csd[0] >> 6) == 1) { /* SDC ver 2.00 */ csize = csd[9] + ((WORD)csd[8] << 8) + 1; *(DWORD*)buff = (DWORD)csize << 10; } else { /* MMC or SDC ver 1.XX */ n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2; csize = (csd[8] >> 6) + ((WORD)csd[7] << 2) + ((WORD)(csd[6] & 3) << 10) + 1; *(DWORD*)buff = (DWORD)csize << (n - 9); } res = RES_OK; } break; case GET_SECTOR_SIZE : /* Get sectors on the disk (WORD) */ *(WORD*)buff = 512; res = RES_OK; break; case CTRL_SYNC : /* Make sure that data has been written */ if (wait_ready() == 0xFF) res = RES_OK; break; case MMC_GET_CSD : /* Receive CSD as a data block (16 bytes) */ if (send_cmd(CMD9, 0) == 0 /* READ_CSD */ && rcvr_datablock(ptr, 16)) res = RES_OK; break; case MMC_GET_CID : /* Receive CID as a data block (16 bytes) */ if (send_cmd(CMD10, 0) == 0 /* READ_CID */ && rcvr_datablock(ptr, 16)) res = RES_OK; break; case MMC_GET_OCR : /* Receive OCR as an R3 resp (4 bytes) */ if (send_cmd(CMD58, 0) == 0) { /* READ_OCR */ for (n = 0; n < 4; n++) *ptr++ = rcvr_spi(); res = RES_OK; } // case MMC_GET_TYPE : /* Get card type flags (1 byte) */ // *ptr = CardType; // res = RES_OK; // break; default: res = RES_PARERR; } DESELECT(); /* CS = H */ rcvr_spi(); /* Idle (Release DO) */ } return res; } /*-----------------------------------------------------------------------*/ /* Device Timer Interrupt Procedure (Platform dependent) */ /*-----------------------------------------------------------------------*/ /* This function must be called in period of 10ms */ void disk_timerproc (void) { // BYTE n, s; BYTE n; n = Timer1; /* 100Hz decrement timer */ if (n) Timer1 = --n; n = Timer2; if (n) Timer2 = --n; } /*---------------------------------------------------------*/ /* User Provided Timer Function for FatFs module */ /*---------------------------------------------------------*/ /* This is a real time clock service to be called from */ /* FatFs module. Any valid time must be returned even if */ /* the system does not support a real time clock. */ DWORD get_fattime (void) { return ((2007UL-1980) << 25) // Year = 2007 | (6UL << 21) // Month = June | (5UL << 16) // Day = 5 | (11U << 11) // Hour = 11 | (38U << 5) // Min = 38 | (0U >> 1) // Sec = 0 ; }
471036.c
#include "file.h" #include "list.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void listInit(List *list, size_t width, void (*destroy)(void *)) { list->head = NULL; list->tail = NULL; list->length = 0; list->width = width; list->destroy = destroy; } int listAppend(List *list, void *value) { if (list->length == 0) { Listnode *node = (Listnode *)malloc(sizeof(Listnode)); if (node == NULL) return -1; node->value = value; node->prev = NULL; node->next = NULL; list->head = list->tail = node; list->length++; } else { Listnode *node = (Listnode *)malloc(sizeof(Listnode)); if (node == NULL) return -1; node->value = value; node->prev = list->tail; node->next = NULL; list->tail->next = node; list->tail = node; list->length++; } return 0; } Listnode *listIndexAt(List *list, long index) { if (index < list->length && index >= 0) { Listnode *current = list->head; while (index > 0) { current = current->next; index--; } return current; } else if (index < 0 && (-index) <= list->length) { Listnode *pnow = list->tail; while (index < 0) { pnow = pnow->prev; index++; } return pnow; } return NULL; } int listRemoveAll(List *list) { Listnode *current = list->head; // This is the current version. while (current != NULL) { if (list->destroy != NULL) { list->destroy(current->value); } list->length--; free(current->value); Listnode *tmp = current->next; free(current); current = tmp; } listInit(list, list->width, list->destroy); return 0; } int listRemoveAt(List *list, long index) { Listnode *node; if (list->length == 0 || !(index >= 0 && index < list->length)) return -1; node = listIndexAt(list, index); if (node == list->head) { list->head = node->next; } if (node == list->tail) { list->tail = node->prev; } if (node->next != NULL) { node->next->prev = node->prev; } if (node->prev != NULL) { node->prev->next = node->next; } if (list->destroy != NULL) { list->destroy(node->value); } free(node->value); list->length--; free(node); return 1; } int listDestroy(List *list) { return listRemoveAll(list); } void nodevalcpy(List *list, void *destiny, Listnode *source) { memcpy(destiny, source->value, list->width); } List listSublist(List *list, int begin, int end) { List result; listInit(&result, list->width, list->destroy); Listnode *current = listIndexAt(list, begin); while (current != NULL && begin < end) { void *value = malloc(list->width); if (value == NULL) continue; nodevalcpy(list, value, current); listAppend(&result, value); begin++; current = current->next; } return result; } List listFilter(List *list, int (*filter)(void *)) { List result; listInit(&result, list->width, list->destroy); Listnode *current = list->head; while (current != NULL) { if (filter(current->value)) { void *value = malloc(list->width); if (value == NULL) continue; nodevalcpy(list, value, current); listAppend(&result, value); } current = current->next; } return result; } long listSearch(List *list, int begin, void *value) { Listnode *current = listIndexAt(list, begin); while (current != NULL) { if (memcmp(current->value, value, list->width) == 0) { return begin; } begin++; current = current->next; } return -1; } void listSort(List *list, int (*compare)(void *, void *)) { int j; long p; void * tmp; Listnode * current; for (p = 1; p < list->length; p++) { current = listIndexAt(list, p); tmp = current->value; for (; current->prev != NULL && compare(tmp, current->prev->value)<0; current = current->prev ) { current->value = current->prev->value; } current->value = tmp; } } // test main //int main() { // int i; // List list; // listInit(&list, sizeof(int), NULL); // // int *tmpvalue; // for (i = 0; i < 10; i++) { // tmpvalue = (int *)malloc(sizeof(int)); // *tmpvalue = i; // listAppend(&list, tmpvalue); // } // for (i = 0; i < 10; i++) { // printf("%d\n", *(int *)(listIndexAt(&list, i)->value)); // } // // listRemoveAt(&list, 0); // listRemoveAt(&list, 4); // listRemoveAt(&list, 5); // printf("length: %ld\n", list.length); // for (i = 0; i < list.length; i++) // printf("%d\n", *(int *)(listIndexAt(&list, i)->value)); // // listRemoveAll(&list); // printf("length: %ld\n", list.length); // // return 0; //}
456770.c
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { char nome[30]; char endereco[30]; int idade; printf("Nome \n"); scanf("%s",&nome); printf("Endereco \n"); scanf("%s",&endereco); printf("Idade \n"); scanf("%d",&idade); printf("\n Nome: %s", nome); printf("\n Endereco: %s", endereco); printf("\n Idade: %d", idade); return 0; }
578043.c
/****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ #include "_hypre_struct_ls.h" #include "_hypre_struct_mv.hpp" /*-------------------------------------------------------------------------- * hypre_SparseMSGRestrictData data structure *--------------------------------------------------------------------------*/ typedef struct { hypre_StructMatrix *R; hypre_ComputePkg *compute_pkg; hypre_Index cindex; hypre_Index stride; hypre_Index strideR; HYPRE_Int time_index; } hypre_SparseMSGRestrictData; /*-------------------------------------------------------------------------- * hypre_SparseMSGRestrictCreate *--------------------------------------------------------------------------*/ void * hypre_SparseMSGRestrictCreate( ) { hypre_SparseMSGRestrictData *restrict_data; restrict_data = hypre_CTAlloc(hypre_SparseMSGRestrictData, 1, HYPRE_MEMORY_HOST); (restrict_data -> time_index) = hypre_InitializeTiming("SparseMSGRestrict"); return (void *) restrict_data; } /*-------------------------------------------------------------------------- * hypre_SparseMSGRestrictSetup *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SparseMSGRestrictSetup( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, hypre_StructVector *rc, hypre_Index cindex, hypre_Index findex, hypre_Index stride, hypre_Index strideR ) { hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; hypre_StructGrid *grid; hypre_StructStencil *stencil; hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; HYPRE_Int ierr = 0; /*---------------------------------------------------------- * Set up the compute package *----------------------------------------------------------*/ grid = hypre_StructVectorGrid(r); stencil = hypre_StructMatrixStencil(R); hypre_CreateComputeInfo(grid, stencil, &compute_info); hypre_ComputeInfoProjectSend(compute_info, findex, stride); hypre_ComputeInfoProjectRecv(compute_info, findex, stride); hypre_ComputeInfoProjectComp(compute_info, cindex, stride); hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(r), 1, grid, &compute_pkg); /*---------------------------------------------------------- * Set up the restrict data structure *----------------------------------------------------------*/ (restrict_data -> R) = hypre_StructMatrixRef(R); (restrict_data -> compute_pkg) = compute_pkg; hypre_CopyIndex(cindex, (restrict_data -> cindex)); hypre_CopyIndex(stride, (restrict_data -> stride)); hypre_CopyIndex(strideR, (restrict_data -> strideR)); return ierr; } /*-------------------------------------------------------------------------- * hypre_SparseMSGRestrict: *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SparseMSGRestrict( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, hypre_StructVector *rc ) { HYPRE_Int ierr = 0; hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; hypre_ComputePkg *compute_pkg; hypre_IndexRef cindex; hypre_IndexRef stride; hypre_IndexRef strideR; hypre_StructGrid *fgrid; HYPRE_Int *fgrid_ids; hypre_StructGrid *cgrid; hypre_BoxArray *cgrid_boxes; HYPRE_Int *cgrid_ids; hypre_CommHandle *comm_handle; hypre_BoxArrayArray *compute_box_aa; hypre_BoxArray *compute_box_a; hypre_Box *compute_box; hypre_Box *R_dbox; hypre_Box *r_dbox; hypre_Box *rc_dbox; HYPRE_Real *Rp0, *Rp1; HYPRE_Real *rp, *rp0, *rp1; HYPRE_Real *rcp; hypre_Index loop_size; hypre_IndexRef start; hypre_Index startc; hypre_Index startR; hypre_Index stridec; hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int compute_i, fi, ci, j; /*----------------------------------------------------------------------- * Initialize some things. *-----------------------------------------------------------------------*/ hypre_BeginTiming(restrict_data -> time_index); compute_pkg = (restrict_data -> compute_pkg); cindex = (restrict_data -> cindex); stride = (restrict_data -> stride); strideR = (restrict_data -> strideR); stencil = hypre_StructMatrixStencil(R); stencil_shape = hypre_StructStencilShape(stencil); hypre_SetIndex3(stridec, 1, 1, 1); /*-------------------------------------------------------------------- * Restrict the residual. *--------------------------------------------------------------------*/ fgrid = hypre_StructVectorGrid(r); fgrid_ids = hypre_StructGridIDs(fgrid); cgrid = hypre_StructVectorGrid(rc); cgrid_boxes = hypre_StructGridBoxes(cgrid); cgrid_ids = hypre_StructGridIDs(cgrid); for (compute_i = 0; compute_i < 2; compute_i++) { switch (compute_i) { case 0: { rp = hypre_StructVectorData(r); hypre_InitializeIndtComputations(compute_pkg, rp, &comm_handle); compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); } break; case 1: { hypre_FinalizeIndtComputations(comm_handle); compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); } break; } fi = 0; hypre_ForBoxI(ci, cgrid_boxes) { while (fgrid_ids[fi] != cgrid_ids[ci]) { fi++; } compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, fi); R_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(R), fi); r_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(r), fi); rc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(rc), ci); Rp0 = hypre_StructMatrixBoxData(R, fi, 1) - hypre_BoxOffsetDistance(R_dbox, stencil_shape[1]); Rp1 = hypre_StructMatrixBoxData(R, fi, 0); rp = hypre_StructVectorBoxData(r, fi); rp0 = rp + hypre_BoxOffsetDistance(r_dbox, stencil_shape[0]); rp1 = rp + hypre_BoxOffsetDistance(r_dbox, stencil_shape[1]); rcp = hypre_StructVectorBoxData(rc, ci); hypre_ForBoxI(j, compute_box_a) { compute_box = hypre_BoxArrayBox(compute_box_a, j); start = hypre_BoxIMin(compute_box); hypre_StructMapFineToCoarse(start, cindex, stride, startc); hypre_StructMapCoarseToFine(startc, cindex, strideR, startR); hypre_BoxGetStrideSize(compute_box, stride, loop_size); #define DEVICE_VAR is_device_ptr(rcp,rp,Rp0,rp0,Rp1,rp1) hypre_BoxLoop3Begin(hypre_StructMatrixNDim(R), loop_size, R_dbox, startR, strideR, Ri, r_dbox, start, stride, ri, rc_dbox, startc, stridec, rci); { rcp[rci] = rp[ri] + (Rp0[Ri] * rp0[ri] + Rp1[Ri] * rp1[ri]); } hypre_BoxLoop3End(Ri, ri, rci); #undef DEVICE_VAR } } } /*----------------------------------------------------------------------- * Return *-----------------------------------------------------------------------*/ hypre_IncFLOPCount(4 * hypre_StructVectorGlobalSize(rc)); hypre_EndTiming(restrict_data -> time_index); return ierr; } /*-------------------------------------------------------------------------- * hypre_SparseMSGRestrictDestroy *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SparseMSGRestrictDestroy( void *restrict_vdata ) { HYPRE_Int ierr = 0; hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; if (restrict_data) { hypre_StructMatrixDestroy(restrict_data -> R); hypre_ComputePkgDestroy(restrict_data -> compute_pkg); hypre_FinalizeTiming(restrict_data -> time_index); hypre_TFree(restrict_data, HYPRE_MEMORY_HOST); } return ierr; }
277748.c
#include <stdio.h> #include <stdlib.h> void BlockReadWrite(FILE *fin, FILE *fout) { int len = 0; char tmp[256]; while(!feof(fin)) { len = fread(tmp, sizeof(char), 255, fin); tmp[len] = '\0'; printf("%s", tmp); fwrite(tmp, sizeof(char), len, fout); } } int main(int argc, char * argv[]) { FILE * fin; FILE * fout; if(argc < 3) { printf("%s <file1> <file2>n",argv[0]); exit(0); } fin = fopen(argv[1], "r+"); fout = fopen(argv[2], "w+"); if(fin == NULL) { printf("Kiem tra tep dau vao: %s", argv[1]); exit(0); } if(fout == NULL) { printf("Kiem tra tep dau ra: %s ", argv[2]); exit(0); } BlockReadWrite(fin, fout); fclose(fin); fclose(fout); return 0; }
28775.c
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas at Austin 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 University of Texas at Austin nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "blis.h" #define FUNCPTR_T subm_fp typedef void (*FUNCPTR_T)( doff_t diagoffx, diag_t diagx, uplo_t uplox, trans_t transx, dim_t m, dim_t n, void* x, inc_t rs_x, inc_t cs_x, void* y, inc_t rs_y, inc_t cs_y ); // If some mixed datatype functions will not be compiled, we initialize // the corresponding elements of the function array to NULL. #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT static FUNCPTR_T GENARRAY2_ALL(ftypes,subm_unb_var1); #else #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT static FUNCPTR_T GENARRAY2_EXT(ftypes,subm_unb_var1); #else static FUNCPTR_T GENARRAY2_MIN(ftypes,subm_unb_var1); #endif #endif void bli_subm_unb_var1( obj_t* x, obj_t* y, cntx_t* cntx ) { num_t dt_x = bli_obj_datatype( *x ); num_t dt_y = bli_obj_datatype( *y ); doff_t diagoffx = bli_obj_diag_offset( *x ); diag_t diagx = bli_obj_diag( *x ); uplo_t uplox = bli_obj_uplo( *x ); trans_t transx = bli_obj_conjtrans_status( *x ); dim_t m = bli_obj_length( *y ); dim_t n = bli_obj_width( *y ); inc_t rs_x = bli_obj_row_stride( *x ); inc_t cs_x = bli_obj_col_stride( *x ); void* buf_x = bli_obj_buffer_at_off( *x ); inc_t rs_y = bli_obj_row_stride( *y ); inc_t cs_y = bli_obj_col_stride( *y ); void* buf_y = bli_obj_buffer_at_off( *y ); FUNCPTR_T f; // Index into the type combination array to extract the correct // function pointer. f = ftypes[dt_x][dt_y]; // Invoke the function. f( diagoffx, diagx, uplox, transx, m, n, buf_x, rs_x, cs_x, buf_y, rs_y, cs_y ); } #undef GENTFUNC2 #define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname, kername ) \ \ void PASTEMAC2(chx,chy,varname)( \ doff_t diagoffx, \ diag_t diagx, \ uplo_t uplox, \ trans_t transx, \ dim_t m, \ dim_t n, \ void* x, inc_t rs_x, inc_t cs_x, \ void* y, inc_t rs_y, inc_t cs_y \ ) \ { \ ctype_x* x_cast = x; \ ctype_y* y_cast = y; \ ctype_x* x1; \ ctype_y* y1; \ uplo_t uplox_eff; \ conj_t conjx; \ dim_t n_iter; \ dim_t n_elem, n_elem_max; \ inc_t ldx, incx; \ inc_t ldy, incy; \ dim_t j, i; \ dim_t ij0, n_shift; \ \ if ( bli_zero_dim2( m, n ) ) return; \ \ /* When the diagonal of x is implicitly unit, we first update only the region strictly above or below the diagonal of y, and then update the diagonal of y. */ \ \ /* Set various loop parameters. */ \ bli_set_dims_incs_uplo_2m( diagoffx, diagx, transx, \ uplox, m, n, rs_x, cs_x, rs_y, cs_y, \ uplox_eff, n_elem_max, n_iter, incx, ldx, incy, ldy, \ ij0, n_shift ); \ \ if ( bli_is_zeros( uplox_eff ) ) return; \ \ conjx = bli_extract_conj( transx ); \ \ /* Handle dense and upper/lower storage cases separately. */ \ if ( bli_is_dense( uplox_eff ) ) \ { \ for ( j = 0; j < n_iter; ++j ) \ { \ n_elem = n_elem_max; \ \ x1 = x_cast + (j )*ldx + (0 )*incx; \ y1 = y_cast + (j )*ldy + (0 )*incy; \ \ PASTEMAC2(chx,chy,kername)( conjx, \ n_elem, \ x1, incx, \ y1, incy ); \ } \ } \ else \ { \ if ( bli_is_upper( uplox_eff ) ) \ { \ for ( j = 0; j < n_iter; ++j ) \ { \ n_elem = bli_min( n_shift + j + 1, n_elem_max ); \ \ x1 = x_cast + (ij0+j )*ldx + (0 )*incx; \ y1 = y_cast + (ij0+j )*ldy + (0 )*incy; \ \ PASTEMAC2(chx,chy,kername)( conjx, \ n_elem, \ x1, incx, \ y1, incy ); \ } \ } \ else if ( bli_is_lower( uplox_eff ) ) \ { \ for ( j = 0; j < n_iter; ++j ) \ { \ i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \ n_elem = n_elem_max - i; \ \ x1 = x_cast + (j )*ldx + (ij0+i )*incx; \ y1 = y_cast + (j )*ldy + (ij0+i )*incy; \ \ PASTEMAC2(chx,chy,kername)( conjx, \ n_elem, \ x1, incx, \ y1, incy ); \ } \ } \ \ /* When the diagonal is unit, we handle it separately. */ \ if ( bli_is_unit_diag( diagx ) ) \ { \ PASTEMAC2(chy,chy,addd)( diagoffx, \ diagx, \ transx, \ m, \ n, \ x_cast, rs_x, cs_x, \ y_cast, rs_y, cs_y ); \ } \ } \ } // Define the basic set of functions unconditionally, and then also some // mixed datatype functions if requested. INSERT_GENTFUNC2_BASIC( subm_unb_var1, SUBV_KERNEL ) #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT INSERT_GENTFUNC2_MIX_D( subm_unb_var1, SUBV_KERNEL ) #endif #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT INSERT_GENTFUNC2_MIX_P( subm_unb_var1, SUBV_KERNEL ) #endif
511989.c
#include <stdio.h> int main (void) { int a, b; scanf("%d %d", &a, &b); printf("%d", a + b); return 0; }
738211.c
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3//" # 1 "<built-in>" #define __STDC__ 1 #define __STDC_VERSION__ 199901L #define __STDC_HOSTED__ 1 #define __GNUC__ 10 #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 1 #define __VERSION__ "10.2.1 20201103 (release)" #define __ATOMIC_RELAXED 0 #define __ATOMIC_SEQ_CST 5 #define __ATOMIC_ACQUIRE 2 #define __ATOMIC_RELEASE 3 #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_CONSUME 1 #define __OPTIMIZE_SIZE__ 1 #define __OPTIMIZE__ 1 #define __FINITE_MATH_ONLY__ 0 #define __SIZEOF_INT__ 4 #define __SIZEOF_LONG__ 4 #define __SIZEOF_LONG_LONG__ 8 #define __SIZEOF_SHORT__ 2 #define __SIZEOF_FLOAT__ 4 #define __SIZEOF_DOUBLE__ 8 #define __SIZEOF_LONG_DOUBLE__ 8 #define __SIZEOF_SIZE_T__ 4 #define __CHAR_BIT__ 8 #define __BIGGEST_ALIGNMENT__ 8 #define __ORDER_LITTLE_ENDIAN__ 1234 #define __ORDER_BIG_ENDIAN__ 4321 #define __ORDER_PDP_ENDIAN__ 3412 #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __SIZEOF_POINTER__ 4 #define __SIZE_TYPE__ unsigned int #define __PTRDIFF_TYPE__ int #define __WCHAR_TYPE__ unsigned int #define __WINT_TYPE__ unsigned int #define __INTMAX_TYPE__ long long int #define __UINTMAX_TYPE__ long long unsigned int #define __CHAR16_TYPE__ short unsigned int #define __CHAR32_TYPE__ long unsigned int #define __SIG_ATOMIC_TYPE__ int #define __INT8_TYPE__ signed char #define __INT16_TYPE__ short int #define __INT32_TYPE__ long int #define __INT64_TYPE__ long long int #define __UINT8_TYPE__ unsigned char #define __UINT16_TYPE__ short unsigned int #define __UINT32_TYPE__ long unsigned int #define __UINT64_TYPE__ long long unsigned int #define __INT_LEAST8_TYPE__ signed char #define __INT_LEAST16_TYPE__ short int #define __INT_LEAST32_TYPE__ long int #define __INT_LEAST64_TYPE__ long long int #define __UINT_LEAST8_TYPE__ unsigned char #define __UINT_LEAST16_TYPE__ short unsigned int #define __UINT_LEAST32_TYPE__ long unsigned int #define __UINT_LEAST64_TYPE__ long long unsigned int #define __INT_FAST8_TYPE__ int #define __INT_FAST16_TYPE__ int #define __INT_FAST32_TYPE__ int #define __INT_FAST64_TYPE__ long long int #define __UINT_FAST8_TYPE__ unsigned int #define __UINT_FAST16_TYPE__ unsigned int #define __UINT_FAST32_TYPE__ unsigned int #define __UINT_FAST64_TYPE__ long long unsigned int #define __INTPTR_TYPE__ int #define __UINTPTR_TYPE__ unsigned int #define __GXX_ABI_VERSION 1014 #define __SCHAR_MAX__ 0x7f #define __SHRT_MAX__ 0x7fff #define __INT_MAX__ 0x7fffffff #define __LONG_MAX__ 0x7fffffffL #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL #define __WCHAR_MAX__ 0xffffffffU #define __WCHAR_MIN__ 0U #define __WINT_MAX__ 0xffffffffU #define __WINT_MIN__ 0U #define __PTRDIFF_MAX__ 0x7fffffff #define __SIZE_MAX__ 0xffffffffU #define __SCHAR_WIDTH__ 8 #define __SHRT_WIDTH__ 16 #define __INT_WIDTH__ 32 #define __LONG_WIDTH__ 32 #define __LONG_LONG_WIDTH__ 64 #define __WCHAR_WIDTH__ 32 #define __WINT_WIDTH__ 32 #define __PTRDIFF_WIDTH__ 32 #define __SIZE_WIDTH__ 32 #define __INTMAX_MAX__ 0x7fffffffffffffffLL #define __INTMAX_C(c) c ## LL #define __UINTMAX_MAX__ 0xffffffffffffffffULL #define __UINTMAX_C(c) c ## ULL #define __INTMAX_WIDTH__ 64 #define __SIG_ATOMIC_MAX__ 0x7fffffff #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) #define __SIG_ATOMIC_WIDTH__ 32 #define __INT8_MAX__ 0x7f #define __INT16_MAX__ 0x7fff #define __INT32_MAX__ 0x7fffffffL #define __INT64_MAX__ 0x7fffffffffffffffLL #define __UINT8_MAX__ 0xff #define __UINT16_MAX__ 0xffff #define __UINT32_MAX__ 0xffffffffUL #define __UINT64_MAX__ 0xffffffffffffffffULL #define __INT_LEAST8_MAX__ 0x7f #define __INT8_C(c) c #define __INT_LEAST8_WIDTH__ 8 #define __INT_LEAST16_MAX__ 0x7fff #define __INT16_C(c) c #define __INT_LEAST16_WIDTH__ 16 #define __INT_LEAST32_MAX__ 0x7fffffffL #define __INT32_C(c) c ## L #define __INT_LEAST32_WIDTH__ 32 #define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL #define __INT64_C(c) c ## LL #define __INT_LEAST64_WIDTH__ 64 #define __UINT_LEAST8_MAX__ 0xff #define __UINT8_C(c) c #define __UINT_LEAST16_MAX__ 0xffff #define __UINT16_C(c) c #define __UINT_LEAST32_MAX__ 0xffffffffUL #define __UINT32_C(c) c ## UL #define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL #define __UINT64_C(c) c ## ULL #define __INT_FAST8_MAX__ 0x7fffffff #define __INT_FAST8_WIDTH__ 32 #define __INT_FAST16_MAX__ 0x7fffffff #define __INT_FAST16_WIDTH__ 32 #define __INT_FAST32_MAX__ 0x7fffffff #define __INT_FAST32_WIDTH__ 32 #define __INT_FAST64_MAX__ 0x7fffffffffffffffLL #define __INT_FAST64_WIDTH__ 64 #define __UINT_FAST8_MAX__ 0xffffffffU #define __UINT_FAST16_MAX__ 0xffffffffU #define __UINT_FAST32_MAX__ 0xffffffffU #define __UINT_FAST64_MAX__ 0xffffffffffffffffULL #define __INTPTR_MAX__ 0x7fffffff #define __INTPTR_WIDTH__ 32 #define __UINTPTR_MAX__ 0xffffffffU #define __GCC_IEC_559 0 #define __GCC_IEC_559_COMPLEX 0 #define __FLT_EVAL_METHOD__ 0 #define __FLT_EVAL_METHOD_TS_18661_3__ 0 #define __DEC_EVAL_METHOD__ 2 #define __FLT_RADIX__ 2 #define __FLT_MANT_DIG__ 24 #define __FLT_DIG__ 6 #define __FLT_MIN_EXP__ (-125) #define __FLT_MIN_10_EXP__ (-37) #define __FLT_MAX_EXP__ 128 #define __FLT_MAX_10_EXP__ 38 #define __FLT_DECIMAL_DIG__ 9 #define __FLT_MAX__ 3.4028234663852886e+38F #define __FLT_NORM_MAX__ 3.4028234663852886e+38F #define __FLT_MIN__ 1.1754943508222875e-38F #define __FLT_EPSILON__ 1.1920928955078125e-7F #define __FLT_DENORM_MIN__ 1.4012984643248171e-45F #define __FLT_HAS_DENORM__ 1 #define __FLT_HAS_INFINITY__ 1 #define __FLT_HAS_QUIET_NAN__ 1 #define __FP_FAST_FMAF 1 #define __DBL_MANT_DIG__ 53 #define __DBL_DIG__ 15 #define __DBL_MIN_EXP__ (-1021) #define __DBL_MIN_10_EXP__ (-307) #define __DBL_MAX_EXP__ 1024 #define __DBL_MAX_10_EXP__ 308 #define __DBL_DECIMAL_DIG__ 17 #define __DBL_MAX__ ((double)1.7976931348623157e+308L) #define __DBL_NORM_MAX__ ((double)1.7976931348623157e+308L) #define __DBL_MIN__ ((double)2.2250738585072014e-308L) #define __DBL_EPSILON__ ((double)2.2204460492503131e-16L) #define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L) #define __DBL_HAS_DENORM__ 1 #define __DBL_HAS_INFINITY__ 1 #define __DBL_HAS_QUIET_NAN__ 1 #define __LDBL_MANT_DIG__ 53 #define __LDBL_DIG__ 15 #define __LDBL_MIN_EXP__ (-1021) #define __LDBL_MIN_10_EXP__ (-307) #define __LDBL_MAX_EXP__ 1024 #define __LDBL_MAX_10_EXP__ 308 #define __DECIMAL_DIG__ 17 #define __LDBL_DECIMAL_DIG__ 17 #define __LDBL_MAX__ 1.7976931348623157e+308L #define __LDBL_NORM_MAX__ 1.7976931348623157e+308L #define __LDBL_MIN__ 2.2250738585072014e-308L #define __LDBL_EPSILON__ 2.2204460492503131e-16L #define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L #define __LDBL_HAS_DENORM__ 1 #define __LDBL_HAS_INFINITY__ 1 #define __LDBL_HAS_QUIET_NAN__ 1 #define __FLT32_MANT_DIG__ 24 #define __FLT32_DIG__ 6 #define __FLT32_MIN_EXP__ (-125) #define __FLT32_MIN_10_EXP__ (-37) #define __FLT32_MAX_EXP__ 128 #define __FLT32_MAX_10_EXP__ 38 #define __FLT32_DECIMAL_DIG__ 9 #define __FLT32_MAX__ 3.4028234663852886e+38F32 #define __FLT32_NORM_MAX__ 3.4028234663852886e+38F32 #define __FLT32_MIN__ 1.1754943508222875e-38F32 #define __FLT32_EPSILON__ 1.1920928955078125e-7F32 #define __FLT32_DENORM_MIN__ 1.4012984643248171e-45F32 #define __FLT32_HAS_DENORM__ 1 #define __FLT32_HAS_INFINITY__ 1 #define __FLT32_HAS_QUIET_NAN__ 1 #define __FP_FAST_FMAF32 1 #define __FLT64_MANT_DIG__ 53 #define __FLT64_DIG__ 15 #define __FLT64_MIN_EXP__ (-1021) #define __FLT64_MIN_10_EXP__ (-307) #define __FLT64_MAX_EXP__ 1024 #define __FLT64_MAX_10_EXP__ 308 #define __FLT64_DECIMAL_DIG__ 17 #define __FLT64_MAX__ 1.7976931348623157e+308F64 #define __FLT64_NORM_MAX__ 1.7976931348623157e+308F64 #define __FLT64_MIN__ 2.2250738585072014e-308F64 #define __FLT64_EPSILON__ 2.2204460492503131e-16F64 #define __FLT64_DENORM_MIN__ 4.9406564584124654e-324F64 #define __FLT64_HAS_DENORM__ 1 #define __FLT64_HAS_INFINITY__ 1 #define __FLT64_HAS_QUIET_NAN__ 1 #define __FLT32X_MANT_DIG__ 53 #define __FLT32X_DIG__ 15 #define __FLT32X_MIN_EXP__ (-1021) #define __FLT32X_MIN_10_EXP__ (-307) #define __FLT32X_MAX_EXP__ 1024 #define __FLT32X_MAX_10_EXP__ 308 #define __FLT32X_DECIMAL_DIG__ 17 #define __FLT32X_MAX__ 1.7976931348623157e+308F32x #define __FLT32X_NORM_MAX__ 1.7976931348623157e+308F32x #define __FLT32X_MIN__ 2.2250738585072014e-308F32x #define __FLT32X_EPSILON__ 2.2204460492503131e-16F32x #define __FLT32X_DENORM_MIN__ 4.9406564584124654e-324F32x #define __FLT32X_HAS_DENORM__ 1 #define __FLT32X_HAS_INFINITY__ 1 #define __FLT32X_HAS_QUIET_NAN__ 1 #define __SFRACT_FBIT__ 7 #define __SFRACT_IBIT__ 0 #define __SFRACT_MIN__ (-0.5HR-0.5HR) #define __SFRACT_MAX__ 0X7FP-7HR #define __SFRACT_EPSILON__ 0x1P-7HR #define __USFRACT_FBIT__ 8 #define __USFRACT_IBIT__ 0 #define __USFRACT_MIN__ 0.0UHR #define __USFRACT_MAX__ 0XFFP-8UHR #define __USFRACT_EPSILON__ 0x1P-8UHR #define __FRACT_FBIT__ 15 #define __FRACT_IBIT__ 0 #define __FRACT_MIN__ (-0.5R-0.5R) #define __FRACT_MAX__ 0X7FFFP-15R #define __FRACT_EPSILON__ 0x1P-15R #define __UFRACT_FBIT__ 16 #define __UFRACT_IBIT__ 0 #define __UFRACT_MIN__ 0.0UR #define __UFRACT_MAX__ 0XFFFFP-16UR #define __UFRACT_EPSILON__ 0x1P-16UR #define __LFRACT_FBIT__ 31 #define __LFRACT_IBIT__ 0 #define __LFRACT_MIN__ (-0.5LR-0.5LR) #define __LFRACT_MAX__ 0X7FFFFFFFP-31LR #define __LFRACT_EPSILON__ 0x1P-31LR #define __ULFRACT_FBIT__ 32 #define __ULFRACT_IBIT__ 0 #define __ULFRACT_MIN__ 0.0ULR #define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR #define __ULFRACT_EPSILON__ 0x1P-32ULR #define __LLFRACT_FBIT__ 63 #define __LLFRACT_IBIT__ 0 #define __LLFRACT_MIN__ (-0.5LLR-0.5LLR) #define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR #define __LLFRACT_EPSILON__ 0x1P-63LLR #define __ULLFRACT_FBIT__ 64 #define __ULLFRACT_IBIT__ 0 #define __ULLFRACT_MIN__ 0.0ULLR #define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR #define __ULLFRACT_EPSILON__ 0x1P-64ULLR #define __SACCUM_FBIT__ 7 #define __SACCUM_IBIT__ 8 #define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK) #define __SACCUM_MAX__ 0X7FFFP-7HK #define __SACCUM_EPSILON__ 0x1P-7HK #define __USACCUM_FBIT__ 8 #define __USACCUM_IBIT__ 8 #define __USACCUM_MIN__ 0.0UHK #define __USACCUM_MAX__ 0XFFFFP-8UHK #define __USACCUM_EPSILON__ 0x1P-8UHK #define __ACCUM_FBIT__ 15 #define __ACCUM_IBIT__ 16 #define __ACCUM_MIN__ (-0X1P15K-0X1P15K) #define __ACCUM_MAX__ 0X7FFFFFFFP-15K #define __ACCUM_EPSILON__ 0x1P-15K #define __UACCUM_FBIT__ 16 #define __UACCUM_IBIT__ 16 #define __UACCUM_MIN__ 0.0UK #define __UACCUM_MAX__ 0XFFFFFFFFP-16UK #define __UACCUM_EPSILON__ 0x1P-16UK #define __LACCUM_FBIT__ 31 #define __LACCUM_IBIT__ 32 #define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK) #define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK #define __LACCUM_EPSILON__ 0x1P-31LK #define __ULACCUM_FBIT__ 32 #define __ULACCUM_IBIT__ 32 #define __ULACCUM_MIN__ 0.0ULK #define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK #define __ULACCUM_EPSILON__ 0x1P-32ULK #define __LLACCUM_FBIT__ 31 #define __LLACCUM_IBIT__ 32 #define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK) #define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK #define __LLACCUM_EPSILON__ 0x1P-31LLK #define __ULLACCUM_FBIT__ 32 #define __ULLACCUM_IBIT__ 32 #define __ULLACCUM_MIN__ 0.0ULLK #define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK #define __ULLACCUM_EPSILON__ 0x1P-32ULLK #define __QQ_FBIT__ 7 #define __QQ_IBIT__ 0 #define __HQ_FBIT__ 15 #define __HQ_IBIT__ 0 #define __SQ_FBIT__ 31 #define __SQ_IBIT__ 0 #define __DQ_FBIT__ 63 #define __DQ_IBIT__ 0 #define __TQ_FBIT__ 127 #define __TQ_IBIT__ 0 #define __UQQ_FBIT__ 8 #define __UQQ_IBIT__ 0 #define __UHQ_FBIT__ 16 #define __UHQ_IBIT__ 0 #define __USQ_FBIT__ 32 #define __USQ_IBIT__ 0 #define __UDQ_FBIT__ 64 #define __UDQ_IBIT__ 0 #define __UTQ_FBIT__ 128 #define __UTQ_IBIT__ 0 #define __HA_FBIT__ 7 #define __HA_IBIT__ 8 #define __SA_FBIT__ 15 #define __SA_IBIT__ 16 #define __DA_FBIT__ 31 #define __DA_IBIT__ 32 #define __TA_FBIT__ 63 #define __TA_IBIT__ 64 #define __UHA_FBIT__ 8 #define __UHA_IBIT__ 8 #define __USA_FBIT__ 16 #define __USA_IBIT__ 16 #define __UDA_FBIT__ 32 #define __UDA_IBIT__ 32 #define __UTA_FBIT__ 64 #define __UTA_IBIT__ 64 #define __REGISTER_PREFIX__ #define __USER_LABEL_PREFIX__ #define __GNUC_STDC_INLINE__ 1 #define __STRICT_ANSI__ 1 #define __CHAR_UNSIGNED__ 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __GCC_ATOMIC_BOOL_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 #define __GCC_ATOMIC_SHORT_LOCK_FREE 2 #define __GCC_ATOMIC_INT_LOCK_FREE 2 #define __GCC_ATOMIC_LONG_LOCK_FREE 2 #define __GCC_ATOMIC_LLONG_LOCK_FREE 1 #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 #define __GCC_ATOMIC_POINTER_LOCK_FREE 2 #define __HAVE_SPECULATION_SAFE_VALUE 1 #define __GCC_HAVE_DWARF2_CFI_ASM 1 #define __PRAGMA_REDEFINE_EXTNAME 1 #define __SIZEOF_WCHAR_T__ 4 #define __SIZEOF_WINT_T__ 4 #define __SIZEOF_PTRDIFF_T__ 4 #define __ARM_FEATURE_DSP 1 #define __ARM_FEATURE_QBIT 1 #define __ARM_FEATURE_SAT 1 #undef __ARM_FEATURE_CRYPTO # 1 "<built-in>" #define __ARM_FEATURE_UNALIGNED 1 #undef __ARM_FEATURE_QRDMX # 1 "<built-in>" #undef __ARM_FEATURE_CRC32 # 1 "<built-in>" #undef __ARM_FEATURE_DOTPROD # 1 "<built-in>" #undef __ARM_FEATURE_COMPLEX # 1 "<built-in>" #define __ARM_32BIT_STATE 1 #undef __ARM_FEATURE_MVE # 1 "<built-in>" #undef __ARM_FEATURE_CMSE # 1 "<built-in>" #undef __ARM_FEATURE_LDREX # 1 "<built-in>" #define __ARM_FEATURE_LDREX 7 #define __ARM_FEATURE_CLZ 1 #undef __ARM_FEATURE_NUMERIC_MAXMIN # 1 "<built-in>" #define __ARM_FEATURE_SIMD32 1 #define __ARM_SIZEOF_MINIMAL_ENUM 1 #define __ARM_SIZEOF_WCHAR_T 4 #undef __ARM_ARCH_PROFILE # 1 "<built-in>" #define __ARM_ARCH_PROFILE 77 #define __arm__ 1 #undef __ARM_ARCH # 1 "<built-in>" #define __ARM_ARCH 7 #define __APCS_32__ 1 #define __GCC_ASM_FLAG_OUTPUTS__ 1 #define __thumb__ 1 #define __thumb2__ 1 #define __THUMBEL__ 1 #undef __ARM_ARCH_ISA_THUMB # 1 "<built-in>" #define __ARM_ARCH_ISA_THUMB 2 #define __ARMEL__ 1 #define __VFP_FP__ 1 #undef __ARM_FP # 1 "<built-in>" #define __ARM_FP 4 #undef __ARM_FP16_FORMAT_IEEE # 1 "<built-in>" #undef __ARM_FP16_FORMAT_ALTERNATIVE # 1 "<built-in>" #undef __ARM_FP16_ARGS # 1 "<built-in>" #undef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_FP16_FML # 1 "<built-in>" #define __ARM_FEATURE_FMA 1 #undef __ARM_NEON__ # 1 "<built-in>" #undef __ARM_NEON # 1 "<built-in>" #undef __ARM_NEON_FP # 1 "<built-in>" #define __THUMB_INTERWORK__ 1 #define __ARM_ARCH_7EM__ 1 #define __ARM_PCS_VFP 1 #define __ARM_EABI__ 1 #undef __FDPIC__ # 1 "<built-in>" #define __ARM_ARCH_EXT_IDIV__ 1 #define __ARM_FEATURE_IDIV 1 #define __ARM_ASM_SYNTAX_UNIFIED__ 1 #undef __ARM_FEATURE_COPROC # 1 "<built-in>" #define __ARM_FEATURE_COPROC 15 #undef __ARM_FEATURE_CDE # 1 "<built-in>" #undef __ARM_FEATURE_CDE_COPROC # 1 "<built-in>" #undef __ARM_FEATURE_MATMUL_INT8 # 1 "<built-in>" #undef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC # 1 "<built-in>" #undef __ARM_BF16_FORMAT_ALTERNATIVE # 1 "<built-in>" #define __GXX_TYPEINFO_EQUALITY_INLINE 0 #define __ELF__ 1 # 1 "<command-line>" #define __USES_INITFINI__ 1 #define nrf52840 1 #define SUPPORT_LORA 1 #define LORA_IO_SPI_PORT 2 #define SYS_RTC_COUNTER_PORT 2 #define ATCMD_CUST_TABLE_SIZE 64 #define WAN_TYPE 0 #define LORA_STACK_VER 0x040407 #define RAK4631_V2 .0+RAK5005-O_V1.0 1 #define rak4630 1 #define BATTERY_LEVEL_SUPPORT 1 #define BLE_CENTRAL_SUPPORT 1 #define WDT_SUPPORT 1 #define APP_TIMER_V2 1 #define APP_TIMER_V2_RTC1_ENABLED 1 #define BOARD_PCA10056 1 #define S140 1 #define CONFIG_GPIO_AS_PINRESET 1 #define FLOAT_ABI_HARD 1 #define NRF52840_XXAA 1 #define NRF_SD_BLE_API_VERSION 6 #define USER_UART 1 #define USBD_CDC 1 #define BLE_SUPPORT 1 #define DFU_SUPPORT 1 #define BL_SETTINGS_ACCESS_ONLY 1 #define NRF_DFU_SVCI_ENABLED 1 #define NRF_DFU_TRANSPORT_BLE 1 #define REGION_AS923 1 #define REGION_AU915 1 #define REGION_CN470 1 #define REGION_CN779 1 #define REGION_EU433 1 #define REGION_EU868 1 #define REGION_KR920 1 #define REGION_IN865 1 #define REGION_US915 1 #define REGION_RU864 1 #define SOFT_SE 1 #define SECURE_ELEMENT_PRE_PROVISIONED 1 #define LORAMAC_CLASSB_ENABLED 1 #define SOFTDEVICE_PRESENT 1 #define SWI_DISABLE0 1 #define __HEAP_SIZE 7168 #define __STACK_SIZE 7168 #define DEBUG 1 #define WISBLOCK_BASE_5005_O 1 #define SUPPORT_USB 1 #define SUPPORT_BLE 1 #define CONFIG_NFCT_PINS_AS_GPIOS 1 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" # 23 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define __UTILITIES_H__ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 1 3 4 # 9 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 3 4 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 1 3 4 # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define _STDINT_H # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 1 3 4 #define _MACHINE__DEFAULT_TYPES_H # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 1 3 4 # 22 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define _SYS_FEATURES_H # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_newlib_version.h" 1 3 4 #define _NEWLIB_VERSION_H__ 1 #define _NEWLIB_VERSION "3.3.0" #define __NEWLIB__ 3 #define __NEWLIB_MINOR__ 3 #define __NEWLIB_PATCHLEVEL__ 0 # 29 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 2 3 4 #define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #define __GNUC_PREREQ__(ma,mi) __GNUC_PREREQ(ma, mi) # 249 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __ATFILE_VISIBLE 0 #define __BSD_VISIBLE 0 #define __GNU_VISIBLE 0 #define __ISO_C_VISIBLE 1999 #define __LARGEFILE_VISIBLE 0 #define __MISC_VISIBLE 0 # 299 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __POSIX_VISIBLE 0 #define __SVID_VISIBLE 0 # 319 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __XSI_VISIBLE 0 # 330 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __SSP_FORTIFY_LEVEL 0 # 9 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 2 3 4 #define __EXP(x) __ ##x ##__ # 26 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 #define __have_longlong64 1 #define __have_long32 1 # 41 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef signed char __int8_t; typedef unsigned char __uint8_t; #define ___int8_t_defined 1 typedef short int __int16_t; typedef short unsigned int __uint16_t; #define ___int16_t_defined 1 # 77 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long int __int32_t; typedef long unsigned int __uint32_t; #define ___int32_t_defined 1 # 103 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long long int __int64_t; typedef long long unsigned int __uint64_t; #define ___int64_t_defined 1 # 134 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef signed char __int_least8_t; typedef unsigned char __uint_least8_t; #define ___int_least8_t_defined 1 # 160 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef short int __int_least16_t; typedef short unsigned int __uint_least16_t; #define ___int_least16_t_defined 1 # 182 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long int __int_least32_t; typedef long unsigned int __uint_least32_t; #define ___int_least32_t_defined 1 # 200 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long long int __int_least64_t; typedef long long unsigned int __uint_least64_t; #define ___int_least64_t_defined 1 typedef long long int __intmax_t; typedef long long unsigned int __uintmax_t; typedef int __intptr_t; typedef unsigned int __uintptr_t; # 244 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 #undef __EXP # 13 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 1 3 4 # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define _SYS__INTSUP_H #define __STDINT_EXP(x) __ ##x ##__ # 35 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #undef signed #undef unsigned #undef char #undef short #undef int #undef __int20 #undef __int20__ #undef long #define signed +0 #define unsigned +0 #define char +0 #define short +1 #define __int20 +2 #define __int20__ +2 #define int +2 #define long +4 # 67 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define _INTPTR_EQ_INT #define _INT32_EQ_LONG #define __INT8 "hh" # 93 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __INT16 "h" # 104 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __INT32 "l" # 113 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __INT64 "ll" #define __FAST8 # 129 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __FAST16 #define __FAST32 # 147 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __FAST64 "ll" #define __LEAST8 "hh" # 162 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __LEAST16 "h" # 173 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __LEAST32 "l" # 182 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __LEAST64 "ll" #undef signed #undef unsigned #undef char #undef short #undef int #undef long # 194 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #undef __int20 # 195 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #undef __int20__ # 14 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 1 3 4 # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 3 4 #define _SYS__STDINT_H # 20 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 3 4 typedef __int8_t int8_t ; #define _INT8_T_DECLARED typedef __uint8_t uint8_t ; #define _UINT8_T_DECLARED #define __int8_t_defined 1 typedef __int16_t int16_t ; #define _INT16_T_DECLARED typedef __uint16_t uint16_t ; #define _UINT16_T_DECLARED #define __int16_t_defined 1 typedef __int32_t int32_t ; #define _INT32_T_DECLARED typedef __uint32_t uint32_t ; #define _UINT32_T_DECLARED #define __int32_t_defined 1 typedef __int64_t int64_t ; #define _INT64_T_DECLARED typedef __uint64_t uint64_t ; #define _UINT64_T_DECLARED #define __int64_t_defined 1 typedef __intmax_t intmax_t; #define _INTMAX_T_DECLARED typedef __uintmax_t uintmax_t; #define _UINTMAX_T_DECLARED typedef __intptr_t intptr_t; #define _INTPTR_T_DECLARED typedef __uintptr_t uintptr_t; #define _UINTPTR_T_DECLARED # 15 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4 typedef __int_least8_t int_least8_t; typedef __uint_least8_t uint_least8_t; #define __int_least8_t_defined 1 typedef __int_least16_t int_least16_t; typedef __uint_least16_t uint_least16_t; #define __int_least16_t_defined 1 typedef __int_least32_t int_least32_t; typedef __uint_least32_t uint_least32_t; #define __int_least32_t_defined 1 typedef __int_least64_t int_least64_t; typedef __uint_least64_t uint_least64_t; #define __int_least64_t_defined 1 # 51 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 typedef int int_fast8_t; typedef unsigned int uint_fast8_t; #define __int_fast8_t_defined 1 typedef int int_fast16_t; typedef unsigned int uint_fast16_t; #define __int_fast16_t_defined 1 typedef int int_fast32_t; typedef unsigned int uint_fast32_t; #define __int_fast32_t_defined 1 typedef long long int int_fast64_t; typedef long long unsigned int uint_fast64_t; #define __int_fast64_t_defined 1 # 128 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INTPTR_MIN (-__INTPTR_MAX__ - 1) #define INTPTR_MAX (__INTPTR_MAX__) #define UINTPTR_MAX (__UINTPTR_MAX__) # 152 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT8_MIN (-__INT8_MAX__ - 1) #define INT8_MAX (__INT8_MAX__) #define UINT8_MAX (__UINT8_MAX__) #define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1) #define INT_LEAST8_MAX (__INT_LEAST8_MAX__) #define UINT_LEAST8_MAX (__UINT_LEAST8_MAX__) # 174 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT16_MIN (-__INT16_MAX__ - 1) #define INT16_MAX (__INT16_MAX__) #define UINT16_MAX (__UINT16_MAX__) #define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1) #define INT_LEAST16_MAX (__INT_LEAST16_MAX__) #define UINT_LEAST16_MAX (__UINT_LEAST16_MAX__) # 196 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT32_MIN (-__INT32_MAX__ - 1) #define INT32_MAX (__INT32_MAX__) #define UINT32_MAX (__UINT32_MAX__) # 212 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1) #define INT_LEAST32_MAX (__INT_LEAST32_MAX__) #define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__) # 230 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT64_MIN (-__INT64_MAX__ - 1) #define INT64_MAX (__INT64_MAX__) #define UINT64_MAX (__UINT64_MAX__) # 246 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1) #define INT_LEAST64_MAX (__INT_LEAST64_MAX__) #define UINT_LEAST64_MAX (__UINT_LEAST64_MAX__) # 262 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1) #define INT_FAST8_MAX (__INT_FAST8_MAX__) #define UINT_FAST8_MAX (__UINT_FAST8_MAX__) # 278 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1) #define INT_FAST16_MAX (__INT_FAST16_MAX__) #define UINT_FAST16_MAX (__UINT_FAST16_MAX__) # 294 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1) #define INT_FAST32_MAX (__INT_FAST32_MAX__) #define UINT_FAST32_MAX (__UINT_FAST32_MAX__) # 310 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1) #define INT_FAST64_MAX (__INT_FAST64_MAX__) #define UINT_FAST64_MAX (__UINT_FAST64_MAX__) # 326 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INTMAX_MAX (__INTMAX_MAX__) #define INTMAX_MIN (-INTMAX_MAX - 1) #define UINTMAX_MAX (__UINTMAX_MAX__) #define SIZE_MAX (__SIZE_MAX__) #define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) #define SIG_ATOMIC_MAX (__STDINT_EXP(INT_MAX)) #define PTRDIFF_MAX (__PTRDIFF_MAX__) #define PTRDIFF_MIN (-PTRDIFF_MAX - 1) #define WCHAR_MIN (__WCHAR_MIN__) # 374 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define WCHAR_MAX (__WCHAR_MAX__) # 384 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define WINT_MAX (__WINT_MAX__) #define WINT_MIN (__WINT_MIN__) #define INT8_C(x) __INT8_C(x) #define UINT8_C(x) __UINT8_C(x) # 408 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT16_C(x) __INT16_C(x) #define UINT16_C(x) __UINT16_C(x) # 420 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT32_C(x) __INT32_C(x) #define UINT32_C(x) __UINT32_C(x) # 433 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT64_C(x) __INT64_C(x) #define UINT64_C(x) __UINT64_C(x) # 449 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INTMAX_C(x) __INTMAX_C(x) #define UINTMAX_C(x) __UINTMAX_C(x) # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 2 3 4 #define _GCC_WRAP_STDINT_H # 32 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" 2 #define SUCCESS 1 #define FAIL 0 # 52 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define MIN(a,b) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) # 63 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define MAX(a,b) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) # 72 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define POW2(n) ( 1 << n ) # 77 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" typedef union Version_u { struct Version_s { uint8_t Revision; uint8_t Patch; uint8_t Minor; uint8_t Major; }Fields; uint32_t Value; }Version_t; void srand1( uint32_t seed ); # 103 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" int32_t randr( int32_t min, int32_t max ); # 114 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void memcpy1( uint8_t *dst, const uint8_t *src, uint16_t size ); # 123 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void memcpyr( uint8_t *dst, const uint8_t *src, uint16_t size ); # 134 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void memset1( uint8_t *dst, uint8_t value, uint16_t size ); int8_t Nibble2HexChar( uint8_t a ); # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" uint32_t Crc32( uint8_t *buffer, uint16_t length ); uint32_t Crc32Init( void ); # 171 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" uint32_t Crc32Update( uint32_t crcInit, uint8_t *buffer, uint16_t length ); # 180 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" uint32_t Crc32Finalize( uint32_t crc ); #define CRITICAL_SECTION_BEGIN() uint32_t mask; BoardCriticalSectionBegin( &mask ) #define CRITICAL_SECTION_END() BoardCriticalSectionEnd( &mask ) # 203 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void BoardCriticalSectionBegin( uint32_t *mask ); void BoardCriticalSectionEnd( uint32_t *mask ); # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/board.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/board.h" #define __BOARD_H__ # 36 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/board.h" enum BoardPowerSources { USB_POWER = 0, BATTERY_POWER, }; void BoardInitMcu( void ); void BoardResetMcu( void ); void BoardInitPeriph( void ); void BoardDeInitMcu( void ); uint8_t BoardGetPotiLevel( void ); uint32_t BoardGetBatteryVoltage( void ); # 86 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/board.h" uint8_t BoardGetBatteryLevel( void ); uint32_t BoardGetRandomSeed( void ); void BoardGetUniqueId( uint8_t *id ); void BoardLowPowerHandler( void ); uint8_t GetBoardPowerSource( void ); Version_t BoardGetVersion( void ); # 25 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" #define __RTC_BOARD_H__ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdbool.h" 1 3 4 # 29 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdbool.h" 3 4 #define _STDBOOL_H #define bool _Bool #define true 1 #define false 0 # 52 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdbool.h" 3 4 #define __bool_true_false_are_defined 1 # 33 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" #define __TIMER_H__ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 39 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define _STDDEF_H #define _STDDEF_H_ #define _ANSI_STDDEF_H # 131 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define _PTRDIFF_T #define _T_PTRDIFF_ #define _T_PTRDIFF #define __PTRDIFF_T #define _PTRDIFF_T_ #define _BSD_PTRDIFF_T_ #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T #define _PTRDIFF_T_DECLARED # 143 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 typedef int ptrdiff_t; # 155 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_ptrdiff_t # 181 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define __size_t__ #define __SIZE_T__ #define _SIZE_T #define _SYS_SIZE_T_H #define _T_SIZE_ #define _T_SIZE #define __SIZE_T #define _SIZE_T_ #define _BSD_SIZE_T_ #define _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED #define _BSD_SIZE_T_DEFINED_ #define _SIZE_T_DECLARED #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ #define __size_t typedef unsigned int size_t; # 231 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_size_t # 260 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define __wchar_t__ #define __WCHAR_T__ #define _WCHAR_T #define _T_WCHAR_ #define _T_WCHAR #define __WCHAR_T #define _WCHAR_T_ #define _BSD_WCHAR_T_ #define _WCHAR_T_DEFINED_ #define _WCHAR_T_DEFINED #define _WCHAR_T_H #define ___int_wchar_t_h #define __INT_WCHAR_T_H #define _GCC_WCHAR_T #define _WCHAR_T_DECLARED # 287 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef _BSD_WCHAR_T_ # 321 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 typedef unsigned int wchar_t; # 340 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_wchar_t # 390 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef NULL #define NULL ((void *)0) #undef __need_NULL #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) # 32 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" 2 # 38 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" typedef struct TimerEvent_s { uint32_t Timestamp; uint32_t ReloadValue; # 42 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" 3 4 _Bool # 42 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" IsStarted; # 43 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" 3 4 _Bool # 43 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" IsNext2Expire; void ( *Callback )( void* context ); void *Context; struct TimerEvent_s *Next; }TimerEvent_t; typedef uint32_t TimerTime_t; #define TIMERTIME_T_MAX ( ( uint32_t )~0 ) # 66 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" void TimerInit( TimerEvent_t *obj, void ( *callback )( void *context ) ); void TimerSetContext( TimerEvent_t *obj, void* context ); void TimerIrqHandler( void ); void TimerStart( TimerEvent_t *obj ); # 96 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" # 96 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" 3 4 _Bool # 96 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" TimerIsStarted( TimerEvent_t *obj ); void TimerStop( TimerEvent_t *obj ); void TimerReset( TimerEvent_t *obj ); void TimerSetValue( TimerEvent_t *obj, uint32_t value ); TimerTime_t TimerGetCurrentTime( void ); # 135 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" TimerTime_t TimerGetElapsedTime( TimerTime_t past ); # 146 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" TimerTime_t TimerTempCompensation( TimerTime_t period, float temperature ); void TimerProcess( void ); # 34 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" 2 #define RTC_TEMP_COEFFICIENT ( -0.035f ) #define RTC_TEMP_DEV_COEFFICIENT ( 0.0035f ) #define RTC_TEMP_TURNOVER ( 25.0f ) #define RTC_TEMP_DEV_TURNOVER ( 5.0f ) void RtcInit( void ); uint32_t RtcGetMinimumTimeout( void ); uint32_t RtcMs2Tick( TimerTime_t milliseconds ); TimerTime_t RtcTick2Ms( uint32_t tick ); void RtcDelayMs( TimerTime_t milliseconds ); void RtcSetMcuWakeUpTime( void ); int16_t RtcGetMcuWakeUpTime( void ); # 113 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" void RtcSetAlarm( uint32_t timeout ); void RtcStopAlarm( void ); # 127 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" void RtcStartAlarm( uint32_t timeout ); uint32_t RtcSetTimerContext( void ); uint32_t RtcGetTimerContext( void ); uint32_t RtcGetCalendarTime( uint16_t *milliseconds ); uint32_t RtcGetTimerValue( void ); uint32_t RtcGetTimerElapsedTime( void ); void RtcBkupWrite( uint32_t data0, uint32_t data1 ); void RtcBkupRead( uint32_t* data0, uint32_t* data1 ); void RtcProcess( void ); # 195 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/rtc-board.h" TimerTime_t RtcTempCompensation( TimerTime_t period, float temperature ); # 26 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.h" 1 # 27 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 2 #define ExecuteCallBack(_callback_,context) do { if( _callback_ == NULL ) { while( 1 ); } else { _callback_( context ); } }while( 0 ); # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" static TimerEvent_t *TimerListHead = # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; # 58 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" static void TimerInsertNewHeadTimer( TimerEvent_t *obj ); # 69 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" static void TimerInsertTimer( TimerEvent_t *obj ); static void TimerSetTimeout( TimerEvent_t *obj ); static # 84 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 _Bool # 84 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" TimerExists( TimerEvent_t *obj ); void TimerInit( TimerEvent_t *obj, void ( *callback )( void *context ) ) { obj->Timestamp = 0; obj->ReloadValue = 0; obj->IsStarted = # 90 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 90 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; obj->IsNext2Expire = # 91 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 91 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; obj->Callback = callback; obj->Context = # 93 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 93 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; obj->Next = # 94 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 94 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } void TimerSetContext( TimerEvent_t *obj, void* context ) { obj->Context = context; } void TimerStart( TimerEvent_t *obj ) { uint32_t elapsedTime = 0; uint32_t mask; BoardCriticalSectionBegin( &mask ); if( ( obj == # 108 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 108 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) || ( TimerExists( obj ) == # 108 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 1 # 108 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) ) { BoardCriticalSectionEnd( &mask ); return; } obj->Timestamp = obj->ReloadValue; obj->IsStarted = # 115 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 1 # 115 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; obj->IsNext2Expire = # 116 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 116 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; if( TimerListHead == # 118 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 118 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { RtcSetTimerContext( ); TimerInsertNewHeadTimer( obj ); } else { elapsedTime = RtcGetTimerElapsedTime( ); if( obj->Timestamp < (TimerListHead->Timestamp - elapsedTime) ) { TimerInsertNewHeadTimer( obj ); } else { obj->Timestamp += elapsedTime; TimerInsertTimer( obj ); } } BoardCriticalSectionEnd( &mask ); } static void TimerInsertTimer( TimerEvent_t *obj ) { TimerEvent_t* cur = TimerListHead; TimerEvent_t* next = TimerListHead->Next; while( cur->Next != # 146 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 146 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { if( obj->Timestamp > next->Timestamp ) { cur = next; next = next->Next; } else { cur->Next = obj; obj->Next = next; return; } } cur->Next = obj; obj->Next = # 161 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 161 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } static void TimerInsertNewHeadTimer( TimerEvent_t *obj ) { TimerEvent_t* cur = TimerListHead; if( cur != # 168 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 168 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { cur->IsNext2Expire = # 170 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 170 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } obj->Next = cur; TimerListHead = obj; TimerSetTimeout( TimerListHead ); } # 178 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 _Bool # 178 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" TimerIsStarted( TimerEvent_t *obj ) { return obj->IsStarted; } void TimerIrqHandler( void ) { TimerEvent_t* cur; TimerEvent_t* next; uint32_t old = RtcGetTimerContext( ); uint32_t now = RtcSetTimerContext( ); uint32_t deltaContext = now - old; if( TimerListHead != # 194 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 194 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { for( cur = TimerListHead; cur->Next != # 196 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 196 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; cur = cur->Next ) { next = cur->Next; if( next->Timestamp > deltaContext ) { next->Timestamp -= deltaContext; } else { next->Timestamp = 0; } } } if ( TimerListHead != # 211 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 211 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { cur = TimerListHead; TimerListHead = TimerListHead->Next; cur->IsStarted = # 215 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 215 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; do { if( cur->Callback == # 216 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 216 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { while( 1 ); } else { cur->Callback( cur->Context ); } }while( 0 );; } while( ( TimerListHead != # 220 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 220 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) && ( TimerListHead->Timestamp < RtcGetTimerElapsedTime( ) ) ) { cur = TimerListHead; TimerListHead = TimerListHead->Next; cur->IsStarted = # 224 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 224 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; do { if( cur->Callback == # 225 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 225 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { while( 1 ); } else { cur->Callback( cur->Context ); } }while( 0 );; } if( ( TimerListHead != # 229 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 229 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) && ( TimerListHead->IsNext2Expire == # 229 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 229 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) ) { TimerSetTimeout( TimerListHead ); } } void TimerStop( TimerEvent_t *obj ) { uint32_t mask; BoardCriticalSectionBegin( &mask ); TimerEvent_t* prev = TimerListHead; TimerEvent_t* cur = TimerListHead; if( ( TimerListHead == # 243 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 243 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) || ( obj == # 243 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 243 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) ) { BoardCriticalSectionEnd( &mask ); return; } obj->IsStarted = # 249 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 249 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; if( TimerListHead == obj ) { if( TimerListHead->IsNext2Expire == # 253 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 1 # 253 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { TimerListHead->IsNext2Expire = # 255 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 255 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; if( TimerListHead->Next != # 256 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 256 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { TimerListHead = TimerListHead->Next; TimerSetTimeout( TimerListHead ); } else { RtcStopAlarm( ); TimerListHead = # 264 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 264 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } } else { if( TimerListHead->Next != # 269 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 269 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { TimerListHead = TimerListHead->Next; } else { TimerListHead = # 275 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 275 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } } } else { while( cur != # 281 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 281 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { if( cur == obj ) { if( cur->Next != # 285 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 285 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { cur = cur->Next; prev->Next = cur; } else { cur = # 292 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 292 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; prev->Next = cur; } break; } else { prev = cur; cur = cur->Next; } } } BoardCriticalSectionEnd( &mask ); } static # 307 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 _Bool # 307 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" TimerExists( TimerEvent_t *obj ) { TimerEvent_t* cur = TimerListHead; while( cur != # 311 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 ((void *)0) # 311 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ) { if( cur == obj ) { return # 315 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 1 # 315 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } cur = cur->Next; } return # 319 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 0 # 319 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; } void TimerReset( TimerEvent_t *obj ) { TimerStop( obj ); TimerStart( obj ); } void TimerSetValue( TimerEvent_t *obj, uint32_t value ) { uint32_t minValue = 0; uint32_t ticks = RtcMs2Tick( value ); TimerStop( obj ); minValue = RtcGetMinimumTimeout( ); if( ticks < minValue ) { ticks = minValue; } obj->Timestamp = ticks; obj->ReloadValue = ticks; } TimerTime_t TimerGetCurrentTime( void ) { uint32_t now = RtcGetTimerValue( ); return RtcTick2Ms( now ); } TimerTime_t TimerGetElapsedTime( TimerTime_t past ) { if ( past == 0 ) { return 0; } uint32_t nowInTicks = RtcGetTimerValue( ); uint32_t pastInTicks = RtcMs2Tick( past ); return RtcTick2Ms( nowInTicks - pastInTicks ); } static void TimerSetTimeout( TimerEvent_t *obj ) { int32_t minTicks= RtcGetMinimumTimeout( ); obj->IsNext2Expire = # 368 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" 3 4 1 # 368 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/timer.c" ; if( obj->Timestamp < ( RtcGetTimerElapsedTime( ) + minTicks ) ) { obj->Timestamp = RtcGetTimerElapsedTime( ) + minTicks; } RtcSetAlarm( obj->Timestamp ); } TimerTime_t TimerTempCompensation( TimerTime_t period, float temperature ) { return RtcTempCompensation( period, temperature ); } void TimerProcess( void ) { RtcProcess( ); }
296186.c
/* Copyright (c) 2009, 2010, 2011 Nicira Networks * * 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. */ #include <config.h> #include "condition.h" #include <limits.h> #include "column.h" #include "json.h" #include "ovsdb-error.h" #include "row.h" #include "table.h" struct ovsdb_error * ovsdb_function_from_string(const char *name, enum ovsdb_function *function) { #define OVSDB_FUNCTION(ENUM, NAME) \ if (!strcmp(name, NAME)) { \ *function = ENUM; \ return NULL; \ } OVSDB_FUNCTIONS; #undef OVSDB_FUNCTION return ovsdb_syntax_error(NULL, "unknown function", "No function named %s.", name); } const char * ovsdb_function_to_string(enum ovsdb_function function) { switch (function) { #define OVSDB_FUNCTION(ENUM, NAME) case ENUM: return NAME; OVSDB_FUNCTIONS; #undef OVSDB_FUNCTION } return NULL; } static WARN_UNUSED_RESULT struct ovsdb_error * ovsdb_clause_from_json(const struct ovsdb_table_schema *ts, const struct json *json, struct ovsdb_symbol_table *symtab, struct ovsdb_clause *clause) { const struct json_array *array; struct ovsdb_error *error; const char *function_name; const char *column_name; struct ovsdb_type type; if (json->type != JSON_ARRAY || json->u.array.n != 3 || json->u.array.elems[0]->type != JSON_STRING || json->u.array.elems[1]->type != JSON_STRING) { return ovsdb_syntax_error(json, NULL, "Parse error in condition."); } array = json_array(json); column_name = json_string(array->elems[0]); clause->column = ovsdb_table_schema_get_column(ts, column_name); if (!clause->column) { return ovsdb_syntax_error(json, "unknown column", "No column %s in table %s.", column_name, ts->name); } type = clause->column->type; function_name = json_string(array->elems[1]); error = ovsdb_function_from_string(function_name, &clause->function); if (error) { return error; } /* Type-check and relax restrictions on 'type' if appropriate. */ switch (clause->function) { case OVSDB_F_LT: case OVSDB_F_LE: case OVSDB_F_GT: case OVSDB_F_GE: /* XXX should we also allow these operators for types with n_min == 0, * n_max == 1? (They would always be "false" if the value was * missing.) */ if (!ovsdb_type_is_scalar(&type) || (type.key.type != OVSDB_TYPE_INTEGER && type.key.type != OVSDB_TYPE_REAL)) { char *s = ovsdb_type_to_english(&type); error = ovsdb_syntax_error( json, NULL, "Type mismatch: \"%s\" operator may not be " "applied to column %s of type %s.", ovsdb_function_to_string(clause->function), clause->column->name, s); free(s); return error; } break; case OVSDB_F_EQ: case OVSDB_F_NE: break; case OVSDB_F_EXCLUDES: if (!ovsdb_type_is_scalar(&type)) { type.n_min = 0; type.n_max = UINT_MAX; } break; case OVSDB_F_INCLUDES: if (!ovsdb_type_is_scalar(&type)) { type.n_min = 0; } break; } return ovsdb_datum_from_json(&clause->arg, &type, array->elems[2], symtab); } static void ovsdb_clause_free(struct ovsdb_clause *clause) { ovsdb_datum_destroy(&clause->arg, &clause->column->type); } static int compare_clauses_3way(const void *a_, const void *b_) { const struct ovsdb_clause *a = a_; const struct ovsdb_clause *b = b_; if (a->function != b->function) { /* Bring functions to the front based on the fraction of table rows * that they are (heuristically) expected to leave in the query * results. Note that "enum ovsdb_function" is intentionally ordered * to make this trivial. */ return a->function < b->function ? -1 : 1; } else if (a->column->index != b->column->index) { if (a->column->index < OVSDB_N_STD_COLUMNS || b->column->index < OVSDB_N_STD_COLUMNS) { /* Bring the standard columns and in particular the UUID column * (since OVSDB_COL_UUID has value 0) to the front. We have an * index on the UUID column, so that makes our queries cheaper. */ return a->column->index < b->column->index ? -1 : 1; } else { /* Order clauses predictably to make testing easier. */ return strcmp(a->column->name, b->column->name); } } else { return 0; } } struct ovsdb_error * ovsdb_condition_from_json(const struct ovsdb_table_schema *ts, const struct json *json, struct ovsdb_symbol_table *symtab, struct ovsdb_condition *cnd) { const struct json_array *array = json_array(json); size_t i; cnd->clauses = xmalloc(array->n * sizeof *cnd->clauses); cnd->n_clauses = 0; for (i = 0; i < array->n; i++) { struct ovsdb_error *error; error = ovsdb_clause_from_json(ts, array->elems[i], symtab, &cnd->clauses[i]); if (error) { ovsdb_condition_destroy(cnd); cnd->clauses = NULL; cnd->n_clauses = 0; return error; } cnd->n_clauses++; } /* A real database would have a query optimizer here. */ qsort(cnd->clauses, cnd->n_clauses, sizeof *cnd->clauses, compare_clauses_3way); return NULL; } static struct json * ovsdb_clause_to_json(const struct ovsdb_clause *clause) { return json_array_create_3( json_string_create(clause->column->name), json_string_create(ovsdb_function_to_string(clause->function)), ovsdb_datum_to_json(&clause->arg, &clause->column->type)); } struct json * ovsdb_condition_to_json(const struct ovsdb_condition *cnd) { struct json **clauses; size_t i; clauses = xmalloc(cnd->n_clauses * sizeof *clauses); for (i = 0; i < cnd->n_clauses; i++) { clauses[i] = ovsdb_clause_to_json(&cnd->clauses[i]); } return json_array_create(clauses, cnd->n_clauses); } static bool ovsdb_clause_evaluate(const struct ovsdb_row *row, const struct ovsdb_clause *c) { const struct ovsdb_datum *field = &row->fields[c->column->index]; const struct ovsdb_datum *arg = &c->arg; const struct ovsdb_type *type = &c->column->type; if (ovsdb_type_is_scalar(type)) { int cmp = ovsdb_atom_compare_3way(&field->keys[0], &arg->keys[0], type->key.type); switch (c->function) { case OVSDB_F_LT: return cmp < 0; case OVSDB_F_LE: return cmp <= 0; case OVSDB_F_EQ: case OVSDB_F_INCLUDES: return cmp == 0; case OVSDB_F_NE: case OVSDB_F_EXCLUDES: return cmp != 0; case OVSDB_F_GE: return cmp >= 0; case OVSDB_F_GT: return cmp > 0; } } else { switch (c->function) { case OVSDB_F_EQ: return ovsdb_datum_equals(field, arg, type); case OVSDB_F_NE: return !ovsdb_datum_equals(field, arg, type); case OVSDB_F_INCLUDES: return ovsdb_datum_includes_all(arg, field, type); case OVSDB_F_EXCLUDES: return ovsdb_datum_excludes_all(arg, field, type); case OVSDB_F_LT: case OVSDB_F_LE: case OVSDB_F_GE: case OVSDB_F_GT: NOT_REACHED(); } } NOT_REACHED(); } bool ovsdb_condition_evaluate(const struct ovsdb_row *row, const struct ovsdb_condition *cnd) { size_t i; for (i = 0; i < cnd->n_clauses; i++) { if (!ovsdb_clause_evaluate(row, &cnd->clauses[i])) { return false; } } return true; } void ovsdb_condition_destroy(struct ovsdb_condition *cnd) { size_t i; for (i = 0; i < cnd->n_clauses; i++) { ovsdb_clause_free(&cnd->clauses[i]); } free(cnd->clauses); }
381337.c
#ifdef _WIN32 __declspec(dllimport) #endif int space(void); int main(void) { return space(); }
587449.c
/* Capstone Disassembly Engine */ /* By Nguyen Anh Quynh <[email protected]>, 2013-2014 */ #ifdef CAPSTONE_HAS_MIPS #include <stdio.h> // debug #include <string.h> #include "../../utils.h" #include "MipsMapping.h" #define GET_INSTRINFO_ENUM #include "MipsGenInstrInfo.inc" #ifndef CAPSTONE_DIET static name_map reg_name_maps[] = { { MIPS_REG_INVALID, NULL }, //{ MIPS_REG_0, "0"}, { MIPS_REG_0, "zero"}, { MIPS_REG_1, "at"}, //{ MIPS_REG_1, "1"}, { MIPS_REG_2, "v0"}, //{ MIPS_REG_2, "2"}, { MIPS_REG_3, "v1"}, //{ MIPS_REG_3, "3"}, { MIPS_REG_4, "a0"}, //{ MIPS_REG_4, "4"}, { MIPS_REG_5, "a1"}, //{ MIPS_REG_5, "5"}, { MIPS_REG_6, "a2"}, //{ MIPS_REG_6, "6"}, { MIPS_REG_7, "a3"}, //{ MIPS_REG_7, "7"}, { MIPS_REG_8, "t0"}, //{ MIPS_REG_8, "8"}, { MIPS_REG_9, "t1"}, //{ MIPS_REG_9, "9"}, { MIPS_REG_10, "t2"}, //{ MIPS_REG_10, "10"}, { MIPS_REG_11, "t3"}, //{ MIPS_REG_11, "11"}, { MIPS_REG_12, "t4"}, //{ MIPS_REG_12, "12"}, { MIPS_REG_13, "t5"}, //{ MIPS_REG_13, "13"}, { MIPS_REG_14, "t6"}, //{ MIPS_REG_14, "14"}, { MIPS_REG_15, "t7"}, //{ MIPS_REG_15, "15"}, { MIPS_REG_16, "s0"}, //{ MIPS_REG_16, "16"}, { MIPS_REG_17, "s1"}, //{ MIPS_REG_17, "17"}, { MIPS_REG_18, "s2"}, //{ MIPS_REG_18, "18"}, { MIPS_REG_19, "s3"}, //{ MIPS_REG_19, "19"}, { MIPS_REG_20, "s4"}, //{ MIPS_REG_20, "20"}, { MIPS_REG_21, "s5"}, //{ MIPS_REG_21, "21"}, { MIPS_REG_22, "s6"}, //{ MIPS_REG_22, "22"}, { MIPS_REG_23, "s7"}, //{ MIPS_REG_23, "23"}, { MIPS_REG_24, "t8"}, //{ MIPS_REG_24, "24"}, { MIPS_REG_25, "t9"}, //{ MIPS_REG_25, "25"}, { MIPS_REG_26, "k0"}, //{ MIPS_REG_26, "26"}, { MIPS_REG_27, "k1"}, //{ MIPS_REG_27, "27"}, { MIPS_REG_28, "gp"}, //{ MIPS_REG_28, "28"}, { MIPS_REG_29, "sp"}, //{ MIPS_REG_29, "29"}, { MIPS_REG_30, "fp"}, //{ MIPS_REG_30, "30"}, { MIPS_REG_31, "ra"}, //{ MIPS_REG_31, "31"}, { MIPS_REG_DSPCCOND, "dspccond"}, { MIPS_REG_DSPCARRY, "dspcarry"}, { MIPS_REG_DSPEFI, "dspefi"}, { MIPS_REG_DSPOUTFLAG, "dspoutflag"}, { MIPS_REG_DSPOUTFLAG16_19, "dspoutflag16_19"}, { MIPS_REG_DSPOUTFLAG20, "dspoutflag20"}, { MIPS_REG_DSPOUTFLAG21, "dspoutflag21"}, { MIPS_REG_DSPOUTFLAG22, "dspoutflag22"}, { MIPS_REG_DSPOUTFLAG23, "dspoutflag23"}, { MIPS_REG_DSPPOS, "dsppos"}, { MIPS_REG_DSPSCOUNT, "dspscount"}, { MIPS_REG_AC0, "ac0"}, { MIPS_REG_AC1, "ac1"}, { MIPS_REG_AC2, "ac2"}, { MIPS_REG_AC3, "ac3"}, { MIPS_REG_CC0, "cc0"}, { MIPS_REG_CC1, "cc1"}, { MIPS_REG_CC2, "cc2"}, { MIPS_REG_CC3, "cc3"}, { MIPS_REG_CC4, "cc4"}, { MIPS_REG_CC5, "cc5"}, { MIPS_REG_CC6, "cc6"}, { MIPS_REG_CC7, "cc7"}, { MIPS_REG_F0, "f0"}, { MIPS_REG_F1, "f1"}, { MIPS_REG_F2, "f2"}, { MIPS_REG_F3, "f3"}, { MIPS_REG_F4, "f4"}, { MIPS_REG_F5, "f5"}, { MIPS_REG_F6, "f6"}, { MIPS_REG_F7, "f7"}, { MIPS_REG_F8, "f8"}, { MIPS_REG_F9, "f9"}, { MIPS_REG_F10, "f10"}, { MIPS_REG_F11, "f11"}, { MIPS_REG_F12, "f12"}, { MIPS_REG_F13, "f13"}, { MIPS_REG_F14, "f14"}, { MIPS_REG_F15, "f15"}, { MIPS_REG_F16, "f16"}, { MIPS_REG_F17, "f17"}, { MIPS_REG_F18, "f18"}, { MIPS_REG_F19, "f19"}, { MIPS_REG_F20, "f20"}, { MIPS_REG_F21, "f21"}, { MIPS_REG_F22, "f22"}, { MIPS_REG_F23, "f23"}, { MIPS_REG_F24, "f24"}, { MIPS_REG_F25, "f25"}, { MIPS_REG_F26, "f26"}, { MIPS_REG_F27, "f27"}, { MIPS_REG_F28, "f28"}, { MIPS_REG_F29, "f29"}, { MIPS_REG_F30, "f30"}, { MIPS_REG_F31, "f31"}, { MIPS_REG_FCC0, "fcc0"}, { MIPS_REG_FCC1, "fcc1"}, { MIPS_REG_FCC2, "fcc2"}, { MIPS_REG_FCC3, "fcc3"}, { MIPS_REG_FCC4, "fcc4"}, { MIPS_REG_FCC5, "fcc5"}, { MIPS_REG_FCC6, "fcc6"}, { MIPS_REG_FCC7, "fcc7"}, { MIPS_REG_W0, "w0"}, { MIPS_REG_W1, "w1"}, { MIPS_REG_W2, "w2"}, { MIPS_REG_W3, "w3"}, { MIPS_REG_W4, "w4"}, { MIPS_REG_W5, "w5"}, { MIPS_REG_W6, "w6"}, { MIPS_REG_W7, "w7"}, { MIPS_REG_W8, "w8"}, { MIPS_REG_W9, "w9"}, { MIPS_REG_W10, "w10"}, { MIPS_REG_W11, "w11"}, { MIPS_REG_W12, "w12"}, { MIPS_REG_W13, "w13"}, { MIPS_REG_W14, "w14"}, { MIPS_REG_W15, "w15"}, { MIPS_REG_W16, "w16"}, { MIPS_REG_W17, "w17"}, { MIPS_REG_W18, "w18"}, { MIPS_REG_W19, "w19"}, { MIPS_REG_W20, "w20"}, { MIPS_REG_W21, "w21"}, { MIPS_REG_W22, "w22"}, { MIPS_REG_W23, "w23"}, { MIPS_REG_W24, "w24"}, { MIPS_REG_W25, "w25"}, { MIPS_REG_W26, "w26"}, { MIPS_REG_W27, "w27"}, { MIPS_REG_W28, "w28"}, { MIPS_REG_W29, "w29"}, { MIPS_REG_W30, "w30"}, { MIPS_REG_W31, "w31"}, { MIPS_REG_HI, "hi"}, { MIPS_REG_LO, "lo"}, { MIPS_REG_P0, "p0"}, { MIPS_REG_P1, "p1"}, { MIPS_REG_P2, "p2"}, { MIPS_REG_MPL0, "mpl0"}, { MIPS_REG_MPL1, "mpl1"}, { MIPS_REG_MPL2, "mpl2"}, }; #endif const char *Mips_reg_name(csh handle, unsigned int reg) { #ifndef CAPSTONE_DIET if (reg >= MIPS_REG_ENDING) return NULL; return reg_name_maps[reg].name; #else return NULL; #endif } static insn_map insns[] = { // dummy item { 0, 0, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { Mips_ABSQ_S_PH, MIPS_INS_ABSQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ABSQ_S_QB, MIPS_INS_ABSQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ABSQ_S_W, MIPS_INS_ABSQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADD, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ADDIUPC, MIPS_INS_ADDIUPC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_ADDQH_PH, MIPS_INS_ADDQH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDQH_R_PH, MIPS_INS_ADDQH_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDQH_R_W, MIPS_INS_ADDQH_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDQH_W, MIPS_INS_ADDQH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDQ_PH, MIPS_INS_ADDQ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADDQ_S_PH, MIPS_INS_ADDQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADDQ_S_W, MIPS_INS_ADDQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADDSC, MIPS_INS_ADDSC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCARRY, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADDS_A_B, MIPS_INS_ADDS_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_A_D, MIPS_INS_ADDS_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_A_H, MIPS_INS_ADDS_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_A_W, MIPS_INS_ADDS_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_S_B, MIPS_INS_ADDS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_S_D, MIPS_INS_ADDS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_S_H, MIPS_INS_ADDS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_S_W, MIPS_INS_ADDS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_U_B, MIPS_INS_ADDS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_U_D, MIPS_INS_ADDS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_U_H, MIPS_INS_ADDS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDS_U_W, MIPS_INS_ADDS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDUH_QB, MIPS_INS_ADDUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDUH_R_QB, MIPS_INS_ADDUH_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDU_PH, MIPS_INS_ADDU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDU_QB, MIPS_INS_ADDU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADDU_S_PH, MIPS_INS_ADDU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ADDU_S_QB, MIPS_INS_ADDU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADDVI_B, MIPS_INS_ADDVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDVI_D, MIPS_INS_ADDVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDVI_H, MIPS_INS_ADDVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDVI_W, MIPS_INS_ADDVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDV_B, MIPS_INS_ADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDV_D, MIPS_INS_ADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDV_H, MIPS_INS_ADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDV_W, MIPS_INS_ADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADDWC, MIPS_INS_ADDWC, #ifndef CAPSTONE_DIET { MIPS_REG_DSPCARRY, 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_ADD_A_B, MIPS_INS_ADD_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADD_A_D, MIPS_INS_ADD_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADD_A_H, MIPS_INS_ADD_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADD_A_W, MIPS_INS_ADD_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ADD_MM, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ADDi, MIPS_INS_ADDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_ADDi_MM, MIPS_INS_ADDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ADDiu, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ADDiu_MM, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ADDu, MIPS_INS_ADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ADDu_MM, MIPS_INS_ADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ALIGN, MIPS_INS_ALIGN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_ALUIPC, MIPS_INS_ALUIPC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_AND, MIPS_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_AND64, MIPS_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ANDI_B, MIPS_INS_ANDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AND_MM, MIPS_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_AND_V, MIPS_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ANDi, MIPS_INS_ANDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ANDi64, MIPS_INS_ANDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ANDi_MM, MIPS_INS_ANDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_APPEND, MIPS_INS_APPEND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_ASUB_S_B, MIPS_INS_ASUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_S_D, MIPS_INS_ASUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_S_H, MIPS_INS_ASUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_S_W, MIPS_INS_ASUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_U_B, MIPS_INS_ASUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_U_D, MIPS_INS_ASUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_U_H, MIPS_INS_ASUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ASUB_U_W, MIPS_INS_ASUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AUI, MIPS_INS_AUI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_AUIPC, MIPS_INS_AUIPC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_AVER_S_B, MIPS_INS_AVER_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_S_D, MIPS_INS_AVER_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_S_H, MIPS_INS_AVER_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_S_W, MIPS_INS_AVER_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_U_B, MIPS_INS_AVER_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_U_D, MIPS_INS_AVER_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_U_H, MIPS_INS_AVER_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVER_U_W, MIPS_INS_AVER_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_S_B, MIPS_INS_AVE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_S_D, MIPS_INS_AVE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_S_H, MIPS_INS_AVE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_S_W, MIPS_INS_AVE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_U_B, MIPS_INS_AVE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_U_D, MIPS_INS_AVE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_U_H, MIPS_INS_AVE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AVE_U_W, MIPS_INS_AVE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_AddiuRxImmX16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AddiuRxPcImmX16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AddiuRxRxImm16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AddiuRxRxImmX16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AddiuRxRyOffMemX16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AddiuSpImm16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { MIPS_REG_SP, 0 }, { MIPS_REG_SP, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AddiuSpImmX16, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { MIPS_REG_SP, 0 }, { MIPS_REG_SP, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AdduRxRyRz16, MIPS_INS_ADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_AndRxRxRy16, MIPS_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_BADDu, MIPS_INS_BADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_BAL, MIPS_INS_BAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BALC, MIPS_INS_BALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BALIGN, MIPS_INS_BALIGN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_BC, MIPS_INS_BC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BC0F, MIPS_INS_BC0F, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC0FL, MIPS_INS_BC0FL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC0T, MIPS_INS_BC0T, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC0TL, MIPS_INS_BC0TL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC1EQZ, MIPS_INS_BC1EQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BC1F, MIPS_INS_BC1F, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC1FL, MIPS_INS_BC1FL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC1F_MM, MIPS_INS_BC1F, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BC1NEZ, MIPS_INS_BC1NEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BC1T, MIPS_INS_BC1T, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC1TL, MIPS_INS_BC1TL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC1T_MM, MIPS_INS_BC1T, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BC2EQZ, MIPS_INS_BC2EQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BC2F, MIPS_INS_BC2F, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC2FL, MIPS_INS_BC2FL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC2NEZ, MIPS_INS_BC2NEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BC2T, MIPS_INS_BC2T, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC2TL, MIPS_INS_BC2TL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC3F, MIPS_INS_BC3F, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC3FL, MIPS_INS_BC3FL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC3T, MIPS_INS_BC3T, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BC3TL, MIPS_INS_BC3TL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 0 #endif }, { Mips_BCLRI_B, MIPS_INS_BCLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLRI_D, MIPS_INS_BCLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLRI_H, MIPS_INS_BCLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLRI_W, MIPS_INS_BCLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLR_B, MIPS_INS_BCLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLR_D, MIPS_INS_BCLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLR_H, MIPS_INS_BCLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BCLR_W, MIPS_INS_BCLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BEQ, MIPS_INS_BEQ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BEQ64, MIPS_INS_BEQ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BEQC, MIPS_INS_BEQC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BEQL, MIPS_INS_BEQL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BEQZALC, MIPS_INS_BEQZALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BEQZC, MIPS_INS_BEQZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BEQZC_MM, MIPS_INS_BEQZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BEQ_MM, MIPS_INS_BEQ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BGEC, MIPS_INS_BGEC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BGEUC, MIPS_INS_BGEUC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BGEZ, MIPS_INS_BGEZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGEZ64, MIPS_INS_BGEZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGEZAL, MIPS_INS_BGEZAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_BGEZALC, MIPS_INS_BGEZALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BGEZALL, MIPS_INS_BGEZALL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGEZALS_MM, MIPS_INS_BGEZALS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_BGEZAL_MM, MIPS_INS_BGEZAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_BGEZC, MIPS_INS_BGEZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BGEZL, MIPS_INS_BGEZL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGEZ_MM, MIPS_INS_BGEZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BGTZ, MIPS_INS_BGTZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGTZ64, MIPS_INS_BGTZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGTZALC, MIPS_INS_BGTZALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BGTZC, MIPS_INS_BGTZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BGTZL, MIPS_INS_BGTZL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BGTZ_MM, MIPS_INS_BGTZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BINSLI_B, MIPS_INS_BINSLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSLI_D, MIPS_INS_BINSLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSLI_H, MIPS_INS_BINSLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSLI_W, MIPS_INS_BINSLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSL_B, MIPS_INS_BINSL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSL_D, MIPS_INS_BINSL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSL_H, MIPS_INS_BINSL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSL_W, MIPS_INS_BINSL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSRI_B, MIPS_INS_BINSRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSRI_D, MIPS_INS_BINSRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSRI_H, MIPS_INS_BINSRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSRI_W, MIPS_INS_BINSRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSR_B, MIPS_INS_BINSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSR_D, MIPS_INS_BINSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSR_H, MIPS_INS_BINSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BINSR_W, MIPS_INS_BINSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BITREV, MIPS_INS_BITREV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_BITSWAP, MIPS_INS_BITSWAP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_BLEZ, MIPS_INS_BLEZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLEZ64, MIPS_INS_BLEZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLEZALC, MIPS_INS_BLEZALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BLEZC, MIPS_INS_BLEZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BLEZL, MIPS_INS_BLEZL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLEZ_MM, MIPS_INS_BLEZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BLTC, MIPS_INS_BLTC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BLTUC, MIPS_INS_BLTUC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BLTZ, MIPS_INS_BLTZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLTZ64, MIPS_INS_BLTZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLTZAL, MIPS_INS_BLTZAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_BLTZALC, MIPS_INS_BLTZALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BLTZALL, MIPS_INS_BLTZALL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLTZALS_MM, MIPS_INS_BLTZALS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_BLTZAL_MM, MIPS_INS_BLTZAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_BLTZC, MIPS_INS_BLTZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BLTZL, MIPS_INS_BLTZL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BLTZ_MM, MIPS_INS_BLTZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BMNZI_B, MIPS_INS_BMNZI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BMNZ_V, MIPS_INS_BMNZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BMZI_B, MIPS_INS_BMZI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BMZ_V, MIPS_INS_BMZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNE, MIPS_INS_BNE, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BNE64, MIPS_INS_BNE, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BNEC, MIPS_INS_BNEC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BNEGI_B, MIPS_INS_BNEGI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEGI_D, MIPS_INS_BNEGI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEGI_H, MIPS_INS_BNEGI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEGI_W, MIPS_INS_BNEGI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEG_B, MIPS_INS_BNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEG_D, MIPS_INS_BNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEG_H, MIPS_INS_BNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEG_W, MIPS_INS_BNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BNEL, MIPS_INS_BNEL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_BNEZALC, MIPS_INS_BNEZALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BNEZC, MIPS_INS_BNEZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BNEZC_MM, MIPS_INS_BNEZC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BNE_MM, MIPS_INS_BNE, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 0 #endif }, { Mips_BNVC, MIPS_INS_BNVC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BNZ_B, MIPS_INS_BNZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BNZ_D, MIPS_INS_BNZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BNZ_H, MIPS_INS_BNZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BNZ_V, MIPS_INS_BNZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BNZ_W, MIPS_INS_BNZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BOVC, MIPS_INS_BOVC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 0 #endif }, { Mips_BPOSGE32, MIPS_INS_BPOSGE32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 1, 0 #endif }, { Mips_BREAK, MIPS_INS_BREAK, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_BREAK_MM, MIPS_INS_BREAK, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_BSELI_B, MIPS_INS_BSELI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSEL_V, MIPS_INS_BSEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSETI_B, MIPS_INS_BSETI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSETI_D, MIPS_INS_BSETI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSETI_H, MIPS_INS_BSETI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSETI_W, MIPS_INS_BSETI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSET_B, MIPS_INS_BSET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSET_D, MIPS_INS_BSET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSET_H, MIPS_INS_BSET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BSET_W, MIPS_INS_BSET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_BZ_B, MIPS_INS_BZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BZ_D, MIPS_INS_BZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BZ_H, MIPS_INS_BZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BZ_V, MIPS_INS_BZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BZ_W, MIPS_INS_BZ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MSA, 0 }, 1, 0 #endif }, { Mips_BeqzRxImm16, MIPS_INS_BEQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_BeqzRxImmX16, MIPS_INS_BEQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_Bimm16, MIPS_INS_B, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_BimmX16, MIPS_INS_B, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_BnezRxImm16, MIPS_INS_BNEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_BnezRxImmX16, MIPS_INS_BNEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_Break16, MIPS_INS_BREAK, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_Bteqz16, MIPS_INS_BTEQZ, #ifndef CAPSTONE_DIET { MIPS_REG_T8, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_BteqzX16, MIPS_INS_BTEQZ, #ifndef CAPSTONE_DIET { MIPS_REG_T8, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_Btnez16, MIPS_INS_BTNEZ, #ifndef CAPSTONE_DIET { MIPS_REG_T8, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_BtnezX16, MIPS_INS_BTNEZ, #ifndef CAPSTONE_DIET { MIPS_REG_T8, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 0 #endif }, { Mips_CACHE, MIPS_INS_CACHE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_CACHE_R6, MIPS_INS_CACHE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CEIL_L_D64, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CEIL_L_S, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CEIL_W_D32, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_CEIL_W_D64, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CEIL_W_MM, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CEIL_W_S, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_CEIL_W_S_MM, MIPS_INS_CEIL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CEQI_B, MIPS_INS_CEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQI_D, MIPS_INS_CEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQI_H, MIPS_INS_CEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQI_W, MIPS_INS_CEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQ_B, MIPS_INS_CEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQ_D, MIPS_INS_CEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQ_H, MIPS_INS_CEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CEQ_W, MIPS_INS_CEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CFC1, MIPS_INS_CFC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_CFC1_MM, MIPS_INS_CFC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CFCMSA, MIPS_INS_CFCMSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CINS, MIPS_INS_CINS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_CINS32, MIPS_INS_CINS32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_CLASS_D, MIPS_INS_CLASS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CLASS_S, MIPS_INS_CLASS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CLEI_S_B, MIPS_INS_CLEI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_S_D, MIPS_INS_CLEI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_S_H, MIPS_INS_CLEI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_S_W, MIPS_INS_CLEI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_U_B, MIPS_INS_CLEI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_U_D, MIPS_INS_CLEI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_U_H, MIPS_INS_CLEI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLEI_U_W, MIPS_INS_CLEI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_S_B, MIPS_INS_CLE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_S_D, MIPS_INS_CLE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_S_H, MIPS_INS_CLE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_S_W, MIPS_INS_CLE_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_U_B, MIPS_INS_CLE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_U_D, MIPS_INS_CLE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_U_H, MIPS_INS_CLE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLE_U_W, MIPS_INS_CLE_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLO, MIPS_INS_CLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_CLO_MM, MIPS_INS_CLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CLO_R6, MIPS_INS_CLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CLTI_S_B, MIPS_INS_CLTI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_S_D, MIPS_INS_CLTI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_S_H, MIPS_INS_CLTI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_S_W, MIPS_INS_CLTI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_U_B, MIPS_INS_CLTI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_U_D, MIPS_INS_CLTI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_U_H, MIPS_INS_CLTI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLTI_U_W, MIPS_INS_CLTI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_S_B, MIPS_INS_CLT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_S_D, MIPS_INS_CLT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_S_H, MIPS_INS_CLT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_S_W, MIPS_INS_CLT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_U_B, MIPS_INS_CLT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_U_D, MIPS_INS_CLT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_U_H, MIPS_INS_CLT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLT_U_W, MIPS_INS_CLT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CLZ, MIPS_INS_CLZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_CLZ_MM, MIPS_INS_CLZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CLZ_R6, MIPS_INS_CLZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMPGDU_EQ_QB, MIPS_INS_CMPGDU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_CMPGDU_LE_QB, MIPS_INS_CMPGDU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_CMPGDU_LT_QB, MIPS_INS_CMPGDU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_CMPGU_EQ_QB, MIPS_INS_CMPGU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMPGU_LE_QB, MIPS_INS_CMPGU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMPGU_LT_QB, MIPS_INS_CMPGU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMPU_EQ_QB, MIPS_INS_CMPU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMPU_LE_QB, MIPS_INS_CMPU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMPU_LT_QB, MIPS_INS_CMPU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMP_EQ_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_EQ_PH, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMP_EQ_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_F_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_F_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_LE_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_LE_PH, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMP_LE_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_LT_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_LT_PH, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPCCOND, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_CMP_LT_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SAF_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SAF_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SEQ_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SEQ_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SLE_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SLE_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SLT_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SLT_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SUEQ_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SUEQ_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SULE_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SULE_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SULT_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SULT_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SUN_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_SUN_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_UEQ_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_UEQ_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_ULE_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_ULE_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_ULT_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_ULT_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_UN_D, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_CMP_UN_S, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_COPY_S_B, MIPS_INS_COPY_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_COPY_S_D, MIPS_INS_COPY_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_COPY_S_H, MIPS_INS_COPY_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_COPY_S_W, MIPS_INS_COPY_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_COPY_U_B, MIPS_INS_COPY_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_COPY_U_D, MIPS_INS_COPY_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_COPY_U_H, MIPS_INS_COPY_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_COPY_U_W, MIPS_INS_COPY_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CTC1, MIPS_INS_CTC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_CTC1_MM, MIPS_INS_CTC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CTCMSA, MIPS_INS_CTCMSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_CVT_D32_S, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_D32_W, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_D32_W_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_D64_L, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_D64_S, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_D64_W, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_D_S_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_L_D64, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3_32R2, 0 }, 0, 0 #endif }, { Mips_CVT_L_D64_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_L_S, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3_32R2, 0 }, 0, 0 #endif }, { Mips_CVT_L_S_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_S_D32, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_S_D32_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_S_D64, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_S_L, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_S_W, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_CVT_S_W_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_W_D32, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_W_D64, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_CVT_W_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_CVT_W_S, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_CVT_W_S_MM, MIPS_INS_CVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_C_EQ_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_EQ_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_EQ_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_F_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_F_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_F_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_LE_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_LE_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_LE_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_LT_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_LT_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_LT_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_NGE_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGE_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGE_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_NGLE_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGLE_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGLE_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_NGL_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGL_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGL_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_NGT_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGT_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_NGT_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_OLE_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_OLE_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_OLE_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_OLT_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_OLT_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_OLT_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_SEQ_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_SEQ_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_SEQ_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_SF_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_SF_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_SF_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_UEQ_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_UEQ_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_UEQ_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_ULE_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_ULE_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_ULE_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_ULT_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_ULT_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_ULT_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_C_UN_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_C_UN_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_C_UN_S, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_CmpRxRy16, MIPS_INS_CMP, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_CmpiRxImm16, MIPS_INS_CMPI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_CmpiRxImmX16, MIPS_INS_CMPI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_DADD, MIPS_INS_DADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DADDi, MIPS_INS_DADDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DADDiu, MIPS_INS_DADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DADDu, MIPS_INS_DADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DAHI, MIPS_INS_DAHI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DALIGN, MIPS_INS_DALIGN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DATI, MIPS_INS_DATI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DAUI, MIPS_INS_DAUI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DBITSWAP, MIPS_INS_DBITSWAP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DCLO, MIPS_INS_DCLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DCLO_R6, MIPS_INS_DCLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DCLZ, MIPS_INS_DCLZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DCLZ_R6, MIPS_INS_DCLZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DDIV, MIPS_INS_DDIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DDIVU, MIPS_INS_DDIVU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DERET, MIPS_INS_DERET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, 0 }, 0, 0 #endif }, { Mips_DERET_MM, MIPS_INS_DERET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_DEXT, MIPS_INS_DEXT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DEXTM, MIPS_INS_DEXTM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DEXTU, MIPS_INS_DEXTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DI, MIPS_INS_DI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DINS, MIPS_INS_DINS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DINSM, MIPS_INS_DINSM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DINSU, MIPS_INS_DINSU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_DIV, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_DIVU, MIPS_INS_DIVU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_DIV_S_B, MIPS_INS_DIV_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_S_D, MIPS_INS_DIV_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_S_H, MIPS_INS_DIV_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_S_W, MIPS_INS_DIV_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_U_B, MIPS_INS_DIV_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_U_D, MIPS_INS_DIV_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_U_H, MIPS_INS_DIV_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DIV_U_W, MIPS_INS_DIV_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DI_MM, MIPS_INS_DI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_DLSA, MIPS_INS_DLSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_DLSA_R6, MIPS_INS_DLSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMFC0, MIPS_INS_DMFC0, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_DMFC1, MIPS_INS_DMFC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DMFC2, MIPS_INS_DMFC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_DMOD, MIPS_INS_DMOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMODU, MIPS_INS_DMODU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMTC0, MIPS_INS_DMTC0, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_DMTC1, MIPS_INS_DMTC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DMTC2, MIPS_INS_DMTC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_DMUH, MIPS_INS_DMUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMUHU, MIPS_INS_DMUHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMUL, MIPS_INS_DMUL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_DMULT, MIPS_INS_DMULT, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMULTu, MIPS_INS_DMULTU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMULU, MIPS_INS_DMULU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DMUL_R6, MIPS_INS_DMUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_DOTP_S_D, MIPS_INS_DOTP_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DOTP_S_H, MIPS_INS_DOTP_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DOTP_S_W, MIPS_INS_DOTP_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DOTP_U_D, MIPS_INS_DOTP_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DOTP_U_H, MIPS_INS_DOTP_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DOTP_U_W, MIPS_INS_DOTP_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPADD_S_D, MIPS_INS_DPADD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPADD_S_H, MIPS_INS_DPADD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPADD_S_W, MIPS_INS_DPADD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPADD_U_D, MIPS_INS_DPADD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPADD_U_H, MIPS_INS_DPADD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPADD_U_W, MIPS_INS_DPADD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPAQX_SA_W_PH, MIPS_INS_DPAQX_SA, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPAQX_S_W_PH, MIPS_INS_DPAQX_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPAQ_SA_L_W, MIPS_INS_DPAQ_SA, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPAQ_S_W_PH, MIPS_INS_DPAQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPAU_H_QBL, MIPS_INS_DPAU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPAU_H_QBR, MIPS_INS_DPAU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPAX_W_PH, MIPS_INS_DPAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPA_W_PH, MIPS_INS_DPA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPOP, MIPS_INS_DPOP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_DPSQX_SA_W_PH, MIPS_INS_DPSQX_SA, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPSQX_S_W_PH, MIPS_INS_DPSQX_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPSQ_SA_L_W, MIPS_INS_DPSQ_SA, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPSQ_S_W_PH, MIPS_INS_DPSQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPSUB_S_D, MIPS_INS_DPSUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPSUB_S_H, MIPS_INS_DPSUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPSUB_S_W, MIPS_INS_DPSUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPSUB_U_D, MIPS_INS_DPSUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPSUB_U_H, MIPS_INS_DPSUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPSUB_U_W, MIPS_INS_DPSUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_DPSU_H_QBL, MIPS_INS_DPSU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPSU_H_QBR, MIPS_INS_DPSU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_DPSX_W_PH, MIPS_INS_DPSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DPS_W_PH, MIPS_INS_DPS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_DROTR, MIPS_INS_DROTR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R2, 0 }, 0, 0 #endif }, { Mips_DROTR32, MIPS_INS_DROTR32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R2, 0 }, 0, 0 #endif }, { Mips_DROTRV, MIPS_INS_DROTRV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R2, 0 }, 0, 0 #endif }, { Mips_DSBH, MIPS_INS_DSBH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R2, 0 }, 0, 0 #endif }, { Mips_DSDIV, MIPS_INS_DDIV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DSHD, MIPS_INS_DSHD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R2, 0 }, 0, 0 #endif }, { Mips_DSLL, MIPS_INS_DSLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSLL32, MIPS_INS_DSLL32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSLL64_32, MIPS_INS_DSLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_DSLLV, MIPS_INS_DSLLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSRA, MIPS_INS_DSRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSRA32, MIPS_INS_DSRA32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSRAV, MIPS_INS_DSRAV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSRL, MIPS_INS_DSRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSRL32, MIPS_INS_DSRL32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSRLV, MIPS_INS_DSRLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSUB, MIPS_INS_DSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DSUBu, MIPS_INS_DSUBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_DUDIV, MIPS_INS_DDIVU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_DivRxRy16, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_DivuRxRy16, MIPS_INS_DIVU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_EHB, MIPS_INS_EHB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_EI, MIPS_INS_EI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_EI_MM, MIPS_INS_EI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ERET, MIPS_INS_ERET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3_32, 0 }, 0, 0 #endif }, { Mips_ERET_MM, MIPS_INS_ERET, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_EXT, MIPS_INS_EXT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_EXTP, MIPS_INS_EXTP, #ifndef CAPSTONE_DIET { MIPS_REG_DSPPOS, 0 }, { MIPS_REG_DSPEFI, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTPDP, MIPS_INS_EXTPDP, #ifndef CAPSTONE_DIET { MIPS_REG_DSPPOS, 0 }, { MIPS_REG_DSPPOS, MIPS_REG_DSPEFI, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTPDPV, MIPS_INS_EXTPDPV, #ifndef CAPSTONE_DIET { MIPS_REG_DSPPOS, 0 }, { MIPS_REG_DSPPOS, MIPS_REG_DSPEFI, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTPV, MIPS_INS_EXTPV, #ifndef CAPSTONE_DIET { MIPS_REG_DSPPOS, 0 }, { MIPS_REG_DSPEFI, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTRV_RS_W, MIPS_INS_EXTRV_RS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTRV_R_W, MIPS_INS_EXTRV_R, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTRV_S_H, MIPS_INS_EXTRV_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTRV_W, MIPS_INS_EXTRV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTR_RS_W, MIPS_INS_EXTR_RS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTR_R_W, MIPS_INS_EXTR_R, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTR_S_H, MIPS_INS_EXTR_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTR_W, MIPS_INS_EXTR, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG23, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_EXTS, MIPS_INS_EXTS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_EXTS32, MIPS_INS_EXTS32, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_EXT_MM, MIPS_INS_EXT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FABS_D32, MIPS_INS_ABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FABS_D64, MIPS_INS_ABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FABS_MM, MIPS_INS_ABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FABS_S, MIPS_INS_ABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FABS_S_MM, MIPS_INS_ABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FADD_D, MIPS_INS_FADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FADD_D32, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FADD_D64, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FADD_MM, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FADD_S, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FADD_S_MM, MIPS_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FADD_W, MIPS_INS_FADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCAF_D, MIPS_INS_FCAF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCAF_W, MIPS_INS_FCAF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCEQ_D, MIPS_INS_FCEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCEQ_W, MIPS_INS_FCEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCLASS_D, MIPS_INS_FCLASS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCLASS_W, MIPS_INS_FCLASS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCLE_D, MIPS_INS_FCLE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCLE_W, MIPS_INS_FCLE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCLT_D, MIPS_INS_FCLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCLT_W, MIPS_INS_FCLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCMP_D32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_FCC0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FCMP_D32_MM, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_FCC0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FCMP_D64, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_FCC0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FCMP_S32, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_FCC0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_FCMP_S32_MM, MIPS_INS_C, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_FCC0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FCNE_D, MIPS_INS_FCNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCNE_W, MIPS_INS_FCNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCOR_D, MIPS_INS_FCOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCOR_W, MIPS_INS_FCOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCUEQ_D, MIPS_INS_FCUEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCUEQ_W, MIPS_INS_FCUEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCULE_D, MIPS_INS_FCULE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCULE_W, MIPS_INS_FCULE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCULT_D, MIPS_INS_FCULT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCULT_W, MIPS_INS_FCULT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCUNE_D, MIPS_INS_FCUNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCUNE_W, MIPS_INS_FCUNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCUN_D, MIPS_INS_FCUN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FCUN_W, MIPS_INS_FCUN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FDIV_D, MIPS_INS_FDIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FDIV_D32, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FDIV_D64, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FDIV_MM, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FDIV_S, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FDIV_S_MM, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FDIV_W, MIPS_INS_FDIV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXDO_H, MIPS_INS_FEXDO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXDO_W, MIPS_INS_FEXDO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXP2_D, MIPS_INS_FEXP2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXP2_W, MIPS_INS_FEXP2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXUPL_D, MIPS_INS_FEXUPL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXUPL_W, MIPS_INS_FEXUPL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXUPR_D, MIPS_INS_FEXUPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FEXUPR_W, MIPS_INS_FEXUPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFINT_S_D, MIPS_INS_FFINT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFINT_S_W, MIPS_INS_FFINT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFINT_U_D, MIPS_INS_FFINT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFINT_U_W, MIPS_INS_FFINT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFQL_D, MIPS_INS_FFQL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFQL_W, MIPS_INS_FFQL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFQR_D, MIPS_INS_FFQR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FFQR_W, MIPS_INS_FFQR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FILL_B, MIPS_INS_FILL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FILL_D, MIPS_INS_FILL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_FILL_H, MIPS_INS_FILL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FILL_W, MIPS_INS_FILL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FLOG2_D, MIPS_INS_FLOG2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FLOG2_W, MIPS_INS_FLOG2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FLOOR_L_D64, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FLOOR_L_S, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FLOOR_W_D32, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FLOOR_W_D64, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FLOOR_W_MM, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FLOOR_W_S, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_FLOOR_W_S_MM, MIPS_INS_FLOOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FMADD_D, MIPS_INS_FMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMADD_W, MIPS_INS_FMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMAX_A_D, MIPS_INS_FMAX_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMAX_A_W, MIPS_INS_FMAX_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMAX_D, MIPS_INS_FMAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMAX_W, MIPS_INS_FMAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMIN_A_D, MIPS_INS_FMIN_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMIN_A_W, MIPS_INS_FMIN_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMIN_D, MIPS_INS_FMIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMIN_W, MIPS_INS_FMIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMOV_D32, MIPS_INS_MOV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FMOV_D32_MM, MIPS_INS_MOV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FMOV_D64, MIPS_INS_MOV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FMOV_S, MIPS_INS_MOV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FMOV_S_MM, MIPS_INS_MOV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FMSUB_D, MIPS_INS_FMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMSUB_W, MIPS_INS_FMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMUL_D, MIPS_INS_FMUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FMUL_D32, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FMUL_D64, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FMUL_MM, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FMUL_S, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FMUL_S_MM, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FMUL_W, MIPS_INS_FMUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FNEG_D32, MIPS_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FNEG_D64, MIPS_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FNEG_MM, MIPS_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FNEG_S, MIPS_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FNEG_S_MM, MIPS_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FRCP_D, MIPS_INS_FRCP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FRCP_W, MIPS_INS_FRCP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FRINT_D, MIPS_INS_FRINT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FRINT_W, MIPS_INS_FRINT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FRSQRT_D, MIPS_INS_FRSQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FRSQRT_W, MIPS_INS_FRSQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSAF_D, MIPS_INS_FSAF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSAF_W, MIPS_INS_FSAF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSEQ_D, MIPS_INS_FSEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSEQ_W, MIPS_INS_FSEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSLE_D, MIPS_INS_FSLE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSLE_W, MIPS_INS_FSLE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSLT_D, MIPS_INS_FSLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSLT_W, MIPS_INS_FSLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSNE_D, MIPS_INS_FSNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSNE_W, MIPS_INS_FSNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSOR_D, MIPS_INS_FSOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSOR_W, MIPS_INS_FSOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSQRT_D, MIPS_INS_FSQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSQRT_D32, MIPS_INS_SQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FSQRT_D64, MIPS_INS_SQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FSQRT_MM, MIPS_INS_SQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FSQRT_S, MIPS_INS_SQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_FSQRT_S_MM, MIPS_INS_SQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FSQRT_W, MIPS_INS_FSQRT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUB_D, MIPS_INS_FSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUB_D32, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_FSUB_D64, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_FSUB_MM, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FSUB_S, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_FSUB_S_MM, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_FSUB_W, MIPS_INS_FSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUEQ_D, MIPS_INS_FSUEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUEQ_W, MIPS_INS_FSUEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSULE_D, MIPS_INS_FSULE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSULE_W, MIPS_INS_FSULE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSULT_D, MIPS_INS_FSULT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSULT_W, MIPS_INS_FSULT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUNE_D, MIPS_INS_FSUNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUNE_W, MIPS_INS_FSUNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUN_D, MIPS_INS_FSUN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FSUN_W, MIPS_INS_FSUN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTINT_S_D, MIPS_INS_FTINT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTINT_S_W, MIPS_INS_FTINT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTINT_U_D, MIPS_INS_FTINT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTINT_U_W, MIPS_INS_FTINT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTQ_H, MIPS_INS_FTQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTQ_W, MIPS_INS_FTQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTRUNC_S_D, MIPS_INS_FTRUNC_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTRUNC_S_W, MIPS_INS_FTRUNC_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTRUNC_U_D, MIPS_INS_FTRUNC_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_FTRUNC_U_W, MIPS_INS_FTRUNC_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HADD_S_D, MIPS_INS_HADD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HADD_S_H, MIPS_INS_HADD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HADD_S_W, MIPS_INS_HADD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HADD_U_D, MIPS_INS_HADD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HADD_U_H, MIPS_INS_HADD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HADD_U_W, MIPS_INS_HADD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HSUB_S_D, MIPS_INS_HSUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HSUB_S_H, MIPS_INS_HSUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HSUB_S_W, MIPS_INS_HSUB_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HSUB_U_D, MIPS_INS_HSUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HSUB_U_H, MIPS_INS_HSUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_HSUB_U_W, MIPS_INS_HSUB_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVEV_B, MIPS_INS_ILVEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVEV_D, MIPS_INS_ILVEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVEV_H, MIPS_INS_ILVEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVEV_W, MIPS_INS_ILVEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVL_B, MIPS_INS_ILVL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVL_D, MIPS_INS_ILVL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVL_H, MIPS_INS_ILVL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVL_W, MIPS_INS_ILVL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVOD_B, MIPS_INS_ILVOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVOD_D, MIPS_INS_ILVOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVOD_H, MIPS_INS_ILVOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVOD_W, MIPS_INS_ILVOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVR_B, MIPS_INS_ILVR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVR_D, MIPS_INS_ILVR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVR_H, MIPS_INS_ILVR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ILVR_W, MIPS_INS_ILVR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INS, MIPS_INS_INS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_INSERT_B, MIPS_INS_INSERT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INSERT_D, MIPS_INS_INSERT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_INSERT_H, MIPS_INS_INSERT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INSERT_W, MIPS_INS_INSERT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INSV, MIPS_INS_INSV, #ifndef CAPSTONE_DIET { MIPS_REG_DSPPOS, MIPS_REG_DSPSCOUNT, 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_INSVE_B, MIPS_INS_INSVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INSVE_D, MIPS_INS_INSVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INSVE_H, MIPS_INS_INSVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INSVE_W, MIPS_INS_INSVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_INS_MM, MIPS_INS_INS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_J, MIPS_INS_J, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, 0 }, 1, 0 #endif }, { Mips_JAL, MIPS_INS_JAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_JALR, MIPS_INS_JALR, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_JALR16_MM, MIPS_INS_JALR, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_JALR64, MIPS_INS_JALR, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_JALRS_MM, MIPS_INS_JALRS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_JALR_HB, MIPS_INS_JALR_HB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, 0 }, 0, 1 #endif }, { Mips_JALR_MM, MIPS_INS_JALR, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_JALS_MM, MIPS_INS_JALS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_JALX, MIPS_INS_JALX, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_JAL_MM, MIPS_INS_JAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_JIALC, MIPS_INS_JIALC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_JIC, MIPS_INS_JIC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_JR, MIPS_INS_JR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 1, 1 #endif }, { Mips_JR64, MIPS_INS_JR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 1, 1 #endif }, { Mips_JRADDIUSP, MIPS_INS_JRADDIUSP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 1 #endif }, { Mips_JR_HB, MIPS_INS_JR_HB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 1, 1 #endif }, { Mips_JR_HB_R6, MIPS_INS_JR_HB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 1, 1 #endif }, { Mips_JR_MM, MIPS_INS_JR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 1, 1 #endif }, { Mips_J_MM, MIPS_INS_J, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_AT, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_Jal16, MIPS_INS_JAL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_JrRa16, MIPS_INS_JR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 1 #endif }, { Mips_JrcRa16, MIPS_INS_JRC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 1 #endif }, { Mips_JrcRx16, MIPS_INS_JRC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 1, 1 #endif }, { Mips_JumpLinkReg16, MIPS_INS_JALRC, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_RA, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LB, MIPS_INS_LB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LB64, MIPS_INS_LB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LBUX, MIPS_INS_LBUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_LB_MM, MIPS_INS_LB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LBu, MIPS_INS_LBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LBu64, MIPS_INS_LBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LBu_MM, MIPS_INS_LBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LD, MIPS_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_LDC1, MIPS_INS_LDC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_LDC164, MIPS_INS_LDC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_LDC1_MM, MIPS_INS_LDC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LDC2, MIPS_INS_LDC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LDC2_R6, MIPS_INS_LDC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LDC3, MIPS_INS_LDC3, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_LDI_B, MIPS_INS_LDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LDI_D, MIPS_INS_LDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LDI_H, MIPS_INS_LDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LDI_W, MIPS_INS_LDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LDL, MIPS_INS_LDL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LDPC, MIPS_INS_LDPC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS64R6, 0 }, 0, 0 #endif }, { Mips_LDR, MIPS_INS_LDR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LDXC1, MIPS_INS_LDXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS4_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, MIPS_GRP_NOTNACL, 0 }, 0, 0 #endif }, { Mips_LDXC164, MIPS_INS_LDXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LD_B, MIPS_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LD_D, MIPS_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LD_H, MIPS_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LD_W, MIPS_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LEA_ADDiu, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LEA_ADDiu64, MIPS_INS_DADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LEA_ADDiu_MM, MIPS_INS_ADDIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LH, MIPS_INS_LH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LH64, MIPS_INS_LH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LHX, MIPS_INS_LHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_LH_MM, MIPS_INS_LH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LHu, MIPS_INS_LHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LHu64, MIPS_INS_LHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LHu_MM, MIPS_INS_LHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LL, MIPS_INS_LL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_LLD, MIPS_INS_LLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LLD_R6, MIPS_INS_LLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LL_MM, MIPS_INS_LL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LL_R6, MIPS_INS_LL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LSA, MIPS_INS_LSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_LSA_R6, MIPS_INS_LSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LUXC1, MIPS_INS_LUXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS5_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTNACL, 0 }, 0, 0 #endif }, { Mips_LUXC164, MIPS_INS_LUXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS5_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LUXC1_MM, MIPS_INS_LUXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LUi, MIPS_INS_LUI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LUi64, MIPS_INS_LUI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LUi_MM, MIPS_INS_LUI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LW, MIPS_INS_LW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LW64, MIPS_INS_LW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LWC1, MIPS_INS_LWC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LWC1_MM, MIPS_INS_LWC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWC2, MIPS_INS_LWC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_LWC2_R6, MIPS_INS_LWC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LWC3, MIPS_INS_LWC3, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LWL, MIPS_INS_LWL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWL64, MIPS_INS_LWL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LWL_MM, MIPS_INS_LWL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWPC, MIPS_INS_LWPC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LWR, MIPS_INS_LWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWR64, MIPS_INS_LWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_LWR_MM, MIPS_INS_LWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWUPC, MIPS_INS_LWUPC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_LWU_MM, MIPS_INS_LWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWX, MIPS_INS_LWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_LWXC1, MIPS_INS_LWXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTNACL, 0 }, 0, 0 #endif }, { Mips_LWXC1_MM, MIPS_INS_LWXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LW_MM, MIPS_INS_LW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_LWu, MIPS_INS_LWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_LbRxRyOffMemX16, MIPS_INS_LB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LbuRxRyOffMemX16, MIPS_INS_LBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LhRxRyOffMemX16, MIPS_INS_LH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LhuRxRyOffMemX16, MIPS_INS_LHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LiRxImm16, MIPS_INS_LI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LiRxImmX16, MIPS_INS_LI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LwRxPcTcp16, MIPS_INS_LW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LwRxPcTcpX16, MIPS_INS_LW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LwRxRyOffMemX16, MIPS_INS_LW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_LwRxSpImmX16, MIPS_INS_LW, #ifndef CAPSTONE_DIET { MIPS_REG_SP, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_MADD, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MADDF_D, MIPS_INS_MADDF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MADDF_S, MIPS_INS_MADDF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MADDR_Q_H, MIPS_INS_MADDR_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADDR_Q_W, MIPS_INS_MADDR_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADDU, MIPS_INS_MADDU, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MADDU_DSP, MIPS_INS_MADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MADDU_MM, MIPS_INS_MADDU, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MADDV_B, MIPS_INS_MADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADDV_D, MIPS_INS_MADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADDV_H, MIPS_INS_MADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADDV_W, MIPS_INS_MADDV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADD_D32, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MADD_D32_MM, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MADD_D64, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MADD_DSP, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MADD_MM, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MADD_Q_H, MIPS_INS_MADD_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADD_Q_W, MIPS_INS_MADD_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MADD_S, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MADD_S_MM, MIPS_INS_MADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MAQ_SA_W_PHL, MIPS_INS_MAQ_SA, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MAQ_SA_W_PHR, MIPS_INS_MAQ_SA, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MAQ_S_W_PHL, MIPS_INS_MAQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MAQ_S_W_PHR, MIPS_INS_MAQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MAXA_D, MIPS_INS_MAXA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MAXA_S, MIPS_INS_MAXA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MAXI_S_B, MIPS_INS_MAXI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_S_D, MIPS_INS_MAXI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_S_H, MIPS_INS_MAXI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_S_W, MIPS_INS_MAXI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_U_B, MIPS_INS_MAXI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_U_D, MIPS_INS_MAXI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_U_H, MIPS_INS_MAXI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAXI_U_W, MIPS_INS_MAXI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_A_B, MIPS_INS_MAX_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_A_D, MIPS_INS_MAX_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_A_H, MIPS_INS_MAX_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_A_W, MIPS_INS_MAX_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_D, MIPS_INS_MAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MAX_S, MIPS_INS_MAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MAX_S_B, MIPS_INS_MAX_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_S_D, MIPS_INS_MAX_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_S_H, MIPS_INS_MAX_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_S_W, MIPS_INS_MAX_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_U_B, MIPS_INS_MAX_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_U_D, MIPS_INS_MAX_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_U_H, MIPS_INS_MAX_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MAX_U_W, MIPS_INS_MAX_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MFC0, MIPS_INS_MFC0, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, 0 }, 0, 0 #endif }, { Mips_MFC1, MIPS_INS_MFC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_MFC1_MM, MIPS_INS_MFC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFC2, MIPS_INS_MFC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_MFHC1_D32, MIPS_INS_MFHC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_MFHC1_D64, MIPS_INS_MFHC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_MFHC1_MM, MIPS_INS_MFHC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFHI, MIPS_INS_MFHI, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFHI16_MM, MIPS_INS_MFHI, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFHI64, MIPS_INS_MFHI, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MFHI_DSP, MIPS_INS_MFHI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MFHI_MM, MIPS_INS_MFHI, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFLO, MIPS_INS_MFLO, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFLO16_MM, MIPS_INS_MFLO, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MFLO64, MIPS_INS_MFLO, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MFLO_DSP, MIPS_INS_MFLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MFLO_MM, MIPS_INS_MFLO, #ifndef CAPSTONE_DIET { MIPS_REG_AC0, 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MINA_D, MIPS_INS_MINA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MINA_S, MIPS_INS_MINA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MINI_S_B, MIPS_INS_MINI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_S_D, MIPS_INS_MINI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_S_H, MIPS_INS_MINI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_S_W, MIPS_INS_MINI_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_U_B, MIPS_INS_MINI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_U_D, MIPS_INS_MINI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_U_H, MIPS_INS_MINI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MINI_U_W, MIPS_INS_MINI_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_A_B, MIPS_INS_MIN_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_A_D, MIPS_INS_MIN_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_A_H, MIPS_INS_MIN_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_A_W, MIPS_INS_MIN_A, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_D, MIPS_INS_MIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MIN_S, MIPS_INS_MIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MIN_S_B, MIPS_INS_MIN_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_S_D, MIPS_INS_MIN_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_S_H, MIPS_INS_MIN_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_S_W, MIPS_INS_MIN_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_U_B, MIPS_INS_MIN_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_U_D, MIPS_INS_MIN_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_U_H, MIPS_INS_MIN_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MIN_U_W, MIPS_INS_MIN_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD, MIPS_INS_MOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MODSUB, MIPS_INS_MODSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MODU, MIPS_INS_MODU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MOD_S_B, MIPS_INS_MOD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_S_D, MIPS_INS_MOD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_S_H, MIPS_INS_MOD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_S_W, MIPS_INS_MOD_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_U_B, MIPS_INS_MOD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_U_D, MIPS_INS_MOD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_U_H, MIPS_INS_MOD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOD_U_W, MIPS_INS_MOD_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOVE16_MM, MIPS_INS_MOVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVE_V, MIPS_INS_MOVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MOVF_D32, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVF_D32_MM, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVF_D64, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVF_I, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVF_I64, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_GP64BIT, 0 }, 0, 0 #endif }, { Mips_MOVF_I_MM, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVF_S, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVF_S_MM, MIPS_INS_MOVF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVN_I64_D64, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I64_I, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I64_I64, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I64_S, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_GP64BIT, 0 }, 0, 0 #endif }, { Mips_MOVN_I_D32, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I_D32_MM, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVN_I_D64, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I_I, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I_I64, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I_MM, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVN_I_S, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVN_I_S_MM, MIPS_INS_MOVN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVT_D32, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVT_D32_MM, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVT_D64, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVT_I, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVT_I64, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_GP64BIT, 0 }, 0, 0 #endif }, { Mips_MOVT_I_MM, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVT_S, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVT_S_MM, MIPS_INS_MOVT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVZ_I64_D64, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I64_I, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I64_I64, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I64_S, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_MIPS64, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_D32, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_D32_MM, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_D64, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_I, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_I64, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_MM, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_S, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MOVZ_I_S_MM, MIPS_INS_MOVZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MSUB, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MSUBF_D, MIPS_INS_MSUBF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MSUBF_S, MIPS_INS_MSUBF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MSUBR_Q_H, MIPS_INS_MSUBR_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUBR_Q_W, MIPS_INS_MSUBR_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUBU, MIPS_INS_MSUBU, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MSUBU_DSP, MIPS_INS_MSUBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MSUBU_MM, MIPS_INS_MSUBU, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MSUBV_B, MIPS_INS_MSUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUBV_D, MIPS_INS_MSUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUBV_H, MIPS_INS_MSUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUBV_W, MIPS_INS_MSUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUB_D32, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MSUB_D32_MM, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MSUB_D64, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MSUB_DSP, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MSUB_MM, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MSUB_Q_H, MIPS_INS_MSUB_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUB_Q_W, MIPS_INS_MSUB_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MSUB_S, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MSUB_S_MM, MIPS_INS_MSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MTC0, MIPS_INS_MTC0, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, 0 }, 0, 0 #endif }, { Mips_MTC1, MIPS_INS_MTC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_MTC1_MM, MIPS_INS_MTC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MTC2, MIPS_INS_MTC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_MTHC1_D32, MIPS_INS_MTHC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_MTHC1_D64, MIPS_INS_MTHC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_MTHC1_MM, MIPS_INS_MTHC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MTHI, MIPS_INS_MTHI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MTHI64, MIPS_INS_MTHI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MTHI_DSP, MIPS_INS_MTHI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MTHI_MM, MIPS_INS_MTHI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MTHLIP, MIPS_INS_MTHLIP, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPPOS, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MTLO, MIPS_INS_MTLO, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MTLO64, MIPS_INS_MTLO, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MTLO_DSP, MIPS_INS_MTLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MTLO_MM, MIPS_INS_MTLO, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MTM0, MIPS_INS_MTM0, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_MPL0, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_MTM1, MIPS_INS_MTM1, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_MPL1, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_MTM2, MIPS_INS_MTM2, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_MPL2, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_MTP0, MIPS_INS_MTP0, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_P0, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_MTP1, MIPS_INS_MTP1, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_P1, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_MTP2, MIPS_INS_MTP2, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_MUH, MIPS_INS_MUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MUHU, MIPS_INS_MUHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MUL, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MULEQ_S_W_PHL, MIPS_INS_MULEQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULEQ_S_W_PHR, MIPS_INS_MULEQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULEU_S_PH_QBL, MIPS_INS_MULEU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULEU_S_PH_QBR, MIPS_INS_MULEU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULQ_RS_PH, MIPS_INS_MULQ_RS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULQ_RS_W, MIPS_INS_MULQ_RS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_MULQ_S_PH, MIPS_INS_MULQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_MULQ_S_W, MIPS_INS_MULQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_MULR_Q_H, MIPS_INS_MULR_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MULR_Q_W, MIPS_INS_MULR_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MULSAQ_S_W_PH, MIPS_INS_MULSAQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG16_19, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULSA_W_PH, MIPS_INS_MULSA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_MULT, MIPS_INS_MULT, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MULTU_DSP, MIPS_INS_MULTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULT_DSP, MIPS_INS_MULT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_MULT_MM, MIPS_INS_MULT, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MULTu, MIPS_INS_MULTU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_MULTu_MM, MIPS_INS_MULTU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MULU, MIPS_INS_MULU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MULV_B, MIPS_INS_MULV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MULV_D, MIPS_INS_MULV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MULV_H, MIPS_INS_MULV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MULV_W, MIPS_INS_MULV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MUL_MM, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_MUL_PH, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_MUL_Q_H, MIPS_INS_MUL_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MUL_Q_W, MIPS_INS_MUL_Q, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_MUL_R6, MIPS_INS_MUL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_MUL_S_PH, MIPS_INS_MUL_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG21, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_Mfhi16, MIPS_INS_MFHI, #ifndef CAPSTONE_DIET { MIPS_REG_HI0, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_Mflo16, MIPS_INS_MFLO, #ifndef CAPSTONE_DIET { MIPS_REG_LO0, 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_Move32R16, MIPS_INS_MOVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_MoveR3216, MIPS_INS_MOVE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_NLOC_B, MIPS_INS_NLOC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLOC_D, MIPS_INS_NLOC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLOC_H, MIPS_INS_NLOC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLOC_W, MIPS_INS_NLOC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLZC_B, MIPS_INS_NLZC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLZC_D, MIPS_INS_NLZC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLZC_H, MIPS_INS_NLZC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NLZC_W, MIPS_INS_NLZC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NMADD_D32, MIPS_INS_NMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NONANSFPMATH, 0 }, 0, 0 #endif }, { Mips_NMADD_D32_MM, MIPS_INS_NMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_NMADD_D64, MIPS_INS_NMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NONANSFPMATH, 0 }, 0, 0 #endif }, { Mips_NMADD_S, MIPS_INS_NMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NONANSFPMATH, 0 }, 0, 0 #endif }, { Mips_NMADD_S_MM, MIPS_INS_NMADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_NMSUB_D32, MIPS_INS_NMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NONANSFPMATH, 0 }, 0, 0 #endif }, { Mips_NMSUB_D32_MM, MIPS_INS_NMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_NMSUB_D64, MIPS_INS_NMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NONANSFPMATH, 0 }, 0, 0 #endif }, { Mips_NMSUB_S, MIPS_INS_NMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NONANSFPMATH, 0 }, 0, 0 #endif }, { Mips_NMSUB_S_MM, MIPS_INS_NMSUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_NOR, MIPS_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_NOR64, MIPS_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_NORI_B, MIPS_INS_NORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NOR_MM, MIPS_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_NOR_V, MIPS_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_NegRxRy16, MIPS_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_NotRxRy16, MIPS_INS_NOT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_OR, MIPS_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_OR64, MIPS_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ORI_B, MIPS_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_OR_MM, MIPS_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_OR_V, MIPS_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ORi, MIPS_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ORi64, MIPS_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ORi_MM, MIPS_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_OrRxRxRy16, MIPS_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_PACKRL_PH, MIPS_INS_PACKRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PAUSE, MIPS_INS_PAUSE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_PCKEV_B, MIPS_INS_PCKEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKEV_D, MIPS_INS_PCKEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKEV_H, MIPS_INS_PCKEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKEV_W, MIPS_INS_PCKEV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKOD_B, MIPS_INS_PCKOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKOD_D, MIPS_INS_PCKOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKOD_H, MIPS_INS_PCKOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCKOD_W, MIPS_INS_PCKOD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCNT_B, MIPS_INS_PCNT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCNT_D, MIPS_INS_PCNT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCNT_H, MIPS_INS_PCNT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PCNT_W, MIPS_INS_PCNT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_PICK_PH, MIPS_INS_PICK, #ifndef CAPSTONE_DIET { MIPS_REG_DSPCCOND, 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PICK_QB, MIPS_INS_PICK, #ifndef CAPSTONE_DIET { MIPS_REG_DSPCCOND, 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_POP, MIPS_INS_POP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_PRECEQU_PH_QBL, MIPS_INS_PRECEQU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEQU_PH_QBLA, MIPS_INS_PRECEQU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEQU_PH_QBR, MIPS_INS_PRECEQU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEQU_PH_QBRA, MIPS_INS_PRECEQU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEQ_W_PHL, MIPS_INS_PRECEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEQ_W_PHR, MIPS_INS_PRECEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEU_PH_QBL, MIPS_INS_PRECEU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEU_PH_QBLA, MIPS_INS_PRECEU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEU_PH_QBR, MIPS_INS_PRECEU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECEU_PH_QBRA, MIPS_INS_PRECEU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECRQU_S_QB_PH, MIPS_INS_PRECRQU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECRQ_PH_W, MIPS_INS_PRECRQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECRQ_QB_PH, MIPS_INS_PRECRQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECRQ_RS_PH_W, MIPS_INS_PRECRQ_RS, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_PRECR_QB_PH, MIPS_INS_PRECR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_PRECR_SRA_PH_W, MIPS_INS_PRECR_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_PRECR_SRA_R_PH_W, MIPS_INS_PRECR_SRA_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_PREF, MIPS_INS_PREF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3_32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_PREF_R6, MIPS_INS_PREF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_PREPEND, MIPS_INS_PREPEND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_RADDU_W_QB, MIPS_INS_RADDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_RDDSP, MIPS_INS_RDDSP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_RDHWR, MIPS_INS_RDHWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_RDHWR64, MIPS_INS_RDHWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_REPLV_PH, MIPS_INS_REPLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_REPLV_QB, MIPS_INS_REPLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_REPL_PH, MIPS_INS_REPL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_REPL_QB, MIPS_INS_REPL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_RINT_D, MIPS_INS_RINT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_RINT_S, MIPS_INS_RINT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_ROTR, MIPS_INS_ROTR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_ROTRV, MIPS_INS_ROTRV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_ROTRV_MM, MIPS_INS_ROTRV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ROTR_MM, MIPS_INS_ROTR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ROUND_L_D64, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_ROUND_L_S, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_ROUND_W_D32, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_ROUND_W_D64, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_ROUND_W_MM, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_ROUND_W_S, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_ROUND_W_S_MM, MIPS_INS_ROUND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SAT_S_B, MIPS_INS_SAT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_S_D, MIPS_INS_SAT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_S_H, MIPS_INS_SAT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_S_W, MIPS_INS_SAT_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_U_B, MIPS_INS_SAT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_U_D, MIPS_INS_SAT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_U_H, MIPS_INS_SAT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SAT_U_W, MIPS_INS_SAT_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SB, MIPS_INS_SB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SB64, MIPS_INS_SB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SB_MM, MIPS_INS_SB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SC, MIPS_INS_SC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_SCD, MIPS_INS_SCD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SCD_R6, MIPS_INS_SCD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SC_MM, MIPS_INS_SC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SC_R6, MIPS_INS_SC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SD, MIPS_INS_SD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, 0 }, 0, 0 #endif }, { Mips_SDBBP, MIPS_INS_SDBBP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SDBBP_R6, MIPS_INS_SDBBP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SDC1, MIPS_INS_SDC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_SDC164, MIPS_INS_SDC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_SDC1_MM, MIPS_INS_SDC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SDC2, MIPS_INS_SDC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SDC2_R6, MIPS_INS_SDC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SDC3, MIPS_INS_SDC3, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_SDIV, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SDIV_MM, MIPS_INS_DIV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SDL, MIPS_INS_SDL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SDR, MIPS_INS_SDR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS3, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SDXC1, MIPS_INS_SDXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS4_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, MIPS_GRP_NOTNACL, 0 }, 0, 0 #endif }, { Mips_SDXC164, MIPS_INS_SDXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS4_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SEB, MIPS_INS_SEB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_SEB64, MIPS_INS_SEB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_SEB_MM, MIPS_INS_SEB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SEH, MIPS_INS_SEH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_SEH64, MIPS_INS_SEH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_SEH_MM, MIPS_INS_SEH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SELEQZ, MIPS_INS_SELEQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_GP32BIT, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELEQZ64, MIPS_INS_SELEQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_GP64BIT, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELEQZ_D, MIPS_INS_SELEQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELEQZ_S, MIPS_INS_SELEQZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELNEZ, MIPS_INS_SELNEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_GP32BIT, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELNEZ64, MIPS_INS_SELNEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_GP64BIT, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELNEZ_D, MIPS_INS_SELNEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SELNEZ_S, MIPS_INS_SELNEZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SEL_D, MIPS_INS_SEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SEL_S, MIPS_INS_SEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SEQ, MIPS_INS_SEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_SEQi, MIPS_INS_SEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_SH, MIPS_INS_SH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SH64, MIPS_INS_SH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SHF_B, MIPS_INS_SHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SHF_H, MIPS_INS_SHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SHF_W, MIPS_INS_SHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SHILO, MIPS_INS_SHILO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHILOV, MIPS_INS_SHILOV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLLV_PH, MIPS_INS_SHLLV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLLV_QB, MIPS_INS_SHLLV, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLLV_S_PH, MIPS_INS_SHLLV_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLLV_S_W, MIPS_INS_SHLLV_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLL_PH, MIPS_INS_SHLL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLL_QB, MIPS_INS_SHLL, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLL_S_PH, MIPS_INS_SHLL_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHLL_S_W, MIPS_INS_SHLL_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG22, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRAV_PH, MIPS_INS_SHRAV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRAV_QB, MIPS_INS_SHRAV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SHRAV_R_PH, MIPS_INS_SHRAV_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRAV_R_QB, MIPS_INS_SHRAV_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SHRAV_R_W, MIPS_INS_SHRAV_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRA_PH, MIPS_INS_SHRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRA_QB, MIPS_INS_SHRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SHRA_R_PH, MIPS_INS_SHRA_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRA_R_QB, MIPS_INS_SHRA_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SHRA_R_W, MIPS_INS_SHRA_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRLV_PH, MIPS_INS_SHRLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SHRLV_QB, MIPS_INS_SHRLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SHRL_PH, MIPS_INS_SHRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SHRL_QB, MIPS_INS_SHRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SH_MM, MIPS_INS_SH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SLDI_B, MIPS_INS_SLDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLDI_D, MIPS_INS_SLDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLDI_H, MIPS_INS_SLDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLDI_W, MIPS_INS_SLDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLD_B, MIPS_INS_SLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLD_D, MIPS_INS_SLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLD_H, MIPS_INS_SLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLD_W, MIPS_INS_SLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLL, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLL64_32, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLL64_64, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLLI_B, MIPS_INS_SLLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLLI_D, MIPS_INS_SLLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLLI_H, MIPS_INS_SLLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLLI_W, MIPS_INS_SLLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLLV, MIPS_INS_SLLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLLV_MM, MIPS_INS_SLLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SLL_B, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLL_D, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLL_H, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLL_MM, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SLL_W, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SLT, MIPS_INS_SLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLT64, MIPS_INS_SLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLT_MM, MIPS_INS_SLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SLTi, MIPS_INS_SLTI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLTi64, MIPS_INS_SLTI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLTi_MM, MIPS_INS_SLTI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SLTiu, MIPS_INS_SLTIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLTiu64, MIPS_INS_SLTIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLTiu_MM, MIPS_INS_SLTIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SLTu, MIPS_INS_SLTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLTu64, MIPS_INS_SLTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SLTu_MM, MIPS_INS_SLTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SNE, MIPS_INS_SNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_SNEi, MIPS_INS_SNEI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_SPLATI_B, MIPS_INS_SPLATI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLATI_D, MIPS_INS_SPLATI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLATI_H, MIPS_INS_SPLATI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLATI_W, MIPS_INS_SPLATI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLAT_B, MIPS_INS_SPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLAT_D, MIPS_INS_SPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLAT_H, MIPS_INS_SPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SPLAT_W, MIPS_INS_SPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRA, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SRAI_B, MIPS_INS_SRAI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAI_D, MIPS_INS_SRAI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAI_H, MIPS_INS_SRAI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAI_W, MIPS_INS_SRAI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRARI_B, MIPS_INS_SRARI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRARI_D, MIPS_INS_SRARI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRARI_H, MIPS_INS_SRARI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRARI_W, MIPS_INS_SRARI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAR_B, MIPS_INS_SRAR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAR_D, MIPS_INS_SRAR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAR_H, MIPS_INS_SRAR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAR_W, MIPS_INS_SRAR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRAV, MIPS_INS_SRAV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SRAV_MM, MIPS_INS_SRAV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SRA_B, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRA_D, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRA_H, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRA_MM, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SRA_W, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRL, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SRLI_B, MIPS_INS_SRLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLI_D, MIPS_INS_SRLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLI_H, MIPS_INS_SRLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLI_W, MIPS_INS_SRLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLRI_B, MIPS_INS_SRLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLRI_D, MIPS_INS_SRLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLRI_H, MIPS_INS_SRLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLRI_W, MIPS_INS_SRLRI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLR_B, MIPS_INS_SRLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLR_D, MIPS_INS_SRLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLR_H, MIPS_INS_SRLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLR_W, MIPS_INS_SRLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRLV, MIPS_INS_SRLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SRLV_MM, MIPS_INS_SRLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SRL_B, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRL_D, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRL_H, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SRL_MM, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SRL_W, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SSNOP, MIPS_INS_SSNOP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_ST_B, MIPS_INS_ST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ST_D, MIPS_INS_ST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ST_H, MIPS_INS_ST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_ST_W, MIPS_INS_ST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUB, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SUBQH_PH, MIPS_INS_SUBQH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBQH_R_PH, MIPS_INS_SUBQH_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBQH_R_W, MIPS_INS_SUBQH_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBQH_W, MIPS_INS_SUBQH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBQ_PH, MIPS_INS_SUBQ, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SUBQ_S_PH, MIPS_INS_SUBQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SUBQ_S_W, MIPS_INS_SUBQ_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SUBSUS_U_B, MIPS_INS_SUBSUS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUS_U_D, MIPS_INS_SUBSUS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUS_U_H, MIPS_INS_SUBSUS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUS_U_W, MIPS_INS_SUBSUS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUU_S_B, MIPS_INS_SUBSUU_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUU_S_D, MIPS_INS_SUBSUU_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUU_S_H, MIPS_INS_SUBSUU_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBSUU_S_W, MIPS_INS_SUBSUU_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_S_B, MIPS_INS_SUBS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_S_D, MIPS_INS_SUBS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_S_H, MIPS_INS_SUBS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_S_W, MIPS_INS_SUBS_S, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_U_B, MIPS_INS_SUBS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_U_D, MIPS_INS_SUBS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_U_H, MIPS_INS_SUBS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBS_U_W, MIPS_INS_SUBS_U, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBUH_QB, MIPS_INS_SUBUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBUH_R_QB, MIPS_INS_SUBUH_R, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBU_PH, MIPS_INS_SUBU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBU_QB, MIPS_INS_SUBU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SUBU_S_PH, MIPS_INS_SUBU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSPR2, 0 }, 0, 0 #endif }, { Mips_SUBU_S_QB, MIPS_INS_SUBU_S, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_DSPOUTFLAG20, 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_SUBVI_B, MIPS_INS_SUBVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBVI_D, MIPS_INS_SUBVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBVI_H, MIPS_INS_SUBVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBVI_W, MIPS_INS_SUBVI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBV_B, MIPS_INS_SUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBV_D, MIPS_INS_SUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBV_H, MIPS_INS_SUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUBV_W, MIPS_INS_SUBV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_SUB_MM, MIPS_INS_SUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SUBu, MIPS_INS_SUBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SUBu_MM, MIPS_INS_SUBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SUXC1, MIPS_INS_SUXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTFP64BIT, MIPS_GRP_MIPS5_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTNACL, 0 }, 0, 0 #endif }, { Mips_SUXC164, MIPS_INS_SUXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, MIPS_GRP_MIPS5_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SUXC1_MM, MIPS_INS_SUXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SW, MIPS_INS_SW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SW64, MIPS_INS_SW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SWC1, MIPS_INS_SWC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SWC1_MM, MIPS_INS_SWC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SWC2, MIPS_INS_SWC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_SWC2_R6, MIPS_INS_SWC2, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R6, 0 }, 0, 0 #endif }, { Mips_SWC3, MIPS_INS_SWC3, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SWL, MIPS_INS_SWL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_SWL64, MIPS_INS_SWL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SWL_MM, MIPS_INS_SWL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SWR, MIPS_INS_SWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_SWR64, MIPS_INS_SWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SWR_MM, MIPS_INS_SWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SWXC1, MIPS_INS_SWXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS4_32R2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, MIPS_GRP_NOTNACL, 0 }, 0, 0 #endif }, { Mips_SWXC1_MM, MIPS_INS_SWXC1, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SW_MM, MIPS_INS_SW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SYNC, MIPS_INS_SYNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32, 0 }, 0, 0 #endif }, { Mips_SYNC_MM, MIPS_INS_SYNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SYSCALL, MIPS_INS_SYSCALL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_SYSCALL_MM, MIPS_INS_SYSCALL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_SbRxRyOffMemX16, MIPS_INS_SB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SebRx16, MIPS_INS_SEB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SehRx16, MIPS_INS_SEH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_ShRxRyOffMemX16, MIPS_INS_SH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SllX16, MIPS_INS_SLL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SllvRxRy16, MIPS_INS_SLLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SltRxRy16, MIPS_INS_SLT, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SltiRxImm16, MIPS_INS_SLTI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SltiRxImmX16, MIPS_INS_SLTI, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SltiuRxImm16, MIPS_INS_SLTIU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SltiuRxImmX16, MIPS_INS_SLTIU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SltuRxRy16, MIPS_INS_SLTU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_T8, 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SraX16, MIPS_INS_SRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SravRxRy16, MIPS_INS_SRAV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SrlX16, MIPS_INS_SRL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SrlvRxRy16, MIPS_INS_SRLV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SubuRxRyRz16, MIPS_INS_SUBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SwRxRyOffMemX16, MIPS_INS_SW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_SwRxSpImmX16, MIPS_INS_SW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, { Mips_TEQ, MIPS_INS_TEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TEQI, MIPS_INS_TEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_TEQI_MM, MIPS_INS_TEQI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TEQ_MM, MIPS_INS_TEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TGE, MIPS_INS_TGE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TGEI, MIPS_INS_TGEI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_TGEIU, MIPS_INS_TGEIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_TGEIU_MM, MIPS_INS_TGEIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TGEI_MM, MIPS_INS_TGEI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TGEU, MIPS_INS_TGEU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TGEU_MM, MIPS_INS_TGEU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TGE_MM, MIPS_INS_TGE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLBP, MIPS_INS_TLBP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_TLBP_MM, MIPS_INS_TLBP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLBR, MIPS_INS_TLBR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_TLBR_MM, MIPS_INS_TLBR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLBWI, MIPS_INS_TLBWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_TLBWI_MM, MIPS_INS_TLBWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLBWR, MIPS_INS_TLBWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_TLBWR_MM, MIPS_INS_TLBWR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLT, MIPS_INS_TLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TLTI, MIPS_INS_TLTI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_TLTIU_MM, MIPS_INS_TLTIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLTI_MM, MIPS_INS_TLTI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLTU, MIPS_INS_TLTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TLTU_MM, MIPS_INS_TLTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TLT_MM, MIPS_INS_TLT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TNE, MIPS_INS_TNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TNEI, MIPS_INS_TNEI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_TNEI_MM, MIPS_INS_TNEI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TNE_MM, MIPS_INS_TNE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TRUNC_L_D64, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_TRUNC_L_S, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_TRUNC_W_D32, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTFP64BIT, 0 }, 0, 0 #endif }, { Mips_TRUNC_W_D64, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_FP64BIT, 0 }, 0, 0 #endif }, { Mips_TRUNC_W_MM, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TRUNC_W_S, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, 0 }, 0, 0 #endif }, { Mips_TRUNC_W_S_MM, MIPS_INS_TRUNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_TTLTIU, MIPS_INS_TLTIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS2, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_UDIV, MIPS_INS_DIVU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_STDENC, MIPS_GRP_NOTMIPS32R6, MIPS_GRP_NOTMIPS64R6, 0 }, 0, 0 #endif }, { Mips_UDIV_MM, MIPS_INS_DIVU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_HI0, MIPS_REG_LO0, 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_V3MULU, MIPS_INS_V3MULU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_VMM0, MIPS_INS_VMM0, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_MPL0, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_VMULU, MIPS_INS_VMULU, #ifndef CAPSTONE_DIET { 0 }, { MIPS_REG_MPL1, MIPS_REG_MPL2, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, 0 }, { MIPS_GRP_CNMIPS, 0 }, 0, 0 #endif }, { Mips_VSHF_B, MIPS_INS_VSHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_VSHF_D, MIPS_INS_VSHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_VSHF_H, MIPS_INS_VSHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_VSHF_W, MIPS_INS_VSHF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_WAIT, MIPS_INS_WAIT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_NOTINMICROMIPS, 0 }, 0, 0 #endif }, { Mips_WAIT_MM, MIPS_INS_WAIT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_WRDSP, MIPS_INS_WRDSP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_DSP, 0 }, 0, 0 #endif }, { Mips_WSBH, MIPS_INS_WSBH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, MIPS_GRP_MIPS32R2, 0 }, 0, 0 #endif }, { Mips_WSBH_MM, MIPS_INS_WSBH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_XOR, MIPS_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_XOR64, MIPS_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_XORI_B, MIPS_INS_XORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_XOR_MM, MIPS_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_XOR_V, MIPS_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MSA, 0 }, 0, 0 #endif }, { Mips_XORi, MIPS_INS_XORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_XORi64, MIPS_INS_XORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_STDENC, 0 }, 0, 0 #endif }, { Mips_XORi_MM, MIPS_INS_XORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MICROMIPS, 0 }, 0, 0 #endif }, { Mips_XorRxRxRy16, MIPS_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { MIPS_GRP_MIPS16MODE, 0 }, 0, 0 #endif }, }; // given internal insn id, return public instruction info void Mips_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id) { unsigned int i; i = insn_find(insns, ARR_SIZE(insns), id, &h->insn_cache); if (i != 0) { insn->id = insns[i].mapid; if (h->detail) { #ifndef CAPSTONE_DIET memcpy(insn->detail->regs_read, insns[i].regs_use, sizeof(insns[i].regs_use)); insn->detail->regs_read_count = (uint8_t)count_positive(insns[i].regs_use); memcpy(insn->detail->regs_write, insns[i].regs_mod, sizeof(insns[i].regs_mod)); insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod); memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups)); insn->detail->groups_count = (uint8_t)count_positive(insns[i].groups); if (insns[i].branch || insns[i].indirect_branch) { // this insn also belongs to JUMP group. add JUMP group insn->detail->groups[insn->detail->groups_count] = MIPS_GRP_JUMP; insn->detail->groups_count++; } #endif } } } static name_map insn_name_maps[] = { { MIPS_INS_INVALID, NULL }, { MIPS_INS_ABSQ_S, "absq_s" }, { MIPS_INS_ADD, "add" }, { MIPS_INS_ADDIUPC, "addiupc" }, { MIPS_INS_ADDQH, "addqh" }, { MIPS_INS_ADDQH_R, "addqh_r" }, { MIPS_INS_ADDQ, "addq" }, { MIPS_INS_ADDQ_S, "addq_s" }, { MIPS_INS_ADDSC, "addsc" }, { MIPS_INS_ADDS_A, "adds_a" }, { MIPS_INS_ADDS_S, "adds_s" }, { MIPS_INS_ADDS_U, "adds_u" }, { MIPS_INS_ADDUH, "adduh" }, { MIPS_INS_ADDUH_R, "adduh_r" }, { MIPS_INS_ADDU, "addu" }, { MIPS_INS_ADDU_S, "addu_s" }, { MIPS_INS_ADDVI, "addvi" }, { MIPS_INS_ADDV, "addv" }, { MIPS_INS_ADDWC, "addwc" }, { MIPS_INS_ADD_A, "add_a" }, { MIPS_INS_ADDI, "addi" }, { MIPS_INS_ADDIU, "addiu" }, { MIPS_INS_ALIGN, "align" }, { MIPS_INS_ALUIPC, "aluipc" }, { MIPS_INS_AND, "and" }, { MIPS_INS_ANDI, "andi" }, { MIPS_INS_APPEND, "append" }, { MIPS_INS_ASUB_S, "asub_s" }, { MIPS_INS_ASUB_U, "asub_u" }, { MIPS_INS_AUI, "aui" }, { MIPS_INS_AUIPC, "auipc" }, { MIPS_INS_AVER_S, "aver_s" }, { MIPS_INS_AVER_U, "aver_u" }, { MIPS_INS_AVE_S, "ave_s" }, { MIPS_INS_AVE_U, "ave_u" }, { MIPS_INS_BADDU, "baddu" }, { MIPS_INS_BAL, "bal" }, { MIPS_INS_BALC, "balc" }, { MIPS_INS_BALIGN, "balign" }, { MIPS_INS_BC, "bc" }, { MIPS_INS_BC0F, "bc0f" }, { MIPS_INS_BC0FL, "bc0fl" }, { MIPS_INS_BC0T, "bc0t" }, { MIPS_INS_BC0TL, "bc0tl" }, { MIPS_INS_BC1EQZ, "bc1eqz" }, { MIPS_INS_BC1F, "bc1f" }, { MIPS_INS_BC1FL, "bc1fl" }, { MIPS_INS_BC1NEZ, "bc1nez" }, { MIPS_INS_BC1T, "bc1t" }, { MIPS_INS_BC1TL, "bc1tl" }, { MIPS_INS_BC2EQZ, "bc2eqz" }, { MIPS_INS_BC2F, "bc2f" }, { MIPS_INS_BC2FL, "bc2fl" }, { MIPS_INS_BC2NEZ, "bc2nez" }, { MIPS_INS_BC2T, "bc2t" }, { MIPS_INS_BC2TL, "bc2tl" }, { MIPS_INS_BC3F, "bc3f" }, { MIPS_INS_BC3FL, "bc3fl" }, { MIPS_INS_BC3T, "bc3t" }, { MIPS_INS_BC3TL, "bc3tl" }, { MIPS_INS_BCLRI, "bclri" }, { MIPS_INS_BCLR, "bclr" }, { MIPS_INS_BEQ, "beq" }, { MIPS_INS_BEQC, "beqc" }, { MIPS_INS_BEQL, "beql" }, { MIPS_INS_BEQZALC, "beqzalc" }, { MIPS_INS_BEQZC, "beqzc" }, { MIPS_INS_BGEC, "bgec" }, { MIPS_INS_BGEUC, "bgeuc" }, { MIPS_INS_BGEZ, "bgez" }, { MIPS_INS_BGEZAL, "bgezal" }, { MIPS_INS_BGEZALC, "bgezalc" }, { MIPS_INS_BGEZALL, "bgezall" }, { MIPS_INS_BGEZALS, "bgezals" }, { MIPS_INS_BGEZC, "bgezc" }, { MIPS_INS_BGEZL, "bgezl" }, { MIPS_INS_BGTZ, "bgtz" }, { MIPS_INS_BGTZALC, "bgtzalc" }, { MIPS_INS_BGTZC, "bgtzc" }, { MIPS_INS_BGTZL, "bgtzl" }, { MIPS_INS_BINSLI, "binsli" }, { MIPS_INS_BINSL, "binsl" }, { MIPS_INS_BINSRI, "binsri" }, { MIPS_INS_BINSR, "binsr" }, { MIPS_INS_BITREV, "bitrev" }, { MIPS_INS_BITSWAP, "bitswap" }, { MIPS_INS_BLEZ, "blez" }, { MIPS_INS_BLEZALC, "blezalc" }, { MIPS_INS_BLEZC, "blezc" }, { MIPS_INS_BLEZL, "blezl" }, { MIPS_INS_BLTC, "bltc" }, { MIPS_INS_BLTUC, "bltuc" }, { MIPS_INS_BLTZ, "bltz" }, { MIPS_INS_BLTZAL, "bltzal" }, { MIPS_INS_BLTZALC, "bltzalc" }, { MIPS_INS_BLTZALL, "bltzall" }, { MIPS_INS_BLTZALS, "bltzals" }, { MIPS_INS_BLTZC, "bltzc" }, { MIPS_INS_BLTZL, "bltzl" }, { MIPS_INS_BMNZI, "bmnzi" }, { MIPS_INS_BMNZ, "bmnz" }, { MIPS_INS_BMZI, "bmzi" }, { MIPS_INS_BMZ, "bmz" }, { MIPS_INS_BNE, "bne" }, { MIPS_INS_BNEC, "bnec" }, { MIPS_INS_BNEGI, "bnegi" }, { MIPS_INS_BNEG, "bneg" }, { MIPS_INS_BNEL, "bnel" }, { MIPS_INS_BNEZALC, "bnezalc" }, { MIPS_INS_BNEZC, "bnezc" }, { MIPS_INS_BNVC, "bnvc" }, { MIPS_INS_BNZ, "bnz" }, { MIPS_INS_BOVC, "bovc" }, { MIPS_INS_BPOSGE32, "bposge32" }, { MIPS_INS_BREAK, "break" }, { MIPS_INS_BSELI, "bseli" }, { MIPS_INS_BSEL, "bsel" }, { MIPS_INS_BSETI, "bseti" }, { MIPS_INS_BSET, "bset" }, { MIPS_INS_BZ, "bz" }, { MIPS_INS_BEQZ, "beqz" }, { MIPS_INS_B, "b" }, { MIPS_INS_BNEZ, "bnez" }, { MIPS_INS_BTEQZ, "bteqz" }, { MIPS_INS_BTNEZ, "btnez" }, { MIPS_INS_CACHE, "cache" }, { MIPS_INS_CEIL, "ceil" }, { MIPS_INS_CEQI, "ceqi" }, { MIPS_INS_CEQ, "ceq" }, { MIPS_INS_CFC1, "cfc1" }, { MIPS_INS_CFCMSA, "cfcmsa" }, { MIPS_INS_CINS, "cins" }, { MIPS_INS_CINS32, "cins32" }, { MIPS_INS_CLASS, "class" }, { MIPS_INS_CLEI_S, "clei_s" }, { MIPS_INS_CLEI_U, "clei_u" }, { MIPS_INS_CLE_S, "cle_s" }, { MIPS_INS_CLE_U, "cle_u" }, { MIPS_INS_CLO, "clo" }, { MIPS_INS_CLTI_S, "clti_s" }, { MIPS_INS_CLTI_U, "clti_u" }, { MIPS_INS_CLT_S, "clt_s" }, { MIPS_INS_CLT_U, "clt_u" }, { MIPS_INS_CLZ, "clz" }, { MIPS_INS_CMPGDU, "cmpgdu" }, { MIPS_INS_CMPGU, "cmpgu" }, { MIPS_INS_CMPU, "cmpu" }, { MIPS_INS_CMP, "cmp" }, { MIPS_INS_COPY_S, "copy_s" }, { MIPS_INS_COPY_U, "copy_u" }, { MIPS_INS_CTC1, "ctc1" }, { MIPS_INS_CTCMSA, "ctcmsa" }, { MIPS_INS_CVT, "cvt" }, { MIPS_INS_C, "c" }, { MIPS_INS_CMPI, "cmpi" }, { MIPS_INS_DADD, "dadd" }, { MIPS_INS_DADDI, "daddi" }, { MIPS_INS_DADDIU, "daddiu" }, { MIPS_INS_DADDU, "daddu" }, { MIPS_INS_DAHI, "dahi" }, { MIPS_INS_DALIGN, "dalign" }, { MIPS_INS_DATI, "dati" }, { MIPS_INS_DAUI, "daui" }, { MIPS_INS_DBITSWAP, "dbitswap" }, { MIPS_INS_DCLO, "dclo" }, { MIPS_INS_DCLZ, "dclz" }, { MIPS_INS_DDIV, "ddiv" }, { MIPS_INS_DDIVU, "ddivu" }, { MIPS_INS_DERET, "deret" }, { MIPS_INS_DEXT, "dext" }, { MIPS_INS_DEXTM, "dextm" }, { MIPS_INS_DEXTU, "dextu" }, { MIPS_INS_DI, "di" }, { MIPS_INS_DINS, "dins" }, { MIPS_INS_DINSM, "dinsm" }, { MIPS_INS_DINSU, "dinsu" }, { MIPS_INS_DIV, "div" }, { MIPS_INS_DIVU, "divu" }, { MIPS_INS_DIV_S, "div_s" }, { MIPS_INS_DIV_U, "div_u" }, { MIPS_INS_DLSA, "dlsa" }, { MIPS_INS_DMFC0, "dmfc0" }, { MIPS_INS_DMFC1, "dmfc1" }, { MIPS_INS_DMFC2, "dmfc2" }, { MIPS_INS_DMOD, "dmod" }, { MIPS_INS_DMODU, "dmodu" }, { MIPS_INS_DMTC0, "dmtc0" }, { MIPS_INS_DMTC1, "dmtc1" }, { MIPS_INS_DMTC2, "dmtc2" }, { MIPS_INS_DMUH, "dmuh" }, { MIPS_INS_DMUHU, "dmuhu" }, { MIPS_INS_DMUL, "dmul" }, { MIPS_INS_DMULT, "dmult" }, { MIPS_INS_DMULTU, "dmultu" }, { MIPS_INS_DMULU, "dmulu" }, { MIPS_INS_DOTP_S, "dotp_s" }, { MIPS_INS_DOTP_U, "dotp_u" }, { MIPS_INS_DPADD_S, "dpadd_s" }, { MIPS_INS_DPADD_U, "dpadd_u" }, { MIPS_INS_DPAQX_SA, "dpaqx_sa" }, { MIPS_INS_DPAQX_S, "dpaqx_s" }, { MIPS_INS_DPAQ_SA, "dpaq_sa" }, { MIPS_INS_DPAQ_S, "dpaq_s" }, { MIPS_INS_DPAU, "dpau" }, { MIPS_INS_DPAX, "dpax" }, { MIPS_INS_DPA, "dpa" }, { MIPS_INS_DPOP, "dpop" }, { MIPS_INS_DPSQX_SA, "dpsqx_sa" }, { MIPS_INS_DPSQX_S, "dpsqx_s" }, { MIPS_INS_DPSQ_SA, "dpsq_sa" }, { MIPS_INS_DPSQ_S, "dpsq_s" }, { MIPS_INS_DPSUB_S, "dpsub_s" }, { MIPS_INS_DPSUB_U, "dpsub_u" }, { MIPS_INS_DPSU, "dpsu" }, { MIPS_INS_DPSX, "dpsx" }, { MIPS_INS_DPS, "dps" }, { MIPS_INS_DROTR, "drotr" }, { MIPS_INS_DROTR32, "drotr32" }, { MIPS_INS_DROTRV, "drotrv" }, { MIPS_INS_DSBH, "dsbh" }, { MIPS_INS_DSHD, "dshd" }, { MIPS_INS_DSLL, "dsll" }, { MIPS_INS_DSLL32, "dsll32" }, { MIPS_INS_DSLLV, "dsllv" }, { MIPS_INS_DSRA, "dsra" }, { MIPS_INS_DSRA32, "dsra32" }, { MIPS_INS_DSRAV, "dsrav" }, { MIPS_INS_DSRL, "dsrl" }, { MIPS_INS_DSRL32, "dsrl32" }, { MIPS_INS_DSRLV, "dsrlv" }, { MIPS_INS_DSUB, "dsub" }, { MIPS_INS_DSUBU, "dsubu" }, { MIPS_INS_EHB, "ehb" }, { MIPS_INS_EI, "ei" }, { MIPS_INS_ERET, "eret" }, { MIPS_INS_EXT, "ext" }, { MIPS_INS_EXTP, "extp" }, { MIPS_INS_EXTPDP, "extpdp" }, { MIPS_INS_EXTPDPV, "extpdpv" }, { MIPS_INS_EXTPV, "extpv" }, { MIPS_INS_EXTRV_RS, "extrv_rs" }, { MIPS_INS_EXTRV_R, "extrv_r" }, { MIPS_INS_EXTRV_S, "extrv_s" }, { MIPS_INS_EXTRV, "extrv" }, { MIPS_INS_EXTR_RS, "extr_rs" }, { MIPS_INS_EXTR_R, "extr_r" }, { MIPS_INS_EXTR_S, "extr_s" }, { MIPS_INS_EXTR, "extr" }, { MIPS_INS_EXTS, "exts" }, { MIPS_INS_EXTS32, "exts32" }, { MIPS_INS_ABS, "abs" }, { MIPS_INS_FADD, "fadd" }, { MIPS_INS_FCAF, "fcaf" }, { MIPS_INS_FCEQ, "fceq" }, { MIPS_INS_FCLASS, "fclass" }, { MIPS_INS_FCLE, "fcle" }, { MIPS_INS_FCLT, "fclt" }, { MIPS_INS_FCNE, "fcne" }, { MIPS_INS_FCOR, "fcor" }, { MIPS_INS_FCUEQ, "fcueq" }, { MIPS_INS_FCULE, "fcule" }, { MIPS_INS_FCULT, "fcult" }, { MIPS_INS_FCUNE, "fcune" }, { MIPS_INS_FCUN, "fcun" }, { MIPS_INS_FDIV, "fdiv" }, { MIPS_INS_FEXDO, "fexdo" }, { MIPS_INS_FEXP2, "fexp2" }, { MIPS_INS_FEXUPL, "fexupl" }, { MIPS_INS_FEXUPR, "fexupr" }, { MIPS_INS_FFINT_S, "ffint_s" }, { MIPS_INS_FFINT_U, "ffint_u" }, { MIPS_INS_FFQL, "ffql" }, { MIPS_INS_FFQR, "ffqr" }, { MIPS_INS_FILL, "fill" }, { MIPS_INS_FLOG2, "flog2" }, { MIPS_INS_FLOOR, "floor" }, { MIPS_INS_FMADD, "fmadd" }, { MIPS_INS_FMAX_A, "fmax_a" }, { MIPS_INS_FMAX, "fmax" }, { MIPS_INS_FMIN_A, "fmin_a" }, { MIPS_INS_FMIN, "fmin" }, { MIPS_INS_MOV, "mov" }, { MIPS_INS_FMSUB, "fmsub" }, { MIPS_INS_FMUL, "fmul" }, { MIPS_INS_MUL, "mul" }, { MIPS_INS_NEG, "neg" }, { MIPS_INS_FRCP, "frcp" }, { MIPS_INS_FRINT, "frint" }, { MIPS_INS_FRSQRT, "frsqrt" }, { MIPS_INS_FSAF, "fsaf" }, { MIPS_INS_FSEQ, "fseq" }, { MIPS_INS_FSLE, "fsle" }, { MIPS_INS_FSLT, "fslt" }, { MIPS_INS_FSNE, "fsne" }, { MIPS_INS_FSOR, "fsor" }, { MIPS_INS_FSQRT, "fsqrt" }, { MIPS_INS_SQRT, "sqrt" }, { MIPS_INS_FSUB, "fsub" }, { MIPS_INS_SUB, "sub" }, { MIPS_INS_FSUEQ, "fsueq" }, { MIPS_INS_FSULE, "fsule" }, { MIPS_INS_FSULT, "fsult" }, { MIPS_INS_FSUNE, "fsune" }, { MIPS_INS_FSUN, "fsun" }, { MIPS_INS_FTINT_S, "ftint_s" }, { MIPS_INS_FTINT_U, "ftint_u" }, { MIPS_INS_FTQ, "ftq" }, { MIPS_INS_FTRUNC_S, "ftrunc_s" }, { MIPS_INS_FTRUNC_U, "ftrunc_u" }, { MIPS_INS_HADD_S, "hadd_s" }, { MIPS_INS_HADD_U, "hadd_u" }, { MIPS_INS_HSUB_S, "hsub_s" }, { MIPS_INS_HSUB_U, "hsub_u" }, { MIPS_INS_ILVEV, "ilvev" }, { MIPS_INS_ILVL, "ilvl" }, { MIPS_INS_ILVOD, "ilvod" }, { MIPS_INS_ILVR, "ilvr" }, { MIPS_INS_INS, "ins" }, { MIPS_INS_INSERT, "insert" }, { MIPS_INS_INSV, "insv" }, { MIPS_INS_INSVE, "insve" }, { MIPS_INS_J, "j" }, { MIPS_INS_JAL, "jal" }, { MIPS_INS_JALR, "jalr" }, { MIPS_INS_JALRS, "jalrs" }, { MIPS_INS_JALS, "jals" }, { MIPS_INS_JALX, "jalx" }, { MIPS_INS_JIALC, "jialc" }, { MIPS_INS_JIC, "jic" }, { MIPS_INS_JR, "jr" }, { MIPS_INS_JRADDIUSP, "jraddiusp" }, { MIPS_INS_JRC, "jrc" }, { MIPS_INS_JALRC, "jalrc" }, { MIPS_INS_LB, "lb" }, { MIPS_INS_LBUX, "lbux" }, { MIPS_INS_LBU, "lbu" }, { MIPS_INS_LD, "ld" }, { MIPS_INS_LDC1, "ldc1" }, { MIPS_INS_LDC2, "ldc2" }, { MIPS_INS_LDC3, "ldc3" }, { MIPS_INS_LDI, "ldi" }, { MIPS_INS_LDL, "ldl" }, { MIPS_INS_LDPC, "ldpc" }, { MIPS_INS_LDR, "ldr" }, { MIPS_INS_LDXC1, "ldxc1" }, { MIPS_INS_LH, "lh" }, { MIPS_INS_LHX, "lhx" }, { MIPS_INS_LHU, "lhu" }, { MIPS_INS_LL, "ll" }, { MIPS_INS_LLD, "lld" }, { MIPS_INS_LSA, "lsa" }, { MIPS_INS_LUXC1, "luxc1" }, { MIPS_INS_LUI, "lui" }, { MIPS_INS_LW, "lw" }, { MIPS_INS_LWC1, "lwc1" }, { MIPS_INS_LWC2, "lwc2" }, { MIPS_INS_LWC3, "lwc3" }, { MIPS_INS_LWL, "lwl" }, { MIPS_INS_LWPC, "lwpc" }, { MIPS_INS_LWR, "lwr" }, { MIPS_INS_LWUPC, "lwupc" }, { MIPS_INS_LWU, "lwu" }, { MIPS_INS_LWX, "lwx" }, { MIPS_INS_LWXC1, "lwxc1" }, { MIPS_INS_LI, "li" }, { MIPS_INS_MADD, "madd" }, { MIPS_INS_MADDF, "maddf" }, { MIPS_INS_MADDR_Q, "maddr_q" }, { MIPS_INS_MADDU, "maddu" }, { MIPS_INS_MADDV, "maddv" }, { MIPS_INS_MADD_Q, "madd_q" }, { MIPS_INS_MAQ_SA, "maq_sa" }, { MIPS_INS_MAQ_S, "maq_s" }, { MIPS_INS_MAXA, "maxa" }, { MIPS_INS_MAXI_S, "maxi_s" }, { MIPS_INS_MAXI_U, "maxi_u" }, { MIPS_INS_MAX_A, "max_a" }, { MIPS_INS_MAX, "max" }, { MIPS_INS_MAX_S, "max_s" }, { MIPS_INS_MAX_U, "max_u" }, { MIPS_INS_MFC0, "mfc0" }, { MIPS_INS_MFC1, "mfc1" }, { MIPS_INS_MFC2, "mfc2" }, { MIPS_INS_MFHC1, "mfhc1" }, { MIPS_INS_MFHI, "mfhi" }, { MIPS_INS_MFLO, "mflo" }, { MIPS_INS_MINA, "mina" }, { MIPS_INS_MINI_S, "mini_s" }, { MIPS_INS_MINI_U, "mini_u" }, { MIPS_INS_MIN_A, "min_a" }, { MIPS_INS_MIN, "min" }, { MIPS_INS_MIN_S, "min_s" }, { MIPS_INS_MIN_U, "min_u" }, { MIPS_INS_MOD, "mod" }, { MIPS_INS_MODSUB, "modsub" }, { MIPS_INS_MODU, "modu" }, { MIPS_INS_MOD_S, "mod_s" }, { MIPS_INS_MOD_U, "mod_u" }, { MIPS_INS_MOVE, "move" }, { MIPS_INS_MOVF, "movf" }, { MIPS_INS_MOVN, "movn" }, { MIPS_INS_MOVT, "movt" }, { MIPS_INS_MOVZ, "movz" }, { MIPS_INS_MSUB, "msub" }, { MIPS_INS_MSUBF, "msubf" }, { MIPS_INS_MSUBR_Q, "msubr_q" }, { MIPS_INS_MSUBU, "msubu" }, { MIPS_INS_MSUBV, "msubv" }, { MIPS_INS_MSUB_Q, "msub_q" }, { MIPS_INS_MTC0, "mtc0" }, { MIPS_INS_MTC1, "mtc1" }, { MIPS_INS_MTC2, "mtc2" }, { MIPS_INS_MTHC1, "mthc1" }, { MIPS_INS_MTHI, "mthi" }, { MIPS_INS_MTHLIP, "mthlip" }, { MIPS_INS_MTLO, "mtlo" }, { MIPS_INS_MTM0, "mtm0" }, { MIPS_INS_MTM1, "mtm1" }, { MIPS_INS_MTM2, "mtm2" }, { MIPS_INS_MTP0, "mtp0" }, { MIPS_INS_MTP1, "mtp1" }, { MIPS_INS_MTP2, "mtp2" }, { MIPS_INS_MUH, "muh" }, { MIPS_INS_MUHU, "muhu" }, { MIPS_INS_MULEQ_S, "muleq_s" }, { MIPS_INS_MULEU_S, "muleu_s" }, { MIPS_INS_MULQ_RS, "mulq_rs" }, { MIPS_INS_MULQ_S, "mulq_s" }, { MIPS_INS_MULR_Q, "mulr_q" }, { MIPS_INS_MULSAQ_S, "mulsaq_s" }, { MIPS_INS_MULSA, "mulsa" }, { MIPS_INS_MULT, "mult" }, { MIPS_INS_MULTU, "multu" }, { MIPS_INS_MULU, "mulu" }, { MIPS_INS_MULV, "mulv" }, { MIPS_INS_MUL_Q, "mul_q" }, { MIPS_INS_MUL_S, "mul_s" }, { MIPS_INS_NLOC, "nloc" }, { MIPS_INS_NLZC, "nlzc" }, { MIPS_INS_NMADD, "nmadd" }, { MIPS_INS_NMSUB, "nmsub" }, { MIPS_INS_NOR, "nor" }, { MIPS_INS_NORI, "nori" }, { MIPS_INS_NOT, "not" }, { MIPS_INS_OR, "or" }, { MIPS_INS_ORI, "ori" }, { MIPS_INS_PACKRL, "packrl" }, { MIPS_INS_PAUSE, "pause" }, { MIPS_INS_PCKEV, "pckev" }, { MIPS_INS_PCKOD, "pckod" }, { MIPS_INS_PCNT, "pcnt" }, { MIPS_INS_PICK, "pick" }, { MIPS_INS_POP, "pop" }, { MIPS_INS_PRECEQU, "precequ" }, { MIPS_INS_PRECEQ, "preceq" }, { MIPS_INS_PRECEU, "preceu" }, { MIPS_INS_PRECRQU_S, "precrqu_s" }, { MIPS_INS_PRECRQ, "precrq" }, { MIPS_INS_PRECRQ_RS, "precrq_rs" }, { MIPS_INS_PRECR, "precr" }, { MIPS_INS_PRECR_SRA, "precr_sra" }, { MIPS_INS_PRECR_SRA_R, "precr_sra_r" }, { MIPS_INS_PREF, "pref" }, { MIPS_INS_PREPEND, "prepend" }, { MIPS_INS_RADDU, "raddu" }, { MIPS_INS_RDDSP, "rddsp" }, { MIPS_INS_RDHWR, "rdhwr" }, { MIPS_INS_REPLV, "replv" }, { MIPS_INS_REPL, "repl" }, { MIPS_INS_RINT, "rint" }, { MIPS_INS_ROTR, "rotr" }, { MIPS_INS_ROTRV, "rotrv" }, { MIPS_INS_ROUND, "round" }, { MIPS_INS_SAT_S, "sat_s" }, { MIPS_INS_SAT_U, "sat_u" }, { MIPS_INS_SB, "sb" }, { MIPS_INS_SC, "sc" }, { MIPS_INS_SCD, "scd" }, { MIPS_INS_SD, "sd" }, { MIPS_INS_SDBBP, "sdbbp" }, { MIPS_INS_SDC1, "sdc1" }, { MIPS_INS_SDC2, "sdc2" }, { MIPS_INS_SDC3, "sdc3" }, { MIPS_INS_SDL, "sdl" }, { MIPS_INS_SDR, "sdr" }, { MIPS_INS_SDXC1, "sdxc1" }, { MIPS_INS_SEB, "seb" }, { MIPS_INS_SEH, "seh" }, { MIPS_INS_SELEQZ, "seleqz" }, { MIPS_INS_SELNEZ, "selnez" }, { MIPS_INS_SEL, "sel" }, { MIPS_INS_SEQ, "seq" }, { MIPS_INS_SEQI, "seqi" }, { MIPS_INS_SH, "sh" }, { MIPS_INS_SHF, "shf" }, { MIPS_INS_SHILO, "shilo" }, { MIPS_INS_SHILOV, "shilov" }, { MIPS_INS_SHLLV, "shllv" }, { MIPS_INS_SHLLV_S, "shllv_s" }, { MIPS_INS_SHLL, "shll" }, { MIPS_INS_SHLL_S, "shll_s" }, { MIPS_INS_SHRAV, "shrav" }, { MIPS_INS_SHRAV_R, "shrav_r" }, { MIPS_INS_SHRA, "shra" }, { MIPS_INS_SHRA_R, "shra_r" }, { MIPS_INS_SHRLV, "shrlv" }, { MIPS_INS_SHRL, "shrl" }, { MIPS_INS_SLDI, "sldi" }, { MIPS_INS_SLD, "sld" }, { MIPS_INS_SLL, "sll" }, { MIPS_INS_SLLI, "slli" }, { MIPS_INS_SLLV, "sllv" }, { MIPS_INS_SLT, "slt" }, { MIPS_INS_SLTI, "slti" }, { MIPS_INS_SLTIU, "sltiu" }, { MIPS_INS_SLTU, "sltu" }, { MIPS_INS_SNE, "sne" }, { MIPS_INS_SNEI, "snei" }, { MIPS_INS_SPLATI, "splati" }, { MIPS_INS_SPLAT, "splat" }, { MIPS_INS_SRA, "sra" }, { MIPS_INS_SRAI, "srai" }, { MIPS_INS_SRARI, "srari" }, { MIPS_INS_SRAR, "srar" }, { MIPS_INS_SRAV, "srav" }, { MIPS_INS_SRL, "srl" }, { MIPS_INS_SRLI, "srli" }, { MIPS_INS_SRLRI, "srlri" }, { MIPS_INS_SRLR, "srlr" }, { MIPS_INS_SRLV, "srlv" }, { MIPS_INS_SSNOP, "ssnop" }, { MIPS_INS_ST, "st" }, { MIPS_INS_SUBQH, "subqh" }, { MIPS_INS_SUBQH_R, "subqh_r" }, { MIPS_INS_SUBQ, "subq" }, { MIPS_INS_SUBQ_S, "subq_s" }, { MIPS_INS_SUBSUS_U, "subsus_u" }, { MIPS_INS_SUBSUU_S, "subsuu_s" }, { MIPS_INS_SUBS_S, "subs_s" }, { MIPS_INS_SUBS_U, "subs_u" }, { MIPS_INS_SUBUH, "subuh" }, { MIPS_INS_SUBUH_R, "subuh_r" }, { MIPS_INS_SUBU, "subu" }, { MIPS_INS_SUBU_S, "subu_s" }, { MIPS_INS_SUBVI, "subvi" }, { MIPS_INS_SUBV, "subv" }, { MIPS_INS_SUXC1, "suxc1" }, { MIPS_INS_SW, "sw" }, { MIPS_INS_SWC1, "swc1" }, { MIPS_INS_SWC2, "swc2" }, { MIPS_INS_SWC3, "swc3" }, { MIPS_INS_SWL, "swl" }, { MIPS_INS_SWR, "swr" }, { MIPS_INS_SWXC1, "swxc1" }, { MIPS_INS_SYNC, "sync" }, { MIPS_INS_SYSCALL, "syscall" }, { MIPS_INS_TEQ, "teq" }, { MIPS_INS_TEQI, "teqi" }, { MIPS_INS_TGE, "tge" }, { MIPS_INS_TGEI, "tgei" }, { MIPS_INS_TGEIU, "tgeiu" }, { MIPS_INS_TGEU, "tgeu" }, { MIPS_INS_TLBP, "tlbp" }, { MIPS_INS_TLBR, "tlbr" }, { MIPS_INS_TLBWI, "tlbwi" }, { MIPS_INS_TLBWR, "tlbwr" }, { MIPS_INS_TLT, "tlt" }, { MIPS_INS_TLTI, "tlti" }, { MIPS_INS_TLTIU, "tltiu" }, { MIPS_INS_TLTU, "tltu" }, { MIPS_INS_TNE, "tne" }, { MIPS_INS_TNEI, "tnei" }, { MIPS_INS_TRUNC, "trunc" }, { MIPS_INS_V3MULU, "v3mulu" }, { MIPS_INS_VMM0, "vmm0" }, { MIPS_INS_VMULU, "vmulu" }, { MIPS_INS_VSHF, "vshf" }, { MIPS_INS_WAIT, "wait" }, { MIPS_INS_WRDSP, "wrdsp" }, { MIPS_INS_WSBH, "wsbh" }, { MIPS_INS_XOR, "xor" }, { MIPS_INS_XORI, "xori" }, // alias instructions { MIPS_INS_NOP, "nop" }, { MIPS_INS_NEGU, "negu" }, { MIPS_INS_JALR_HB, "jalr.hb" }, { MIPS_INS_JR_HB, "jr.hb" }, }; const char *Mips_insn_name(csh handle, unsigned int id) { #ifndef CAPSTONE_DIET if (id >= MIPS_INS_ENDING) return NULL; return insn_name_maps[id].name; #else return NULL; #endif } #ifndef CAPSTONE_DIET static name_map group_name_maps[] = { // generic groups { MIPS_GRP_INVALID, NULL }, { MIPS_GRP_JUMP, "jump" }, // architecture-specific groups { MIPS_GRP_BITCOUNT, "bitcount" }, { MIPS_GRP_DSP, "dsp" }, { MIPS_GRP_DSPR2, "dspr2" }, { MIPS_GRP_FPIDX, "fpidx" }, { MIPS_GRP_MSA, "msa" }, { MIPS_GRP_MIPS32R2, "mips32r2" }, { MIPS_GRP_MIPS64, "mips64" }, { MIPS_GRP_MIPS64R2, "mips64r2" }, { MIPS_GRP_SEINREG, "seinreg" }, { MIPS_GRP_STDENC, "stdenc" }, { MIPS_GRP_SWAP, "swap" }, { MIPS_GRP_MICROMIPS, "micromips" }, { MIPS_GRP_MIPS16MODE, "mips16mode" }, { MIPS_GRP_FP64BIT, "fp64bit" }, { MIPS_GRP_NONANSFPMATH, "nonansfpmath" }, { MIPS_GRP_NOTFP64BIT, "notfp64bit" }, { MIPS_GRP_NOTINMICROMIPS, "notinmicromips" }, { MIPS_GRP_NOTNACL, "notnacl" }, { MIPS_GRP_NOTMIPS32R6, "notmips32r6" }, { MIPS_GRP_NOTMIPS64R6, "notmips64r6" }, { MIPS_GRP_CNMIPS, "cnmips" }, { MIPS_GRP_MIPS32, "mips32" }, { MIPS_GRP_MIPS32R6, "mips32r6" }, { MIPS_GRP_MIPS64R6, "mips64r6" }, { MIPS_GRP_MIPS2, "mips2" }, { MIPS_GRP_MIPS3, "mips3" }, { MIPS_GRP_MIPS3_32, "mips3_32"}, { MIPS_GRP_MIPS3_32R2, "mips3_32r2" }, { MIPS_GRP_MIPS4_32, "mips4_32" }, { MIPS_GRP_MIPS4_32R2, "mips4_32r2" }, { MIPS_GRP_MIPS5_32R2, "mips5_32r2" }, { MIPS_GRP_GP32BIT, "gp32bit" }, { MIPS_GRP_GP64BIT, "gp64bit" }, }; #endif const char *Mips_group_name(csh handle, unsigned int id) { #ifndef CAPSTONE_DIET // verify group id if (id >= MIPS_GRP_ENDING || (id > MIPS_GRP_JUMP && id < MIPS_GRP_BITCOUNT)) return NULL; // NOTE: when new generic groups are added, 2 must be changed accordingly if (id >= 128) return group_name_maps[id - 128 + 2].name; else return group_name_maps[id].name; #else return NULL; #endif } // map instruction name to public instruction ID mips_reg Mips_map_insn(const char *name) { // handle special alias first unsigned int i; // NOTE: skip first NULL name in insn_name_maps i = name2id(&insn_name_maps[1], ARR_SIZE(insn_name_maps) - 1, name); return (i != -1)? i : MIPS_REG_INVALID; } // map internal raw register to 'public' register mips_reg Mips_map_register(unsigned int r) { // for some reasons different Mips modes can map different register number to // the same Mips register. this function handles the issue for exposing Mips // operands by mapping internal registers to 'public' register. unsigned int map[] = { 0, MIPS_REG_AT, MIPS_REG_DSPCCOND, MIPS_REG_DSPCARRY, MIPS_REG_DSPEFI, MIPS_REG_DSPOUTFLAG, MIPS_REG_DSPPOS, MIPS_REG_DSPSCOUNT, MIPS_REG_FP, MIPS_REG_GP, MIPS_REG_2, MIPS_REG_1, MIPS_REG_0, MIPS_REG_6, MIPS_REG_4, MIPS_REG_5, MIPS_REG_3, MIPS_REG_7, 0, MIPS_REG_RA, MIPS_REG_SP, MIPS_REG_ZERO, MIPS_REG_A0, MIPS_REG_A1, MIPS_REG_A2, MIPS_REG_A3, MIPS_REG_AC0, MIPS_REG_AC1, MIPS_REG_AC2, MIPS_REG_AC3, MIPS_REG_AT, MIPS_REG_CC0, MIPS_REG_CC1, MIPS_REG_CC2, MIPS_REG_CC3, MIPS_REG_CC4, MIPS_REG_CC5, MIPS_REG_CC6, MIPS_REG_CC7, MIPS_REG_0, MIPS_REG_1, MIPS_REG_2, MIPS_REG_3, MIPS_REG_4, MIPS_REG_5, MIPS_REG_6, MIPS_REG_7, MIPS_REG_8, MIPS_REG_9, MIPS_REG_0, MIPS_REG_1, MIPS_REG_2, MIPS_REG_3, MIPS_REG_4, MIPS_REG_5, MIPS_REG_6, MIPS_REG_7, MIPS_REG_8, MIPS_REG_9, MIPS_REG_10, MIPS_REG_11, MIPS_REG_12, MIPS_REG_13, MIPS_REG_14, MIPS_REG_15, MIPS_REG_16, MIPS_REG_17, MIPS_REG_18, MIPS_REG_19, MIPS_REG_20, MIPS_REG_21, MIPS_REG_22, MIPS_REG_23, MIPS_REG_24, MIPS_REG_25, MIPS_REG_26, MIPS_REG_27, MIPS_REG_28, MIPS_REG_29, MIPS_REG_30, MIPS_REG_31, MIPS_REG_10, MIPS_REG_11, MIPS_REG_12, MIPS_REG_13, MIPS_REG_14, MIPS_REG_15, MIPS_REG_16, MIPS_REG_17, MIPS_REG_18, MIPS_REG_19, MIPS_REG_20, MIPS_REG_21, MIPS_REG_22, MIPS_REG_23, MIPS_REG_24, MIPS_REG_25, MIPS_REG_26, MIPS_REG_27, MIPS_REG_28, MIPS_REG_29, MIPS_REG_30, MIPS_REG_31, MIPS_REG_F0, MIPS_REG_F2, MIPS_REG_F4, MIPS_REG_F6, MIPS_REG_F8, MIPS_REG_F10, MIPS_REG_F12, MIPS_REG_F14, MIPS_REG_F16, MIPS_REG_F18, MIPS_REG_F20, MIPS_REG_F22, MIPS_REG_F24, MIPS_REG_F26, MIPS_REG_F28, MIPS_REG_F30, MIPS_REG_DSPOUTFLAG20, MIPS_REG_DSPOUTFLAG21, MIPS_REG_DSPOUTFLAG22, MIPS_REG_DSPOUTFLAG23, MIPS_REG_F0, MIPS_REG_F1, MIPS_REG_F2, MIPS_REG_F3, MIPS_REG_F4, MIPS_REG_F5, MIPS_REG_F6, MIPS_REG_F7, MIPS_REG_F8, MIPS_REG_F9, MIPS_REG_F10, MIPS_REG_F11, MIPS_REG_F12, MIPS_REG_F13, MIPS_REG_F14, MIPS_REG_F15, MIPS_REG_F16, MIPS_REG_F17, MIPS_REG_F18, MIPS_REG_F19, MIPS_REG_F20, MIPS_REG_F21, MIPS_REG_F22, MIPS_REG_F23, MIPS_REG_F24, MIPS_REG_F25, MIPS_REG_F26, MIPS_REG_F27, MIPS_REG_F28, MIPS_REG_F29, MIPS_REG_F30, MIPS_REG_F31, MIPS_REG_FCC0, MIPS_REG_FCC1, MIPS_REG_FCC2, MIPS_REG_FCC3, MIPS_REG_FCC4, MIPS_REG_FCC5, MIPS_REG_FCC6, MIPS_REG_FCC7, MIPS_REG_0, MIPS_REG_1, MIPS_REG_2, MIPS_REG_3, MIPS_REG_4, MIPS_REG_5, MIPS_REG_6, MIPS_REG_7, MIPS_REG_8, MIPS_REG_9, MIPS_REG_10, MIPS_REG_11, MIPS_REG_12, MIPS_REG_13, MIPS_REG_14, MIPS_REG_15, MIPS_REG_16, MIPS_REG_17, MIPS_REG_18, MIPS_REG_19, MIPS_REG_20, MIPS_REG_21, MIPS_REG_22, MIPS_REG_23, MIPS_REG_24, MIPS_REG_25, MIPS_REG_26, MIPS_REG_27, MIPS_REG_28, MIPS_REG_29, MIPS_REG_30, MIPS_REG_31, MIPS_REG_FP, MIPS_REG_F0, MIPS_REG_F1, MIPS_REG_F2, MIPS_REG_F3, MIPS_REG_F4, MIPS_REG_F5, MIPS_REG_F6, MIPS_REG_F7, MIPS_REG_F8, MIPS_REG_F9, MIPS_REG_F10, MIPS_REG_F11, MIPS_REG_F12, MIPS_REG_F13, MIPS_REG_F14, MIPS_REG_F15, MIPS_REG_F16, MIPS_REG_F17, MIPS_REG_F18, MIPS_REG_F19, MIPS_REG_F20, MIPS_REG_F21, MIPS_REG_F22, MIPS_REG_F23, MIPS_REG_F24, MIPS_REG_F25, MIPS_REG_F26, MIPS_REG_F27, MIPS_REG_F28, MIPS_REG_F29, MIPS_REG_F30, MIPS_REG_F31, MIPS_REG_GP, MIPS_REG_AC0, MIPS_REG_AC1, MIPS_REG_AC2, MIPS_REG_AC3, MIPS_REG_0, MIPS_REG_1, MIPS_REG_2, MIPS_REG_3, MIPS_REG_4, MIPS_REG_5, MIPS_REG_6, MIPS_REG_7, MIPS_REG_8, MIPS_REG_9, MIPS_REG_10, MIPS_REG_11, MIPS_REG_12, MIPS_REG_13, MIPS_REG_14, MIPS_REG_15, MIPS_REG_16, MIPS_REG_17, MIPS_REG_18, MIPS_REG_19, MIPS_REG_20, MIPS_REG_21, MIPS_REG_22, MIPS_REG_23, MIPS_REG_24, MIPS_REG_25, MIPS_REG_26, MIPS_REG_27, MIPS_REG_28, MIPS_REG_29, MIPS_REG_30, MIPS_REG_31, MIPS_REG_K0, MIPS_REG_K1, MIPS_REG_AC0, MIPS_REG_AC1, MIPS_REG_AC2, MIPS_REG_AC3, MIPS_REG_MPL0, MIPS_REG_MPL1, MIPS_REG_MPL2, MIPS_REG_P0, MIPS_REG_P1, MIPS_REG_P2, MIPS_REG_RA, MIPS_REG_S0, MIPS_REG_S1, MIPS_REG_S2, MIPS_REG_S3, MIPS_REG_S4, MIPS_REG_S5, MIPS_REG_S6, MIPS_REG_S7, MIPS_REG_SP, MIPS_REG_T0, MIPS_REG_T1, MIPS_REG_T2, MIPS_REG_T3, MIPS_REG_T4, MIPS_REG_T5, MIPS_REG_T6, MIPS_REG_T7, MIPS_REG_T8, MIPS_REG_T9, MIPS_REG_V0, MIPS_REG_V1, MIPS_REG_W0, MIPS_REG_W1, MIPS_REG_W2, MIPS_REG_W3, MIPS_REG_W4, MIPS_REG_W5, MIPS_REG_W6, MIPS_REG_W7, MIPS_REG_W8, MIPS_REG_W9, MIPS_REG_W10, MIPS_REG_W11, MIPS_REG_W12, MIPS_REG_W13, MIPS_REG_W14, MIPS_REG_W15, MIPS_REG_W16, MIPS_REG_W17, MIPS_REG_W18, MIPS_REG_W19, MIPS_REG_W20, MIPS_REG_W21, MIPS_REG_W22, MIPS_REG_W23, MIPS_REG_W24, MIPS_REG_W25, MIPS_REG_W26, MIPS_REG_W27, MIPS_REG_W28, MIPS_REG_W29, MIPS_REG_W30, MIPS_REG_W31, MIPS_REG_ZERO, MIPS_REG_A0, MIPS_REG_A1, MIPS_REG_A2, MIPS_REG_A3, MIPS_REG_AC0, MIPS_REG_F0, MIPS_REG_F1, MIPS_REG_F2, MIPS_REG_F3, MIPS_REG_F4, MIPS_REG_F5, MIPS_REG_F6, MIPS_REG_F7, MIPS_REG_F8, MIPS_REG_F9, MIPS_REG_F10, MIPS_REG_F11, MIPS_REG_F12, MIPS_REG_F13, MIPS_REG_F14, MIPS_REG_F15, MIPS_REG_F16, MIPS_REG_F17, MIPS_REG_F18, MIPS_REG_F19, MIPS_REG_F20, MIPS_REG_F21, MIPS_REG_F22, MIPS_REG_F23, MIPS_REG_F24, MIPS_REG_F25, MIPS_REG_F26, MIPS_REG_F27, MIPS_REG_F28, MIPS_REG_F29, MIPS_REG_F30, MIPS_REG_F31, MIPS_REG_DSPOUTFLAG16_19, MIPS_REG_HI, MIPS_REG_K0, MIPS_REG_K1, MIPS_REG_LO, MIPS_REG_S0, MIPS_REG_S1, MIPS_REG_S2, MIPS_REG_S3, MIPS_REG_S4, MIPS_REG_S5, MIPS_REG_S6, MIPS_REG_S7, MIPS_REG_T0, MIPS_REG_T1, MIPS_REG_T2, MIPS_REG_T3, MIPS_REG_T4, MIPS_REG_T5, MIPS_REG_T6, MIPS_REG_T7, MIPS_REG_T8, MIPS_REG_T9, MIPS_REG_V0, MIPS_REG_V1, }; if (r < ARR_SIZE(map)) return map[r]; // cannot find this register return 0; } #endif
288342.c
/** * @file * @brief ext4 driver * * @date 10.09.2013 * @author Alexander Kalmuk */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include <limits.h> #include <util/array.h> #include <util/err.h> #include <util/getopt.h> #include <embox/unit.h> #include <drivers/block_dev.h> #include <mem/misc/pool.h> #include <mem/phymem.h> #include <lib/crypt/crc16.h> #include <fs/journal.h> #include <fs/fs_driver.h> #include <fs/vfs.h> #include <fs/inode.h> #include <fs/ext2.h> #include <fs/ext4.h> #include <fs/hlpr_path.h> #include <fs/mount.h> #include <fs/super_block.h> #include <fs/file_desc.h> #include <fs/file_operation.h> #include <mem/sysmalloc.h> /* * Copyright (c) 1997 Manuel Bouyer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR 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) 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * The Mach Operating System project at Carnegie-Mellon University. * * 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 University 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 REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * Copyright (c) 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: David Golub * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ static int ext4_read_inode(struct nas *nas, uint32_t); static int ext4_block_map(struct nas *nas, int32_t, uint32_t *); static int ext4_buf_read_file(struct nas *nas, char **, size_t *); static size_t ext4_write_file(struct nas *nas, char *buf_p, size_t size); static int ext4_new_block(struct nas *nas, long position); static int ext4_search_directory(struct nas *nas, const char *, int, uint32_t *); static int ext4_read_sblock(struct nas *nas); static int ext4_read_gdblock(struct nas *nas); static int ext4_mount_entry(struct nas *nas); int ext4_write_gdblock(struct nas *nas); static void ext4_rw_inode(struct nas *nas, struct ext4_inode *fdi, int rw_flag); int ext4_write_map(struct nas *nas, long position, uint32_t new_block, int op); /* ext filesystem description pool */ POOL_DEF(ext4_fs_pool, struct ext4_fs_info, 128); /* ext file description pool */ POOL_DEF(ext4_file_pool, struct ext4_file_info, 128); #define EXT4_NAME "ext4" /* TODO link counter */ static struct idesc *ext4fs_open(struct inode *node, struct idesc *idesc); static int ext4fs_close(struct file_desc *desc); static size_t ext4fs_read(struct file_desc *desc, void *buf, size_t size); static size_t ext4fs_write(struct file_desc *desc, void *buf, size_t size); static struct file_operations ext4_fop = { .open = ext4fs_open, .close = ext4fs_close, .read = ext4fs_read, .write = ext4fs_write, }; /* Calculates the physical block from a given logical block and extent */ static uint64_t ext4_extent_get_block_from_ees(struct ext4_extent *ee, uint32_t n_ee, uint32_t lblock, uint32_t *len) { uint32_t block_ext_index = 0; uint32_t block_ext_offset = 0; uint32_t i; /* Skip to the right extent entry */ for (i = 0; i < n_ee; i++) { if (ee[i].ee_block + ee[i].ee_len > lblock) { block_ext_index = i; block_ext_offset = lblock - ee[i].ee_block; if (len) { *len = ee[i].ee_block + ee[i].ee_len - lblock; } return ee[block_ext_index].ee_start_lo + block_ext_offset; } } return 0; } /* Fetches a block that stores extent info and returns an array of extents * _with_ its header. */ static void *ext4_extent_get_extents_in_block(struct nas *nas, uint32_t block) { struct ext4_extent_header eh; void *exts; uint32_t extents_len; struct ext4_fs_info *fsi; fsi = nas->fs->sb_data; block_dev_read_buffered(nas->fs->bdev, (char*)&eh, sizeof(struct ext4_extent_header), block * fsi->s_block_size); extents_len = eh.eh_entries * sizeof(struct ext4_extent) + sizeof(struct ext4_extent_header); exts = sysmalloc(extents_len); block_dev_read_buffered(nas->fs->bdev, exts, extents_len, block * fsi->s_block_size); return exts; } /* Returns the physical block number */ static uint64_t ext4_extent_get_pblock(struct nas *nas, void *extents, uint32_t lblock, uint32_t *len) { struct ext4_extent_header *eh = extents; struct ext4_extent *ee_array; uint64_t ret; if (eh->eh_depth == 0) { ee_array = extents + sizeof(struct ext4_extent_header); ret = ext4_extent_get_block_from_ees(ee_array, eh->eh_entries, lblock, len); } else { struct ext4_extent_idx *ei_array = extents + sizeof(struct ext4_extent_header); struct ext4_extent_idx *recurse_ei = NULL; void *leaf_extents; for (int i = 0; i < eh->eh_entries; i++) { assert(ei_array[i].ei_leaf_hi == 0); if (ei_array[i].ei_block > lblock) { break; } recurse_ei = &ei_array[i]; } assert(recurse_ei); leaf_extents = ext4_extent_get_extents_in_block(nas, recurse_ei->ei_leaf_lo); ret = ext4_extent_get_pblock(nas, leaf_extents, lblock, len); sysfree(leaf_extents); } return ret; } static void ext4_extent_add_block(struct nas *nas, uint32_t lblock, uint64_t pblock) { struct ext4_file_info *fi = inode_priv(nas->node); void *extents = fi->f_di.i_block; struct ext4_extent_header *eh = extents; struct ext4_extent *ee_array; int current_ee; ee_array = extents + sizeof(struct ext4_extent_header); eh->eh_depth = 0; current_ee = eh->eh_entries++; ee_array[current_ee].ee_block = lblock; ee_array[current_ee].ee_len = 1; ee_array[current_ee].ee_start_lo = pblock; ee_array[current_ee].ee_start_hi = 0; } static void *ext4_buff_alloc(struct nas *nas, size_t size) { struct ext4_fs_info *fsi; fsi = nas->fs->sb_data; if (size < fsi->s_block_size) { size = fsi->s_block_size; } fsi->s_page_count = size / PAGE_SIZE(); if (0 != size % PAGE_SIZE()) { fsi->s_page_count++; } if (0 == fsi->s_page_count) { fsi->s_page_count++; } return phymem_alloc(fsi->s_page_count); } static int ext4_buff_free(struct ext4_fs_info *fsi, char *buff) { if ((0 != fsi->s_page_count) && (NULL != buff)) { phymem_free(buff, fsi->s_page_count); } return 0; } static int ext4_read_sector(struct nas *nas, char *buffer, uint32_t count, uint32_t sector) { struct ext4_fs_info *fsi; fsi = nas->fs->sb_data; if (0 > block_dev_read(nas->fs->bdev, (char *) buffer, count * fsi->s_block_size, fsbtodb(fsi, sector))) { return -1; } else { return count; } } int ext4_write_sector(struct nas *nas, char *buffer, uint32_t count, uint32_t sector) { struct ext4_fs_info *fsi; fsi = nas->fs->sb_data; if (!strcmp(nas->fs->fs_drv->name, "ext3")) { /* EXT3 */ int i = 0; journal_t *jp = fsi->journal; journal_block_t *b; assert(jp); for (i = 0 ; i < count; i++) { b = journal_new_block(jp, sector + i); if (!b) { return -1; } memcpy(b->data, buffer + i * fsi->s_block_size, fsi->s_block_size); journal_dirty_block(jp, b); } } else { /* EXT2 */ if (0 > block_dev_write(nas->fs->bdev, (char *) buffer, count * fsi->s_block_size, fsbtodb(fsi, sector))) { return -1; } } return count; } /* * Calculate indirect block levels. * * We note that the number of indirect blocks is always * a power of 2. This lets us use shifts and masks instead * of divide and remainder and avoinds pulling in the * 64bit division routine into the boot code. */ static int ext4_shift_culc(struct ext4_file_info *fi, struct ext4_fs_info *fsi) { int32_t mult; int ln2; mult = NINDIR(fsi); if (0 == mult) { return -1; } for (ln2 = 0; mult != 1; ln2++) { mult >>= 1; } fi->f_nishift = ln2; return 0; } /* find and read symlink file */ static int ext4_read_symlink(struct nas *nas, uint32_t parent_inumber, const char **cp) { /* XXX should handle LARGEFILE */ int len, link_len; int rc; uint32_t inumber; char namebuf[MAXPATHLEN + 1]; int nlinks; uint32_t disk_block; struct ext4_file_info *fi; fi = inode_priv(nas->node); nlinks = 0; link_len = ext4_file_size(fi->f_di); len = strlen(*cp); if ((link_len + len > MAXPATHLEN) || (++nlinks > MAXSYMLINKS)) { return ENOENT; } memmove(&namebuf[link_len], cp, len + 1); if (link_len < EXT2_MAXSYMLINKLEN) { memcpy(namebuf, fi->f_di.i_block, link_len); } else { /* Read file for symbolic link */ if (0 != (rc = ext4_block_map(nas, (int32_t) 0, &disk_block))) { return rc; } if (1 != ext4_read_sector(nas, fi->f_buf, 1, disk_block)) { return EIO; } memcpy(namebuf, fi->f_buf, link_len); } /* * If relative pathname, restart at parent directory. * If absolute pathname, restart at root. */ *cp = namebuf; if (*namebuf != '/') { inumber = parent_inumber; } else { inumber = (uint32_t) EXT2_ROOTINO; } rc = ext4_read_inode(nas, inumber); return rc; } /* set node type by file system file type */ static mode_t ext4_type_to_mode_fmt(uint8_t e2d_type) { switch (e2d_type) { case EXT2_FT_REG_FILE: return S_IFREG; case EXT2_FT_DIR: return S_IFDIR; case EXT2_FT_SYMLINK: return S_IFLNK; case EXT2_FT_BLKDEV: return S_IFBLK; case EXT2_FT_CHRDEV: return S_IFCHR; case EXT2_FT_FIFO: return S_IFIFO; default: return 0; } } static uint8_t ext4_type_from_mode_fmt(mode_t mode) { switch (mode & S_IFMT) { case S_IFREG: return EXT2_FT_REG_FILE; case S_IFDIR: return EXT2_FT_DIR; case S_IFLNK: return EXT2_FT_SYMLINK; case S_IFBLK: return EXT2_FT_BLKDEV; case S_IFCHR: return EXT2_FT_CHRDEV; case S_IFIFO: return EXT2_FT_FIFO; default: return EXT2_FT_UNKNOWN; } } int ext4_close(struct nas *nas) { struct ext4_file_info *fi; fi = inode_priv(nas->node); if (NULL != fi) { if (NULL != fi->f_buf) { ext4_buff_free(nas->fs->sb_data, fi->f_buf); } } return 0; } int ext4_open(struct nas *nas) { int rc; char path[PATH_MAX]; const char *cp, *ncp; uint32_t inumber, parent_inumber; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; /* prepare full path into this filesystem */ vfs_get_relative_path(nas->node, path, PATH_MAX); /* alloc a block sized buffer used for all transfers */ if (NULL == (fi->f_buf = ext4_buff_alloc(nas, fsi->s_block_size))) { return ENOMEM; } /* read group descriptor blocks */ if (0 != (rc = ext4_read_gdblock(nas))) { return rc; } if (0 != (rc = ext4_shift_culc(fi, fsi))) { return rc; } inumber = EXT2_ROOTINO; if (0 != (rc = ext4_read_inode(nas, inumber))) { return rc; } cp = path; while (*cp) { /* Remove extra separators */ while (*cp == '/') { cp++; } if (*cp == '\0') { break; } /* Check that current node is a directory */ if (!S_ISDIR(fi->f_di.i_mode)) { rc = ENOTDIR; goto out; } /* Get next component of path name */ ncp = cp; while ((*cp != '\0') && (*cp != '/')) { cp++; } /* * Look up component in current directory. Save directory inumber * in case we find a symbolic link. */ parent_inumber = inumber; if (0 != (rc = ext4_search_directory(nas, ncp, cp - ncp, &inumber))) { goto out; } /* Open next component */ if (0 != (rc = ext4_read_inode(nas, inumber))) { goto out; } /* Check for symbolic link */ if (S_ISLNK(fi->f_di.i_mode)) { if (0 != (rc = ext4_read_symlink(nas, parent_inumber, &cp))) { goto out; } } } fi->f_num = inumber; return 0; out: ext4_close(nas); return rc; } /* * file_operation */ static struct idesc *ext4fs_open(struct inode *node, struct idesc *idesc) { int rc; struct nas *nas; struct ext4_file_info *fi; struct ext4_fs_info *fsi; nas = node->nas; fi = inode_priv(node); fsi = nas->fs->sb_data; fi->f_pointer = file_get_pos(file_desc_from_idesc(idesc)); /* reset seek pointer */ if (NULL == (fi->f_buf = ext4_buff_alloc(nas, fsi->s_block_size))) { return err_ptr(ENOMEM); } if (0 != (rc = ext4_read_inode(nas, fi->f_num))) { ext4_close(nas); return err_ptr(rc); } else { file_set_size(file_desc_from_idesc(idesc), ext4_file_size(fi->f_di)); } return idesc; } static int ext4fs_close(struct file_desc *desc) { struct nas *nas; if (NULL == desc) { return 0; } nas = desc->f_inode->nas; return ext4_close(nas); } static size_t ext4fs_read(struct file_desc *desc, void *buff, size_t size) { int rc; size_t csize; char *buf; size_t buf_size; char *addr = buff; struct nas *nas; struct ext4_file_info *fi; nas = desc->f_inode->nas; fi = inode_priv(nas->node); fi->f_pointer = file_get_pos(desc); while (size != 0) { /* XXX should handle LARGEFILE */ if (fi->f_pointer >= ext4_file_size(fi->f_di)) { break; } if (0 != (rc = ext4_buf_read_file(nas, &buf, &buf_size))) { SET_ERRNO(rc); return 0; } csize = size; if (csize > buf_size) { csize = buf_size; } memcpy(addr, buf, csize); fi->f_pointer += csize; addr += csize; size -= csize; } return (addr - (char *) buff); } static size_t ext4fs_write(struct file_desc *desc, void *buff, size_t size) { uint32_t bytecount; struct nas *nas; struct ext4_file_info *fi; nas = desc->f_inode->nas; fi = inode_priv(nas->node); fi->f_pointer = file_get_pos(desc); bytecount = ext4_write_file(nas, buff, size); file_set_size(desc, ext4_file_size(fi->f_di)); return bytecount; } static int ext4_create(struct nas *nas, struct nas * parents_nas); static int ext4_mkdir(struct nas *nas, struct nas * parents_nas); static int ext4_unlink(struct nas *dir_nas, struct nas *nas); static void ext4_free_fs(struct super_block *sb); static int ext4fs_umount_entry(struct inode *node); static int ext4fs_format(struct block_dev *dev, void *priv); static int ext4fs_fill_sb(struct super_block *sb, const char *source); static int ext4fs_clean_sb(struct super_block *sb); static int ext4fs_mount(struct super_block *sb, struct inode *dest); static int ext4fs_create(struct inode *parent_node, struct inode *node); static int ext4fs_delete(struct inode *node); static int ext4fs_truncate(struct inode *node, off_t length); static struct fsop_desc ext4_fsop = { .format = ext4fs_format, .mount = ext4fs_mount, .create_node = ext4fs_create, .delete_node = ext4fs_delete, .getxattr = ext2fs_getxattr, .setxattr = ext2fs_setxattr, .listxattr = ext2fs_listxattr, .truncate = ext4fs_truncate, .umount_entry = ext4fs_umount_entry, }; static struct fs_driver ext4fs_driver = { .name = EXT4_NAME, .fill_sb = ext4fs_fill_sb, .clean_sb = ext4fs_clean_sb, .file_op = &ext4_fop, .fsop = &ext4_fsop, }; static ext4_file_info_t *ext4_fi_alloc(struct nas *nas, void *fs) { ext4_file_info_t *fi; fi = pool_alloc(&ext4_file_pool); if (fi) { nas->fi->ni.size = fi->f_pointer = 0; inode_priv_set(nas->node, fi); } return fi; } static int ext4fs_create(struct inode *parent_node, struct inode *node) { int rc; struct nas *nas, *parents_nas; nas = node->nas; parents_nas = parent_node->nas; if (node_is_directory(node)) { if (0 != (rc = ext4_mkdir(nas, parents_nas))) { return -rc; } if (0 != (rc = ext4_mount_entry(nas))) { return -rc; } } else { if (0 != (rc = ext4_create(nas, parents_nas))) { return -rc; } } return 0; } extern int main_mke2fs(int argc, char **argv); static int ext4fs_format(struct block_dev *dev, void *priv) { int argc = 6; char *argv[6]; char dev_path[64]; strcpy(dev_path, "/dev/"); strcat(dev_path, dev->name); argv[0] = "mke2fs"; argv[1] = "-b"; argv[2] = "1024"; argv[3] = "-t"; argv[4] = "ext4"; argv[5] = dev_path; getopt_init(); return main_mke2fs(argc, argv); } static int ext4fs_delete(struct inode *node) { int rc; struct inode *parents; if (NULL == (parents = vfs_subtree_get_parent(node))) { rc = ENOENT; return -rc; } if (0 != (rc = ext4_unlink(parents->nas, node->nas))) { return -rc; } return 0; } static int ext4fs_fill_sb(struct super_block *sb, const char *source) { struct ext4_fs_info *fsi; struct block_dev *bdev = bdev_by_path(source); if (NULL == bdev) { return -ENODEV; } sb->bdev = bdev; if (NULL == (fsi = pool_alloc(&ext4_fs_pool))) { return -ENOMEM; } memset(fsi, 0, sizeof(struct ext4_fs_info)); sb->sb_data = fsi; return 0; } static int ext4fs_mount(struct super_block *sb, struct inode *dest) { int rc; struct nas *dir_nas; struct ext4_file_info *fi; struct ext4_fs_info *fsi; dir_nas = dest->nas; if (NULL == (fi = pool_alloc(&ext4_file_pool))) { rc = ENOMEM; goto error; } memset(fi, 0, sizeof(struct ext4_file_info)); fi->f_pointer = 0; inode_priv_set(dest, fi); /* presetting that we think */ fsi = sb->sb_data; fsi->s_block_size = SBSIZE; fsi->s_sectors_in_block = fsi->s_block_size / 512; if (0 != (rc = ext4_read_sblock(dir_nas))) { goto error; } if (NULL == (fsi->e4fs_gd = ext4_buff_alloc(dir_nas, sizeof(struct ext4_group_desc) * fsi->s_ncg))) { rc = ENOMEM; goto error; } if (0 != (rc = ext4_read_gdblock(dir_nas))) { goto error; } if (0 != (rc = ext4_mount_entry(dir_nas))) { goto error; } return 0; error: ext4_free_fs(sb); return -rc; } static int ext4fs_truncate (struct inode *node, off_t length) { struct nas *nas = node->nas; nas->fi->ni.size = length; return 0; } static int ext4fs_clean_sb(struct super_block *sb) { ext4_free_fs(sb); return 0; } static void ext4_free_fs(struct super_block *sb) { struct ext4_fs_info *fsi = sb->sb_data; if (NULL != fsi) { if(NULL != fsi->e4fs_gd) { ext4_buff_free(fsi, (char *) fsi->e4fs_gd); } pool_free(&ext4_fs_pool, fsi); } } static int ext4fs_umount_entry(struct inode *node) { pool_free(&ext4_file_pool, inode_priv(node)); return 0; } /* * Read a new inode into a file structure. */ static int ext4_read_inode(struct nas *nas, uint32_t inumber) { char *buf; size_t rsize; int64_t inode_sector; struct ext4_inode *dip; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; rsize = EXT4_DINODE_SIZE(fsi); inode_sector = ext4_ino_to_fsba(fsi, inumber); /* Read inode and save it */ buf = fi->f_buf; rsize = ext4_read_sector(nas, buf, 1, inode_sector); if (rsize * fsi->s_block_size != fsi->s_block_size) { return EIO; } /* set pointer to inode struct in read buffer */ dip = (struct ext4_inode *) (buf + EXT4_DINODE_SIZE(fsi) * ext4_ino_to_fsbo(fsi, inumber)); /* load inode struct to file info */ e4fs_iload(dip, &fi->f_di); /* Clear out the old buffers */ fi->f_ind_cache_block = ~0; fi->f_buf_blkno = -1; return 0; } /* * Given an offset in a file, find the disk block number that * contains that block. */ static int ext4_block_map(struct nas *nas, int32_t file_block, uint32_t *disk_block_p) { uint32_t len; struct ext4_file_info *fi = inode_priv(nas->node); *disk_block_p = ext4_extent_get_pblock(nas, fi->f_di.i_block, file_block, &len); return 0; } /* * Read a portion of a file into an internal buffer. * Return the location in the buffer and the amount in the buffer. */ static int ext4_buf_read_file(struct nas *nas, char **buf_p, size_t *size_p) { int rc; long off; int32_t file_block; uint32_t disk_block; size_t block_size; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; off = blkoff(fsi, fi->f_pointer); file_block = lblkno(fsi, fi->f_pointer); block_size = fsi->s_block_size; /* no fragment */ if (file_block != fi->f_buf_blkno) { if (0 != (rc = ext4_block_map(nas, file_block, &disk_block))) { return rc; } if (disk_block == 0) { memset(fi->f_buf, 0, block_size); fi->f_buf_size = block_size; } else { if (1 != ext4_read_sector(nas, fi->f_buf, 1, disk_block)) { return EIO; } } fi->f_buf_blkno = file_block; } /* * Return address of byte in buffer corresponding to * offset, and size of remainder of buffer after that * byte. */ *buf_p = fi->f_buf + off; *size_p = block_size - off; /* But truncate buffer at end of file */ /* XXX should handle LARGEFILE */ if (*size_p > ext4_file_size(fi->f_di) - fi->f_pointer) { *size_p = ext4_file_size(fi->f_di) - fi->f_pointer; } return 0; } /* * Write a portion to a file from an internal buffer. */ static size_t ext4_write_file(struct nas *nas, char *buf, size_t size) { long inblock_off; int32_t file_block; uint32_t disk_block; char *buff; size_t block_size, len, cnt; size_t bytecount, end_pointer; struct ext4_inode fdi; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; block_size = fsi->s_block_size; /* no fragment */ bytecount = 0; len = size; buff = buf; end_pointer = fi->f_pointer + len; if (0 != ext4_new_block(nas, end_pointer - 1)) { return 0; } while (1) { file_block = lblkno(fsi, fi->f_pointer); if (0 != ext4_block_map(nas, file_block, &disk_block)) { return 0; } /* if need alloc new block for a file */ if (0 == disk_block) { return bytecount; } fi->f_buf_blkno = file_block; /* calculate f_pointer in scratch buffer */ inblock_off = blkoff(fsi, fi->f_pointer); /* set the counter how many bytes written in block */ /* more than block */ if (end_pointer - fi->f_pointer > block_size) { if (0 != inblock_off) { /* write a part of block */ cnt = block_size - inblock_off; } else { /* write the whole block */ cnt = block_size; } } else { cnt = end_pointer - fi->f_pointer; /* over the block ? */ if ((inblock_off + cnt) > block_size) { cnt -= blkoff(fsi, (inblock_off + cnt)); } } /* one 4096-bytes block read operation */ if (1 != ext4_read_sector(nas, fi->f_buf, 1, disk_block)) { bytecount = 0; break; } /* set new data in block */ memcpy(fi->f_buf + inblock_off, buff, cnt); /* write one block to device */ if (1 != ext4_write_sector(nas, fi->f_buf, 1, disk_block)) { bytecount = 0; break; } bytecount += cnt; buff += cnt; /* shift the f_pointer */ fi->f_pointer += cnt; if (end_pointer <= fi->f_pointer) { break; } } /* if we write over the last EOF, set new filelen */ if (ext4_file_size(fi->f_di) < fi->f_pointer) { fi->f_di.i_size_lo = fi->f_pointer; fi->f_di.i_size_hi = 0; } memcpy(&fdi, &fi->f_di, sizeof(struct ext4_inode)); ext4_rw_inode(nas, &fdi, EXT4_W_INODE); return bytecount; } /* * Search a directory for a name and return its * inode number. */ static int ext4_search_directory(struct nas *nas, const char *name, int length, uint32_t *inumber_p) { int rc; struct ext4_dir *dp; struct ext4_dir *edp; char *buf; size_t buf_size; int namlen; struct ext4_file_info *fi; fi = inode_priv(nas->node); fi->f_pointer = 0; /* XXX should handle LARGEFILE */ while (fi->f_pointer < (long) ext4_file_size(fi->f_di)) { if (0 != (rc = ext4_buf_read_file(nas, &buf, &buf_size))) { return rc; } dp = (struct ext4_dir *) buf; edp = (struct ext4_dir *) (buf + buf_size); for (; dp < edp; dp = (struct ext4_dir *) ((char *) dp + fs2h16(dp->rec_len))) { if (fs2h16(dp->rec_len) <= 0) { break; } if (fs2h32(dp->inode) == (uint32_t) 0) { continue; } namlen = dp->name_len; if (namlen == length && !memcmp(name, dp->name, length)) { /* found entry */ *inumber_p = fs2h32(dp->inode); return 0; } } fi->f_pointer += buf_size; } return ENOENT; } int ext4_write_sblock(struct nas *nas) { struct ext4_fs_info *fsi; fsi = nas->fs->sb_data; if (1 != ext4_write_sector(nas, (char *) &fsi->e4sb, 1, dbtofsb(fsi, SBOFF / SECTOR_SIZE))) { return EIO; } return 0; } static int ext4_read_sblock(struct nas *nas) { void *sbbuf = NULL; struct ext4_fs_info *fsi; struct ext4_super_block *ext4sb; int ret = 0; fsi = nas->fs->sb_data; ext4sb = &fsi->e4sb; if (!(sbbuf = ext4_buff_alloc(nas, fsi->s_block_size))) { return ENOMEM; } if (1 != ext4_read_sector(nas, (char *) sbbuf, 1, dbtofsb(fsi, SBOFF / SECTOR_SIZE))) { ret = EIO; goto out; } e2fs_sbload(sbbuf, ext4sb); ext4_buff_free(fsi, sbbuf); if (ext4sb->s_magic != E2FS_MAGIC) { ret = EINVAL; goto out; } // if (ext2sb->s_rev_level > E2FS_REV1 // || (ext2sb->s_rev_level == E2FS_REV1 // && (ext2sb->s_first_ino != EXT4_FIRSTINO // || (ext2sb->s_inode_size != 128 // && ext2sb->s_inode_size != 256) // || ext2sb->s_feature_incompat & ~EXT2F_INCOMPAT_SUPP))) { // ret = ENODEV; // goto out; // // } /* compute in-memory ext4_fs_info values */ fsi->s_ncg = howmany(fsi->e4sb.s_blocks_count - fsi->e4sb.s_first_data_block, fsi->e4sb.s_blocks_per_group); /* XXX assume hw bsize = 512 */ fsi->s_fsbtodb = fsi->e4sb.s_log_block_size + 1; fsi->s_block_size = MINBSIZE << fsi->e4sb.s_log_block_size; fsi->s_bshift = LOG_MINBSIZE + fsi->e4sb.s_log_block_size; fsi->s_qbmask = fsi->s_block_size - 1; fsi->s_bmask = ~fsi->s_qbmask; fsi->s_gdb_count = howmany(fsi->s_ncg, fsi->s_block_size / sizeof(struct ext4_group_desc)); fsi->s_inodes_per_block = fsi->s_block_size / ext4sb->s_inode_size; fsi->s_itb_per_group = fsi->e4sb.s_inodes_per_group / fsi->s_inodes_per_block; fsi->s_groups_count = ((fsi->e4sb.s_blocks_count - fsi->e4sb.s_first_data_block - 1) / fsi->e4sb.s_blocks_per_group) + 1; fsi->s_bsearch = fsi->e4sb.s_first_data_block + 1 + fsi->s_gdb_count + 2 + fsi->s_itb_per_group; fsi->s_blocksize_bits = fsi->e4sb.s_log_block_size + 10; fsi->s_desc_per_block = fsi->s_block_size / sizeof(struct ext4_group_desc); out: ext4_buff_free(fsi, sbbuf); return ret; } static uint16_t ext4_checksum(struct ext4_fs_info *fsi, uint32_t block_nr, struct ext4_group_desc *gdp) { int offset; uint16_t crc = 0; offset = offsetof(struct ext4_group_desc, checksum); crc = crc16(~0, fsi->e4sb.s_uuid, sizeof(fsi->e4sb.s_uuid)); crc = crc16(crc, (__u8 *)&block_nr, sizeof(block_nr)); crc = crc16(crc, (__u8 *)gdp, offset); offset += sizeof(gdp->checksum); crc = crc16(crc, (__u8 *) gdp + offset, sizeof(struct ext4_group_desc) - offset); return crc; } int ext4_write_gdblock(struct nas *nas) { uint gdpb; int i; char *buff; struct ext4_fs_info *fsi; fsi = nas->fs->sb_data; gdpb = fsi->s_block_size / sizeof(struct ext4_group_desc); for (i = 0; i < fsi->s_gdb_count; i += gdpb) { buff = (char *) &fsi->e4fs_gd[i * gdpb]; fsi->e4fs_gd[i * gdpb].checksum = ext4_checksum(fsi, i / gdpb, &fsi->e4fs_gd[i * gdpb]); if (1 != ext4_write_sector(nas, buff, 1, fsi->e4sb.s_first_data_block + 1 + i / gdpb)) { return EIO; } } return 0; } static int ext4_read_gdblock(struct nas *nas) { size_t rsize; uint gdpb; int i; struct ext4_fs_info *fsi; void *gdbuf = NULL; int ret = 0; fsi = nas->fs->sb_data; gdpb = fsi->s_block_size / sizeof(struct ext4_group_desc); if (!(gdbuf = ext4_buff_alloc(nas, fsi->s_block_size))) { return ENOMEM; } for (i = 0; i < fsi->s_gdb_count; i++) { rsize = ext4_read_sector(nas, gdbuf, 1, fsi->e4sb.s_first_data_block + 1 + i); if (rsize * fsi->s_block_size != fsi->s_block_size) { ret = EIO; goto out; } e2fs_cgload((struct ext4_group_desc *)gdbuf, &fsi->e4fs_gd[i * gdpb], (i == (fsi->s_gdb_count - 1)) ? (fsi->s_ncg - gdpb * i) * sizeof(struct ext4_group_desc) : fsi->s_block_size); } out: ext4_buff_free(fsi, gdbuf); return ret; } static int ext4_mount_entry(struct nas *dir_nas) { int rc; char *buf; size_t buf_size; struct ext4_dir *dp, *edp; struct ext4_file_info *dir_fi, *fi; struct ext4_fs_info *fsi; char *name, *name_buff; struct inode *node; mode_t mode; rc = 0; if (NULL == (name_buff = ext4_buff_alloc(dir_nas, NAME_MAX))) { rc = ENOMEM; return rc; } if (0 != ext4_open(dir_nas)) { goto out; } dir_fi = inode_priv(dir_nas->node); fsi = dir_nas->fs->sb_data; dir_nas->node->i_mode = dir_fi->f_di.i_mode; dir_nas->node->uid = dir_fi->f_di.i_uid; dir_nas->node->gid = dir_fi->f_di.i_gid; dir_fi->f_pointer = 0; while (dir_fi->f_pointer < ext4_file_size(dir_fi->f_di)) { if (0 != (rc = ext4_buf_read_file(dir_nas, &buf, &buf_size))) { goto out; } if (buf_size != fsi->s_block_size || buf_size == 0) { rc = EIO; goto out; } dp = (struct ext4_dir *) buf; edp = (struct ext4_dir *) (buf + buf_size); for (; dp < edp; dp = (void *) ((char *) dp + fs2h16(dp->rec_len))) { if (fs2h16(dp->rec_len) <= 0) { goto out; } if (fs2h32(dp->inode) == 0) { continue; } /* set null determine name */ name = (char *) &dp->name; memcpy(name_buff, name, fs2h16(dp->name_len)); name_buff[fs2h16(dp->name_len)] = '\0'; if(0 != path_is_dotname(name_buff, dp->name_len)) { /* dont need create dot or dotdot node */ continue; } mode = ext4_type_to_mode_fmt(dp->type); node = vfs_subtree_create(dir_nas->node, name_buff, mode); if (!node) { rc = ENOMEM; goto out; } fi = ext4_fi_alloc(node->nas, dir_nas->fs); if (!fi) { vfs_del_leaf(node); rc = ENOMEM; goto out; } if (node_is_directory(node)) { rc = ext4_mount_entry(node->nas); } else { /* read inode into fi->f_di*/ if (0 == ext4_open(node->nas)) { /* Load permisiions and credentials. */ assert((node->i_mode & S_IFMT) == (fi->f_di.i_mode & S_IFMT)); node->i_mode = fi->f_di.i_mode; node->uid = fi->f_di.i_uid; node->gid = fi->f_di.i_gid; } ext4_close(node->nas); } } dir_fi->f_pointer += buf_size; } out: ext4_close(dir_nas); ext4_buff_free(fsi, name_buff); return rc; } static int ext4_dir_operation(struct nas *nas, char *string, ino_t *numb, int flag, mode_t mode_fmt); static int ext4_new_block(struct nas *nas, long position) { /* Acquire a new block and return a pointer to it.*/ int rc; uint32_t goal; long position_diff; struct ext4_file_info *fi; struct ext4_fs_info *fsi; uint32_t b, lblock; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; lblock = lblkno(fsi, position); if (0 != (rc = ext4_block_map(nas, lblock, &b))) { return rc; } /* Is another block available? */ if (EXT4_NO_BLOCK == b) { /* Check if this position follows last allocated block. */ goal = EXT4_NO_BLOCK; if (fi->f_last_pos_bl_alloc != 0) { position_diff = position - fi->f_last_pos_bl_alloc; if (0 == fi->f_bsearch) { /* Should never happen, but not critical */ return -1; } if (position_diff <= fsi->s_block_size) { goal = fi->f_bsearch + 1; } } if (EXT4_NO_BLOCK == (b = ext4_alloc_block(nas, goal))) { return ENOSPC; } ext4_extent_add_block(nas, lblock, b); } return 0; } static int ext4_new_node(struct nas *nas, struct nas * parents_nas); static int ext4_create(struct nas *nas, struct nas *parents_nas) { int rc; struct ext4_file_info *fi, *dir_fi; struct ext4_fs_info *fsi; dir_fi = inode_priv(parents_nas->node); if (0 != (rc = ext4_open(parents_nas))) { return rc; } /* Create a new file inode */ if (0 != (rc = ext4_new_node(nas, parents_nas))) { return rc; } fi = inode_priv(nas->node); dir_fi->f_di.i_links_count++; ext4_rw_inode(parents_nas, &dir_fi->f_di, EXT4_W_INODE); ext4_close(parents_nas); fsi = nas->node->i_sb->sb_data; if (NULL != fi) { ext4_buff_free(fsi, fi->f_buf); return 0; } return ENOSPC; } static int ext4_mkdir(struct nas *nas, struct nas *parents_nas) { int rc; int r1, r2; /* status codes */ ino_t dot, dotdot; /* inode numbers for . and .. */ struct ext4_file_info *fi, *dir_fi; struct ext4_fs_info *fsi; if (!node_is_directory(parents_nas->node)) { rc = ENOTDIR; return rc; } dir_fi = inode_priv(parents_nas->node); /* read the directory inode */ if (0 != (rc = ext4_open(parents_nas))) { return rc; } /* Create a new directory inode. */ if (0 != (rc = ext4_new_node(nas, parents_nas))) { ext4_close(parents_nas); return ENOSPC; } fi = inode_priv(nas->node); /* Get the inode numbers for . and .. to enter in the directory. */ dotdot = dir_fi->f_num; /* parent's inode number */ dot = fi->f_num; /* inode number of the new dir itself */ /* Now make dir entries for . and .. unless the disk is completely full. */ /* Use dot1 and dot2, so the mode of the directory isn't important. */ /* enter . in the new dir*/ r1 = ext4_dir_operation(nas, ".", &dot, ENTER, S_IFDIR); /* enter .. in the new dir */ r2 = ext4_dir_operation(nas, "..", &dotdot, ENTER, S_IFDIR); /* If both . and .. were successfully entered, increment the link counts. */ if (r1 != 0 || r2 != 0) { /* It was not possible to enter . or .. probably disk was full - * links counts haven't been touched. */ ext4_dir_operation(parents_nas, (char *) nas->node->name/*string*/, &dot, DELETE, 0); /* TODO del inode and clear the pool*/ return (r1 | r2); } dir_fi->f_di.i_links_count++; ext4_rw_inode(parents_nas, &dir_fi->f_di, EXT4_W_INODE); fsi = nas->fs->sb_data; ext4_buff_free(fsi, fi->f_buf); ext4_close(parents_nas); if (NULL == fi) { return ENOSPC; } return 0; } static void ext4_wipe_inode(struct ext4_file_info *fi, struct ext4_file_info *dir_fi) { /* Erase some fields in the ext4_file_info. This function is called from alloc_inode() * when a new ext4_file_info is to be allocated, and from truncate(), when an existing * ext4_file_info is to be truncated. */ struct ext4_inode *di = &fi->f_di; struct ext4_inode *dir_di = &dir_fi->f_di; di->i_size_lo = 0; di->i_size_hi = 0; di->i_blocks_lo = 0; di->i_flags = 0; di->i_obso_faddr = 0; for (int i = 0; i < EXT4_N_BLOCKS; i++) { di->i_block[i] = NO_BLOCK; } di->i_mode = dir_di->i_mode & ~S_IFMT; di->i_uid = dir_di->i_uid; di->i_atime = dir_di->i_atime; di->i_ctime = dir_di->i_ctime; di->i_mtime = dir_di->i_mtime; di->i_dtime = dir_di->i_dtime; di->i_gid = dir_di->i_gid; } /* * Find first group which has free inode slot. */ static int ext4_find_group_any(struct ext4_fs_info *fsi) { int group, ngroups; struct ext4_group_desc *gd; group = 0; ngroups = fsi->s_groups_count; for (; group < ngroups; group++) { gd = ext4_get_group_desc(group, fsi); if (gd == NULL ) { return EIO; } if (ext4_free_inodes_count(gd)) { return group; } } return EIO; } static int ext4_free_inode_bit(struct nas *nas, uint32_t bit_returned, int is_dir) { /* Return an inode by turning off its bitmap bit. */ int group; /* group number of bit_returned */ int bit; /* bit_returned number within its group */ struct ext4_group_desc *gd; struct ext4_fs_info *fsi; struct ext4_file_info *fi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; /* At first search group, to which bit_returned belongs to * and figure out in what word bit is stored. */ if (bit_returned > fsi->e4sb.s_inodes_count|| bit_returned < EXT2_FIRST_INO(&fsi->e4sb)) { return ENOMEM; } group = (bit_returned - 1) / fsi->e4sb.s_inodes_per_group; bit = (bit_returned - 1) % fsi->e4sb.s_inodes_per_group; /* index in bitmap */ if (NULL == (gd = ext4_get_group_desc(group, fsi))) { return ENOMEM; } if (1 != ext4_read_sector(nas, fi->f_buf, 1, ext4_inode_bitmap_len(gd))) { return EIO; } if (ext4_unsetbit(b_bitmap(fi->f_buf), bit)) { return EIO; } if (1 != ext4_write_sector(nas, fi->f_buf, 1, ext4_inode_bitmap_len(gd))) { return EIO; } ext4_inc_lo_hi(gd->free_inodes_count_lo, gd->free_inodes_count_hi); fsi->e4sb.s_free_inodes_count++; if (is_dir) { ext4_dec_lo_hi(gd->used_dirs_count_lo, gd->used_dirs_count_hi); } return (ext4_write_sblock(nas) | ext4_write_gdblock(nas)); } static uint32_t ext4_alloc_inode_bit(struct nas *nas, int is_dir) { /* inode will be a directory if it is TRUE */ int group; ino_t inumber; uint32_t bit; struct ext4_group_desc *gd; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; inumber = 0; group = ext4_find_group_any(fsi); /* Check if we have a group where to allocate an ext4_file_info */ if (group == -1) { return 0; /* no bit could be allocated */ } if (NULL == (gd = ext4_get_group_desc(group, fsi))) { return 0; } /* find_group_* should always return either a group with * a free ext4_file_info slot or -1, which we checked earlier. */ if (1 != ext4_read_sector(nas, fi->f_buf, 1, ext4_inode_bitmap_len(gd))) { return 0; } bit = ext4_setbit(b_bitmap(fi->f_buf), fsi->e4sb.s_inodes_per_group, 0); inumber = group * fsi->e4sb.s_inodes_per_group + bit + 1; /* Extra checks before real allocation. * Only major bug can cause problems. Since setbit changed * bp->b_bitmap there is no way to recover from this bug. * Should never happen. */ if (inumber > fsi->e4sb.s_inodes_count) { return 0; } if (inumber < EXT4_FIRST_INO(&fsi->e4sb)) { return 0; } ext4_write_sector(nas, fi->f_buf, 1, ext4_inode_bitmap_len(gd)); ext4_dec_lo_hi(gd->free_inodes_count_lo, gd->free_inodes_count_hi); fsi->e4sb.s_free_inodes_count--; if (is_dir) { ext4_inc_lo_hi(gd->used_dirs_count_lo, gd->used_dirs_count_hi); } if (ext4_write_sblock(nas) || ext4_write_gdblock(nas)) { inumber = 0; } return inumber; } static int ext4_free_inode(struct nas *nas) { /* ext4_file_info to free */ /* Return an ext4_file_info to the pool of unallocated inodes. */ int rc; uint32_t pos; uint32_t b; struct ext4_inode fdi; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; /* Locate the appropriate super_block. */ if (0!= (rc = ext4_read_sblock(nas))) { return rc; } /* free all data block of file */ for(pos = 0; pos <= ext4_file_size(fi->f_di); pos += fsi->s_block_size) { if (0 != (rc = ext4_block_map(nas, lblkno(fsi, pos), &b))) { return rc; } ext4_free_block(nas, b); } /* clear inode in inode table */ memset(&fdi, 0, sizeof(struct ext4_inode)); ext4_rw_inode(nas, &fdi, EXT4_W_INODE); /* free inode bitmap */ b = fi->f_num; if (b <= 0 || b > fsi->e4sb.s_inodes_count) { return ENOSPC; } rc = ext4_free_inode_bit(nas, b, node_is_directory(nas->node)); ext4_close(nas); pool_free(&ext4_file_pool, fi); return rc; } static int ext4_alloc_inode(struct nas *nas, struct nas *parents_nas) { /* Allocate a free inode in inode table and return a pointer to it. */ int rc; struct ext4_file_info *fi, *dir_fi; struct ext4_fs_info *fsi; uint32_t b; dir_fi = inode_priv(parents_nas->node); fsi = parents_nas->fs->sb_data; if (NULL == (fi = ext4_fi_alloc(nas, parents_nas->fs))) { rc = ENOSPC; goto out; } memset(fi, 0, sizeof(struct ext4_file_info)); if (NULL == (fi->f_buf = ext4_buff_alloc(nas, fsi->s_block_size))) { rc = ENOSPC; goto out; } if (0 != (rc = ext4_read_sblock(nas))) { goto out; } /* Acquire an inode from the bit map. */ if (0 == (b = ext4_alloc_inode_bit(nas, node_is_directory(nas->node)))) { rc = ENOSPC; goto out; } fi->f_num = b; ext4_wipe_inode(fi, dir_fi); return 0; out: vfs_del_leaf(nas->node); if (NULL != fi) { if (NULL != fi->f_buf) { ext4_buff_free(fsi, fi->f_buf); } pool_free(&ext4_file_pool, fi); } return rc; } static void ext4_rw_inode(struct nas *nas, struct ext4_inode *fdi, int rw_flag) { /* An entry in the inode table is to be copied to or from the disk. */ struct ext4_group_desc *gd; struct ext4_inode *dip; unsigned int block_group_number; uint32_t b, offset; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; /* Get the block where the inode resides. */ ext4_read_sblock(nas); block_group_number = (fi->f_num - 1) / fsi->e4sb.s_inodes_per_group; if (NULL == (gd = ext4_get_group_desc(block_group_number, fsi))) { return; } offset = ((fi->f_num - 1) % fsi->e4sb.s_inodes_per_group) * EXT4_INODE_SIZE(&fsi->e4sb); /* offset requires shifting, since each block contains several inodes, * e.g. inode 2 is stored in bklock 0. */ b = (uint32_t) ext4_inode_table_len(gd) + (offset >> fsi->s_blocksize_bits); ext4_read_sector(nas, fi->f_buf, 1, b); offset &= (fsi->s_block_size - 1); dip = (struct ext4_inode*) (b_data(fi->f_buf) + offset); /* Do the read or write. */ if (rw_flag) { memcpy(dip, fdi, sizeof(struct ext4_inode)); ext4_write_sector(nas, fi->f_buf, 1, b); ext4_write_gdblock(nas); } else { memcpy(fdi, dip, sizeof(struct ext4_inode)); } } static int ext4_dir_operation(struct nas *nas, char *string, ino_t *numb, int flag, mode_t mode_fmt) { /* This function searches the directory whose inode is pointed to : * if (flag == ENTER) enter 'string' in the directory with inode # '*numb'; * if (flag == DELETE) delete 'string' from the directory; * if (flag == LOOK_UP) search for 'string' and return inode # in 'numb'; * if (flag == IS_EMPTY) return OK if only . and .. in dir else ENOTEMPTY; * * if 'string' is dot1 or dot2, no access permissions are checked. */ int rc; struct ext4_dir *dp = NULL; struct ext4_dir *prev_dp = NULL; int i, e_hit, t, match; uint32_t pos; unsigned new_slots; uint32_t b = 0; int extended; int required_space; int string_len; int new_slot_size, actual_size; u16_t temp; struct ext4_inode fdi; struct ext4_file_info *fi; struct ext4_fs_info *fsi; fi = inode_priv(nas->node); fsi = nas->fs->sb_data; /* If 'fi' is not a pointer to a dir inode, error. */ if (!node_is_directory(nas->node)) { return ENOTDIR; } e_hit = match = 0; /* set when a string match occurs */ new_slots = 0; pos = 0; extended = required_space = string_len = 0; if (ENTER == flag) { string_len = strlen(string); required_space = MIN_DIR_ENTRY_SIZE + string_len; required_space += (required_space & 0x03) == 0 ? 0 : (DIR_ENTRY_ALIGN - (required_space & 0x03)); } for (; pos < ext4_file_size(fi->f_di); pos += fsi->s_block_size) { if (0 != (rc = ext4_block_map(nas, lblkno(fsi, pos), &b))) { return rc; } /* Since directories don't have holes, 'b' cannot be NO_BLOCK. */ /* get a dir block */ if (1 != ext4_read_sector(nas, fi->f_buf, 1, b)) { return EIO; } prev_dp = NULL; /* New block - new first dentry, so no prev. */ /* Search a directory block. * Note, we set prev_dp at the end of the loop. */ for (dp = (struct ext4_dir*) &b_data(fi->f_buf) ; CUR_DISC_DIR_POS(dp, &b_data(fi->f_buf)) < fsi->s_block_size; dp = EXT4_NEXT_DISC_DIR_DESC(dp) ) { if (prev_dp == dp) { /* no dp in directory entry */ dp->rec_len = fsi->s_block_size; } /* Match occurs if string found. */ if (ENTER != flag && 0 != dp->inode) { if (IS_EMPTY == flag) { /* If this test succeeds, dir is not empty. */ if(0 == path_is_dotname(dp->name, dp->name_len)) { match = 1; } } else { if ((dp->name_len == strlen(string)) && (0 == strncmp(dp->name, string, dp->name_len))) { match = 1; } } } if (match) { /* LOOK_UP or DELETE found what it wanted. */ rc = 0; if (IS_EMPTY == flag) { rc = ENOTEMPTY; } else if (DELETE == flag) { if (dp->name_len >= sizeof(ino_t)) { /* Save d_ino for recovery. */ t = dp->name_len - sizeof(ino_t); *((ino_t *) &dp->name[t]) = dp->inode; } dp->inode = 0; /* erase entry */ /* Now we have cleared dentry, if it's not the first one, * merge it with previous one. Since we assume, that * existing dentry must be correct, there is no way to * spann a data block. */ if (prev_dp) { temp = prev_dp->rec_len; temp += dp->rec_len; prev_dp->rec_len = temp; } } else { /* 'flag' is LOOK_UP */ *numb = (ino_t) dp->inode; } if (1 != ext4_write_sector(nas, fi->f_buf, 1, b)) { return EIO; } return rc; } /* Check for free slot for the benefit of ENTER. */ if (ENTER == flag && 0 == dp->inode) { /* we found a free slot, check if it has enough space */ if (required_space <= dp->rec_len) { e_hit = 1; /* we found a free slot */ break; } } /* Can we shrink dentry? */ if (ENTER == flag && required_space <= EXT4_DIR_ENTRY_SHRINK(dp)) { /* Shrink directory and create empty slot, now * dp->d_rec_len = DIR_ENTRY_ACTUAL_SIZE + DIR_ENTRY_SHRINK. */ new_slot_size = dp->rec_len; actual_size = EXT4_DIR_ENTRY_ACTUAL_SIZE(dp); new_slot_size -= actual_size; dp->rec_len = actual_size; dp = EXT4_NEXT_DISC_DIR_DESC(dp); dp->rec_len = new_slot_size; /* if we fail before writing real ino */ dp->inode = 0; e_hit = 1; /* we found a free slot */ break; } prev_dp = dp; } /* The whole block has been searched or ENTER has a free slot. */ if (e_hit) { break; /* e_hit set if ENTER can be performed now */ } /* otherwise, continue searching dir */ if (1 != ext4_write_sector(nas, fi->f_buf, 1, b)) { return EIO; } } /* The whole directory has now been searched. */ if (ENTER != flag) { return (flag == IS_EMPTY ? 0 : ENOENT); } /* This call is for ENTER. If no free slot has been found so far, try to * extend directory. */ if (0 == e_hit) { /* directory is full and no room left in last block */ new_slots++; /* increase directory size by 1 entry */ if (0 != (rc = ext4_new_block(nas, ext4_file_size(fi->f_di)))) { return rc; } dp = (struct ext4_dir*) &b_data(fi->f_buf); dp->rec_len = fsi->s_block_size; dp->name_len = EXT4_DIR_ENTRY_MAX_NAME_LEN(dp); /* for failure */ extended = 1; } /* 'bp' now points to a directory block with space. 'dp' points to slot. */ dp->name_len = string_len; for (i = 0; i < PATH_MAX && i < dp->name_len && string[i]; i++) { dp->name[i] = string[i]; } dp->inode = (int) *numb; if (HAS_INCOMPAT_FEATURE(&fsi->e4sb, EXT2F_INCOMPAT_FILETYPE)) { dp->type = ext4_type_from_mode_fmt(mode_fmt); } if (1 != ext4_write_sector(nas, fi->f_buf, 1, b)) { return EIO; } if (1 == new_slots) { ext4_add_lo_hi(fi->f_di.i_size_lo, fi->f_di.i_size_hi, (uint32_t) dp->rec_len); /* Send the change to disk if the directory is extended. */ if (extended) { memcpy(&fdi, &fi->f_di, sizeof(struct ext4_inode)); ext4_rw_inode(nas, &fdi, EXT4_W_INODE); } } return 0; } static int ext4_new_node(struct nas *nas, struct nas * parents_nas) { /* It allocates a new inode, makes a directory entry for it in * the dir_fi directory with string name, and initializes it. * It returns a pointer to the ext4_file_info if it can do this; * otherwise it returns NULL. */ int rc; struct ext4_file_info *fi; struct ext4_inode fdi; struct ext4_fs_info *fsi; fsi = parents_nas->fs->sb_data; /* Last path component does not exist. Make new directory entry. */ if (0 != (rc = ext4_alloc_inode(nas, parents_nas))) { /* Can't creat new inode: out of inodes. */ return rc; } fi = inode_priv(nas->node); /* Force inode to the disk before making directory entry to make * the system more robust in the face of a crash: an inode with * no directory entry is much better than the opposite. */ if (node_is_directory(nas->node)) { fi->f_di.i_size_lo = fsi->s_block_size; if (0 != ext4_new_block(nas, fsi->s_block_size - 1)) { return ENOSPC; } fi->f_di.i_links_count++; /* directory have 2 links */ } fi->f_di.i_mode = nas->node->i_mode; fi->f_di.i_links_count++; memcpy(&fdi, &fi->f_di, sizeof(struct ext4_inode)); ext4_rw_inode(nas, &fdi, EXT4_W_INODE);/* force inode to disk now */ /* New inode acquired. Try to make directory entry. */ if (0 != (rc = ext4_dir_operation(parents_nas, (char *) nas->node->name, &fi->f_num, ENTER, nas->node->i_mode))) { return rc; } /* The caller has to return the directory ext4_file_info (*dir_fi). */ return 0; } /* Unlink 'file_name'; rip must be the inode of 'file_name' or NULL. */ static int ext4_unlink_file(struct nas *dir_nas, struct nas *nas) { int rc; if ((0 != (rc = ext4_open(nas))) || (0 != (rc = ext4_free_inode(nas)))) { return rc; } return ext4_dir_operation(dir_nas, (char *) nas->node->name, NULL, DELETE, 0); } static int ext4_remove_dir(struct nas *dir_nas, struct nas *nas) { /* A directory file has to be removed. Five conditions have to met: * - The file must be a directory * - The directory must be empty (except for . and ..) * - The final component of the path must not be . or .. * - The directory must not be the root of a mounted file system (VFS) * - The directory must not be anybody's root/working directory (VFS) */ int rc; char *dir_name; struct ext4_file_info *fi; fi = inode_priv(nas->node); dir_name = (char *) nas->node->name; /* search_dir checks that rip is a directory too. */ if (0 != (rc = ext4_dir_operation(nas, "", NULL, IS_EMPTY, 0))) { return -1; } if(path_is_dotname(dir_name, strlen(dir_name))) { return EINVAL; } if (fi->f_num == ROOT_INODE) { return EBUSY; /* can't remove 'root' */ } /* Unlink . and .. from the dir. */ if (0 != (rc = (ext4_dir_operation(nas, ".", NULL, DELETE, 0) | ext4_dir_operation(nas, "..", NULL, DELETE, 0)))) { return rc; } /* Actually try to unlink the file; fails if parent is mode 0 etc. */ if (0 != (rc = ext4_unlink_file(dir_nas, nas))) { return rc; } return 0; } static int ext4_unlink(struct nas *dir_nas, struct nas *nas) { int rc; struct ext4_file_info *dir_fi; dir_fi = inode_priv(dir_nas->node); /* Temporarily open the dir. */ if (0 != (rc = ext4_open(dir_nas))) { return rc; } if (node_is_directory(nas->node)) { rc = ext4_remove_dir(dir_nas, nas); /* call is RMDIR */ } else { rc = ext4_unlink_file(dir_nas, nas); } if(0 == rc) { dir_fi->f_di.i_links_count--; ext4_rw_inode(dir_nas, &dir_fi->f_di, EXT4_W_INODE); } ext4_close(dir_nas); return rc; } DECLARE_FILE_SYSTEM_DRIVER(ext4fs_driver);
789897.c
/* * Copyright(c) 2019 Intel Corporation * SPDX - License - Identifier: BSD - 2 - Clause - Patent */ /* * Copyright (c) 2016, Alliance for Open Media. All rights reserved * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ #include <string.h> #include "EbDefinitions.h" #include "EbUtility.h" #include "EbTransformUnit.h" #include "EbRateDistortionCost.h" #include "EbDeblockingFilter.h" #include "EbPictureOperators.h" #include "EbSegmentation.h" #include "EbModeDecisionProcess.h" #include "EbEncDecProcess.h" #include "EbSvtAv1ErrorCodes.h" #include "EbTransforms.h" #include "EbModeDecisionConfigurationProcess.h" #include "EbIntraPrediction.h" #include "aom_dsp_rtcd.h" #include "EbCodingLoop.h" void av1_set_ref_frame(MvReferenceFrame *rf, int8_t ref_frame_type); extern void av1_predict_intra_block( TileInfo *tile, STAGE stage, const BlockGeom *blk_geom, const Av1Common *cm, int32_t wpx, int32_t hpx, TxSize tx_size, PredictionMode mode, int32_t angle_delta, int32_t use_palette, FilterIntraMode filter_intra_mode, uint8_t* topNeighArray, uint8_t* leftNeighArray, EbPictureBufferDesc *recon_buffer, int32_t col_off, int32_t row_off, int32_t plane, BlockSize bsize, #if ATB_EP uint32_t tu_org_x_pict, uint32_t tu_org_y_pict, #endif uint32_t bl_org_x_pict, uint32_t bl_org_y_pict, uint32_t bl_org_x_mb, uint32_t bl_org_y_mb); void av1_predict_intra_block_16bit( TileInfo *tile, EncDecContext *context_ptr, const Av1Common *cm, int32_t wpx, int32_t hpx, TxSize tx_size, PredictionMode mode, int32_t angle_delta, int32_t use_palette, FilterIntraMode filter_intra_mode, uint16_t* topNeighArray, uint16_t* leftNeighArray, EbPictureBufferDesc *recon_buffer, int32_t col_off, int32_t row_off, int32_t plane, BlockSize bsize, uint32_t bl_org_x_pict, uint32_t bl_org_y_pict); /******************************************* * set Penalize Skip Flag * * Summary: Set the penalize_skipflag to true * When there is luminance/chrominance change * or in noisy clip with low motion at meduim * varince area * *******************************************/ #define S32 32*32 #define S16 16*16 #define S8 8*8 #define S4 4*4 typedef void(*EB_AV1_ENCODE_LOOP_FUNC_PTR)( PictureControlSet *picture_control_set_ptr, EncDecContext *context_ptr, LargestCodingUnit *sb_ptr, uint32_t origin_x, uint32_t origin_y, uint32_t cb_qp, EbPictureBufferDesc *predSamples, // no basis/offset EbPictureBufferDesc *coeffSamplesTB, // lcu based EbPictureBufferDesc *residual16bit, // no basis/offset EbPictureBufferDesc *transform16bit, // no basis/offset EbPictureBufferDesc *inverse_quant_buffer, int16_t *transformScratchBuffer, EbAsm asm_type, uint32_t *count_non_zero_coeffs, uint32_t component_mask, uint32_t use_delta_qp, uint32_t dZoffset, uint16_t *eob, MacroblockPlane *candidate_plane); typedef void(*EB_AV1_GENERATE_RECON_FUNC_PTR)( EncDecContext *context_ptr, uint32_t origin_x, uint32_t origin_y, EbPictureBufferDesc *predSamples, // no basis/offset EbPictureBufferDesc *residual16bit, // no basis/offset int16_t *transformScratchBuffer, uint32_t component_mask, uint16_t *eob, EbAsm asm_type); /*************************************************** * Update Intra Mode Neighbor Arrays ***************************************************/ static void EncodePassUpdateIntraModeNeighborArrays( NeighborArrayUnit *mode_type_neighbor_array, NeighborArrayUnit *intra_luma_mode_neighbor_array, NeighborArrayUnit *intra_chroma_mode_neighbor_array, uint8_t luma_mode, uint8_t chroma_mode, uint32_t origin_x, uint32_t origin_y, uint32_t width, uint32_t height, uint32_t width_uv, uint32_t height_uv, uint32_t component_mask) { uint8_t modeType = INTRA_MODE; if (component_mask & PICTURE_BUFFER_DESC_LUMA_MASK) { // Mode Type Update neighbor_array_unit_mode_write( mode_type_neighbor_array, &modeType, origin_x, origin_y, width, height, NEIGHBOR_ARRAY_UNIT_FULL_MASK); // Intra Luma Mode Update neighbor_array_unit_mode_write( intra_luma_mode_neighbor_array, &luma_mode, origin_x, origin_y, width, height, NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } if (component_mask & PICTURE_BUFFER_DESC_CHROMA_MASK) { // Intra Luma Mode Update neighbor_array_unit_mode_write( intra_chroma_mode_neighbor_array, &chroma_mode, ((origin_x >> 3) << 3) / 2, ((origin_y >> 3) << 3) / 2, width_uv, height_uv, NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } return; } /*************************************************** * Update Inter Mode Neighbor Arrays ***************************************************/ static void EncodePassUpdateInterModeNeighborArrays( NeighborArrayUnit *mode_type_neighbor_array, NeighborArrayUnit *mv_neighbor_array, NeighborArrayUnit *skipNeighborArray, MvUnit *mv_unit, uint8_t *skip_flag, uint32_t origin_x, uint32_t origin_y, uint32_t bwidth, uint32_t bheight) { uint8_t modeType = INTER_MODE; // Mode Type Update neighbor_array_unit_mode_write( mode_type_neighbor_array, &modeType, origin_x, origin_y, bwidth, bheight, NEIGHBOR_ARRAY_UNIT_FULL_MASK); // Motion Vector Unit neighbor_array_unit_mode_write( mv_neighbor_array, (uint8_t*)mv_unit, origin_x, origin_y, bwidth, bheight, NEIGHBOR_ARRAY_UNIT_FULL_MASK); // Skip Flag neighbor_array_unit_mode_write( skipNeighborArray, skip_flag, origin_x, origin_y, bwidth, bheight, NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); return; } /*************************************************** * Update Recon Samples Neighbor Arrays ***************************************************/ static void EncodePassUpdateReconSampleNeighborArrays( NeighborArrayUnit *lumaReconSampleNeighborArray, NeighborArrayUnit *cbReconSampleNeighborArray, NeighborArrayUnit *crReconSampleNeighborArray, EbPictureBufferDesc *recon_buffer, uint32_t origin_x, uint32_t origin_y, uint32_t width, uint32_t height, uint32_t bwidth_uv, uint32_t bheight_uv, uint32_t component_mask, EbBool is16bit) { uint32_t round_origin_x = (origin_x >> 3) << 3;// for Chroma blocks with size of 4 uint32_t round_origin_y = (origin_y >> 3) << 3;// for Chroma blocks with size of 4 if (is16bit == EB_TRUE) { if (component_mask & PICTURE_BUFFER_DESC_LUMA_MASK) { // Recon Samples - Luma neighbor_array_unit16bit_sample_write( lumaReconSampleNeighborArray, (uint16_t*)(recon_buffer->buffer_y), recon_buffer->stride_y, recon_buffer->origin_x + origin_x, recon_buffer->origin_y + origin_y, origin_x, origin_y, width, height, NEIGHBOR_ARRAY_UNIT_FULL_MASK); } if (component_mask & PICTURE_BUFFER_DESC_CHROMA_MASK) { // Recon Samples - Cb neighbor_array_unit16bit_sample_write( cbReconSampleNeighborArray, (uint16_t*)(recon_buffer->buffer_cb), recon_buffer->stride_cb, (recon_buffer->origin_x + round_origin_x) >> 1, (recon_buffer->origin_y + round_origin_y) >> 1, round_origin_x >> 1, round_origin_y >> 1, bwidth_uv, bheight_uv, NEIGHBOR_ARRAY_UNIT_FULL_MASK); // Recon Samples - Cr neighbor_array_unit16bit_sample_write( crReconSampleNeighborArray, (uint16_t*)(recon_buffer->buffer_cr), recon_buffer->stride_cr, (recon_buffer->origin_x + round_origin_x) >> 1, (recon_buffer->origin_y + round_origin_y) >> 1, round_origin_x >> 1, round_origin_y >> 1, bwidth_uv, bheight_uv, NEIGHBOR_ARRAY_UNIT_FULL_MASK); } } else { if (component_mask & PICTURE_BUFFER_DESC_LUMA_MASK) { // Recon Samples - Luma neighbor_array_unit_sample_write( lumaReconSampleNeighborArray, recon_buffer->buffer_y, recon_buffer->stride_y, recon_buffer->origin_x + origin_x, recon_buffer->origin_y + origin_y, origin_x, origin_y, width, height, NEIGHBOR_ARRAY_UNIT_FULL_MASK); } if (component_mask & PICTURE_BUFFER_DESC_CHROMA_MASK) { // Recon Samples - Cb neighbor_array_unit_sample_write( cbReconSampleNeighborArray, recon_buffer->buffer_cb, recon_buffer->stride_cb, (recon_buffer->origin_x + round_origin_x) >> 1, (recon_buffer->origin_y + round_origin_y) >> 1, round_origin_x >> 1, round_origin_y >> 1, bwidth_uv, bheight_uv, NEIGHBOR_ARRAY_UNIT_FULL_MASK); // Recon Samples - Cr neighbor_array_unit_sample_write( crReconSampleNeighborArray, recon_buffer->buffer_cr, recon_buffer->stride_cr, (recon_buffer->origin_x + round_origin_x) >> 1, (recon_buffer->origin_y + round_origin_y) >> 1, round_origin_x >> 1, round_origin_y >> 1, bwidth_uv, bheight_uv, NEIGHBOR_ARRAY_UNIT_FULL_MASK); } } return; } /************************************************************ * Update Intra Luma Neighbor Modes ************************************************************/ void GeneratePuIntraLumaNeighborModes( CodingUnit *cu_ptr, uint32_t pu_origin_x, uint32_t pu_origin_y, uint32_t sb_sz, NeighborArrayUnit *intraLumaNeighborArray, NeighborArrayUnit *intraChromaNeighborArray, NeighborArrayUnit *mode_type_neighbor_array) { (void)sb_sz; uint32_t modeTypeLeftNeighborIndex = get_neighbor_array_unit_left_index( mode_type_neighbor_array, pu_origin_y); uint32_t modeTypeTopNeighborIndex = get_neighbor_array_unit_top_index( mode_type_neighbor_array, pu_origin_x); uint32_t intraLumaModeLeftNeighborIndex = get_neighbor_array_unit_left_index( intraLumaNeighborArray, pu_origin_y); uint32_t intraLumaModeTopNeighborIndex = get_neighbor_array_unit_top_index( intraLumaNeighborArray, pu_origin_x); uint32_t puOriginX_round = (pu_origin_x >> 3) << 3; uint32_t puOriginY_round = (pu_origin_y >> 3) << 3; uint32_t intraChromaModeLeftNeighborIndex = get_neighbor_array_unit_left_index( intraChromaNeighborArray, puOriginY_round >> 1); uint32_t intraChromaModeTopNeighborIndex = get_neighbor_array_unit_top_index( intraChromaNeighborArray, puOriginX_round >> 1); (&cu_ptr->prediction_unit_array[0])->intra_luma_left_mode = (uint32_t)( (mode_type_neighbor_array->left_array[modeTypeLeftNeighborIndex] != INTRA_MODE) ? DC_PRED/*EB_INTRA_DC*/ : (uint32_t)intraLumaNeighborArray->left_array[intraLumaModeLeftNeighborIndex]); (&cu_ptr->prediction_unit_array[0])->intra_luma_top_mode = (uint32_t)( (mode_type_neighbor_array->top_array[modeTypeTopNeighborIndex] != INTRA_MODE) ? DC_PRED/*EB_INTRA_DC*/ : (uint32_t)intraLumaNeighborArray->top_array[intraLumaModeTopNeighborIndex]); // use DC. This seems like we could use a LCU-width uint32_t modeTypeLeftNeighborIndex_round = get_neighbor_array_unit_left_index( mode_type_neighbor_array, puOriginY_round); uint32_t modeTypeTopNeighborIndex_round = get_neighbor_array_unit_top_index( mode_type_neighbor_array, puOriginX_round); (&cu_ptr->prediction_unit_array[0])->intra_chroma_left_mode = (uint32_t)( (mode_type_neighbor_array->left_array[modeTypeLeftNeighborIndex_round] != INTRA_MODE) ? UV_DC_PRED : (uint32_t)intraChromaNeighborArray->left_array[intraChromaModeLeftNeighborIndex]); (&cu_ptr->prediction_unit_array[0])->intra_chroma_top_mode = (uint32_t)( (mode_type_neighbor_array->top_array[modeTypeTopNeighborIndex_round] != INTRA_MODE) ? UV_DC_PRED : (uint32_t)intraChromaNeighborArray->top_array[intraChromaModeTopNeighborIndex]); // use DC. This seems like we could use a LCU-width return; } void encode_pass_tx_search( PictureControlSet *picture_control_set_ptr, EncDecContext *context_ptr, LargestCodingUnit *sb_ptr, uint32_t cb_qp, EbPictureBufferDesc *coeffSamplesTB, EbPictureBufferDesc *residual16bit, EbPictureBufferDesc *transform16bit, EbPictureBufferDesc *inverse_quant_buffer, int16_t *transformScratchBuffer, EbAsm asm_type, uint32_t *count_non_zero_coeffs, uint32_t component_mask, uint32_t use_delta_qp, uint32_t dZoffset, uint16_t *eob, MacroblockPlane *candidate_plane); /********************************************************** * Encode Loop * * Summary: Performs a H.265 conformant * Transform, Quantization and Inverse Quantization of a TU. * * Inputs: * origin_x * origin_y * txb_size * sb_sz * input - input samples (position sensitive) * pred - prediction samples (position independent) * * Outputs: * Inverse quantized coeff - quantization indices (position sensitive) * **********************************************************/ static void Av1EncodeLoop( PictureControlSet *picture_control_set_ptr, EncDecContext *context_ptr, LargestCodingUnit *sb_ptr, uint32_t origin_x, //pic based tx org x uint32_t origin_y, //pic based tx org y uint32_t cb_qp, EbPictureBufferDesc *predSamples, // no basis/offset EbPictureBufferDesc *coeffSamplesTB, // lcu based EbPictureBufferDesc *residual16bit, // no basis/offset EbPictureBufferDesc *transform16bit, // no basis/offset EbPictureBufferDesc *inverse_quant_buffer, int16_t *transformScratchBuffer, EbAsm asm_type, uint32_t *count_non_zero_coeffs, uint32_t component_mask, uint32_t use_delta_qp, uint32_t dZoffset, uint16_t *eob, MacroblockPlane *candidate_plane){ (void)dZoffset; (void)use_delta_qp; (void)cb_qp; // uint32_t chroma_qp = cb_qp; CodingUnit *cu_ptr = context_ptr->cu_ptr; TransformUnit *txb_ptr = &cu_ptr->transform_unit_array[context_ptr->txb_itr]; // EB_SLICE slice_type = sb_ptr->picture_control_set_ptr->slice_type; // uint32_t temporal_layer_index = sb_ptr->picture_control_set_ptr->temporal_layer_index; uint32_t qp = cu_ptr->qp; EbPictureBufferDesc *input_samples = context_ptr->input_samples; uint32_t round_origin_x = (origin_x >> 3) << 3;// for Chroma blocks with size of 4 uint32_t round_origin_y = (origin_y >> 3) << 3;// for Chroma blocks with size of 4 const uint32_t input_luma_offset = ((origin_y + input_samples->origin_y) * input_samples->stride_y) + (origin_x + input_samples->origin_x); const uint32_t input_cb_offset = (((round_origin_y + input_samples->origin_y) >> 1) * input_samples->stride_cb) + ((round_origin_x + input_samples->origin_x) >> 1); const uint32_t input_cr_offset = (((round_origin_y + input_samples->origin_y) >> 1) * input_samples->stride_cr) + ((round_origin_x + input_samples->origin_x) >> 1); const uint32_t pred_luma_offset = ((predSamples->origin_y + origin_y) * predSamples->stride_y) + (predSamples->origin_x + origin_x); const uint32_t pred_cb_offset = (((predSamples->origin_y + round_origin_y) >> 1) * predSamples->stride_cb) + ((predSamples->origin_x + round_origin_x) >> 1); const uint32_t pred_cr_offset = (((predSamples->origin_y + round_origin_y) >> 1) * predSamples->stride_cr) + ((predSamples->origin_x + round_origin_x) >> 1); #if ATB_SUPPORT const uint32_t scratch_luma_offset = context_ptr->blk_geom->tx_org_x[cu_ptr->tx_depth][context_ptr->txb_itr] + context_ptr->blk_geom->tx_org_y[cu_ptr->tx_depth][context_ptr->txb_itr] * SB_STRIDE_Y; const uint32_t scratch_cb_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; const uint32_t scratch_cr_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; #else const uint32_t scratch_luma_offset = context_ptr->blk_geom->tx_org_x[context_ptr->txb_itr] + context_ptr->blk_geom->tx_org_y[context_ptr->txb_itr] * SB_STRIDE_Y; const uint32_t scratch_cb_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; const uint32_t scratch_cr_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; #endif const uint32_t coeff1dOffset = context_ptr->coded_area_sb; const uint32_t coeff1dOffsetChroma = context_ptr->coded_area_sb_uv; UNUSED(coeff1dOffsetChroma); #if !OPT_LOSSLESS_0 //uint8_t enable_contouring_qc_update_flag; //enable_contouring_qc_update_flag = DeriveContouringClass( // sb_ptr->picture_control_set_ptr->parent_pcs_ptr, // sb_ptr->index, // cu_ptr->leaf_index) && (cu_ptr->qp < sb_ptr->picture_control_set_ptr->picture_qp); #endif context_ptr->three_quad_energy = 0; //********************************** // Luma //********************************** if (component_mask == PICTURE_BUFFER_DESC_FULL_MASK || component_mask == PICTURE_BUFFER_DESC_LUMA_MASK) { ResidualKernel( input_samples->buffer_y + input_luma_offset, input_samples->stride_y, predSamples->buffer_y + pred_luma_offset, predSamples->stride_y, ((int16_t*)residual16bit->buffer_y) + scratch_luma_offset, residual16bit->stride_y, #if ATB_SUPPORT context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr]); #endif #if ATB_MD uint8_t tx_search_skip_fag = (picture_control_set_ptr->parent_pcs_ptr->tx_search_level == TX_SEARCH_ENC_DEC && (picture_control_set_ptr->parent_pcs_ptr->atb_mode == 0 || cu_ptr->prediction_mode_flag == INTER_MODE)) ? get_skip_tx_search_flag( #else uint8_t tx_search_skip_fag = picture_control_set_ptr->parent_pcs_ptr->tx_search_level == TX_SEARCH_ENC_DEC ? get_skip_tx_search_flag( #endif #if BYPASS_USELESS_TX_SEARCH context_ptr->blk_geom, #else context_ptr->blk_geom->sq_size, #endif MAX_MODE_COST, 0, 1) : 1; if (!tx_search_skip_fag) { encode_pass_tx_search( picture_control_set_ptr, context_ptr, sb_ptr, cb_qp, coeffSamplesTB, residual16bit, transform16bit, inverse_quant_buffer, transformScratchBuffer, asm_type, count_non_zero_coeffs, component_mask, use_delta_qp, dZoffset, eob, candidate_plane); } av1_estimate_transform( ((int16_t*)residual16bit->buffer_y) + scratch_luma_offset, residual16bit->stride_y, ((TranLow*)transform16bit->buffer_y) + coeff1dOffset, NOT_USED_VALUE, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif &context_ptr->three_quad_energy, transformScratchBuffer, BIT_INCREMENT_8BIT, txb_ptr->transform_type[PLANE_TYPE_Y], asm_type, PLANE_TYPE_Y, #if PF_N2_SUPPORT DEFAULT_SHAPE); #else context_ptr->trans_coeff_shape_luma); #endif int32_t seg_qp = picture_control_set_ptr->parent_pcs_ptr->segmentation_params.segmentation_enabled ? picture_control_set_ptr->parent_pcs_ptr->segmentation_params.feature_data[context_ptr->cu_ptr->segment_id][SEG_LVL_ALT_Q] : 0; #if DC_SIGN_CONTEXT_EP cu_ptr->quantized_dc[0][context_ptr->txb_itr] = av1_quantize_inv_quantize( #else av1_quantize_inv_quantize( #endif sb_ptr->picture_control_set_ptr, context_ptr->md_context, ((TranLow*)transform16bit->buffer_y) + coeff1dOffset, NOT_USED_VALUE, ((int32_t*)coeffSamplesTB->buffer_y) + coeff1dOffset, ((int32_t*)inverse_quant_buffer->buffer_y) + coeff1dOffset, qp, seg_qp, #if ATB_SUPPORT context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else seg_qp, context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr], context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif &eob[0], asm_type, &(count_non_zero_coeffs[0]), #if !PF_N2_SUPPORT 0, #endif COMPONENT_LUMA, BIT_INCREMENT_8BIT, txb_ptr->transform_type[PLANE_TYPE_Y], &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]), #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->luma_txb_skip_context, context_ptr->md_context->luma_dc_sign_context, #else cu_ptr->luma_txb_skip_context, cu_ptr->luma_dc_sign_context, #endif cu_ptr->pred_mode, #if RDOQ_INTRA cu_ptr->av1xd->use_intrabc, #endif EB_TRUE); #if BLK_SKIP_DECISION if (context_ptr->md_skip_blk) { count_non_zero_coeffs[0] = 0; eob[0] = 0; } #endif txb_ptr->y_has_coeff = count_non_zero_coeffs[0] ? EB_TRUE : EB_FALSE; if (count_non_zero_coeffs[0] == 0) { // INTER. Chroma follows Luma in transform type if (cu_ptr->prediction_mode_flag == INTER_MODE) { txb_ptr->transform_type[PLANE_TYPE_Y] = DCT_DCT; txb_ptr->transform_type[PLANE_TYPE_UV] = DCT_DCT; } else { // INTRA txb_ptr->transform_type[PLANE_TYPE_Y] = DCT_DCT; } } #if !ATB_EP || ATB_EC_NO_CFL if (cu_ptr->prediction_mode_flag == INTRA_MODE && (context_ptr->evaluate_cfl_ep || cu_ptr->prediction_unit_array->intra_chroma_mode == UV_CFL_PRED)) { EbPictureBufferDesc *reconSamples = predSamples; uint32_t reconLumaOffset = (reconSamples->origin_y + origin_y) * reconSamples->stride_y + (reconSamples->origin_x + origin_x); if (txb_ptr->y_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint8_t *predBuffer = predSamples->buffer_y + pred_luma_offset; av1_inv_transform_recon8bit( ((int32_t*)inverse_quant_buffer->buffer_y) + coeff1dOffset, predBuffer, predSamples->stride_y, #if ATB_SUPPORT context_ptr->blk_geom->txsize[tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif txb_ptr->transform_type[PLANE_TYPE_Y], PLANE_TYPE_Y, eob[0]); } #if CFL_FIX if (context_ptr->blk_geom->has_uv) { reconLumaOffset = (reconSamples->origin_y + round_origin_y) * reconSamples->stride_y + (reconSamples->origin_x + round_origin_x); #endif // Down sample Luma cfl_luma_subsampling_420_lbd_c( reconSamples->buffer_y + reconLumaOffset, reconSamples->stride_y, context_ptr->md_context->pred_buf_q3, #if CFL_FIX context_ptr->blk_geom->bwidth_uv == context_ptr->blk_geom->bwidth ? (context_ptr->blk_geom->bwidth_uv << 1) : context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight_uv == context_ptr->blk_geom->bheight ? (context_ptr->blk_geom->bheight_uv << 1) : context_ptr->blk_geom->bheight); #else context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr]); #endif #if ATB_SUPPORT int32_t round_offset = ((context_ptr->blk_geom->tx_width_uv[tx_depth][context_ptr->txb_itr])*(context_ptr->blk_geom->tx_height_uv[tx_depth][context_ptr->txb_itr])) / 2; #else int32_t round_offset = ((context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr])*(context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr])) / 2; #endif subtract_average( context_ptr->md_context->pred_buf_q3, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[tx_depth][context_ptr->txb_itr], round_offset, LOG2F(context_ptr->blk_geom->tx_width_uv[tx_depth][context_ptr->txb_itr]) + LOG2F(context_ptr->blk_geom->tx_height_uv[tx_depth][context_ptr->txb_itr])); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], round_offset, LOG2F(context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr]) + LOG2F(context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr])); #endif if (context_ptr->evaluate_cfl_ep) { // 3: Loop over alphas and find the best or choose DC // Use the 1st spot of the candidate buffer to hold cfl settings: (1) to use same kernel as MD for CFL evaluation: cfl_rd_pick_alpha() (toward unification), (2) to avoid dedicated buffers for CFL evaluation @ EP (toward less memory) ModeDecisionCandidateBuffer *candidateBuffer = &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]); // Input(s) candidateBuffer->candidate_ptr->type = INTRA_MODE; candidateBuffer->candidate_ptr->intra_luma_mode = cu_ptr->pred_mode; candidateBuffer->candidate_ptr->cfl_alpha_signs = 0; candidateBuffer->candidate_ptr->cfl_alpha_idx = 0; context_ptr->md_context->blk_geom = context_ptr->blk_geom; EbByte src_pred_ptr; EbByte dst_pred_ptr; // Copy Cb pred samples from ep buffer to md buffer src_pred_ptr = predSamples->buffer_cb + pred_cb_offset; dst_pred_ptr = &(candidateBuffer->prediction_ptr->buffer_cb[scratch_cb_offset]); for (int i = 0; i < context_ptr->blk_geom->bheight_uv; i++) { memcpy(dst_pred_ptr, src_pred_ptr, context_ptr->blk_geom->bwidth_uv); src_pred_ptr += predSamples->stride_cb; dst_pred_ptr += candidateBuffer->prediction_ptr->stride_cb; } // Copy Cr pred samples from ep buffer to md buffer src_pred_ptr = predSamples->buffer_cr + pred_cr_offset; dst_pred_ptr = &(candidateBuffer->prediction_ptr->buffer_cr[scratch_cr_offset]); for (int i = 0; i < context_ptr->blk_geom->bheight_uv; i++) { memcpy(dst_pred_ptr, src_pred_ptr, context_ptr->blk_geom->bwidth_uv); src_pred_ptr += predSamples->stride_cr; dst_pred_ptr += candidateBuffer->prediction_ptr->stride_cr; } cfl_rd_pick_alpha( picture_control_set_ptr, candidateBuffer, sb_ptr, context_ptr->md_context, input_samples, input_cb_offset, scratch_cb_offset, asm_type); // Output(s) if (candidateBuffer->candidate_ptr->intra_chroma_mode == UV_CFL_PRED) { cu_ptr->prediction_unit_array->intra_chroma_mode = UV_CFL_PRED; cu_ptr->prediction_unit_array->cfl_alpha_idx = candidateBuffer->candidate_ptr->cfl_alpha_idx; cu_ptr->prediction_unit_array->cfl_alpha_signs = candidateBuffer->candidate_ptr->cfl_alpha_signs; cu_ptr->prediction_unit_array->is_directional_chroma_mode_flag = EB_FALSE; } } if (cu_ptr->prediction_unit_array->intra_chroma_mode == UV_CFL_PRED) { int32_t alpha_q3 = cfl_idx_to_alpha(cu_ptr->prediction_unit_array->cfl_alpha_idx, cu_ptr->prediction_unit_array->cfl_alpha_signs, CFL_PRED_U); // once for U, once for V //TOCHANGE //assert(chroma_size * CFL_BUF_LINE + chroma_size <= CFL_BUF_SQUARE); cfl_predict_lbd( context_ptr->md_context->pred_buf_q3, predSamples->buffer_cb + pred_cb_offset, predSamples->stride_cb, predSamples->buffer_cb + pred_cb_offset, predSamples->stride_cb, alpha_q3, 8, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif alpha_q3 = cfl_idx_to_alpha(cu_ptr->prediction_unit_array->cfl_alpha_idx, cu_ptr->prediction_unit_array->cfl_alpha_signs, CFL_PRED_V); // once for U, once for V //TOCHANGE //assert(chroma_size * CFL_BUF_LINE + chroma_size <= CFL_BUF_SQUARE); cfl_predict_lbd( context_ptr->md_context->pred_buf_q3, predSamples->buffer_cr + pred_cr_offset, predSamples->stride_cr, predSamples->buffer_cr + pred_cr_offset, predSamples->stride_cr, alpha_q3, 8, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif } #if CFL_FIX } #endif } #endif #if ATB_EP txb_ptr->nz_coef_count[0] = (uint16_t)count_non_zero_coeffs[0]; #endif } if (component_mask == PICTURE_BUFFER_DESC_FULL_MASK || component_mask == PICTURE_BUFFER_DESC_CHROMA_MASK) { #if ATB_EP if (cu_ptr->prediction_mode_flag == INTRA_MODE && (context_ptr->evaluate_cfl_ep || cu_ptr->prediction_unit_array->intra_chroma_mode == UV_CFL_PRED)) { EbPictureBufferDesc *reconSamples = predSamples; uint32_t reconLumaOffset = (reconSamples->origin_y + round_origin_y) * reconSamples->stride_y + (reconSamples->origin_x + round_origin_x); // Down sample Luma cfl_luma_subsampling_420_lbd_c( reconSamples->buffer_y + reconLumaOffset, reconSamples->stride_y, context_ptr->md_context->pred_buf_q3, #if CFL_FIX context_ptr->blk_geom->bwidth_uv == context_ptr->blk_geom->bwidth ? (context_ptr->blk_geom->bwidth_uv << 1) : context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight_uv == context_ptr->blk_geom->bheight ? (context_ptr->blk_geom->bheight_uv << 1) : context_ptr->blk_geom->bheight); #else context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr]); #endif #if ATB_SUPPORT int32_t round_offset = ((context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr])*(context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr])) / 2; #else int32_t round_offset = ((context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr])*(context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr])) / 2; #endif subtract_average( context_ptr->md_context->pred_buf_q3, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], round_offset, LOG2F(context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr]) + LOG2F(context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr])); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], round_offset, LOG2F(context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr]) + LOG2F(context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr])); #endif if (context_ptr->evaluate_cfl_ep) { // 3: Loop over alphas and find the best or choose DC // Use the 1st spot of the candidate buffer to hold cfl settings: (1) to use same kernel as MD for CFL evaluation: cfl_rd_pick_alpha() (toward unification), (2) to avoid dedicated buffers for CFL evaluation @ EP (toward less memory) ModeDecisionCandidateBuffer *candidateBuffer = &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]); // Input(s) candidateBuffer->candidate_ptr->type = INTRA_MODE; candidateBuffer->candidate_ptr->intra_luma_mode = cu_ptr->pred_mode; candidateBuffer->candidate_ptr->cfl_alpha_signs = 0; candidateBuffer->candidate_ptr->cfl_alpha_idx = 0; context_ptr->md_context->blk_geom = context_ptr->blk_geom; EbByte src_pred_ptr; EbByte dst_pred_ptr; // Copy Cb pred samples from ep buffer to md buffer src_pred_ptr = predSamples->buffer_cb + pred_cb_offset; dst_pred_ptr = &(candidateBuffer->prediction_ptr->buffer_cb[scratch_cb_offset]); for (int i = 0; i < context_ptr->blk_geom->bheight_uv; i++) { memcpy(dst_pred_ptr, src_pred_ptr, context_ptr->blk_geom->bwidth_uv); src_pred_ptr += predSamples->stride_cb; dst_pred_ptr += candidateBuffer->prediction_ptr->stride_cb; } // Copy Cr pred samples from ep buffer to md buffer src_pred_ptr = predSamples->buffer_cr + pred_cr_offset; dst_pred_ptr = &(candidateBuffer->prediction_ptr->buffer_cr[scratch_cr_offset]); for (int i = 0; i < context_ptr->blk_geom->bheight_uv; i++) { memcpy(dst_pred_ptr, src_pred_ptr, context_ptr->blk_geom->bwidth_uv); src_pred_ptr += predSamples->stride_cr; dst_pred_ptr += candidateBuffer->prediction_ptr->stride_cr; } cfl_rd_pick_alpha( picture_control_set_ptr, candidateBuffer, sb_ptr, context_ptr->md_context, input_samples, input_cb_offset, scratch_cb_offset, asm_type); // Output(s) if (candidateBuffer->candidate_ptr->intra_chroma_mode == UV_CFL_PRED) { cu_ptr->prediction_unit_array->intra_chroma_mode = UV_CFL_PRED; cu_ptr->prediction_unit_array->cfl_alpha_idx = candidateBuffer->candidate_ptr->cfl_alpha_idx; cu_ptr->prediction_unit_array->cfl_alpha_signs = candidateBuffer->candidate_ptr->cfl_alpha_signs; cu_ptr->prediction_unit_array->is_directional_chroma_mode_flag = EB_FALSE; } } if (cu_ptr->prediction_unit_array->intra_chroma_mode == UV_CFL_PRED) { int32_t alpha_q3 = cfl_idx_to_alpha(cu_ptr->prediction_unit_array->cfl_alpha_idx, cu_ptr->prediction_unit_array->cfl_alpha_signs, CFL_PRED_U); // once for U, once for V //TOCHANGE //assert(chroma_size * CFL_BUF_LINE + chroma_size <= CFL_BUF_SQUARE); cfl_predict_lbd( context_ptr->md_context->pred_buf_q3, predSamples->buffer_cb + pred_cb_offset, predSamples->stride_cb, predSamples->buffer_cb + pred_cb_offset, predSamples->stride_cb, alpha_q3, 8, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif alpha_q3 = cfl_idx_to_alpha(cu_ptr->prediction_unit_array->cfl_alpha_idx, cu_ptr->prediction_unit_array->cfl_alpha_signs, CFL_PRED_V); // once for U, once for V //TOCHANGE //assert(chroma_size * CFL_BUF_LINE + chroma_size <= CFL_BUF_SQUARE); cfl_predict_lbd( context_ptr->md_context->pred_buf_q3, predSamples->buffer_cr + pred_cr_offset, predSamples->stride_cr, predSamples->buffer_cr + pred_cr_offset, predSamples->stride_cr, alpha_q3, 8, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif } } #endif //********************************** // Cb //********************************** ResidualKernel( input_samples->buffer_cb + input_cb_offset, input_samples->stride_cb, predSamples->buffer_cb + pred_cb_offset, predSamples->stride_cb, ((int16_t*)residual16bit->buffer_cb) + scratch_cb_offset, residual16bit->stride_cb, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif ResidualKernel( input_samples->buffer_cr + input_cr_offset, input_samples->stride_cr, predSamples->buffer_cr + pred_cr_offset, predSamples->stride_cr, ((int16_t*)residual16bit->buffer_cr) + scratch_cr_offset, residual16bit->stride_cr, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif av1_estimate_transform( ((int16_t*)residual16bit->buffer_cb) + scratch_cb_offset, residual16bit->stride_cb, ((TranLow*)transform16bit->buffer_cb) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &context_ptr->three_quad_energy, transformScratchBuffer, BIT_INCREMENT_8BIT, txb_ptr->transform_type[PLANE_TYPE_UV], asm_type, PLANE_TYPE_UV, #if PF_N2_SUPPORT DEFAULT_SHAPE); #else context_ptr->trans_coeff_shape_chroma); #endif int32_t seg_qp = picture_control_set_ptr->parent_pcs_ptr->segmentation_params.segmentation_enabled ? picture_control_set_ptr->parent_pcs_ptr->segmentation_params.feature_data[context_ptr->cu_ptr->segment_id][SEG_LVL_ALT_Q] : 0; #if DC_SIGN_CONTEXT_EP cu_ptr->quantized_dc[1][context_ptr->txb_itr] = av1_quantize_inv_quantize( #else av1_quantize_inv_quantize( #endif sb_ptr->picture_control_set_ptr, context_ptr->md_context, ((TranLow*)transform16bit->buffer_cb) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, ((int32_t*)coeffSamplesTB->buffer_cb) + context_ptr->coded_area_sb_uv, ((int32_t*)inverse_quant_buffer->buffer_cb) + context_ptr->coded_area_sb_uv, qp, seg_qp, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &eob[1], asm_type, &(count_non_zero_coeffs[1]), #if !PF_N2_SUPPORT 0, #endif COMPONENT_CHROMA_CB, BIT_INCREMENT_8BIT, txb_ptr->transform_type[PLANE_TYPE_UV], &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]), #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->cb_txb_skip_context, context_ptr->md_context->cb_dc_sign_context, #else cu_ptr->cb_txb_skip_context, cu_ptr->cb_dc_sign_context, #endif cu_ptr->pred_mode, #if RDOQ_INTRA cu_ptr->av1xd->use_intrabc, #endif EB_TRUE); #if BLK_SKIP_DECISION if (context_ptr->md_skip_blk) { count_non_zero_coeffs[1] = 0; eob[1] = 0; } #endif txb_ptr->u_has_coeff = count_non_zero_coeffs[1] ? EB_TRUE : EB_FALSE; //********************************** // Cr //********************************** av1_estimate_transform( ((int16_t*)residual16bit->buffer_cr) + scratch_cb_offset, residual16bit->stride_cr, ((TranLow*)transform16bit->buffer_cr) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &context_ptr->three_quad_energy, transformScratchBuffer, BIT_INCREMENT_8BIT, txb_ptr->transform_type[PLANE_TYPE_UV], asm_type, PLANE_TYPE_UV, #if PF_N2_SUPPORT DEFAULT_SHAPE); #else context_ptr->trans_coeff_shape_chroma); #endif #if DC_SIGN_CONTEXT_EP cu_ptr->quantized_dc[2][context_ptr->txb_itr] = av1_quantize_inv_quantize( #else av1_quantize_inv_quantize( #endif sb_ptr->picture_control_set_ptr, context_ptr->md_context, ((TranLow*)transform16bit->buffer_cr) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, ((int32_t*)coeffSamplesTB->buffer_cr) + context_ptr->coded_area_sb_uv, ((TranLow*)inverse_quant_buffer->buffer_cr) + context_ptr->coded_area_sb_uv, qp, seg_qp, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &eob[2], asm_type, &(count_non_zero_coeffs[2]), #if !PF_N2_SUPPORT 0, #endif COMPONENT_CHROMA_CR, BIT_INCREMENT_8BIT, txb_ptr->transform_type[PLANE_TYPE_UV], &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]), #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->cr_txb_skip_context, context_ptr->md_context->cr_dc_sign_context, #else cu_ptr->cr_txb_skip_context, cu_ptr->cr_dc_sign_context, #endif cu_ptr->pred_mode, #if RDOQ_INTRA cu_ptr->av1xd->use_intrabc, #endif EB_TRUE); #if BLK_SKIP_DECISION if (context_ptr->md_skip_blk) { count_non_zero_coeffs[2] = 0; eob[2] = 0; } #endif txb_ptr->v_has_coeff = count_non_zero_coeffs[2] ? EB_TRUE : EB_FALSE; #if ATB_EP txb_ptr->nz_coef_count[1] = (uint16_t)count_non_zero_coeffs[1]; txb_ptr->nz_coef_count[2] = (uint16_t)count_non_zero_coeffs[2]; #endif } #if !PF_N2_SUPPORT txb_ptr->trans_coeff_shape_luma = context_ptr->trans_coeff_shape_luma; txb_ptr->trans_coeff_shape_chroma = context_ptr->trans_coeff_shape_chroma; #endif #if !ATB_EP txb_ptr->nz_coef_count[0] = (uint16_t)count_non_zero_coeffs[0]; txb_ptr->nz_coef_count[1] = (uint16_t)count_non_zero_coeffs[1]; txb_ptr->nz_coef_count[2] = (uint16_t)count_non_zero_coeffs[2]; #endif return; } void encode_pass_tx_search_hbd( PictureControlSet *picture_control_set_ptr, EncDecContext *context_ptr, LargestCodingUnit *sb_ptr, uint32_t cb_qp, EbPictureBufferDesc *coeffSamplesTB, EbPictureBufferDesc *residual16bit, EbPictureBufferDesc *transform16bit, EbPictureBufferDesc *inverse_quant_buffer, int16_t *transformScratchBuffer, EbAsm asm_type, uint32_t *count_non_zero_coeffs, uint32_t component_mask, uint32_t use_delta_qp, uint32_t dZoffset, uint16_t *eob, MacroblockPlane *candidate_plane); /********************************************************** * Encode Loop * * Summary: Performs a H.265 conformant * Transform, Quantization and Inverse Quantization of a TU. * * Inputs: * origin_x * origin_y * txb_size * sb_sz * input - input samples (position sensitive) * pred - prediction samples (position independent) * * Outputs: * Inverse quantized coeff - quantization indices (position sensitive) * **********************************************************/ static void Av1EncodeLoop16bit( PictureControlSet *picture_control_set_ptr, EncDecContext *context_ptr, LargestCodingUnit *sb_ptr, uint32_t origin_x, uint32_t origin_y, uint32_t cb_qp, EbPictureBufferDesc *predSamples, // no basis/offset EbPictureBufferDesc *coeffSamplesTB, // lcu based EbPictureBufferDesc *residual16bit, // no basis/offset EbPictureBufferDesc *transform16bit, // no basis/offset EbPictureBufferDesc *inverse_quant_buffer, int16_t *transformScratchBuffer, EbAsm asm_type, uint32_t *count_non_zero_coeffs, uint32_t component_mask, uint32_t use_delta_qp, uint32_t dZoffset, uint16_t *eob, MacroblockPlane *candidate_plane) { (void)use_delta_qp; (void)dZoffset; (void)cb_qp; CodingUnit *cu_ptr = context_ptr->cu_ptr; TransformUnit *txb_ptr = &cu_ptr->transform_unit_array[context_ptr->txb_itr]; // EB_SLICE slice_type = sb_ptr->picture_control_set_ptr->slice_type; // uint32_t temporal_layer_index = sb_ptr->picture_control_set_ptr->temporal_layer_index; uint32_t qp = cu_ptr->qp; EbPictureBufferDesc *inputSamples16bit = context_ptr->input_sample16bit_buffer; EbPictureBufferDesc *predSamples16bit = predSamples; #if ATB_SUPPORT uint32_t round_origin_x = (origin_x >> 3) << 3;// for Chroma blocks with size of 4 uint32_t round_origin_y = (origin_y >> 3) << 3;// for Chroma blocks with size of 4 const uint32_t input_luma_offset = context_ptr->blk_geom->tx_org_x[cu_ptr->tx_depth][context_ptr->txb_itr] + context_ptr->blk_geom->tx_org_y[cu_ptr->tx_depth][context_ptr->txb_itr] * SB_STRIDE_Y; const uint32_t input_cb_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; const uint32_t input_cr_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[cu_ptr->tx_depth][context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; const uint32_t pred_luma_offset = ((predSamples16bit->origin_y + origin_y) * predSamples16bit->stride_y) + (predSamples16bit->origin_x + origin_x); const uint32_t pred_cb_offset = (((predSamples16bit->origin_y + round_origin_y) >> 1) * predSamples16bit->stride_cb) + ((predSamples16bit->origin_x + round_origin_x) >> 1); const uint32_t pred_cr_offset = (((predSamples16bit->origin_y + round_origin_y) >> 1) * predSamples16bit->stride_cr) + ((predSamples16bit->origin_x + round_origin_x) >> 1); const uint32_t scratch_luma_offset = context_ptr->blk_geom->origin_x + context_ptr->blk_geom->origin_y * SB_STRIDE_Y; const uint32_t scratch_cb_offset = ROUND_UV(context_ptr->blk_geom->origin_x) / 2 + ROUND_UV(context_ptr->blk_geom->origin_y) / 2 * SB_STRIDE_UV; const uint32_t scratch_cr_offset = ROUND_UV(context_ptr->blk_geom->origin_x) / 2 + ROUND_UV(context_ptr->blk_geom->origin_y) / 2 * SB_STRIDE_UV; #else uint32_t round_origin_x = (origin_x >> 3) << 3;// for Chroma blocks with size of 4 uint32_t round_origin_y = (origin_y >> 3) << 3;// for Chroma blocks with size of 4 const uint32_t input_luma_offset = context_ptr->blk_geom->tx_org_x[context_ptr->txb_itr] + context_ptr->blk_geom->tx_org_y[context_ptr->txb_itr] * SB_STRIDE_Y; const uint32_t input_cb_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; const uint32_t input_cr_offset = ROUND_UV(context_ptr->blk_geom->tx_org_x[context_ptr->txb_itr]) / 2 + ROUND_UV(context_ptr->blk_geom->tx_org_y[context_ptr->txb_itr]) / 2 * SB_STRIDE_UV; const uint32_t pred_luma_offset = ((predSamples16bit->origin_y + origin_y) * predSamples16bit->stride_y) + (predSamples16bit->origin_x + origin_x); const uint32_t pred_cb_offset = (((predSamples16bit->origin_y + round_origin_y) >> 1) * predSamples16bit->stride_cb) + ((predSamples16bit->origin_x + round_origin_x) >> 1); const uint32_t pred_cr_offset = (((predSamples16bit->origin_y + round_origin_y) >> 1) * predSamples16bit->stride_cr) + ((predSamples16bit->origin_x + round_origin_x) >> 1); const uint32_t scratch_luma_offset = context_ptr->blk_geom->origin_x + context_ptr->blk_geom->origin_y * SB_STRIDE_Y; const uint32_t scratch_cb_offset = ROUND_UV(context_ptr->blk_geom->origin_x) / 2 + ROUND_UV(context_ptr->blk_geom->origin_y) / 2 * SB_STRIDE_UV; const uint32_t scratch_cr_offset = ROUND_UV(context_ptr->blk_geom->origin_x) / 2 + ROUND_UV(context_ptr->blk_geom->origin_y) / 2 * SB_STRIDE_UV; #endif const uint32_t coeff1dOffset = context_ptr->coded_area_sb; const uint32_t coeff1dOffsetChroma = context_ptr->coded_area_sb_uv; UNUSED(coeff1dOffsetChroma); //Update QP for Quant qp += QP_BD_OFFSET; { //********************************** // Luma //********************************** if (component_mask == PICTURE_BUFFER_DESC_FULL_MASK || component_mask == PICTURE_BUFFER_DESC_LUMA_MASK) { residual_kernel16bit( ((uint16_t*)inputSamples16bit->buffer_y) + input_luma_offset, inputSamples16bit->stride_y, ((uint16_t*)predSamples16bit->buffer_y) + pred_luma_offset, predSamples16bit->stride_y, ((int16_t*)residual16bit->buffer_y) + scratch_luma_offset, residual16bit->stride_y, #if ATB_SUPPORT context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr]); #endif #if ATB_MD uint8_t tx_search_skip_fag = (picture_control_set_ptr->parent_pcs_ptr->tx_search_level == TX_SEARCH_ENC_DEC && (picture_control_set_ptr->parent_pcs_ptr->atb_mode == 0 || cu_ptr->prediction_mode_flag == INTER_MODE)) ? get_skip_tx_search_flag( #else uint8_t tx_search_skip_fag = picture_control_set_ptr->parent_pcs_ptr->tx_search_level == TX_SEARCH_ENC_DEC ? get_skip_tx_search_flag( #endif #if BYPASS_USELESS_TX_SEARCH context_ptr->blk_geom, #else context_ptr->blk_geom->sq_size, #endif MAX_MODE_COST, 0, 1) : 1; if (!tx_search_skip_fag) { encode_pass_tx_search_hbd( picture_control_set_ptr, context_ptr, sb_ptr, cb_qp, coeffSamplesTB, residual16bit, transform16bit, inverse_quant_buffer, transformScratchBuffer, asm_type, count_non_zero_coeffs, component_mask, use_delta_qp, dZoffset, eob, candidate_plane); } av1_estimate_transform( ((int16_t*)residual16bit->buffer_y) + scratch_luma_offset, residual16bit->stride_y, ((TranLow*)transform16bit->buffer_y) + coeff1dOffset, NOT_USED_VALUE, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif &context_ptr->three_quad_energy, transformScratchBuffer, BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_Y], asm_type, PLANE_TYPE_Y, #if PF_N2_SUPPORT DEFAULT_SHAPE); #else context_ptr->trans_coeff_shape_luma); #endif int32_t seg_qp = picture_control_set_ptr->parent_pcs_ptr->segmentation_params.segmentation_enabled ? picture_control_set_ptr->parent_pcs_ptr->segmentation_params.feature_data[context_ptr->cu_ptr->segment_id][SEG_LVL_ALT_Q] : 0; #if DC_SIGN_CONTEXT_EP cu_ptr->quantized_dc[0][context_ptr->txb_itr] = av1_quantize_inv_quantize( #else av1_quantize_inv_quantize( #endif sb_ptr->picture_control_set_ptr, context_ptr->md_context, ((int32_t*)transform16bit->buffer_y) + coeff1dOffset, NOT_USED_VALUE, ((int32_t*)coeffSamplesTB->buffer_y) + coeff1dOffset, ((int32_t*)inverse_quant_buffer->buffer_y) + coeff1dOffset, qp, seg_qp, #if ATB_SUPPORT context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr], context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif &eob[0], asm_type, &(count_non_zero_coeffs[0]), #if !PF_N2_SUPPORT 0, #endif COMPONENT_LUMA, BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_Y], &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]), #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->luma_txb_skip_context, context_ptr->md_context->luma_dc_sign_context, #else cu_ptr->luma_txb_skip_context, cu_ptr->luma_dc_sign_context, #endif cu_ptr->pred_mode, #if RDOQ_INTRA cu_ptr->av1xd->use_intrabc, #endif EB_TRUE); #if BLK_SKIP_DECISION if (context_ptr->md_skip_blk) { count_non_zero_coeffs[0] = 0; eob[0] = 0; } #endif txb_ptr->y_has_coeff = count_non_zero_coeffs[0] ? EB_TRUE : EB_FALSE; if (count_non_zero_coeffs[0] == 0) { // INTER. Chroma follows Luma in transform type if (cu_ptr->prediction_mode_flag == INTER_MODE) { txb_ptr->transform_type[PLANE_TYPE_Y] = DCT_DCT; txb_ptr->transform_type[PLANE_TYPE_UV] = DCT_DCT; } else { // INTRA txb_ptr->transform_type[PLANE_TYPE_Y] = DCT_DCT; } } #if ATB_EP txb_ptr->nz_coef_count[0] = (uint16_t)count_non_zero_coeffs[0]; #endif } if (cu_ptr->prediction_mode_flag == INTRA_MODE && cu_ptr->prediction_unit_array->intra_chroma_mode == UV_CFL_PRED) { EbPictureBufferDesc *reconSamples = predSamples16bit; uint32_t reconLumaOffset = (reconSamples->origin_y + origin_y) * reconSamples->stride_y + (reconSamples->origin_x + origin_x); if (txb_ptr->y_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint16_t *predBuffer = ((uint16_t*)predSamples16bit->buffer_y) + pred_luma_offset; av1_inv_transform_recon( ((int32_t*)inverse_quant_buffer->buffer_y) + coeff1dOffset, CONVERT_TO_BYTEPTR(predBuffer), predSamples->stride_y, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_Y], PLANE_TYPE_Y, eob[0]); } #if CFL_FIX if (context_ptr->blk_geom->has_uv) { reconLumaOffset = (reconSamples->origin_y + round_origin_y) * reconSamples->stride_y + (reconSamples->origin_x + round_origin_x); #endif // Down sample Luma cfl_luma_subsampling_420_hbd_c( ((uint16_t*)reconSamples->buffer_y) + reconLumaOffset, reconSamples->stride_y, context_ptr->md_context->pred_buf_q3, #if CFL_FIX context_ptr->blk_geom->bwidth_uv == context_ptr->blk_geom->bwidth ? (context_ptr->blk_geom->bwidth_uv << 1) : context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight_uv == context_ptr->blk_geom->bheight ? (context_ptr->blk_geom->bheight_uv << 1) : context_ptr->blk_geom->bheight); #else context_ptr->blk_geom->tx_width[context_ptr->txb_itr], context_ptr->blk_geom->tx_height[context_ptr->txb_itr]); #endif #if ATB_SUPPORT int32_t round_offset = ((context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr])*(context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr])) / 2; #else int32_t round_offset = ((context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr])*(context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr])) / 2; #endif subtract_average( context_ptr->md_context->pred_buf_q3, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], round_offset, LOG2F(context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr]) + LOG2F(context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr])); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], round_offset, LOG2F(context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr]) + LOG2F(context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr])); #endif int32_t alpha_q3 = cfl_idx_to_alpha(cu_ptr->prediction_unit_array->cfl_alpha_idx, cu_ptr->prediction_unit_array->cfl_alpha_signs, CFL_PRED_U); // once for U, once for V // TOCHANGE // assert(chroma_size * CFL_BUF_LINE + chroma_size <= CFL_BUF_SQUARE); cfl_predict_hbd( context_ptr->md_context->pred_buf_q3, ((uint16_t*)predSamples16bit->buffer_cb) + pred_cb_offset, predSamples16bit->stride_cb, ((uint16_t*)predSamples16bit->buffer_cb) + pred_cb_offset, predSamples16bit->stride_cb, alpha_q3, 10, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif alpha_q3 = cfl_idx_to_alpha(cu_ptr->prediction_unit_array->cfl_alpha_idx, cu_ptr->prediction_unit_array->cfl_alpha_signs, CFL_PRED_V); // once for U, once for V // TOCHANGE //assert(chroma_size * CFL_BUF_LINE + chroma_size <= CFL_BUF_SQUARE); cfl_predict_hbd( context_ptr->md_context->pred_buf_q3, ((uint16_t*)predSamples16bit->buffer_cr) + pred_cr_offset, predSamples16bit->stride_cr, ((uint16_t*)predSamples16bit->buffer_cr) + pred_cr_offset, predSamples16bit->stride_cr, alpha_q3, 10, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif } #if CFL_FIX } #endif if (component_mask == PICTURE_BUFFER_DESC_FULL_MASK || component_mask == PICTURE_BUFFER_DESC_CHROMA_MASK) { //********************************** // Cb //********************************** residual_kernel16bit( ((uint16_t*)inputSamples16bit->buffer_cb) + input_cb_offset, inputSamples16bit->stride_cb, ((uint16_t*)predSamples16bit->buffer_cb) + pred_cb_offset, predSamples16bit->stride_cb, ((int16_t*)residual16bit->buffer_cb) + scratch_cb_offset, residual16bit->stride_cb, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif residual_kernel16bit( ((uint16_t*)inputSamples16bit->buffer_cr) + input_cr_offset, inputSamples16bit->stride_cr, ((uint16_t*)predSamples16bit->buffer_cr) + pred_cr_offset, predSamples16bit->stride_cr, ((int16_t*)residual16bit->buffer_cr) + scratch_cr_offset, residual16bit->stride_cr, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]); #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr]); #endif av1_estimate_transform( ((int16_t*)residual16bit->buffer_cb) + scratch_cb_offset, residual16bit->stride_cb, ((TranLow*)transform16bit->buffer_cb) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &context_ptr->three_quad_energy, transformScratchBuffer, BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_UV], asm_type, PLANE_TYPE_UV, #if PF_N2_SUPPORT DEFAULT_SHAPE); #else context_ptr->trans_coeff_shape_chroma); #endif int32_t seg_qp = picture_control_set_ptr->parent_pcs_ptr->segmentation_params.segmentation_enabled ? picture_control_set_ptr->parent_pcs_ptr->segmentation_params.feature_data[context_ptr->cu_ptr->segment_id][SEG_LVL_ALT_Q] : 0; #if DC_SIGN_CONTEXT_EP cu_ptr->quantized_dc[1][context_ptr->txb_itr] = av1_quantize_inv_quantize( #else av1_quantize_inv_quantize( #endif sb_ptr->picture_control_set_ptr, context_ptr->md_context, ((int32_t*)transform16bit->buffer_cb) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, ((int32_t*)coeffSamplesTB->buffer_cb) + context_ptr->coded_area_sb_uv, ((int32_t*)inverse_quant_buffer->buffer_cb) + context_ptr->coded_area_sb_uv, qp, seg_qp, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &eob[1], asm_type, &(count_non_zero_coeffs[1]), #if !PF_N2_SUPPORT 0, #endif COMPONENT_CHROMA_CB, BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_UV], &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]), #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->cb_txb_skip_context, context_ptr->md_context->cb_dc_sign_context, #else cu_ptr->cb_txb_skip_context, cu_ptr->cb_dc_sign_context, #endif cu_ptr->pred_mode, #if RDOQ_INTRA cu_ptr->av1xd->use_intrabc, #endif EB_TRUE); #if BLK_SKIP_DECISION if (context_ptr->md_skip_blk) { count_non_zero_coeffs[1] = 0; eob[1] = 0; } #endif txb_ptr->u_has_coeff = count_non_zero_coeffs[1] ? EB_TRUE : EB_FALSE; //********************************** // Cr //********************************** av1_estimate_transform( ((int16_t*)residual16bit->buffer_cr) + scratch_cb_offset, residual16bit->stride_cr, ((TranLow*)transform16bit->buffer_cr) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &context_ptr->three_quad_energy, transformScratchBuffer, BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_UV], asm_type, PLANE_TYPE_UV, #if PF_N2_SUPPORT DEFAULT_SHAPE); #else context_ptr->trans_coeff_shape_chroma); #endif #if DC_SIGN_CONTEXT_EP cu_ptr->quantized_dc[2][context_ptr->txb_itr] = av1_quantize_inv_quantize( #else av1_quantize_inv_quantize( #endif sb_ptr->picture_control_set_ptr, context_ptr->md_context, ((int32_t*)transform16bit->buffer_cr) + context_ptr->coded_area_sb_uv, NOT_USED_VALUE, ((int32_t*)coeffSamplesTB->buffer_cr) + context_ptr->coded_area_sb_uv, ((int32_t*)inverse_quant_buffer->buffer_cr) + context_ptr->coded_area_sb_uv, qp, seg_qp, #if ATB_SUPPORT context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->tx_width_uv[context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif &eob[2], asm_type, &(count_non_zero_coeffs[2]), #if !PF_N2_SUPPORT 0, #endif COMPONENT_CHROMA_CR, BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_UV], &(context_ptr->md_context->candidate_buffer_ptr_array[0][0]), #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->cr_txb_skip_context, context_ptr->md_context->cr_dc_sign_context, #else cu_ptr->cr_txb_skip_context, cu_ptr->cr_dc_sign_context, #endif cu_ptr->pred_mode, #if RDOQ_INTRA cu_ptr->av1xd->use_intrabc, #endif EB_TRUE); #if BLK_SKIP_DECISION if (context_ptr->md_skip_blk) { count_non_zero_coeffs[2] = 0; eob[2] = 0; } #endif txb_ptr->v_has_coeff = count_non_zero_coeffs[2] ? EB_TRUE : EB_FALSE; #if ATB_EP txb_ptr->nz_coef_count[1] = (uint16_t)count_non_zero_coeffs[1]; txb_ptr->nz_coef_count[2] = (uint16_t)count_non_zero_coeffs[2]; #endif } } #if !PF_N2_SUPPORT txb_ptr->trans_coeff_shape_luma = context_ptr->trans_coeff_shape_luma; txb_ptr->trans_coeff_shape_chroma = context_ptr->trans_coeff_shape_chroma; #endif #if !ATB_EP txb_ptr->nz_coef_count[0] = (uint16_t)count_non_zero_coeffs[0]; txb_ptr->nz_coef_count[1] = (uint16_t)count_non_zero_coeffs[1]; txb_ptr->nz_coef_count[2] = (uint16_t)count_non_zero_coeffs[2]; #endif return; } /********************************************************** * Encode Generate Recon * * Summary: Performs a H.265 conformant * Inverse Transform and generate * the reconstructed samples of a TU. * * Inputs: * origin_x * origin_y * txb_size * sb_sz * input - Inverse Qunatized Coeff (position sensitive) * pred - prediction samples (position independent) * * Outputs: * Recon (position independent) * **********************************************************/ static void Av1EncodeGenerateRecon( EncDecContext *context_ptr, uint32_t origin_x, uint32_t origin_y, EbPictureBufferDesc *predSamples, // no basis/offset EbPictureBufferDesc *residual16bit, // no basis/offset int16_t *transformScratchBuffer, uint32_t component_mask, uint16_t *eob, EbAsm asm_type) { uint32_t pred_luma_offset; uint32_t predChromaOffset; CodingUnit *cu_ptr = context_ptr->cu_ptr; TransformUnit *txb_ptr = &cu_ptr->transform_unit_array[context_ptr->txb_itr]; // *Note - The prediction is built in-place in the Recon buffer. It is overwritten with Reconstructed // samples if the CBF==1 && SKIP==False //********************************** // Luma //********************************** if (component_mask & PICTURE_BUFFER_DESC_LUMA_MASK) { #if ATB_EP { #else if (cu_ptr->prediction_mode_flag != INTRA_MODE || (cu_ptr->prediction_unit_array->intra_chroma_mode != UV_CFL_PRED && context_ptr->evaluate_cfl_ep == EB_FALSE)) { #endif pred_luma_offset = (predSamples->origin_y + origin_y) * predSamples->stride_y + (predSamples->origin_x + origin_x); if (txb_ptr->y_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { (void)asm_type; (void)transformScratchBuffer; uint8_t *predBuffer = predSamples->buffer_y + pred_luma_offset; av1_inv_transform_recon8bit( ((int32_t*)residual16bit->buffer_y) + context_ptr->coded_area_sb, predBuffer, predSamples->stride_y, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif txb_ptr->transform_type[PLANE_TYPE_Y], PLANE_TYPE_Y, eob[0] ); } } } if (component_mask & PICTURE_BUFFER_DESC_CHROMA_MASK) { //********************************** // Chroma //********************************** uint32_t round_origin_x = (origin_x >> 3) << 3;// for Chroma blocks with size of 4 uint32_t round_origin_y = (origin_y >> 3) << 3;// for Chroma blocks with size of 4 predChromaOffset = (((predSamples->origin_y + round_origin_y) >> 1) * predSamples->stride_cb) + ((predSamples->origin_x + round_origin_x) >> 1); //********************************** // Cb //********************************** if (txb_ptr->u_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint8_t *predBuffer = predSamples->buffer_cb + predChromaOffset; av1_inv_transform_recon8bit( ((int32_t*)residual16bit->buffer_cb) + context_ptr->coded_area_sb_uv, predBuffer, predSamples->stride_cb, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif txb_ptr->transform_type[PLANE_TYPE_UV], PLANE_TYPE_UV, eob[1]); } //********************************** // Cr //********************************** predChromaOffset = (((predSamples->origin_y + round_origin_y) >> 1) * predSamples->stride_cr) + ((predSamples->origin_x + round_origin_x) >> 1); if (txb_ptr->v_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint8_t *predBuffer = predSamples->buffer_cr + predChromaOffset; av1_inv_transform_recon8bit( ((int32_t*)residual16bit->buffer_cr) + context_ptr->coded_area_sb_uv, predBuffer, predSamples->stride_cr, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif txb_ptr->transform_type[PLANE_TYPE_UV], PLANE_TYPE_UV, eob[2]); } } return; } /********************************************************** * Encode Generate Recon * * Summary: Performs a H.265 conformant * Inverse Transform and generate * the reconstructed samples of a TU. * * Inputs: * origin_x * origin_y * txb_size * sb_sz * input - Inverse Qunatized Coeff (position sensitive) * pred - prediction samples (position independent) * * Outputs: * Recon (position independent) * **********************************************************/ static void Av1EncodeGenerateRecon16bit( EncDecContext *context_ptr, uint32_t origin_x, uint32_t origin_y, EbPictureBufferDesc *predSamples, // no basis/offset EbPictureBufferDesc *residual16bit, // no basis/offset int16_t *transformScratchBuffer, uint32_t component_mask, uint16_t *eob, EbAsm asm_type) { uint32_t pred_luma_offset; uint32_t predChromaOffset; CodingUnit *cu_ptr = context_ptr->cu_ptr; TransformUnit *txb_ptr = &cu_ptr->transform_unit_array[context_ptr->txb_itr]; (void)asm_type; (void)transformScratchBuffer; //********************************** // Luma //********************************** if (component_mask & PICTURE_BUFFER_DESC_LUMA_MASK) { if (cu_ptr->prediction_mode_flag != INTRA_MODE || cu_ptr->prediction_unit_array->intra_chroma_mode != UV_CFL_PRED) { pred_luma_offset = (predSamples->origin_y + origin_y)* predSamples->stride_y + (predSamples->origin_x + origin_x); if (txb_ptr->y_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint16_t *predBuffer = ((uint16_t*)predSamples->buffer_y) + pred_luma_offset; av1_inv_transform_recon( ((int32_t*)residual16bit->buffer_y) + context_ptr->coded_area_sb, CONVERT_TO_BYTEPTR(predBuffer), predSamples->stride_y, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], #endif BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_Y], PLANE_TYPE_Y, eob[0] ); } } } if (component_mask & PICTURE_BUFFER_DESC_CHROMA_MASK) { //********************************** // Chroma //********************************** //********************************** // Cb //********************************** uint32_t round_origin_x = (origin_x >> 3) << 3;// for Chroma blocks with size of 4 uint32_t round_origin_y = (origin_y >> 3) << 3;// for Chroma blocks with size of 4 predChromaOffset = (((predSamples->origin_y + round_origin_y) >> 1) * predSamples->stride_cb) + ((predSamples->origin_x + round_origin_x) >> 1); if (txb_ptr->u_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint16_t *predBuffer = ((uint16_t*)predSamples->buffer_cb) + predChromaOffset; av1_inv_transform_recon( ((int32_t*)residual16bit->buffer_cb) + context_ptr->coded_area_sb_uv, CONVERT_TO_BYTEPTR(predBuffer), predSamples->stride_cb, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_UV], PLANE_TYPE_UV, eob[1]); } //********************************** // Cr //********************************** predChromaOffset = (((predSamples->origin_y + round_origin_y) >> 1) * predSamples->stride_cr) + ((predSamples->origin_x + round_origin_x) >> 1); if (txb_ptr->v_has_coeff == EB_TRUE && cu_ptr->skip_flag == EB_FALSE) { uint16_t *predBuffer = ((uint16_t*)predSamples->buffer_cr) + predChromaOffset; av1_inv_transform_recon( ((int32_t*)residual16bit->buffer_cr) + context_ptr->coded_area_sb_uv, CONVERT_TO_BYTEPTR(predBuffer), predSamples->stride_cr, #if ATB_SUPPORT context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif BIT_INCREMENT_10BIT, txb_ptr->transform_type[PLANE_TYPE_UV], PLANE_TYPE_UV, eob[2]); } } return; } static EB_AV1_ENCODE_LOOP_FUNC_PTR Av1EncodeLoopFunctionTable[2] = { Av1EncodeLoop, Av1EncodeLoop16bit }; EB_AV1_GENERATE_RECON_FUNC_PTR Av1EncodeGenerateReconFunctionPtr[2] = { Av1EncodeGenerateRecon, Av1EncodeGenerateRecon16bit }; #if !MEMORY_FOOTPRINT_OPT /******************************************* * Encode Pass - Assign Delta Qp *******************************************/ static void EncodePassUpdateQp( PictureControlSet *picture_control_set_ptr, EncDecContext *context_ptr, EbBool availableCoeff, EbBool isDeltaQpEnable, EbBool *isDeltaQpNotCoded, uint32_t dif_cu_delta_qp_depth, uint8_t *prev_coded_qp, uint8_t *prev_quant_group_coded_qp, uint32_t sb_qp ) { uint32_t ref_qp; uint8_t qp; uint32_t log2MinCuQpDeltaSize = LOG2F_MAX_LCU_SIZE - dif_cu_delta_qp_depth; int32_t qpTopNeighbor = 0; int32_t qpLeftNeighbor = 0; EbBool newQuantGroup; uint32_t quantGroupX = context_ptr->cu_origin_x - (context_ptr->cu_origin_x & ((1 << log2MinCuQpDeltaSize) - 1)); uint32_t quantGroupY = context_ptr->cu_origin_y - (context_ptr->cu_origin_y & ((1 << log2MinCuQpDeltaSize) - 1)); EbBool sameLcuCheckTop = (((quantGroupY - 1) >> LOG2F_MAX_LCU_SIZE) == ((quantGroupY) >> LOG2F_MAX_LCU_SIZE)) ? EB_TRUE : EB_FALSE; EbBool sameLcuCheckLeft = (((quantGroupX - 1) >> LOG2F_MAX_LCU_SIZE) == ((quantGroupX) >> LOG2F_MAX_LCU_SIZE)) ? EB_TRUE : EB_FALSE; // Neighbor Array uint32_t qpLeftNeighborIndex = 0; uint32_t qpTopNeighborIndex = 0; // CU larger than the quantization group if (Log2f(context_ptr->blk_geom->bwidth) >= log2MinCuQpDeltaSize) *isDeltaQpNotCoded = EB_TRUE; // At the beginning of a new quantization group if (((context_ptr->cu_origin_x & ((1 << log2MinCuQpDeltaSize) - 1)) == 0) && ((context_ptr->cu_origin_y & ((1 << log2MinCuQpDeltaSize) - 1)) == 0)) { *isDeltaQpNotCoded = EB_TRUE; newQuantGroup = EB_TRUE; } else newQuantGroup = EB_FALSE; // setting the previous Quantization Group QP if (newQuantGroup == EB_TRUE) *prev_coded_qp = *prev_quant_group_coded_qp; if (sameLcuCheckTop) { qpTopNeighborIndex = LUMA_SAMPLE_PIC_WISE_LOCATION_TO_QP_ARRAY_IDX( quantGroupX, quantGroupY - 1, picture_control_set_ptr->qp_array_stride); qpTopNeighbor = picture_control_set_ptr->qp_array[qpTopNeighborIndex]; } else qpTopNeighbor = *prev_coded_qp; if (sameLcuCheckLeft) { qpLeftNeighborIndex = LUMA_SAMPLE_PIC_WISE_LOCATION_TO_QP_ARRAY_IDX( quantGroupX - 1, quantGroupY, picture_control_set_ptr->qp_array_stride); qpLeftNeighbor = picture_control_set_ptr->qp_array[qpLeftNeighborIndex]; } else qpLeftNeighbor = *prev_coded_qp; ref_qp = (qpLeftNeighbor + qpTopNeighbor + 1) >> 1; qp = (uint8_t)context_ptr->cu_ptr->qp; // Update the State info if (isDeltaQpEnable) { if (*isDeltaQpNotCoded) { if (availableCoeff) { qp = (uint8_t)context_ptr->cu_ptr->qp; *prev_coded_qp = qp; *prev_quant_group_coded_qp = qp; *isDeltaQpNotCoded = EB_FALSE; } else { qp = (uint8_t)ref_qp; *prev_quant_group_coded_qp = qp; } } } else qp = (uint8_t)sb_qp; context_ptr->cu_ptr->qp = qp; return; } #endif #if !MEMORY_FOOTPRINT_OPT EbErrorType QpmDeriveBeaAndSkipQpmFlagLcu( SequenceControlSet *sequence_control_set_ptr, PictureControlSet *picture_control_set_ptr, LargestCodingUnit *sb_ptr, uint32_t sb_index, EncDecContext *context_ptr) { EbErrorType return_error = EB_ErrorNone; #if ADD_DELTA_QP_SUPPORT uint16_t picture_qp = picture_control_set_ptr->parent_pcs_ptr->base_qindex; uint16_t min_qp_allowed = 0; uint16_t max_qp_allowed = 255; uint16_t deltaQpRes = (uint16_t)picture_control_set_ptr->parent_pcs_ptr->delta_q_res; #else uint8_t picture_qp = picture_control_set_ptr->picture_qp; uint8_t min_qp_allowed = (uint8_t)sequence_control_set_ptr->static_config.min_qp_allowed; uint8_t max_qp_allowed = (uint8_t)sequence_control_set_ptr->static_config.max_qp_allowed; #endif context_ptr->qpm_qp = picture_qp; SbStat *sb_stat_ptr = &(picture_control_set_ptr->parent_pcs_ptr->sb_stat_array[sb_index]); context_ptr->non_moving_delta_qp = 0; context_ptr->grass_enhancement_flag = ((picture_control_set_ptr->scene_caracteristic_id == EB_FRAME_CARAC_1) && (sb_stat_ptr->cu_stat_array[0].grass_area) && (sb_ptr->picture_control_set_ptr->parent_pcs_ptr->edge_results_ptr[sb_index].edge_block_num > 0)) ? EB_TRUE : EB_FALSE; context_ptr->backgorund_enhancement = EB_FALSE; context_ptr->skip_qpm_flag = sequence_control_set_ptr->static_config.improve_sharpness ? EB_FALSE : EB_TRUE; #if !DISABLE_OIS_USE if ((picture_control_set_ptr->parent_pcs_ptr->logo_pic_flag == EB_FALSE) && ((picture_control_set_ptr->parent_pcs_ptr->pic_noise_class >= PIC_NOISE_CLASS_3_1) || (picture_control_set_ptr->parent_pcs_ptr->high_dark_low_light_area_density_flag) || (picture_control_set_ptr->parent_pcs_ptr->intra_coded_block_probability > 90))) context_ptr->skip_qpm_flag = EB_TRUE; #endif if (sequence_control_set_ptr->input_resolution < INPUT_SIZE_4K_RANGE) context_ptr->skip_qpm_flag = EB_TRUE; #if ADD_DELTA_QP_SUPPORT context_ptr->skip_qpm_flag = EB_FALSE; #endif if (context_ptr->skip_qpm_flag == EB_FALSE) { if (picture_control_set_ptr->parent_pcs_ptr->pic_homogenous_over_time_sb_percentage > 30 && picture_control_set_ptr->slice_type != I_SLICE) { #if ADD_DELTA_QP_SUPPORT context_ptr->qpm_qp = CLIP3(min_qp_allowed, max_qp_allowed, picture_qp + deltaQpRes); #else context_ptr->qpm_qp = CLIP3(min_qp_allowed, max_qp_allowed, picture_qp + 1); #endif } } return return_error; } #endif #if ADD_DELTA_QP_SUPPORT /***************************************************************************** * NM - Note: Clean up * AV1 QPM is SB based and all sub-Lcu buffers needs to be removed ******************************************************************************/ EbErrorType Av1QpModulationLcu( SequenceControlSet *sequence_control_set_ptr, PictureControlSet *picture_control_set_ptr, LargestCodingUnit *sb_ptr, uint32_t sb_index, uint8_t type, EncDecContext *context_ptr) { EbErrorType return_error = EB_ErrorNone; int64_t complexityDistance; int8_t delta_qp = 0; uint16_t qpm_qp = context_ptr->qpm_qp; uint16_t min_qp_allowed = 0; uint16_t max_qp_allowed = 255; uint16_t cu_qp; EbBool acEnergyBasedAntiContouring = picture_control_set_ptr->slice_type == I_SLICE ? EB_TRUE : EB_FALSE; uint8_t lowerQPClass; int8_t non_moving_delta_qp = context_ptr->non_moving_delta_qp; int8_t bea64x64DeltaQp; uint8_t deltaQpRes = picture_control_set_ptr->parent_pcs_ptr->delta_q_res; cu_qp = qpm_qp; sb_ptr->qp = qpm_qp; uint32_t distortion = 0; if (!context_ptr->skip_qpm_flag) { // INTRA MODE if (type == INTRA_MODE) { OisSbResults *ois_sb_results_ptr = picture_control_set_ptr->parent_pcs_ptr->ois_sb_results[sb_index]; OisCandidate *OisCuPtr = ois_sb_results_ptr->sorted_ois_candidate[from_1101_to_85[cu_index]]; distortion = OisCuPtr[ois_sb_results_ptr->best_distortion_index[from_1101_to_85[cu_index]]].distortion; distortion = (uint32_t)CLIP3(picture_control_set_ptr->parent_pcs_ptr->intra_complexity_min[0], picture_control_set_ptr->parent_pcs_ptr->intra_complexity_max[0], distortion); complexityDistance = ((int32_t)distortion - (int32_t)picture_control_set_ptr->parent_pcs_ptr->intra_complexity_avg[0]); if (complexityDistance < 0) delta_qp = (picture_control_set_ptr->parent_pcs_ptr->intra_min_distance[0] != 0) ? (int8_t)((context_ptr->min_delta_qp_weight * context_ptr->min_delta_qp[0] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->intra_min_distance[0])) : 0; else delta_qp = (picture_control_set_ptr->parent_pcs_ptr->intra_max_distance[0] != 0) ? (int8_t)((context_ptr->max_delta_qp_weight * context_ptr->max_delta_qp[0] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->intra_max_distance[0])) : 0; } // INTER MODE else { distortion = picture_control_set_ptr->parent_pcs_ptr->me_results[sb_index][0].distortion_direction[0].distortion; distortion = (uint32_t)CLIP3(picture_control_set_ptr->parent_pcs_ptr->inter_complexity_min[0], picture_control_set_ptr->parent_pcs_ptr->inter_complexity_max[0], distortion); complexityDistance = ((int32_t)distortion - (int32_t)picture_control_set_ptr->parent_pcs_ptr->inter_complexity_avg[0]); if (complexityDistance < 0) delta_qp = (picture_control_set_ptr->parent_pcs_ptr->inter_min_distance[0] != 0) ? (int8_t)((context_ptr->min_delta_qp_weight * context_ptr->min_delta_qp[0] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->inter_min_distance[0])) : 0; else delta_qp = (picture_control_set_ptr->parent_pcs_ptr->inter_max_distance[0] != 0) ? (int8_t)((context_ptr->max_delta_qp_weight * context_ptr->max_delta_qp[0] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->inter_max_distance[0])) : 0; } if (context_ptr->backgorund_enhancement) { // Use the 8x8 background enhancement only for the Intra slice, otherwise, use the existing SB based BEA results bea64x64DeltaQp = non_moving_delta_qp; if ((picture_control_set_ptr->parent_pcs_ptr->y_mean[sb_index][0] > ANTI_CONTOURING_LUMA_T2) || (picture_control_set_ptr->parent_pcs_ptr->y_mean[sb_index][0] < ANTI_CONTOURING_LUMA_T1)) { if (bea64x64DeltaQp < 0) bea64x64DeltaQp = 0; } delta_qp += bea64x64DeltaQp; } if ((picture_control_set_ptr->parent_pcs_ptr->logo_pic_flag)) delta_qp = (delta_qp < context_ptr->min_delta_qp[0]) ? delta_qp : context_ptr->min_delta_qp[0]; SbStat *sb_stat_ptr = &(picture_control_set_ptr->parent_pcs_ptr->sb_stat_array[sb_index]); if (sb_stat_ptr->stationary_edge_over_time_flag && delta_qp > 0) delta_qp = 0; if (acEnergyBasedAntiContouring) { lowerQPClass = derive_contouring_class( sb_ptr->picture_control_set_ptr->parent_pcs_ptr, sb_ptr->index, (uint8_t)1/*cu_index*/); if (lowerQPClass) { if (lowerQPClass == 3) delta_qp = ANTI_CONTOURING_DELTA_QP_0; else if (lowerQPClass == 2) delta_qp = ANTI_CONTOURING_DELTA_QP_1; else if (lowerQPClass == 1) delta_qp = ANTI_CONTOURING_DELTA_QP_2; } } delta_qp -= context_ptr->grass_enhancement_flag ? 3 : 0; delta_qp *= deltaQpRes; if (sequence_control_set_ptr->static_config.rate_control_mode == 1 || sequence_control_set_ptr->static_config.rate_control_mode == 2) { if (qpm_qp > (RC_QPMOD_MAXQP * deltaQpRes)) delta_qp = MIN(0, delta_qp); cu_qp = (uint32_t)(qpm_qp + delta_qp); if ((qpm_qp <= (RC_QPMOD_MAXQP *deltaQpRes))) { cu_qp = (uint8_t)CLIP3( min_qp_allowed, RC_QPMOD_MAXQP*deltaQpRes, cu_qp); } } else cu_qp = (uint8_t)(qpm_qp + delta_qp); cu_qp = (uint8_t)CLIP3( min_qp_allowed, max_qp_allowed, cu_qp); } sb_ptr->qp = sequence_control_set_ptr->static_config.improve_sharpness ? cu_qp : qpm_qp; sb_ptr->delta_qp = (int16_t)sb_ptr->qp - (int16_t)qpm_qp; sb_ptr->org_delta_qp = sb_ptr->delta_qp; if (sb_ptr->delta_qp % deltaQpRes != 0) printf("Qpm_error: delta_qp must be multiplier of deltaQpRes\n"); if (sb_ptr->qp == 0) printf("Qpm_error: qp must be greater than 0 when use_delta_q is ON\n"); return return_error; } #endif #if !MEMORY_FOOTPRINT_OPT EbErrorType EncQpmDeriveDeltaQPForEachLeafLcu( SequenceControlSet *sequence_control_set_ptr, PictureControlSet *picture_control_set_ptr, LargestCodingUnit *sb_ptr, uint32_t sb_index, CodingUnit *cu_ptr, uint32_t cu_depth, uint32_t cu_index, uint32_t cu_size, uint8_t type, uint8_t parent32x32_index, EncDecContext *context_ptr) { EbErrorType return_error = EB_ErrorNone; //SbParams sb_params; int64_t complexityDistance; int8_t delta_qp = 0; uint8_t qpm_qp = (uint8_t)context_ptr->qpm_qp; uint8_t min_qp_allowed = (uint8_t)sequence_control_set_ptr->static_config.min_qp_allowed; uint8_t max_qp_allowed = (uint8_t)sequence_control_set_ptr->static_config.max_qp_allowed; uint8_t cu_qp; EbBool use16x16Stat = EB_FALSE; uint32_t usedDepth = cu_depth; if (use16x16Stat) usedDepth = 2; uint32_t cuIndexInRaterScan = md_scan_to_raster_scan[cu_index]; #if !OPT_LOSSLESS_0 EbBool acEnergyBasedAntiContouring = picture_control_set_ptr->slice_type == I_SLICE ? EB_TRUE : EB_FALSE; uint8_t lowerQPClass; #endif int8_t non_moving_delta_qp = context_ptr->non_moving_delta_qp; int8_t bea64x64DeltaQp; cu_qp = qpm_qp; cu_ptr->qp = qpm_qp; uint32_t distortion = 0; if (!context_ptr->skip_qpm_flag) { // INTRA MODE if (type == INTRA_MODE) { OisSbResults *ois_sb_results_ptr = picture_control_set_ptr->parent_pcs_ptr->ois_sb_results[sb_index]; OisCandidate *OisCuPtr = ois_sb_results_ptr->ois_candidate_array[ep_to_pa_block_index[cu_index]]; distortion = OisCuPtr[ois_sb_results_ptr->best_distortion_index[ep_to_pa_block_index[cu_index]]].distortion; distortion = (uint32_t)CLIP3(picture_control_set_ptr->parent_pcs_ptr->intra_complexity_min[usedDepth], picture_control_set_ptr->parent_pcs_ptr->intra_complexity_max[usedDepth], distortion); complexityDistance = ((int32_t)distortion - (int32_t)picture_control_set_ptr->parent_pcs_ptr->intra_complexity_avg[usedDepth]); if (complexityDistance < 0) delta_qp = (picture_control_set_ptr->parent_pcs_ptr->intra_min_distance[usedDepth] != 0) ? (int8_t)((context_ptr->min_delta_qp_weight * context_ptr->min_delta_qp[usedDepth] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->intra_min_distance[usedDepth])) : 0; else delta_qp = (picture_control_set_ptr->parent_pcs_ptr->intra_max_distance[usedDepth] != 0) ? (int8_t)((context_ptr->max_delta_qp_weight * context_ptr->max_delta_qp[usedDepth] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->intra_max_distance[usedDepth])) : 0; } // INTER MODE else { #if MRP_CONNECTION distortion = picture_control_set_ptr->parent_pcs_ptr->me_results[sb_index]->me_candidate[cuIndexInRaterScan][0].distortion; #else distortion = picture_control_set_ptr->parent_pcs_ptr->me_results[sb_index][cuIndexInRaterScan].distortion_direction[0].distortion; #endif if (use16x16Stat) { uint32_t cuIndexRScan = md_scan_to_raster_scan[ParentBlockIndex[cu_index]]; #if MRP_CONNECTION distortion = picture_control_set_ptr->parent_pcs_ptr->me_results[sb_index]->me_candidate[cuIndexRScan][0].distortion; #else distortion = picture_control_set_ptr->parent_pcs_ptr->me_results[sb_index][cuIndexRScan].distortion_direction[0].distortion; #endif } distortion = (uint32_t)CLIP3(picture_control_set_ptr->parent_pcs_ptr->inter_complexity_min[usedDepth], picture_control_set_ptr->parent_pcs_ptr->inter_complexity_max[usedDepth], distortion); complexityDistance = ((int32_t)distortion - (int32_t)picture_control_set_ptr->parent_pcs_ptr->inter_complexity_avg[usedDepth]); if (complexityDistance < 0) delta_qp = (picture_control_set_ptr->parent_pcs_ptr->inter_min_distance[usedDepth] != 0) ? (int8_t)((context_ptr->min_delta_qp_weight * context_ptr->min_delta_qp[usedDepth] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->inter_min_distance[usedDepth])) : 0; else delta_qp = (picture_control_set_ptr->parent_pcs_ptr->inter_max_distance[usedDepth] != 0) ? (int8_t)((context_ptr->max_delta_qp_weight * context_ptr->max_delta_qp[usedDepth] * complexityDistance) / (100 * picture_control_set_ptr->parent_pcs_ptr->inter_max_distance[usedDepth])) : 0; } if (context_ptr->backgorund_enhancement) { // Use the 8x8 background enhancement only for the Intra slice, otherwise, use the existing SB based BEA results bea64x64DeltaQp = non_moving_delta_qp; if (((cu_index > 0) && ((picture_control_set_ptr->parent_pcs_ptr->y_mean[sb_index][parent32x32_index]) > ANTI_CONTOURING_LUMA_T2 || (picture_control_set_ptr->parent_pcs_ptr->y_mean[sb_index][parent32x32_index]) < ANTI_CONTOURING_LUMA_T1)) || ((cu_index == 0) && ((picture_control_set_ptr->parent_pcs_ptr->y_mean[sb_index][0]) > ANTI_CONTOURING_LUMA_T2 || (picture_control_set_ptr->parent_pcs_ptr->y_mean[sb_index][0]) < ANTI_CONTOURING_LUMA_T1))) { if (bea64x64DeltaQp < 0) bea64x64DeltaQp = 0; } delta_qp += bea64x64DeltaQp; } if ((picture_control_set_ptr->parent_pcs_ptr->logo_pic_flag)) delta_qp = (delta_qp < context_ptr->min_delta_qp[0]) ? delta_qp : context_ptr->min_delta_qp[0]; SbStat *sb_stat_ptr = &(picture_control_set_ptr->parent_pcs_ptr->sb_stat_array[sb_index]); if (sb_stat_ptr->stationary_edge_over_time_flag && delta_qp > 0) delta_qp = 0; #if !OPT_LOSSLESS_0 if (acEnergyBasedAntiContouring) { lowerQPClass = derive_contouring_class( sb_ptr->picture_control_set_ptr->parent_pcs_ptr, sb_ptr->index, (uint8_t)cu_index); if (lowerQPClass) { if (lowerQPClass == 3) delta_qp = ANTI_CONTOURING_DELTA_QP_0; else if (lowerQPClass == 2) delta_qp = ANTI_CONTOURING_DELTA_QP_1; else if (lowerQPClass == 1) delta_qp = ANTI_CONTOURING_DELTA_QP_2; } } #endif delta_qp -= context_ptr->grass_enhancement_flag ? 3 : 0; if (sequence_control_set_ptr->static_config.rate_control_mode == 1 || sequence_control_set_ptr->static_config.rate_control_mode == 2) { if (qpm_qp > RC_QPMOD_MAXQP) delta_qp = MIN(0, delta_qp); cu_qp = (uint32_t)(qpm_qp + delta_qp); if ((qpm_qp <= RC_QPMOD_MAXQP)) { cu_qp = (uint8_t)CLIP3( min_qp_allowed, RC_QPMOD_MAXQP, cu_qp); } } else cu_qp = (uint8_t)(qpm_qp + delta_qp); cu_qp = (uint8_t)CLIP3( min_qp_allowed, max_qp_allowed, cu_qp); } cu_ptr->qp = sequence_control_set_ptr->static_config.improve_sharpness ? cu_qp : qpm_qp; sb_ptr->qp = (cu_size == 64) ? (uint8_t)cu_ptr->qp : sb_ptr->qp; cu_ptr->delta_qp = (int16_t)cu_ptr->qp - (int16_t)qpm_qp; cu_ptr->org_delta_qp = cu_ptr->delta_qp; return return_error; } #endif void Store16bitInputSrc( EncDecContext *context_ptr, PictureControlSet *picture_control_set_ptr, uint32_t lcuX, uint32_t lcuY, uint32_t lcuW, uint32_t lcuH ){ uint32_t rowIt; uint16_t* fromPtr; uint16_t* toPtr; fromPtr = (uint16_t*)context_ptr->input_sample16bit_buffer->buffer_y; toPtr = (uint16_t*)picture_control_set_ptr->input_frame16bit->buffer_y + (lcuX + picture_control_set_ptr->input_frame16bit->origin_x) + (lcuY + picture_control_set_ptr->input_frame16bit->origin_y)*picture_control_set_ptr->input_frame16bit->stride_y; for (rowIt = 0; rowIt < lcuH; rowIt++) memcpy(toPtr + rowIt * picture_control_set_ptr->input_frame16bit->stride_y, fromPtr + rowIt * context_ptr->input_sample16bit_buffer->stride_y, lcuW * 2); lcuX = lcuX / 2; lcuY = lcuY / 2; lcuW = lcuW / 2; lcuH = lcuH / 2; fromPtr = (uint16_t*)context_ptr->input_sample16bit_buffer->buffer_cb; toPtr = (uint16_t*)picture_control_set_ptr->input_frame16bit->buffer_cb + (lcuX + picture_control_set_ptr->input_frame16bit->origin_x / 2) + (lcuY + picture_control_set_ptr->input_frame16bit->origin_y / 2)*picture_control_set_ptr->input_frame16bit->stride_cb; for (rowIt = 0; rowIt < lcuH; rowIt++) memcpy(toPtr + rowIt * picture_control_set_ptr->input_frame16bit->stride_cb, fromPtr + rowIt * context_ptr->input_sample16bit_buffer->stride_cb, lcuW * 2); fromPtr = (uint16_t*)context_ptr->input_sample16bit_buffer->buffer_cr; toPtr = (uint16_t*)picture_control_set_ptr->input_frame16bit->buffer_cr + (lcuX + picture_control_set_ptr->input_frame16bit->origin_x / 2) + (lcuY + picture_control_set_ptr->input_frame16bit->origin_y / 2)*picture_control_set_ptr->input_frame16bit->stride_cb; for (rowIt = 0; rowIt < lcuH; rowIt++) memcpy(toPtr + rowIt * picture_control_set_ptr->input_frame16bit->stride_cr, fromPtr + rowIt * context_ptr->input_sample16bit_buffer->stride_cr, lcuW * 2); } void update_av1_mi_map( CodingUnit *cu_ptr, uint32_t cu_origin_x, uint32_t cu_origin_y, const BlockGeom *blk_geom, PictureControlSet *picture_control_set_ptr); void move_cu_data( CodingUnit *src_cu, CodingUnit *dst_cu); #if ATB_EP void perform_intra_coding_loop( SequenceControlSet *sequence_control_set_ptr, PictureControlSet *picture_control_set_ptr, LargestCodingUnit *sb_ptr, uint32_t tbAddr, CodingUnit *cu_ptr, PredictionUnit *pu_ptr, EncDecContext *context_ptr, uint32_t dZoffset) { EbAsm asm_type = sequence_control_set_ptr->encode_context_ptr->asm_type; EbBool is16bit = context_ptr->is16bit; EbPictureBufferDesc *recon_buffer = is16bit ? picture_control_set_ptr->recon_picture16bit_ptr : picture_control_set_ptr->recon_picture_ptr; EbPictureBufferDesc *coeff_buffer_sb = sb_ptr->quantized_coeff; NeighborArrayUnit *ep_luma_recon_neighbor_array = is16bit ? picture_control_set_ptr->ep_luma_recon_neighbor_array16bit : picture_control_set_ptr->ep_luma_recon_neighbor_array; NeighborArrayUnit *ep_cb_recon_neighbor_array = is16bit ? picture_control_set_ptr->ep_cb_recon_neighbor_array16bit : picture_control_set_ptr->ep_cb_recon_neighbor_array; NeighborArrayUnit *ep_cr_recon_neighbor_array = is16bit ? picture_control_set_ptr->ep_cr_recon_neighbor_array16bit : picture_control_set_ptr->ep_cr_recon_neighbor_array; EbPictureBufferDesc *residual_buffer = context_ptr->residual_buffer; EbPictureBufferDesc *transform_buffer = context_ptr->transform_buffer; EbPictureBufferDesc *inverse_quant_buffer = context_ptr->inverse_quant_buffer; int16_t *transform_inner_array_ptr = context_ptr->transform_inner_array_ptr; uint32_t count_non_zero_coeffs[3]; MacroblockPlane cuPlane[3]; uint16_t eobs[MAX_TXB_COUNT][3]; uint64_t y_tu_coeff_bits; uint64_t cb_tu_coeff_bits; uint64_t cr_tu_coeff_bits; EntropyCoder *coeff_est_entropy_coder_ptr = picture_control_set_ptr->coeff_est_entropy_coder_ptr; if (picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag == EB_TRUE) //get the 16bit form of the input LCU if (is16bit) recon_buffer = ((EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr)->reference_picture16bit; else recon_buffer = ((EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr)->reference_picture; else // non ref pictures recon_buffer = is16bit ? picture_control_set_ptr->recon_picture16bit_ptr : picture_control_set_ptr->recon_picture_ptr; uint32_t totTu = context_ptr->blk_geom->txb_count[cu_ptr->tx_depth]; // Luma path for (context_ptr->txb_itr = 0; context_ptr->txb_itr < totTu; context_ptr->txb_itr++) { uint16_t txb_origin_x = context_ptr->cu_origin_x + context_ptr->blk_geom->tx_boff_x[cu_ptr->tx_depth][context_ptr->txb_itr]; uint16_t txb_origin_y = context_ptr->cu_origin_y + context_ptr->blk_geom->tx_boff_y[cu_ptr->tx_depth][context_ptr->txb_itr]; #if DC_SIGN_CONTEXT_EP #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->luma_txb_skip_context = 0; context_ptr->md_context->luma_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, txb_origin_x, txb_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->luma_txb_skip_context, &context_ptr->md_context->luma_dc_sign_context); #else context_ptr->cu_ptr->luma_txb_skip_context = 0; context_ptr->cu_ptr->luma_dc_sign_context[context_ptr->txb_itr] = 0; get_txb_ctx( COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, txb_origin_x, txb_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->cu_ptr->luma_txb_skip_context, &context_ptr->cu_ptr->luma_dc_sign_context[context_ptr->txb_itr]); #endif #endif if (is16bit) { uint16_t topNeighArray[64 * 2 + 1]; uint16_t leftNeighArray[64 * 2 + 1]; PredictionMode mode; TxSize tx_size = context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; if (txb_origin_y != 0) memcpy(topNeighArray + 1, (uint16_t*)(ep_luma_recon_neighbor_array->top_array) + txb_origin_x, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr] * 2 * sizeof(uint16_t)); if (txb_origin_x != 0) memcpy(leftNeighArray + 1, (uint16_t*)(ep_luma_recon_neighbor_array->left_array) + txb_origin_y, context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr] * 2 * sizeof(uint16_t)); if (txb_origin_y != 0 && txb_origin_x != 0) topNeighArray[0] = leftNeighArray[0] = ((uint16_t*)(ep_luma_recon_neighbor_array->top_left_array) + MAX_PICTURE_HEIGHT_SIZE + txb_origin_x - txb_origin_y)[0]; mode = cu_ptr->pred_mode; av1_predict_intra_block_16bit( &sb_ptr->tile_info, context_ptr, picture_control_set_ptr->parent_pcs_ptr->av1_cm, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], tx_size, mode, pu_ptr->angle_delta[PLANE_TYPE_Y], 0, FILTER_INTRA_MODES, topNeighArray + 1, leftNeighArray + 1, recon_buffer, 0, 0, 0, context_ptr->blk_geom->bsize, context_ptr->cu_origin_x, context_ptr->cu_origin_y); } else { uint8_t topNeighArray[64 * 2 + 1]; uint8_t leftNeighArray[64 * 2 + 1]; PredictionMode mode; TxSize tx_size = context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; if (txb_origin_y != 0) memcpy(topNeighArray + 1, ep_luma_recon_neighbor_array->top_array + txb_origin_x, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr] * 2); if (txb_origin_x != 0) memcpy(leftNeighArray + 1, ep_luma_recon_neighbor_array->left_array + txb_origin_y, context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr] * 2); if (txb_origin_y != 0 && txb_origin_x != 0) topNeighArray[0] = leftNeighArray[0] = ep_luma_recon_neighbor_array->top_left_array[MAX_PICTURE_HEIGHT_SIZE + txb_origin_x - txb_origin_y]; mode = cu_ptr->pred_mode; // Hsan: if CHROMA_MODE_2, then CFL will be evaluated @ EP as no CHROMA @ MD // If that's the case then you should ensure than the 1st chroma prediction uses UV_DC_PRED (that's the default configuration for CHROMA_MODE_2 if CFL applicable (set @ fast loop candidates injection) then MD assumes chroma mode always UV_DC_PRED) av1_predict_intra_block( &sb_ptr->tile_info, ED_STAGE, context_ptr->blk_geom, picture_control_set_ptr->parent_pcs_ptr->av1_cm, context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight, tx_size, mode, pu_ptr->angle_delta[PLANE_TYPE_Y], 0, FILTER_INTRA_MODES, topNeighArray + 1, leftNeighArray + 1, recon_buffer, context_ptr->blk_geom->tx_boff_x[cu_ptr->tx_depth][context_ptr->txb_itr] >> 2, context_ptr->blk_geom->tx_boff_y[cu_ptr->tx_depth][context_ptr->txb_itr] >> 2, 0, context_ptr->blk_geom->bsize, txb_origin_x, txb_origin_y, context_ptr->cu_origin_x, context_ptr->cu_origin_y, 0, 0); } // Encode Transform Unit -INTRA- uint8_t cb_qp = cu_ptr->qp; Av1EncodeLoopFunctionTable[is16bit]( picture_control_set_ptr, context_ptr, sb_ptr, txb_origin_x, txb_origin_y, cb_qp, recon_buffer, coeff_buffer_sb, residual_buffer, transform_buffer, inverse_quant_buffer, transform_inner_array_ptr, asm_type, count_non_zero_coeffs, PICTURE_BUFFER_DESC_LUMA_MASK, 0, cu_ptr->delta_qp > 0 ? 0 : dZoffset, eobs[context_ptr->txb_itr], cuPlane); #if CABAC_UP if (picture_control_set_ptr->update_cdf) { ModeDecisionCandidateBuffer **candidateBufferPtrArrayBase = context_ptr->md_context->candidate_buffer_ptr_array; ModeDecisionCandidateBuffer **candidate_buffer_ptr_array = &(candidateBufferPtrArrayBase[0]); ModeDecisionCandidateBuffer *candidateBuffer; // Set the Candidate Buffer candidateBuffer = candidate_buffer_ptr_array[0]; // Rate estimation function uses the values from CandidatePtr. The right values are copied from cu_ptr to CandidatePtr #if ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[context_ptr->txb_itr] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type_uv = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV]; #else candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_Y] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_UV] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV]; #endif candidateBuffer->candidate_ptr->type = cu_ptr->prediction_mode_flag; candidateBuffer->candidate_ptr->pred_mode = cu_ptr->pred_mode; const uint32_t coeff1dOffset = context_ptr->coded_area_sb; av1_tu_estimate_coeff_bits( #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context, #endif 1,//allow_update_cdf, &picture_control_set_ptr->ec_ctx_array[tbAddr], picture_control_set_ptr, candidateBuffer, cu_ptr, coeff1dOffset, context_ptr->coded_area_sb_uv, coeff_est_entropy_coder_ptr, coeff_buffer_sb, eobs[context_ptr->txb_itr][0], eobs[context_ptr->txb_itr][1], eobs[context_ptr->txb_itr][2], &y_tu_coeff_bits, &cb_tu_coeff_bits, &cr_tu_coeff_bits, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #if ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[context_ptr->txb_itr], candidateBuffer->candidate_ptr->transform_type_uv, #endif COMPONENT_LUMA, asm_type); } #endif Av1EncodeGenerateReconFunctionPtr[is16bit]( context_ptr, txb_origin_x, txb_origin_y, recon_buffer, inverse_quant_buffer, transform_inner_array_ptr, PICTURE_BUFFER_DESC_LUMA_MASK, eobs[context_ptr->txb_itr], asm_type); // Update Recon Samples-INTRA- EncodePassUpdateReconSampleNeighborArrays( ep_luma_recon_neighbor_array, ep_cb_recon_neighbor_array, ep_cr_recon_neighbor_array, recon_buffer, txb_origin_x, txb_origin_y, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], PICTURE_BUFFER_DESC_LUMA_MASK, is16bit); context_ptr->coded_area_sb += context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr] * context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr]; #if DC_SIGN_CONTEXT_EP // TBD // Update the luma Dc Sign Level Coeff Neighbor Array { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[0][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, txb_origin_x, txb_origin_y, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } #endif } // Transform Loop // Chroma path if(context_ptr->blk_geom->has_uv) { context_ptr->txb_itr = 0; uint16_t txb_origin_x = context_ptr->cu_origin_x + context_ptr->blk_geom->tx_boff_x[cu_ptr->tx_depth][context_ptr->txb_itr]; uint16_t txb_origin_y = context_ptr->cu_origin_y + context_ptr->blk_geom->tx_boff_y[cu_ptr->tx_depth][context_ptr->txb_itr]; uint32_t cu_originx_uv = (context_ptr->cu_origin_x >> 3 << 3) >> 1; uint32_t cu_originy_uv = (context_ptr->cu_origin_y >> 3 << 3) >> 1; #if DC_SIGN_CONTEXT_EP #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->cb_txb_skip_context = 0; context_ptr->md_context->cb_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->cb_txb_skip_context, &context_ptr->md_context->cb_dc_sign_context); context_ptr->md_context->cr_txb_skip_context = 0; context_ptr->md_context->cr_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[context_ptr->cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->cr_txb_skip_context, &context_ptr->md_context->cr_dc_sign_context); #else cu_ptr->cb_txb_skip_context = 0; cu_ptr->cb_dc_sign_context = 0; get_txb_ctx( COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], &cu_ptr->cb_txb_skip_context, &cu_ptr->cb_dc_sign_context); cu_ptr->cr_txb_skip_context = 0; cu_ptr->cr_dc_sign_context = 0; get_txb_ctx( COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[context_ptr->cu_ptr->tx_depth][context_ptr->txb_itr], &cu_ptr->cr_txb_skip_context, &cu_ptr->cr_dc_sign_context); #endif #endif if (is16bit) { uint16_t topNeighArray[64 * 2 + 1]; uint16_t leftNeighArray[64 * 2 + 1]; PredictionMode mode; int32_t plane_end = 2; for (int32_t plane = 1; plane <= plane_end; ++plane) { TxSize tx_size = plane ? context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr] : context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; if (plane == 1) { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, (uint16_t*)(ep_cb_recon_neighbor_array->top_array) + cu_originx_uv, context_ptr->blk_geom->bwidth_uv * 2 * sizeof(uint16_t)); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, (uint16_t*)(ep_cb_recon_neighbor_array->left_array) + cu_originy_uv, context_ptr->blk_geom->bheight_uv * 2 * sizeof(uint16_t)); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ((uint16_t*)(ep_cb_recon_neighbor_array->top_left_array) + MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv)[0]; } else if (plane == 2) { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, (uint16_t*)(ep_cr_recon_neighbor_array->top_array) + cu_originx_uv, context_ptr->blk_geom->bwidth_uv * 2 * sizeof(uint16_t)); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, (uint16_t*)(ep_cr_recon_neighbor_array->left_array) + cu_originy_uv, context_ptr->blk_geom->bheight_uv * 2 * sizeof(uint16_t)); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ((uint16_t*)(ep_cr_recon_neighbor_array->top_left_array) + MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv)[0]; } mode = (pu_ptr->intra_chroma_mode == UV_CFL_PRED) ? (PredictionMode)UV_DC_PRED : (PredictionMode)pu_ptr->intra_chroma_mode; av1_predict_intra_block_16bit( &sb_ptr->tile_info, context_ptr, picture_control_set_ptr->parent_pcs_ptr->av1_cm, plane ? context_ptr->blk_geom->bwidth_uv : context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], plane ? context_ptr->blk_geom->bheight_uv : context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], tx_size, mode, #if SEARCH_UV_MODE // conformance plane ? pu_ptr->angle_delta[PLANE_TYPE_UV] : pu_ptr->angle_delta[PLANE_TYPE_Y], #else plane ? 0 : pu_ptr->angle_delta[PLANE_TYPE_Y], #endif 0, FILTER_INTRA_MODES, topNeighArray + 1, leftNeighArray + 1, recon_buffer, //int32_t dst_stride, 0, 0, plane, context_ptr->blk_geom->bsize, plane ? context_ptr->cu_origin_x : context_ptr->cu_origin_x, plane ? context_ptr->cu_origin_y : context_ptr->cu_origin_y); } } else { uint8_t topNeighArray[64 * 2 + 1]; uint8_t leftNeighArray[64 * 2 + 1]; PredictionMode mode; // Partition Loop int32_t plane_end = 2; for (int32_t plane = 1; plane <= plane_end; ++plane) { TxSize tx_size = plane ? context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr] : context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; if (plane == 1) { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, ep_cb_recon_neighbor_array->top_array + cu_originx_uv, context_ptr->blk_geom->bwidth_uv * 2); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, ep_cb_recon_neighbor_array->left_array + cu_originy_uv, context_ptr->blk_geom->bheight_uv * 2); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ep_cb_recon_neighbor_array->top_left_array[MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv]; } else { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, ep_cr_recon_neighbor_array->top_array + cu_originx_uv, context_ptr->blk_geom->bwidth_uv * 2); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, ep_cr_recon_neighbor_array->left_array + cu_originy_uv, context_ptr->blk_geom->bheight_uv * 2); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ep_cr_recon_neighbor_array->top_left_array[MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv]; } mode = (pu_ptr->intra_chroma_mode == UV_CFL_PRED) ? (PredictionMode)UV_DC_PRED : (PredictionMode)pu_ptr->intra_chroma_mode; // Hsan: if CHROMA_MODE_2, then CFL will be evaluated @ EP as no CHROMA @ MD // If that's the case then you should ensure than the 1st chroma prediction uses UV_DC_PRED (that's the default configuration for CHROMA_MODE_2 if CFL applicable (set @ fast loop candidates injection) then MD assumes chroma mode always UV_DC_PRED) av1_predict_intra_block( &sb_ptr->tile_info, ED_STAGE, context_ptr->blk_geom, picture_control_set_ptr->parent_pcs_ptr->av1_cm, plane ? context_ptr->blk_geom->bwidth_uv : context_ptr->blk_geom->bwidth, plane ? context_ptr->blk_geom->bheight_uv : context_ptr->blk_geom->bheight, tx_size, mode, #if SEARCH_UV_MODE // conformance plane ? pu_ptr->angle_delta[PLANE_TYPE_UV] : pu_ptr->angle_delta[PLANE_TYPE_Y], #else plane ? 0 : pu_ptr->angle_delta[PLANE_TYPE_Y], #endif 0, FILTER_INTRA_MODES, topNeighArray + 1, leftNeighArray + 1, recon_buffer, plane ? 0 : context_ptr->blk_geom->tx_boff_x[cu_ptr->tx_depth][context_ptr->txb_itr] >> 2, plane ? 0 : context_ptr->blk_geom->tx_boff_y[cu_ptr->tx_depth][context_ptr->txb_itr] >> 2, plane, context_ptr->blk_geom->bsize, txb_origin_x, txb_origin_y, plane ? context_ptr->cu_origin_x : context_ptr->cu_origin_x, plane ? context_ptr->cu_origin_y : context_ptr->cu_origin_y, 0, 0); } } // Encode Transform Unit -INTRA- uint8_t cb_qp = cu_ptr->qp; Av1EncodeLoopFunctionTable[is16bit]( picture_control_set_ptr, context_ptr, sb_ptr, txb_origin_x, txb_origin_y, cb_qp, recon_buffer, coeff_buffer_sb, residual_buffer, transform_buffer, inverse_quant_buffer, transform_inner_array_ptr, asm_type, count_non_zero_coeffs, PICTURE_BUFFER_DESC_CHROMA_MASK, 0, cu_ptr->delta_qp > 0 ? 0 : dZoffset, eobs[context_ptr->txb_itr], cuPlane); #if CABAC_UP if (picture_control_set_ptr->update_cdf) { ModeDecisionCandidateBuffer **candidateBufferPtrArrayBase = context_ptr->md_context->candidate_buffer_ptr_array; ModeDecisionCandidateBuffer **candidate_buffer_ptr_array = &(candidateBufferPtrArrayBase[0]); ModeDecisionCandidateBuffer *candidateBuffer; // Set the Candidate Buffer candidateBuffer = candidate_buffer_ptr_array[0]; // Rate estimation function uses the values from CandidatePtr. The right values are copied from cu_ptr to CandidatePtr #if ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[context_ptr->txb_itr] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type_uv = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV]; #else candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_Y] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_UV] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV]; #endif candidateBuffer->candidate_ptr->type = cu_ptr->prediction_mode_flag; candidateBuffer->candidate_ptr->pred_mode = cu_ptr->pred_mode; const uint32_t coeff1dOffset = context_ptr->coded_area_sb; av1_tu_estimate_coeff_bits( #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context, #endif 1,//allow_update_cdf, &picture_control_set_ptr->ec_ctx_array[tbAddr], picture_control_set_ptr, candidateBuffer, cu_ptr, coeff1dOffset, context_ptr->coded_area_sb_uv, coeff_est_entropy_coder_ptr, coeff_buffer_sb, eobs[context_ptr->txb_itr][0], eobs[context_ptr->txb_itr][1], eobs[context_ptr->txb_itr][2], &y_tu_coeff_bits, &cb_tu_coeff_bits, &cr_tu_coeff_bits, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #if ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[context_ptr->txb_itr], candidateBuffer->candidate_ptr->transform_type_uv, #endif COMPONENT_CHROMA, asm_type); } #endif Av1EncodeGenerateReconFunctionPtr[is16bit]( context_ptr, txb_origin_x, txb_origin_y, recon_buffer, inverse_quant_buffer, transform_inner_array_ptr, PICTURE_BUFFER_DESC_CHROMA_MASK, eobs[context_ptr->txb_itr], asm_type); // Update Recon Samples-INTRA- EncodePassUpdateReconSampleNeighborArrays( ep_luma_recon_neighbor_array, ep_cb_recon_neighbor_array, ep_cr_recon_neighbor_array, recon_buffer, txb_origin_x, txb_origin_y, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], PICTURE_BUFFER_DESC_CHROMA_MASK, is16bit); context_ptr->coded_area_sb_uv += context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr] * context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr]; #if DC_SIGN_CONTEXT_EP // TBD // Update the cb Dc Sign Level Coeff Neighbor Array { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[1][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cr DC Sign Level Coeff Neighbor Array { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[2][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } #endif } // Transform Loop for (context_ptr->txb_itr = 0; context_ptr->txb_itr < totTu; context_ptr->txb_itr++) { uint8_t uv_pass = cu_ptr->tx_depth && context_ptr->txb_itr ? 0 : 1; if (context_ptr->blk_geom->has_uv && uv_pass) { cu_ptr->block_has_coeff = cu_ptr->block_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff; if (cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff) cu_ptr->transform_unit_array[0].u_has_coeff = EB_TRUE; if (cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff) cu_ptr->transform_unit_array[0].v_has_coeff = EB_TRUE; } else { cu_ptr->block_has_coeff = cu_ptr->block_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff; } } // Transform Loop } #endif /******************************************* * Encode Pass * * Summary: Performs a H.265 conformant * reconstruction based on the LCU * mode decision. * * Inputs: * SourcePic * Coding Results * SB Location * Sequence Control Set * Picture Control Set * * Outputs: * Reconstructed Samples * Coefficient Samples * *******************************************/ EB_EXTERN void av1_encode_pass( SequenceControlSet *sequence_control_set_ptr, PictureControlSet *picture_control_set_ptr, LargestCodingUnit *sb_ptr, uint32_t tbAddr, uint32_t sb_origin_x, uint32_t sb_origin_y, #if !MEMORY_FOOTPRINT_OPT uint32_t sb_qp, #endif EncDecContext *context_ptr) { EbBool is16bit = context_ptr->is16bit; EbPictureBufferDesc *recon_buffer = is16bit ? picture_control_set_ptr->recon_picture16bit_ptr : picture_control_set_ptr->recon_picture_ptr; EbPictureBufferDesc *coeff_buffer_sb = sb_ptr->quantized_coeff; EbPictureBufferDesc *inputPicture; ModeDecisionContext *mdcontextPtr; mdcontextPtr = context_ptr->md_context; inputPicture = context_ptr->input_samples = (EbPictureBufferDesc*)picture_control_set_ptr->parent_pcs_ptr->enhanced_picture_ptr; SbStat *sb_stat_ptr = &(picture_control_set_ptr->parent_pcs_ptr->sb_stat_array[tbAddr]); #if !MEMORY_FOOTPRINT_OPT EbBool availableCoeff; // QP Neighbor Arrays EbBool isDeltaQpNotCoded = EB_TRUE; #endif // SB Stats uint32_t sb_width = MIN(sequence_control_set_ptr->sb_size_pix, sequence_control_set_ptr->seq_header.max_frame_width - sb_origin_x); uint32_t sb_height = MIN(sequence_control_set_ptr->sb_size_pix, sequence_control_set_ptr->seq_header.max_frame_height - sb_origin_y); // MV merge mode uint32_t y_has_coeff; uint32_t u_has_coeff; uint32_t v_has_coeff; EbAsm asm_type = sequence_control_set_ptr->encode_context_ptr->asm_type; uint64_t y_coeff_bits; uint64_t cb_coeff_bits; uint64_t cr_coeff_bits; uint64_t y_full_distortion[DIST_CALC_TOTAL]; uint64_t yTuFullDistortion[DIST_CALC_TOTAL]; uint32_t count_non_zero_coeffs[3]; MacroblockPlane cuPlane[3]; uint16_t eobs[MAX_TXB_COUNT][3]; uint64_t y_tu_coeff_bits; uint64_t cb_tu_coeff_bits; uint64_t cr_tu_coeff_bits; EncodeContext *encode_context_ptr; #if !MEMORY_FOOTPRINT_OPT uint32_t lcuRowIndex = sb_origin_y / BLOCK_SIZE_64; #endif // Dereferencing early NeighborArrayUnit *ep_mode_type_neighbor_array = picture_control_set_ptr->ep_mode_type_neighbor_array; NeighborArrayUnit *ep_intra_luma_mode_neighbor_array = picture_control_set_ptr->ep_intra_luma_mode_neighbor_array; NeighborArrayUnit *ep_intra_chroma_mode_neighbor_array = picture_control_set_ptr->ep_intra_chroma_mode_neighbor_array; NeighborArrayUnit *ep_mv_neighbor_array = picture_control_set_ptr->ep_mv_neighbor_array; NeighborArrayUnit *ep_luma_recon_neighbor_array = is16bit ? picture_control_set_ptr->ep_luma_recon_neighbor_array16bit : picture_control_set_ptr->ep_luma_recon_neighbor_array; NeighborArrayUnit *ep_cb_recon_neighbor_array = is16bit ? picture_control_set_ptr->ep_cb_recon_neighbor_array16bit : picture_control_set_ptr->ep_cb_recon_neighbor_array; NeighborArrayUnit *ep_cr_recon_neighbor_array = is16bit ? picture_control_set_ptr->ep_cr_recon_neighbor_array16bit : picture_control_set_ptr->ep_cr_recon_neighbor_array; NeighborArrayUnit *ep_skip_flag_neighbor_array = picture_control_set_ptr->ep_skip_flag_neighbor_array; EbBool constrained_intra_flag = picture_control_set_ptr->constrained_intra_flag; #if LOOP_FILTER_FIX EbBool dlfEnableFlag = (EbBool) picture_control_set_ptr->parent_pcs_ptr->loop_filter_mode; #else EbBool dlfEnableFlag = (EbBool)(picture_control_set_ptr->parent_pcs_ptr->loop_filter_mode && (picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag || sequence_control_set_ptr->static_config.recon_enabled || sequence_control_set_ptr->static_config.stat_report)); #endif const EbBool isIntraLCU = picture_control_set_ptr->limit_intra ? EB_FALSE : EB_TRUE; EbBool doRecon = (EbBool)( (picture_control_set_ptr->limit_intra == 0 || isIntraLCU == 1) || picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag || sequence_control_set_ptr->static_config.recon_enabled || sequence_control_set_ptr->static_config.stat_report); EntropyCoder *coeff_est_entropy_coder_ptr = picture_control_set_ptr->coeff_est_entropy_coder_ptr; uint32_t dZoffset = 0; #if !MEMORY_FOOTPRINT_OPT if (!sb_stat_ptr->stationary_edge_over_time_flag && sequence_control_set_ptr->static_config.improve_sharpness && picture_control_set_ptr->parent_pcs_ptr->pic_noise_class < PIC_NOISE_CLASS_3_1) { int16_t cuDeltaQp = (int16_t)(sb_ptr->qp - picture_control_set_ptr->parent_pcs_ptr->average_qp); uint32_t dzCondition = cuDeltaQp > 0 ? 0 : 1; if (sequence_control_set_ptr->input_resolution == INPUT_SIZE_4K_RANGE) { if (!(picture_control_set_ptr->parent_pcs_ptr->is_pan || (picture_control_set_ptr->parent_pcs_ptr->non_moving_index_average < 10 && sb_ptr->aura_status_iii) || (sb_stat_ptr->cu_stat_array[0].skin_area) || #if !DISABLE_OIS_USE (picture_control_set_ptr->parent_pcs_ptr->intra_coded_block_probability > 90) || #endif (picture_control_set_ptr->parent_pcs_ptr->high_dark_area_density_flag))) { if (picture_control_set_ptr->slice_type != I_SLICE && picture_control_set_ptr->temporal_layer_index == 0 && #if !DISABLE_OIS_USE picture_control_set_ptr->parent_pcs_ptr->intra_coded_block_probability > 60 && #endif !picture_control_set_ptr->parent_pcs_ptr->is_tilt && picture_control_set_ptr->parent_pcs_ptr->pic_homogenous_over_time_sb_percentage > 40) { dZoffset = 10; } if (dzCondition) { if (picture_control_set_ptr->scene_caracteristic_id == EB_FRAME_CARAC_1) { if (picture_control_set_ptr->slice_type == I_SLICE) dZoffset = sb_stat_ptr->cu_stat_array[0].grass_area ? 10 : dZoffset; else if (picture_control_set_ptr->temporal_layer_index == 0) dZoffset = sb_stat_ptr->cu_stat_array[0].grass_area ? 9 : dZoffset; else if (picture_control_set_ptr->temporal_layer_index == 1) dZoffset = sb_stat_ptr->cu_stat_array[0].grass_area ? 5 : dZoffset; } } } } } #endif #if MEMORY_FOOTPRINT_OPT context_ptr->skip_qpm_flag = EB_TRUE; #else if (sequence_control_set_ptr->static_config.improve_sharpness) { QpmDeriveBeaAndSkipQpmFlagLcu( sequence_control_set_ptr, picture_control_set_ptr, sb_ptr, tbAddr, context_ptr); } else context_ptr->skip_qpm_flag = EB_TRUE; #endif encode_context_ptr = ((SequenceControlSet*)(picture_control_set_ptr->sequence_control_set_wrapper_ptr->object_ptr))->encode_context_ptr; if (picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag == EB_TRUE) //get the 16bit form of the input LCU if (is16bit) recon_buffer = ((EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr)->reference_picture16bit; else recon_buffer = ((EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr)->reference_picture; else // non ref pictures recon_buffer = is16bit ? picture_control_set_ptr->recon_picture16bit_ptr : picture_control_set_ptr->recon_picture_ptr; EbBool use_delta_qp = (EbBool)sequence_control_set_ptr->static_config.improve_sharpness; EbBool oneSegment = (sequence_control_set_ptr->enc_dec_segment_col_count_array[picture_control_set_ptr->temporal_layer_index] == 1) && (sequence_control_set_ptr->enc_dec_segment_row_count_array[picture_control_set_ptr->temporal_layer_index] == 1); EbBool useDeltaQpSegments = oneSegment ? 0 : (EbBool)sequence_control_set_ptr->static_config.improve_sharpness; // DeriveZeroLumaCbf EbBool highIntraRef = EB_FALSE; EbBool checkZeroLumaCbf = EB_FALSE; if (is16bit) { //SB128_TODO change 10bit SB creation if ((sequence_control_set_ptr->static_config.ten_bit_format == 1) || (sequence_control_set_ptr->static_config.compressed_ten_bit_format == 1)) { const uint32_t input_luma_offset = ((sb_origin_y + inputPicture->origin_y) * inputPicture->stride_y) + (sb_origin_x + inputPicture->origin_x); const uint32_t input_cb_offset = (((sb_origin_y + inputPicture->origin_y) >> 1) * inputPicture->stride_cb) + ((sb_origin_x + inputPicture->origin_x) >> 1); const uint32_t input_cr_offset = (((sb_origin_y + inputPicture->origin_y) >> 1) * inputPicture->stride_cr) + ((sb_origin_x + inputPicture->origin_x) >> 1); const uint16_t luma2BitWidth = inputPicture->width / 4; const uint16_t chroma2BitWidth = inputPicture->width / 8; compressed_pack_lcu( inputPicture->buffer_y + input_luma_offset, inputPicture->stride_y, inputPicture->buffer_bit_inc_y + sb_origin_y * luma2BitWidth + (sb_origin_x / 4)*sb_height, sb_width / 4, (uint16_t *)context_ptr->input_sample16bit_buffer->buffer_y, context_ptr->input_sample16bit_buffer->stride_y, sb_width, sb_height, asm_type); compressed_pack_lcu( inputPicture->buffer_cb + input_cb_offset, inputPicture->stride_cb, inputPicture->buffer_bit_inc_cb + sb_origin_y / 2 * chroma2BitWidth + (sb_origin_x / 8)*(sb_height / 2), sb_width / 8, (uint16_t *)context_ptr->input_sample16bit_buffer->buffer_cb, context_ptr->input_sample16bit_buffer->stride_cb, sb_width >> 1, sb_height >> 1, asm_type); compressed_pack_lcu( inputPicture->buffer_cr + input_cr_offset, inputPicture->stride_cr, inputPicture->buffer_bit_inc_cr + sb_origin_y / 2 * chroma2BitWidth + (sb_origin_x / 8)*(sb_height / 2), sb_width / 8, (uint16_t *)context_ptr->input_sample16bit_buffer->buffer_cr, context_ptr->input_sample16bit_buffer->stride_cr, sb_width >> 1, sb_height >> 1, asm_type); } else { const uint32_t input_luma_offset = ((sb_origin_y + inputPicture->origin_y) * inputPicture->stride_y) + (sb_origin_x + inputPicture->origin_x); const uint32_t inputBitIncLumaOffset = ((sb_origin_y + inputPicture->origin_y) * inputPicture->stride_bit_inc_y) + (sb_origin_x + inputPicture->origin_x); const uint32_t input_cb_offset = (((sb_origin_y + inputPicture->origin_y) >> 1) * inputPicture->stride_cb) + ((sb_origin_x + inputPicture->origin_x) >> 1); const uint32_t inputBitIncCbOffset = (((sb_origin_y + inputPicture->origin_y) >> 1) * inputPicture->stride_bit_inc_cb) + ((sb_origin_x + inputPicture->origin_x) >> 1); const uint32_t input_cr_offset = (((sb_origin_y + inputPicture->origin_y) >> 1) * inputPicture->stride_cr) + ((sb_origin_x + inputPicture->origin_x) >> 1); const uint32_t inputBitIncCrOffset = (((sb_origin_y + inputPicture->origin_y) >> 1) * inputPicture->stride_bit_inc_cr) + ((sb_origin_x + inputPicture->origin_x) >> 1); pack2d_src( inputPicture->buffer_y + input_luma_offset, inputPicture->stride_y, inputPicture->buffer_bit_inc_y + inputBitIncLumaOffset, inputPicture->stride_bit_inc_y, (uint16_t *)context_ptr->input_sample16bit_buffer->buffer_y, context_ptr->input_sample16bit_buffer->stride_y, sb_width, sb_height, asm_type); pack2d_src( inputPicture->buffer_cb + input_cb_offset, inputPicture->stride_cr, inputPicture->buffer_bit_inc_cb + inputBitIncCbOffset, inputPicture->stride_bit_inc_cr, (uint16_t *)context_ptr->input_sample16bit_buffer->buffer_cb, context_ptr->input_sample16bit_buffer->stride_cb, sb_width >> 1, sb_height >> 1, asm_type); pack2d_src( inputPicture->buffer_cr + input_cr_offset, inputPicture->stride_cr, inputPicture->buffer_bit_inc_cr + inputBitIncCrOffset, inputPicture->stride_bit_inc_cr, (uint16_t *)context_ptr->input_sample16bit_buffer->buffer_cr, context_ptr->input_sample16bit_buffer->stride_cr, sb_width >> 1, sb_height >> 1, asm_type); } Store16bitInputSrc(context_ptr, picture_control_set_ptr, sb_origin_x, sb_origin_y, sb_width, sb_height); } if ((sequence_control_set_ptr->input_resolution == INPUT_SIZE_4K_RANGE) && !picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag) { if (!((sb_stat_ptr->stationary_edge_over_time_flag) || (picture_control_set_ptr->parent_pcs_ptr->logo_pic_flag))) { if (picture_control_set_ptr->slice_type == B_SLICE) { #if MRP_MD EbReferenceObject *refObjL0 = (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_0][0]->object_ptr; EbReferenceObject *refObjL1 = (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_1][0]->object_ptr; #else EbReferenceObject *refObjL0 = (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_0]->object_ptr; EbReferenceObject *refObjL1 = (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_1]->object_ptr; #endif uint32_t const TH = (sequence_control_set_ptr->static_config.frame_rate >> 16) < 50 ? 25 : 30; if ((refObjL0->tmp_layer_idx == 2 && refObjL0->intra_coded_area > TH) || (refObjL1->tmp_layer_idx == 2 && refObjL1->intra_coded_area > TH)) highIntraRef = EB_TRUE; } if (highIntraRef == EB_FALSE) checkZeroLumaCbf = EB_TRUE; } } context_ptr->intra_coded_area_sb[tbAddr] = 0; #if !PF_N2_SUPPORT context_ptr->trans_coeff_shape_luma = 0; context_ptr->trans_coeff_shape_chroma = 0; #endif context_ptr->coded_area_sb = 0; context_ptr->coded_area_sb_uv = 0; #if AV1_LF if (dlfEnableFlag && picture_control_set_ptr->parent_pcs_ptr->loop_filter_mode == 1){ if (tbAddr == 0) { av1_loop_filter_init(picture_control_set_ptr); av1_pick_filter_level( 0, (EbPictureBufferDesc*)picture_control_set_ptr->parent_pcs_ptr->enhanced_picture_ptr, picture_control_set_ptr, LPF_PICK_FROM_Q); av1_loop_filter_frame_init(picture_control_set_ptr, 0, 3); } } #endif #if ADD_DELTA_QP_SUPPORT if (context_ptr->skip_qpm_flag == EB_FALSE && sequence_control_set_ptr->static_config.improve_sharpness) { Av1QpModulationLcu( sequence_control_set_ptr, picture_control_set_ptr, sb_ptr, tbAddr, picture_control_set_ptr->slice_type == I_SLICE ? INTRA_MODE : INTER_MODE, context_ptr); } #endif #if CABAC_UP uint8_t allow_update_cdf = picture_control_set_ptr->update_cdf; #endif uint32_t final_cu_itr = 0; // CU Loop uint32_t blk_it = 0; while (blk_it < sequence_control_set_ptr->max_block_cnt) { CodingUnit *cu_ptr = context_ptr->cu_ptr = &context_ptr->md_context->md_cu_arr_nsq[blk_it]; PartitionType part = cu_ptr->part; const BlockGeom * blk_geom = context_ptr->blk_geom = get_blk_geom_mds(blk_it); UNUSED(blk_geom); sb_ptr->cu_partition_array[blk_it] = context_ptr->md_context->md_cu_arr_nsq[blk_it].part; #if INCOMPLETE_SB_FIX if (part != PARTITION_SPLIT && sequence_control_set_ptr->sb_geom[tbAddr].block_is_allowed[blk_it]) { #else if (part != PARTITION_SPLIT) { #endif int32_t offset_d1 = ns_blk_offset[(int32_t)part]; //cu_ptr->best_d1_blk; // TOCKECK int32_t num_d1_block = ns_blk_num[(int32_t)part]; // context_ptr->blk_geom->totns; // TOCKECK // for (int32_t d1_itr = blk_it; d1_itr < blk_it + num_d1_block; d1_itr++) { for (int32_t d1_itr = (int32_t)blk_it + offset_d1; d1_itr < (int32_t)blk_it + offset_d1 + num_d1_block; d1_itr++) { const BlockGeom * blk_geom = context_ptr->blk_geom = get_blk_geom_mds(d1_itr); // PU Stack variables PredictionUnit *pu_ptr = (PredictionUnit *)EB_NULL; // done EbPictureBufferDesc *residual_buffer = context_ptr->residual_buffer; EbPictureBufferDesc *transform_buffer = context_ptr->transform_buffer; EbPictureBufferDesc *inverse_quant_buffer = context_ptr->inverse_quant_buffer; int16_t *transform_inner_array_ptr = context_ptr->transform_inner_array_ptr; CodingUnit *cu_ptr = context_ptr->cu_ptr = &context_ptr->md_context->md_cu_arr_nsq[d1_itr]; context_ptr->cu_origin_x = (uint16_t)(sb_origin_x + blk_geom->origin_x); context_ptr->cu_origin_y = (uint16_t)(sb_origin_y + blk_geom->origin_y); cu_ptr->delta_qp = 0; #if BLK_SKIP_DECISION context_ptr->md_skip_blk = context_ptr->md_context->blk_skip_decision ? ((cu_ptr->prediction_mode_flag == INTRA_MODE || cu_ptr->block_has_coeff) ? 0 : 1) : 0; #endif cu_ptr->block_has_coeff = 0; // if(picture_control_set_ptr->picture_number==4 && context_ptr->cu_origin_x==0 && context_ptr->cu_origin_y==0) // printf("CHEDD"); uint32_t coded_area_org = context_ptr->coded_area_sb; uint32_t coded_area_org_uv = context_ptr->coded_area_sb_uv; // Derive disable_cfl_flag as evaluate_cfl_ep = f(disable_cfl_flag) EbBool disable_cfl_flag = (context_ptr->blk_geom->sq_size > 32 || context_ptr->blk_geom->bwidth == 4 || context_ptr->blk_geom->bheight == 4) ? EB_TRUE : EB_FALSE; // Evaluate cfl @ EP if applicable, and not done @ MD context_ptr->evaluate_cfl_ep = (disable_cfl_flag == EB_FALSE && context_ptr->md_context->chroma_level == CHROMA_MODE_2); #if ADD_DELTA_QP_SUPPORT if (context_ptr->skip_qpm_flag == EB_FALSE && sequence_control_set_ptr->static_config.improve_sharpness) { cu_ptr->qp = sb_ptr->qp; cu_ptr->delta_qp = sb_ptr->delta_qp; cu_ptr->org_delta_qp = sb_ptr->org_delta_qp; } else { uint16_t picture_qp = picture_control_set_ptr->parent_pcs_ptr->base_qindex; sb_ptr->qp = picture_qp; cu_ptr->qp = sb_ptr->qp; cu_ptr->delta_qp = 0; cu_ptr->org_delta_qp = 0; } #else // for now, segmentation independent of sharpness/delta QP. if(picture_control_set_ptr->parent_pcs_ptr->segmentation_params.segmentation_enabled){ apply_segmentation_based_quantization( blk_geom, picture_control_set_ptr, sb_ptr, cu_ptr); sb_ptr->qp = cu_ptr->qp; } else{ cu_ptr->qp = (sequence_control_set_ptr->static_config.improve_sharpness) ? context_ptr->qpm_qp : picture_control_set_ptr->picture_qp; sb_ptr->qp = (sequence_control_set_ptr->static_config.improve_sharpness) ? context_ptr->qpm_qp : picture_control_set_ptr->picture_qp; } #endif #if !MEMORY_FOOTPRINT_OPT #if !ADD_DELTA_QP_SUPPORT //CHKN remove usage of depth if (!context_ptr->skip_qpm_flag && (sequence_control_set_ptr->static_config.improve_sharpness) && (0xFF <= picture_control_set_ptr->dif_cu_delta_qp_depth)) { EncQpmDeriveDeltaQPForEachLeafLcu( sequence_control_set_ptr, picture_control_set_ptr, sb_ptr, tbAddr, cu_ptr, 0xFF, //This is obviously not ok d1_itr, // TOCHECK OMK context_ptr->blk_geom->bwidth, // TOCHECK cu_ptr->prediction_mode_flag, context_ptr->cu_stats->parent32x32_index, // TOCHECK not valid context_ptr); } #endif #endif if (cu_ptr->prediction_mode_flag == INTRA_MODE) { context_ptr->is_inter = cu_ptr->av1xd->use_intrabc; context_ptr->tot_intra_coded_area += blk_geom->bwidth* blk_geom->bheight; if (picture_control_set_ptr->slice_type != I_SLICE) context_ptr->intra_coded_area_sb[tbAddr] += blk_geom->bwidth* blk_geom->bheight; // *Note - Transforms are the same size as predictions // Partition Loop context_ptr->txb_itr = 0; #if ATB_EP // Transform partitioning path (INTRA Luma/Chroma) if (picture_control_set_ptr->parent_pcs_ptr->atb_mode && cu_ptr->av1xd->use_intrabc == 0) { // Set the PU Loop Variables pu_ptr = cu_ptr->prediction_unit_array; // Generate Intra Luma Neighbor Modes GeneratePuIntraLumaNeighborModes( cu_ptr, context_ptr->cu_origin_x, context_ptr->cu_origin_y, BLOCK_SIZE_64, ep_intra_luma_mode_neighbor_array, ep_intra_chroma_mode_neighbor_array, ep_mode_type_neighbor_array); perform_intra_coding_loop( sequence_control_set_ptr, picture_control_set_ptr, sb_ptr, tbAddr, cu_ptr, pu_ptr, context_ptr, dZoffset); // Update the Intra-specific Neighbor Arrays EncodePassUpdateIntraModeNeighborArrays( ep_mode_type_neighbor_array, ep_intra_luma_mode_neighbor_array, ep_intra_chroma_mode_neighbor_array, (uint8_t)cu_ptr->pred_mode, (uint8_t)pu_ptr->intra_chroma_mode, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight, context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK); } // Transform partitioning free patch (except the 128x128 case) else #endif { // Set the PU Loop Variables pu_ptr = cu_ptr->prediction_unit_array; // Generate Intra Luma Neighbor Modes GeneratePuIntraLumaNeighborModes( // HT done cu_ptr, context_ptr->cu_origin_x, context_ptr->cu_origin_y, BLOCK_SIZE_64, ep_intra_luma_mode_neighbor_array, ep_intra_chroma_mode_neighbor_array, ep_mode_type_neighbor_array); { uint32_t cu_originy_uv = (context_ptr->cu_origin_y >> 3 << 3) >> 1; uint32_t cu_originx_uv = (context_ptr->cu_origin_x >> 3 << 3) >> 1; #if DC_SIGN_CONTEXT_EP #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->luma_txb_skip_context = 0; context_ptr->md_context->luma_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[0][0], &context_ptr->md_context->luma_txb_skip_context, &context_ptr->md_context->luma_dc_sign_context); if (context_ptr->blk_geom->has_uv) { context_ptr->md_context->cb_txb_skip_context = 0; context_ptr->md_context->cb_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[0][0], &context_ptr->md_context->cb_txb_skip_context, &context_ptr->md_context->cb_dc_sign_context); context_ptr->md_context->cr_txb_skip_context = 0; context_ptr->md_context->cr_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[0][0], &context_ptr->md_context->cr_txb_skip_context, &context_ptr->md_context->cr_dc_sign_context); } #else context_ptr->cu_ptr->luma_txb_skip_context = 0; context_ptr->cu_ptr->luma_dc_sign_context[context_ptr->txb_itr] = 0; get_txb_ctx( COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[0][0], &context_ptr->cu_ptr->luma_txb_skip_context, &context_ptr->cu_ptr->luma_dc_sign_context[0]); if (context_ptr->blk_geom->has_uv) { cu_ptr->cb_txb_skip_context = 0; cu_ptr->cb_dc_sign_context = 0; get_txb_ctx( COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[0][0], &cu_ptr->cb_txb_skip_context, &cu_ptr->cb_dc_sign_context); cu_ptr->cr_txb_skip_context = 0; cu_ptr->cr_dc_sign_context = 0; get_txb_ctx( COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[0][0], &cu_ptr->cr_txb_skip_context, &cu_ptr->cr_dc_sign_context); } #endif #endif if (cu_ptr->av1xd->use_intrabc) { MvReferenceFrame ref_frame = INTRA_FRAME; generate_av1_mvp_table( &sb_ptr->tile_info, context_ptr->md_context, cu_ptr, context_ptr->blk_geom, context_ptr->cu_origin_x, context_ptr->cu_origin_y, &ref_frame, 1, picture_control_set_ptr); IntMv nearestmv, nearmv; av1_find_best_ref_mvs_from_stack(0, context_ptr->md_context->md_local_cu_unit[blk_geom->blkidx_mds].ed_ref_mv_stack, cu_ptr->av1xd, ref_frame, &nearestmv, &nearmv, 0); if (nearestmv.as_int == INVALID_MV) nearestmv.as_int = 0; if (nearmv.as_int == INVALID_MV) nearmv.as_int = 0; IntMv dv_ref = nearestmv.as_int == 0 ? nearmv : nearestmv; if (dv_ref.as_int == 0) av1_find_ref_dv(&dv_ref, &cu_ptr->av1xd->tile, sequence_control_set_ptr->seq_header.sb_mi_size, context_ptr->cu_origin_y >> MI_SIZE_LOG2, context_ptr->cu_origin_x >> MI_SIZE_LOG2); // Ref DV should not have sub-pel. assert((dv_ref.as_mv.col & 7) == 0); assert((dv_ref.as_mv.row & 7) == 0); context_ptr->md_context->md_local_cu_unit[blk_geom->blkidx_mds].ed_ref_mv_stack[INTRA_FRAME][0].this_mv = dv_ref; cu_ptr->predmv[0] = dv_ref; //keep final usefull mvp for entropy memcpy(cu_ptr->av1xd->final_ref_mv_stack, context_ptr->md_context->md_local_cu_unit[context_ptr->blk_geom->blkidx_mds].ed_ref_mv_stack[cu_ptr->prediction_unit_array[0].ref_frame_type], sizeof(CandidateMv)*MAX_REF_MV_STACK_SIZE); pu_ptr = cu_ptr->prediction_unit_array; // Set MvUnit context_ptr->mv_unit.pred_direction = (uint8_t)pu_ptr->inter_pred_direction_index; context_ptr->mv_unit.mv[REF_LIST_0].mv_union = pu_ptr->mv[REF_LIST_0].mv_union; context_ptr->mv_unit.mv[REF_LIST_1].mv_union = pu_ptr->mv[REF_LIST_1].mv_union; EbPictureBufferDesc * ref_pic_list0 = ((EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr)->reference_picture; if (is16bit) ref_pic_list0 = ((EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr)->reference_picture16bit; if (is16bit) av1_inter_prediction_hbd( picture_control_set_ptr, cu_ptr->prediction_unit_array->ref_frame_type, cu_ptr, &context_ptr->mv_unit, 1,//intrabc context_ptr->cu_origin_x, context_ptr->cu_origin_y, blk_geom->bwidth, blk_geom->bheight, ref_pic_list0, 0, recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, (uint8_t)sequence_control_set_ptr->static_config.encoder_bit_depth, asm_type); else av1_inter_prediction( picture_control_set_ptr, cu_ptr->interp_filters, cu_ptr, cu_ptr->prediction_unit_array->ref_frame_type, &context_ptr->mv_unit, 1,// use_intrabc, context_ptr->cu_origin_x, context_ptr->cu_origin_y, blk_geom->bwidth, blk_geom->bheight, ref_pic_list0, 0, recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, EB_TRUE, asm_type); } else { if (is16bit) { uint16_t topNeighArray[64 * 2 + 1]; uint16_t leftNeighArray[64 * 2 + 1]; PredictionMode mode; int32_t plane_end = blk_geom->has_uv ? 2 : 0; for (int32_t plane = 0; plane <= plane_end; ++plane) { #if ATB_SUPPORT TxSize tx_size = plane ? blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr] : blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; #else TxSize tx_size = plane ? blk_geom->txsize_uv[context_ptr->txb_itr] : blk_geom->txsize[context_ptr->txb_itr]; #endif if (plane == 0) { if (context_ptr->cu_origin_y != 0) memcpy(topNeighArray + 1, (uint16_t*)(ep_luma_recon_neighbor_array->top_array) + context_ptr->cu_origin_x, blk_geom->bwidth * 2 * sizeof(uint16_t)); if (context_ptr->cu_origin_x != 0) memcpy(leftNeighArray + 1, (uint16_t*)(ep_luma_recon_neighbor_array->left_array) + context_ptr->cu_origin_y, blk_geom->bheight * 2 * sizeof(uint16_t)); if (context_ptr->cu_origin_y != 0 && context_ptr->cu_origin_x != 0) topNeighArray[0] = leftNeighArray[0] = ((uint16_t*)(ep_luma_recon_neighbor_array->top_left_array) + MAX_PICTURE_HEIGHT_SIZE + context_ptr->cu_origin_x - context_ptr->cu_origin_y)[0]; } else if (plane == 1) { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, (uint16_t*)(ep_cb_recon_neighbor_array->top_array) + cu_originx_uv, blk_geom->bwidth_uv * 2 * sizeof(uint16_t)); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, (uint16_t*)(ep_cb_recon_neighbor_array->left_array) + cu_originy_uv, blk_geom->bheight_uv * 2 * sizeof(uint16_t)); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ((uint16_t*)(ep_cb_recon_neighbor_array->top_left_array) + MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv)[0]; } else { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, (uint16_t*)(ep_cr_recon_neighbor_array->top_array) + cu_originx_uv, blk_geom->bwidth_uv * 2 * sizeof(uint16_t)); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, (uint16_t*)(ep_cr_recon_neighbor_array->left_array) + cu_originy_uv, blk_geom->bheight_uv * 2 * sizeof(uint16_t)); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ((uint16_t*)(ep_cr_recon_neighbor_array->top_left_array) + MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv)[0]; } if (plane) mode = (pu_ptr->intra_chroma_mode == UV_CFL_PRED) ? (PredictionMode)UV_DC_PRED : (PredictionMode)pu_ptr->intra_chroma_mode; else mode = cu_ptr->pred_mode; //PredictionMode mode, av1_predict_intra_block_16bit( &sb_ptr->tile_info, context_ptr, picture_control_set_ptr->parent_pcs_ptr->av1_cm, //const Av1Common *cm, plane ? blk_geom->bwidth_uv : blk_geom->bwidth, //int32_t wpx, plane ? blk_geom->bheight_uv : blk_geom->bheight, //int32_t hpx, tx_size, mode, //PredictionMode mode, #if SEARCH_UV_MODE // conformance plane ? pu_ptr->angle_delta[PLANE_TYPE_UV] : pu_ptr->angle_delta[PLANE_TYPE_Y], #else plane ? 0 : pu_ptr->angle_delta[PLANE_TYPE_Y], //int32_t angle_delta, #endif 0, //int32_t use_palette, FILTER_INTRA_MODES, //CHKN FilterIntraMode filter_intra_mode, topNeighArray + 1, leftNeighArray + 1, recon_buffer, //uint8_t *dst, //int32_t dst_stride, 0, //int32_t col_off, 0, //int32_t row_off, plane, //int32_t plane, blk_geom->bsize, //uint32_t puSize, context_ptr->cu_origin_x, //uint32_t cuOrgX, context_ptr->cu_origin_y); //uint32_t cuOrgY } } else { uint8_t topNeighArray[64 * 2 + 1]; uint8_t leftNeighArray[64 * 2 + 1]; PredictionMode mode; // Partition Loop int32_t plane_end = blk_geom->has_uv ? 2 : 0; for (int32_t plane = 0; plane <= plane_end; ++plane) { #if ATB_SUPPORT TxSize tx_size = plane ? blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr] : blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; #else TxSize tx_size = plane ? blk_geom->txsize_uv[context_ptr->txb_itr] : blk_geom->txsize[context_ptr->txb_itr]; #endif if (plane == 0) { if (context_ptr->cu_origin_y != 0) memcpy(topNeighArray + 1, ep_luma_recon_neighbor_array->top_array + context_ptr->cu_origin_x, blk_geom->bwidth * 2); if (context_ptr->cu_origin_x != 0) memcpy(leftNeighArray + 1, ep_luma_recon_neighbor_array->left_array + context_ptr->cu_origin_y, blk_geom->bheight * 2); if (context_ptr->cu_origin_y != 0 && context_ptr->cu_origin_x != 0) topNeighArray[0] = leftNeighArray[0] = ep_luma_recon_neighbor_array->top_left_array[MAX_PICTURE_HEIGHT_SIZE + context_ptr->cu_origin_x - context_ptr->cu_origin_y]; } else if (plane == 1) { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, ep_cb_recon_neighbor_array->top_array + cu_originx_uv, blk_geom->bwidth_uv * 2); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, ep_cb_recon_neighbor_array->left_array + cu_originy_uv, blk_geom->bheight_uv * 2); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ep_cb_recon_neighbor_array->top_left_array[MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv]; } else { if (cu_originy_uv != 0) memcpy(topNeighArray + 1, ep_cr_recon_neighbor_array->top_array + cu_originx_uv, blk_geom->bwidth_uv * 2); if (cu_originx_uv != 0) memcpy(leftNeighArray + 1, ep_cr_recon_neighbor_array->left_array + cu_originy_uv, blk_geom->bheight_uv * 2); if (cu_originy_uv != 0 && cu_originx_uv != 0) topNeighArray[0] = leftNeighArray[0] = ep_cr_recon_neighbor_array->top_left_array[MAX_PICTURE_HEIGHT_SIZE / 2 + cu_originx_uv - cu_originy_uv]; } if (plane) mode = (pu_ptr->intra_chroma_mode == UV_CFL_PRED) ? (PredictionMode)UV_DC_PRED : (PredictionMode)pu_ptr->intra_chroma_mode; else mode = cu_ptr->pred_mode; //PredictionMode mode, // Hsan: if CHROMA_MODE_2, then CFL will be evaluated @ EP as no CHROMA @ MD // If that's the case then you should ensure than the 1st chroma prediction uses UV_DC_PRED (that's the default configuration for CHROMA_MODE_2 if CFL applicable (set @ fast loop candidates injection) then MD assumes chroma mode always UV_DC_PRED) av1_predict_intra_block( &sb_ptr->tile_info, ED_STAGE, context_ptr->blk_geom, picture_control_set_ptr->parent_pcs_ptr->av1_cm, //const Av1Common *cm, plane ? blk_geom->bwidth_uv : blk_geom->bwidth, //int32_t wpx, plane ? blk_geom->bheight_uv : blk_geom->bheight, //int32_t hpx, tx_size, mode, //PredictionMode mode, #if SEARCH_UV_MODE // conformance plane ? pu_ptr->angle_delta[PLANE_TYPE_UV] : pu_ptr->angle_delta[PLANE_TYPE_Y], #else plane ? 0 : pu_ptr->angle_delta[PLANE_TYPE_Y], //int32_t angle_delta, #endif 0, //int32_t use_palette, FILTER_INTRA_MODES, //CHKN FilterIntraMode filter_intra_mode, topNeighArray + 1, leftNeighArray + 1, recon_buffer, //uint8_t *dst, //int32_t dst_stride, 0, //int32_t col_off, 0, //int32_t row_off, plane, //int32_t plane, blk_geom->bsize, //uint32_t puSize, #if ATB_EP context_ptr->cu_origin_x, context_ptr->cu_origin_y, #endif context_ptr->cu_origin_x, context_ptr->cu_origin_y, 0, // MD ONLY - NOT USED BY ENCDEC 0); } } } // Encode Transform Unit -INTRA- { uint8_t cb_qp = cu_ptr->qp; Av1EncodeLoopFunctionTable[is16bit]( picture_control_set_ptr, context_ptr, sb_ptr, context_ptr->cu_origin_x, context_ptr->cu_origin_y, cb_qp, recon_buffer, coeff_buffer_sb, residual_buffer, transform_buffer, inverse_quant_buffer, transform_inner_array_ptr, asm_type, count_non_zero_coeffs, blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, useDeltaQpSegments, cu_ptr->delta_qp > 0 ? 0 : dZoffset, eobs[context_ptr->txb_itr], cuPlane); #if CABAC_UP if(allow_update_cdf) { ModeDecisionCandidateBuffer **candidateBufferPtrArrayBase = context_ptr->md_context->candidate_buffer_ptr_array; ModeDecisionCandidateBuffer **candidate_buffer_ptr_array = &(candidateBufferPtrArrayBase[0]); ModeDecisionCandidateBuffer *candidateBuffer; // Set the Candidate Buffer candidateBuffer = candidate_buffer_ptr_array[0]; // Rate estimation function uses the values from CandidatePtr. The right values are copied from cu_ptr to CandidatePtr #if !ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_Y] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_UV] = cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV]; #endif candidateBuffer->candidate_ptr->type = cu_ptr->prediction_mode_flag; candidateBuffer->candidate_ptr->pred_mode = cu_ptr->pred_mode; const uint32_t coeff1dOffset = context_ptr->coded_area_sb; av1_tu_estimate_coeff_bits( #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context, #endif 1,//allow_update_cdf, &picture_control_set_ptr->ec_ctx_array[tbAddr], picture_control_set_ptr, candidateBuffer, cu_ptr, coeff1dOffset, context_ptr->coded_area_sb_uv, coeff_est_entropy_coder_ptr, coeff_buffer_sb, eobs[context_ptr->txb_itr][0], eobs[context_ptr->txb_itr][1], eobs[context_ptr->txb_itr][2], &y_tu_coeff_bits, &cb_tu_coeff_bits, &cr_tu_coeff_bits, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif #if ATB_TX_TYPE_SUPPORT_PER_TU cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y], cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV], #endif context_ptr->blk_geom->has_uv ? COMPONENT_ALL : COMPONENT_LUMA, asm_type); } #endif //intra mode Av1EncodeGenerateReconFunctionPtr[is16bit]( context_ptr, context_ptr->cu_origin_x, context_ptr->cu_origin_y, recon_buffer, inverse_quant_buffer, transform_inner_array_ptr, blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, eobs[context_ptr->txb_itr], asm_type); } // Update the Intra-specific Neighbor Arrays EncodePassUpdateIntraModeNeighborArrays( ep_mode_type_neighbor_array, ep_intra_luma_mode_neighbor_array, ep_intra_chroma_mode_neighbor_array, (uint8_t)cu_ptr->pred_mode, (uint8_t)pu_ptr->intra_chroma_mode, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight, context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK); // Update Recon Samples-INTRA- EncodePassUpdateReconSampleNeighborArrays( ep_luma_recon_neighbor_array, ep_cb_recon_neighbor_array, ep_cr_recon_neighbor_array, recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight, context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, is16bit); #if DC_SIGN_CONTEXT_EP // TBD // Update the luma Dc Sign Level Coeff Neighbor Array { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[0][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight, NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cb Dc Sign Level Coeff Neighbor Array if (context_ptr->blk_geom->has_uv) { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[1][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(context_ptr->cu_origin_x) >> 1, ROUND_UV(context_ptr->cu_origin_y) >> 1, context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cr DC Sign Level Coeff Neighbor Array if (context_ptr->blk_geom->has_uv) { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[2][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(context_ptr->cu_origin_x) >> 1, ROUND_UV(context_ptr->cu_origin_y) >> 1, context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } #endif if (context_ptr->blk_geom->has_uv) { cu_ptr->block_has_coeff = cu_ptr->block_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff; if (cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff) cu_ptr->transform_unit_array[0].u_has_coeff = EB_TRUE; if (cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff) cu_ptr->transform_unit_array[0].v_has_coeff = EB_TRUE; } else { cu_ptr->block_has_coeff = cu_ptr->block_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff; } } // Transform Loop #if !ATB_EP } // Partition Loop #endif context_ptr->coded_area_sb += blk_geom->bwidth * blk_geom->bheight; if (blk_geom->has_uv) context_ptr->coded_area_sb_uv += blk_geom->bwidth_uv * blk_geom->bheight_uv; #if ATB_EP } #endif } // Inter else if (cu_ptr->prediction_mode_flag == INTER_MODE) { context_ptr->is_inter = 1; #if MRP_MD int8_t ref_idx_l0 = (&cu_ptr->prediction_unit_array[0])->ref_frame_index_l0; int8_t ref_idx_l1 = (&cu_ptr->prediction_unit_array[0])->ref_frame_index_l1; #if MRP_MD_UNI_DIR_BIPRED MvReferenceFrame rf[2]; av1_set_ref_frame(rf, (&cu_ptr->prediction_unit_array[0])->ref_frame_type); uint8_t list_idx0, list_idx1; list_idx0 = get_list_idx(rf[0]); if (rf[1] == NONE_FRAME) list_idx1 = get_list_idx(rf[0]); else list_idx1 = get_list_idx(rf[1]); EbReferenceObject* refObj0 = ref_idx_l0 >= 0 ? (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[list_idx0][ref_idx_l0]->object_ptr : (EbReferenceObject*)EB_NULL; EbReferenceObject* refObj1 = ref_idx_l1 >= 0 ? (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[list_idx1][ref_idx_l1]->object_ptr : (EbReferenceObject*)EB_NULL; #else EbReferenceObject_t* refObj0 = ref_idx_l0 >= 0 ? (EbReferenceObject_t*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_0][ref_idx_l0]->object_ptr : (EbReferenceObject_t*)EB_NULL; EbReferenceObject_t* refObj1 = ref_idx_l1 >= 0 ? (EbReferenceObject_t*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_1][ref_idx_l1]->object_ptr : (EbReferenceObject_t*)EB_NULL; #endif #else EbReferenceObject* refObj0 = (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_0]->object_ptr; EbReferenceObject* refObj1 = picture_control_set_ptr->slice_type == B_SLICE ? (EbReferenceObject*)picture_control_set_ptr->ref_pic_ptr_array[REF_LIST_1]->object_ptr : 0; #endif uint16_t txb_origin_x; uint16_t txb_origin_y; EbBool isCuSkip = EB_FALSE; //******************************** // INTER //******************************** EbBool zeroLumaCbfMD = EB_FALSE; //EbBool doLumaMC = EB_TRUE; EbBool doMVpred = EB_TRUE; //if QPM and Segments are used, First Cu in SB row should have at least one coeff. EbBool isFirstCUinRow = (use_delta_qp == 1) && !oneSegment && (context_ptr->cu_origin_x == 0 && context_ptr->cu_origin_y == sb_origin_y) ? EB_TRUE : EB_FALSE; zeroLumaCbfMD = (EbBool)(checkZeroLumaCbf && ((&cu_ptr->prediction_unit_array[0])->merge_flag == EB_FALSE && cu_ptr->block_has_coeff == 0 && isFirstCUinRow == EB_FALSE)); zeroLumaCbfMD = EB_FALSE; //Motion Compensation could be avoided in the case below EbBool doMC = EB_TRUE; // Perform Merge/Skip Decision if the mode coming from MD is merge. for the First CU in Row merge will remain as is. if (cu_ptr->prediction_unit_array[0].merge_flag == EB_TRUE) { if (isFirstCUinRow == EB_FALSE) isCuSkip = mdcontextPtr->md_ep_pipe_sb[cu_ptr->mds_idx].skip_cost <= mdcontextPtr->md_ep_pipe_sb[cu_ptr->mds_idx].merge_cost ? 1 : 0; } //MC could be avoided in some cases below if (isFirstCUinRow == EB_FALSE) { if (picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag == EB_FALSE && constrained_intra_flag == EB_TRUE && cu_ptr->prediction_unit_array[0].merge_flag == EB_TRUE) { if (isCuSkip) { //here merge is decided to be skip in nonRef frame. doMC = EB_FALSE; doMVpred = EB_FALSE; } } else if (picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag == EB_FALSE && constrained_intra_flag == EB_TRUE && zeroLumaCbfMD == EB_TRUE) { //MV mode with no Coeff in nonRef frame. doMC = EB_FALSE; } else if (picture_control_set_ptr->limit_intra && isIntraLCU == EB_FALSE) { if (isCuSkip) { doMC = EB_FALSE; doMVpred = EB_FALSE; } } } doMC = (EbBool)(doRecon | doMC); doMVpred = (EbBool)(doRecon | doMVpred); //IntMv predmv[2]; enc_pass_av1_mv_pred( &sb_ptr->tile_info, context_ptr->md_context, cu_ptr, blk_geom, context_ptr->cu_origin_x, context_ptr->cu_origin_y, picture_control_set_ptr, cu_ptr->prediction_unit_array[0].ref_frame_type, cu_ptr->prediction_unit_array[0].is_compound, cu_ptr->pred_mode, cu_ptr->predmv); //out1: predmv //out2: cu_ptr->inter_mode_ctx[ cu_ptr->prediction_unit_array[0].ref_frame_type ] //keep final usefull mvp for entropy memcpy(cu_ptr->av1xd->final_ref_mv_stack, context_ptr->md_context->md_local_cu_unit[context_ptr->blk_geom->blkidx_mds].ed_ref_mv_stack[cu_ptr->prediction_unit_array[0].ref_frame_type], sizeof(CandidateMv)*MAX_REF_MV_STACK_SIZE); { // 1st Partition Loop pu_ptr = cu_ptr->prediction_unit_array; // Set MvUnit context_ptr->mv_unit.pred_direction = (uint8_t)pu_ptr->inter_pred_direction_index; context_ptr->mv_unit.mv[REF_LIST_0].mv_union = pu_ptr->mv[REF_LIST_0].mv_union; context_ptr->mv_unit.mv[REF_LIST_1].mv_union = pu_ptr->mv[REF_LIST_1].mv_union; // Inter Prediction if (doMC && pu_ptr->motion_mode == WARPED_CAUSAL) { warped_motion_prediction( &context_ptr->mv_unit, context_ptr->cu_origin_x, context_ptr->cu_origin_y, cu_ptr, blk_geom, is16bit ? refObj0->reference_picture16bit : refObj0->reference_picture, recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, &cu_ptr->prediction_unit_array[0].wm_params, (uint8_t) sequence_control_set_ptr->static_config.encoder_bit_depth, EB_TRUE, asm_type); } if (doMC && pu_ptr->motion_mode != WARPED_CAUSAL) { if (is16bit) { av1_inter_prediction_hbd( picture_control_set_ptr, cu_ptr->prediction_unit_array->ref_frame_type, cu_ptr, &context_ptr->mv_unit, 0,// use_intrabc, context_ptr->cu_origin_x, context_ptr->cu_origin_y, blk_geom->bwidth, blk_geom->bheight, #if FIXED_MRP_10BIT cu_ptr->prediction_unit_array->ref_frame_index_l0 >= 0 ? refObj0->reference_picture16bit : (EbPictureBufferDesc*)EB_NULL, cu_ptr->prediction_unit_array->ref_frame_index_l1 >= 0 ? refObj1->reference_picture16bit : (EbPictureBufferDesc*)EB_NULL, #else refObj0->reference_picture16bit, picture_control_set_ptr->slice_type == B_SLICE ? refObj1->reference_picture16bit : 0, #endif recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, (uint8_t)sequence_control_set_ptr->static_config.encoder_bit_depth, asm_type); } else { av1_inter_prediction( picture_control_set_ptr, cu_ptr->interp_filters, cu_ptr, cu_ptr->prediction_unit_array->ref_frame_type, &context_ptr->mv_unit, 0,//use_intrabc, context_ptr->cu_origin_x, context_ptr->cu_origin_y, blk_geom->bwidth, blk_geom->bheight, #if MRP_MD cu_ptr->prediction_unit_array->ref_frame_index_l0 >= 0 ? refObj0->reference_picture : (EbPictureBufferDesc*)EB_NULL, cu_ptr->prediction_unit_array->ref_frame_index_l1 >= 0 ? refObj1->reference_picture : (EbPictureBufferDesc*)EB_NULL, #else refObj0->reference_picture, picture_control_set_ptr->slice_type == B_SLICE ? refObj1->reference_picture : 0, #endif recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, EB_TRUE, asm_type); } } } context_ptr->txb_itr = 0; // Transform Loop cu_ptr->transform_unit_array[0].y_has_coeff = EB_FALSE; cu_ptr->transform_unit_array[0].u_has_coeff = EB_FALSE; cu_ptr->transform_unit_array[0].v_has_coeff = EB_FALSE; // initialize TU Split y_full_distortion[DIST_CALC_RESIDUAL] = 0; y_full_distortion[DIST_CALC_PREDICTION] = 0; y_coeff_bits = 0; cb_coeff_bits = 0; cr_coeff_bits = 0; #if ATB_SUPPORT uint32_t totTu = context_ptr->blk_geom->txb_count[cu_ptr->tx_depth]; #else uint32_t totTu = context_ptr->blk_geom->txb_count; #endif uint8_t tuIt; uint8_t cb_qp = cu_ptr->qp; uint32_t component_mask = context_ptr->blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK; if (cu_ptr->prediction_unit_array[0].merge_flag == EB_FALSE) { for (uint8_t tuIt = 0; tuIt < totTu; tuIt++) { context_ptr->txb_itr = tuIt; #if ATB_SUPPORT uint8_t uv_pass = cu_ptr->tx_depth && tuIt ? 0 : 1; //NM: 128x128 exeption #endif #if ATB_SUPPORT txb_origin_x = context_ptr->cu_origin_x + context_ptr->blk_geom->tx_boff_x[cu_ptr->tx_depth][tuIt]; txb_origin_y = context_ptr->cu_origin_y + context_ptr->blk_geom->tx_boff_y[cu_ptr->tx_depth][tuIt]; #else txb_origin_x = context_ptr->cu_origin_x + context_ptr->blk_geom->tx_boff_x[tuIt]; txb_origin_y = context_ptr->cu_origin_y + context_ptr->blk_geom->tx_boff_y[tuIt]; #endif #if DC_SIGN_CONTEXT_EP #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->luma_txb_skip_context = 0; context_ptr->md_context->luma_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, txb_origin_x, txb_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->luma_txb_skip_context, &context_ptr->md_context->luma_dc_sign_context); if (context_ptr->blk_geom->has_uv && uv_pass) { context_ptr->md_context->cb_txb_skip_context = 0; context_ptr->md_context->cb_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[context_ptr->cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->cb_txb_skip_context, &context_ptr->md_context->cb_dc_sign_context); context_ptr->md_context->cr_txb_skip_context = 0; context_ptr->md_context->cr_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->cr_txb_skip_context, &context_ptr->md_context->cr_dc_sign_context); } #else context_ptr->cu_ptr->luma_txb_skip_context = 0; context_ptr->cu_ptr->luma_dc_sign_context[context_ptr->txb_itr] = 0; get_txb_ctx( COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, txb_origin_x, txb_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->cu_ptr->luma_txb_skip_context, &context_ptr->cu_ptr->luma_dc_sign_context[context_ptr->txb_itr]); if (context_ptr->blk_geom->has_uv && uv_pass) { uint32_t cu_originy_uv = (context_ptr->cu_origin_y >> 3 << 3) >> 1; uint32_t cu_originx_uv = (context_ptr->cu_origin_x >> 3 << 3) >> 1; cu_ptr->cb_txb_skip_context = 0; cu_ptr->cb_dc_sign_context = 0; get_txb_ctx( COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[context_ptr->cu_ptr->tx_depth][context_ptr->txb_itr], &cu_ptr->cb_txb_skip_context, &cu_ptr->cb_dc_sign_context); cu_ptr->cr_txb_skip_context = 0; cu_ptr->cr_dc_sign_context = 0; get_txb_ctx( COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, cu_originx_uv, cu_originy_uv, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], &cu_ptr->cr_txb_skip_context, &cu_ptr->cr_dc_sign_context); } #endif #endif if (!zeroLumaCbfMD) //inter mode 1 Av1EncodeLoopFunctionTable[is16bit]( picture_control_set_ptr, context_ptr, sb_ptr, txb_origin_x, //pic org txb_origin_y, cb_qp, recon_buffer, coeff_buffer_sb, residual_buffer, transform_buffer, inverse_quant_buffer, transform_inner_array_ptr, asm_type, count_non_zero_coeffs, #if ATB_SUPPORT context_ptr->blk_geom->has_uv && uv_pass ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, #else context_ptr->blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, #endif useDeltaQpSegments, cu_ptr->delta_qp > 0 ? 0 : dZoffset, eobs[context_ptr->txb_itr], cuPlane); // SKIP the CBF zero mode for DC path. There are problems with cost calculations #if PF_N2_SUPPORT { #else if (context_ptr->trans_coeff_shape_luma != ONLY_DC_SHAPE) { #endif // Compute Tu distortion if (!zeroLumaCbfMD) // LUMA DISTORTION picture_full_distortion32_bits( transform_buffer, context_ptr->coded_area_sb, 0, inverse_quant_buffer, context_ptr->coded_area_sb, 0, #if ATB_SUPPORT blk_geom->tx_width[cu_ptr->tx_depth][tuIt], blk_geom->tx_height[cu_ptr->tx_depth][tuIt], #else blk_geom->tx_width[tuIt], blk_geom->tx_height[tuIt], #endif context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, yTuFullDistortion, yTuFullDistortion, yTuFullDistortion, eobs[context_ptr->txb_itr][0], 0, 0, COMPONENT_LUMA, asm_type); #if ATB_SUPPORT TxSize txSize = blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr]; #else TxSize txSize = blk_geom->txsize[context_ptr->txb_itr]; #endif int32_t shift = (MAX_TX_SCALE - av1_get_tx_scale(txSize)) * 2; yTuFullDistortion[DIST_CALC_RESIDUAL] = RIGHT_SIGNED_SHIFT(yTuFullDistortion[DIST_CALC_RESIDUAL], shift); yTuFullDistortion[DIST_CALC_PREDICTION] = RIGHT_SIGNED_SHIFT(yTuFullDistortion[DIST_CALC_PREDICTION], shift); y_tu_coeff_bits = 0; cb_tu_coeff_bits = 0; cr_tu_coeff_bits = 0; if (!zeroLumaCbfMD) { ModeDecisionCandidateBuffer **candidateBufferPtrArrayBase = context_ptr->md_context->candidate_buffer_ptr_array; ModeDecisionCandidateBuffer **candidate_buffer_ptr_array = &(candidateBufferPtrArrayBase[0]); ModeDecisionCandidateBuffer *candidateBuffer; // Set the Candidate Buffer candidateBuffer = candidate_buffer_ptr_array[0]; // Rate estimation function uses the values from CandidatePtr. The right values are copied from cu_ptr to CandidatePtr #if !ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_Y] = cu_ptr->transform_unit_array[tuIt].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_UV] = cu_ptr->transform_unit_array[tuIt].transform_type[PLANE_TYPE_UV]; #endif candidateBuffer->candidate_ptr->type = cu_ptr->prediction_mode_flag; const uint32_t coeff1dOffset = context_ptr->coded_area_sb; av1_tu_estimate_coeff_bits( #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context, #endif #if CABAC_UP 0,//allow_update_cdf, NULL, #endif picture_control_set_ptr, candidateBuffer, cu_ptr, coeff1dOffset, context_ptr->coded_area_sb_uv, coeff_est_entropy_coder_ptr, coeff_buffer_sb, eobs[context_ptr->txb_itr][0], eobs[context_ptr->txb_itr][1], eobs[context_ptr->txb_itr][2], &y_tu_coeff_bits, &cb_tu_coeff_bits, &cr_tu_coeff_bits, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif #if ATB_TX_TYPE_SUPPORT_PER_TU cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y], cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV], #endif #if ATB_SUPPORT context_ptr->blk_geom->has_uv && uv_pass ? COMPONENT_ALL : COMPONENT_LUMA, #else context_ptr->blk_geom->has_uv ? COMPONENT_ALL : COMPONENT_LUMA, #endif asm_type); } // CBF Tu decision if (zeroLumaCbfMD == EB_FALSE) av1_encode_tu_calc_cost( context_ptr, count_non_zero_coeffs, yTuFullDistortion, &y_tu_coeff_bits, component_mask); else { cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff = 0; cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff = 0; cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff = 0; } // Update count_non_zero_coeffs after CBF decision if (cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff == EB_FALSE) count_non_zero_coeffs[0] = 0; #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) { #else if (context_ptr->blk_geom->has_uv) { #endif if (cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff == EB_FALSE) count_non_zero_coeffs[1] = 0; if (cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff == EB_FALSE) count_non_zero_coeffs[2] = 0; } // Update TU count_non_zero_coeffs cu_ptr->transform_unit_array[context_ptr->txb_itr].nz_coef_count[0] = (uint16_t)count_non_zero_coeffs[0]; cu_ptr->transform_unit_array[context_ptr->txb_itr].nz_coef_count[1] = (uint16_t)count_non_zero_coeffs[1]; cu_ptr->transform_unit_array[context_ptr->txb_itr].nz_coef_count[2] = (uint16_t)count_non_zero_coeffs[2]; y_coeff_bits += y_tu_coeff_bits; #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) { #else if (context_ptr->blk_geom->has_uv) { #endif cb_coeff_bits += cb_tu_coeff_bits; cr_coeff_bits += cr_tu_coeff_bits; } y_full_distortion[DIST_CALC_RESIDUAL] += yTuFullDistortion[DIST_CALC_RESIDUAL]; y_full_distortion[DIST_CALC_PREDICTION] += yTuFullDistortion[DIST_CALC_PREDICTION]; #if CABAC_UP if (allow_update_cdf) { ModeDecisionCandidateBuffer **candidateBufferPtrArrayBase = context_ptr->md_context->candidate_buffer_ptr_array; ModeDecisionCandidateBuffer **candidate_buffer_ptr_array = &(candidateBufferPtrArrayBase[0]); ModeDecisionCandidateBuffer *candidateBuffer; // Set the Candidate Buffer candidateBuffer = candidate_buffer_ptr_array[0]; // Rate estimation function uses the values from CandidatePtr. The right values are copied from cu_ptr to CandidatePtr #if !ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_Y] = cu_ptr->transform_unit_array[tuIt].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_UV] = cu_ptr->transform_unit_array[tuIt].transform_type[PLANE_TYPE_UV]; #endif candidateBuffer->candidate_ptr->type = cu_ptr->prediction_mode_flag; candidateBuffer->candidate_ptr->pred_mode = cu_ptr->pred_mode; const uint32_t coeff1dOffset = context_ptr->coded_area_sb; //CHKN add updating eobs[] after CBF decision if (cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff == EB_FALSE) eobs[context_ptr->txb_itr][0] = 0; #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) { #else if (context_ptr->blk_geom->has_uv) { #endif if (cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff == EB_FALSE) eobs[context_ptr->txb_itr][1] = 0; if (cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff == EB_FALSE) eobs[context_ptr->txb_itr][2] = 0; } av1_tu_estimate_coeff_bits( #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context, #endif 1,//allow_update_cdf, &picture_control_set_ptr->ec_ctx_array[tbAddr], picture_control_set_ptr, candidateBuffer, cu_ptr, coeff1dOffset, context_ptr->coded_area_sb_uv, coeff_est_entropy_coder_ptr, coeff_buffer_sb, eobs[context_ptr->txb_itr][0], eobs[context_ptr->txb_itr][1], eobs[context_ptr->txb_itr][2], &y_tu_coeff_bits, &cb_tu_coeff_bits, &cr_tu_coeff_bits, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif #if ATB_TX_TYPE_SUPPORT_PER_TU cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y], cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV], #endif #if ATB_SUPPORT context_ptr->blk_geom->has_uv && uv_pass ? COMPONENT_ALL : COMPONENT_LUMA, #else context_ptr->blk_geom->has_uv ? COMPONENT_ALL : COMPONENT_LUMA, #endif asm_type); } #endif } #if ATB_SUPPORT context_ptr->coded_area_sb += blk_geom->tx_width[cu_ptr->tx_depth][tuIt] * blk_geom->tx_height[cu_ptr->tx_depth][tuIt]; #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) #else if (blk_geom->has_uv) #endif context_ptr->coded_area_sb_uv += blk_geom->tx_width_uv[cu_ptr->tx_depth][tuIt] * blk_geom->tx_height_uv[cu_ptr->tx_depth][tuIt]; #else context_ptr->coded_area_sb += blk_geom->tx_width[tuIt] * blk_geom->tx_height[tuIt]; if (blk_geom->has_uv) context_ptr->coded_area_sb_uv += blk_geom->tx_width_uv[tuIt] * blk_geom->tx_height_uv[tuIt]; #endif #if DC_SIGN_CONTEXT_EP // TBD // Update the luma Dc Sign Level Coeff Neighbor Array { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[0][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, txb_origin_x, txb_origin_y, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cb Dc Sign Level Coeff Neighbor Array if (context_ptr->blk_geom->has_uv && uv_pass) { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[1][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cr DC Sign Level Coeff Neighbor Array if (context_ptr->blk_geom->has_uv && uv_pass) { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[2][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } #endif } // Transform Loop } //Set Final CU data flags after skip/Merge decision. if (isFirstCUinRow == EB_FALSE) { if (cu_ptr->prediction_unit_array[0].merge_flag == EB_TRUE) { cu_ptr->skip_flag = (isCuSkip) ? EB_TRUE : EB_FALSE; cu_ptr->prediction_unit_array[0].merge_flag = (isCuSkip) ? EB_FALSE : EB_TRUE; } } // Initialize the Transform Loop context_ptr->txb_itr = 0; y_has_coeff = 0; u_has_coeff = 0; v_has_coeff = 0; #if ATB_SUPPORT totTu = context_ptr->blk_geom->txb_count[cu_ptr->tx_depth]; #else totTu = context_ptr->blk_geom->txb_count; #endif //reset coeff buffer offsets at the start of a new Tx loop context_ptr->coded_area_sb = coded_area_org; context_ptr->coded_area_sb_uv = coded_area_org_uv; for (tuIt = 0; tuIt < totTu; tuIt++) { #if ATB_SUPPORT uint8_t uv_pass = cu_ptr->tx_depth && tuIt ? 0 : 1; //NM: 128x128 exeption #endif context_ptr->txb_itr = tuIt; #if ATB_SUPPORT txb_origin_x = context_ptr->cu_origin_x + context_ptr->blk_geom->tx_boff_x[cu_ptr->tx_depth][tuIt]; txb_origin_y = context_ptr->cu_origin_y + context_ptr->blk_geom->tx_boff_y[cu_ptr->tx_depth][tuIt]; #else txb_origin_x = context_ptr->cu_origin_x + context_ptr->blk_geom->tx_boff_x[tuIt]; txb_origin_y = context_ptr->cu_origin_y + context_ptr->blk_geom->tx_boff_y[tuIt]; #endif #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context->luma_txb_skip_context = 0; context_ptr->md_context->luma_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_LUMA, picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, txb_origin_x, txb_origin_y, context_ptr->blk_geom->bsize, context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->luma_txb_skip_context, &context_ptr->md_context->luma_dc_sign_context); if (context_ptr->blk_geom->has_uv && uv_pass) { context_ptr->md_context->cb_txb_skip_context = 0; context_ptr->md_context->cb_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[context_ptr->cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->cb_txb_skip_context, &context_ptr->md_context->cb_dc_sign_context); context_ptr->md_context->cr_txb_skip_context = 0; context_ptr->md_context->cr_dc_sign_context = 0; get_txb_ctx( #if INCOMPLETE_SB_FIX picture_control_set_ptr->parent_pcs_ptr->sequence_control_set_ptr, #endif COMPONENT_CHROMA, picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->bsize_uv, context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], &context_ptr->md_context->cr_txb_skip_context, &context_ptr->md_context->cr_dc_sign_context); } #endif if (cu_ptr->skip_flag == EB_TRUE) { cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff = EB_FALSE; cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff = EB_FALSE; cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff = EB_FALSE; #if DC_SIGN_CONTEXT_EP context_ptr->cu_ptr->quantized_dc[0][context_ptr->txb_itr] = 0; context_ptr->cu_ptr->quantized_dc[1][context_ptr->txb_itr] = 0; context_ptr->cu_ptr->quantized_dc[2][context_ptr->txb_itr] = 0; #endif } else if ((&cu_ptr->prediction_unit_array[0])->merge_flag == EB_TRUE) { //inter mode 2 Av1EncodeLoopFunctionTable[is16bit]( picture_control_set_ptr, context_ptr, sb_ptr, txb_origin_x, //pic offset txb_origin_y, cb_qp, recon_buffer, coeff_buffer_sb, residual_buffer, transform_buffer, inverse_quant_buffer, transform_inner_array_ptr, asm_type, count_non_zero_coeffs, #if ATB_SUPPORT context_ptr->blk_geom->has_uv && uv_pass ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, #else context_ptr->blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, #endif useDeltaQpSegments, cu_ptr->delta_qp > 0 ? 0 : dZoffset, eobs[context_ptr->txb_itr], cuPlane); #if CABAC_UP if (allow_update_cdf) { ModeDecisionCandidateBuffer **candidateBufferPtrArrayBase = context_ptr->md_context->candidate_buffer_ptr_array; ModeDecisionCandidateBuffer **candidate_buffer_ptr_array = &(candidateBufferPtrArrayBase[0]); ModeDecisionCandidateBuffer *candidateBuffer; // Set the Candidate Buffer candidateBuffer = candidate_buffer_ptr_array[0]; // Rate estimation function uses the values from CandidatePtr. The right values are copied from cu_ptr to CandidatePtr #if !ATB_TX_TYPE_SUPPORT_PER_TU candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_Y] = cu_ptr->transform_unit_array[tuIt].transform_type[PLANE_TYPE_Y]; candidateBuffer->candidate_ptr->transform_type[PLANE_TYPE_UV] = cu_ptr->transform_unit_array[tuIt].transform_type[PLANE_TYPE_UV]; #endif candidateBuffer->candidate_ptr->type = cu_ptr->prediction_mode_flag; candidateBuffer->candidate_ptr->pred_mode = cu_ptr->pred_mode; const uint32_t coeff1dOffset = context_ptr->coded_area_sb; av1_tu_estimate_coeff_bits( #if FIXED_128x128_CONTEXT_UPDATE context_ptr->md_context, #endif 1,//allow_update_cdf, &picture_control_set_ptr->ec_ctx_array[tbAddr], picture_control_set_ptr, candidateBuffer, cu_ptr, coeff1dOffset, context_ptr->coded_area_sb_uv, coeff_est_entropy_coder_ptr, coeff_buffer_sb, eobs[context_ptr->txb_itr][0], eobs[context_ptr->txb_itr][1], eobs[context_ptr->txb_itr][2], &y_tu_coeff_bits, &cb_tu_coeff_bits, &cr_tu_coeff_bits, #if ATB_SUPPORT context_ptr->blk_geom->txsize[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[cu_ptr->tx_depth][context_ptr->txb_itr], #else context_ptr->blk_geom->txsize[context_ptr->txb_itr], context_ptr->blk_geom->txsize_uv[context_ptr->txb_itr], #endif #if ATB_TX_TYPE_SUPPORT_PER_TU cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_Y], cu_ptr->transform_unit_array[context_ptr->txb_itr].transform_type[PLANE_TYPE_UV], #endif #if ATB_SUPPORT context_ptr->blk_geom->has_uv && uv_pass ? COMPONENT_ALL : COMPONENT_LUMA, #else context_ptr->blk_geom->has_uv ? COMPONENT_ALL : COMPONENT_LUMA, #endif asm_type); } #endif } #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) { #else if (context_ptr->blk_geom->has_uv) { #endif cu_ptr->block_has_coeff = cu_ptr->block_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff; } else { cu_ptr->block_has_coeff = cu_ptr->block_has_coeff | cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff; } //inter mode if (doRecon) Av1EncodeGenerateReconFunctionPtr[is16bit]( context_ptr, txb_origin_x, //pic offset txb_origin_y, recon_buffer, inverse_quant_buffer, transform_inner_array_ptr, #if ATB_SUPPORT context_ptr->blk_geom->has_uv && uv_pass ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, #else context_ptr->blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, #endif eobs[context_ptr->txb_itr], asm_type); #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) { #else if (context_ptr->blk_geom->has_uv) { #endif y_has_coeff |= cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff; u_has_coeff |= cu_ptr->transform_unit_array[context_ptr->txb_itr].u_has_coeff; v_has_coeff |= cu_ptr->transform_unit_array[context_ptr->txb_itr].v_has_coeff; } else y_has_coeff |= cu_ptr->transform_unit_array[context_ptr->txb_itr].y_has_coeff; #if ATB_SUPPORT context_ptr->coded_area_sb += blk_geom->tx_width[cu_ptr->tx_depth][tuIt] * blk_geom->tx_height[cu_ptr->tx_depth][tuIt]; #if ATB_SUPPORT if (context_ptr->blk_geom->has_uv && uv_pass) #else if (blk_geom->has_uv) #endif context_ptr->coded_area_sb_uv += blk_geom->tx_width_uv[cu_ptr->tx_depth][tuIt] * blk_geom->tx_height_uv[cu_ptr->tx_depth][tuIt]; #else context_ptr->coded_area_sb += blk_geom->tx_width[tuIt] * blk_geom->tx_height[tuIt]; if (blk_geom->has_uv) context_ptr->coded_area_sb_uv += blk_geom->tx_width_uv[tuIt] * blk_geom->tx_height_uv[tuIt]; #endif #if DC_SIGN_CONTEXT_EP // TBD // Update the luma Dc Sign Level Coeff Neighbor Array { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[0][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_luma_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, txb_origin_x, txb_origin_y, context_ptr->blk_geom->tx_width[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cb Dc Sign Level Coeff Neighbor Array if (context_ptr->blk_geom->has_uv && uv_pass) { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[1][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cb_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } // Update the cr DC Sign Level Coeff Neighbor Array if (context_ptr->blk_geom->has_uv && uv_pass) { uint8_t dcSignLevelCoeff = (uint8_t)cu_ptr->quantized_dc[2][context_ptr->txb_itr]; neighbor_array_unit_mode_write( picture_control_set_ptr->ep_cr_dc_sign_level_coeff_neighbor_array, (uint8_t*)&dcSignLevelCoeff, ROUND_UV(txb_origin_x) >> 1, ROUND_UV(txb_origin_y) >> 1, context_ptr->blk_geom->tx_width_uv[cu_ptr->tx_depth][context_ptr->txb_itr], context_ptr->blk_geom->tx_height_uv[cu_ptr->tx_depth][context_ptr->txb_itr], NEIGHBOR_ARRAY_UNIT_TOP_AND_LEFT_ONLY_MASK); } #endif } // Transform Loop // Calculate Root CBF if (context_ptr->blk_geom->has_uv) cu_ptr->block_has_coeff = (y_has_coeff | u_has_coeff | v_has_coeff) ? EB_TRUE : EB_FALSE; else cu_ptr->block_has_coeff = (y_has_coeff) ? EB_TRUE : EB_FALSE; // Force Skip if MergeFlag == TRUE && RootCbf == 0 if (cu_ptr->skip_flag == EB_FALSE && cu_ptr->prediction_unit_array[0].merge_flag == EB_TRUE && cu_ptr->block_has_coeff == EB_FALSE) { cu_ptr->skip_flag = EB_TRUE; } { // Set the PU Loop Variables pu_ptr = cu_ptr->prediction_unit_array; // Set MvUnit context_ptr->mv_unit.pred_direction = (uint8_t)pu_ptr->inter_pred_direction_index; context_ptr->mv_unit.mv[REF_LIST_0].mv_union = pu_ptr->mv[REF_LIST_0].mv_union; context_ptr->mv_unit.mv[REF_LIST_1].mv_union = pu_ptr->mv[REF_LIST_1].mv_union; // Update Neighbor Arrays (Mode Type, mvs, SKIP) { uint8_t skip_flag = (uint8_t)cu_ptr->skip_flag; EncodePassUpdateInterModeNeighborArrays( ep_mode_type_neighbor_array, ep_mv_neighbor_array, ep_skip_flag_neighbor_array, &context_ptr->mv_unit, &skip_flag, context_ptr->cu_origin_x, context_ptr->cu_origin_y, blk_geom->bwidth, blk_geom->bheight); } } // 2nd Partition Loop // Update Recon Samples Neighbor Arrays -INTER- if (doRecon) EncodePassUpdateReconSampleNeighborArrays( ep_luma_recon_neighbor_array, ep_cb_recon_neighbor_array, ep_cr_recon_neighbor_array, recon_buffer, context_ptr->cu_origin_x, context_ptr->cu_origin_y, context_ptr->blk_geom->bwidth, context_ptr->blk_geom->bheight, context_ptr->blk_geom->bwidth_uv, context_ptr->blk_geom->bheight_uv, context_ptr->blk_geom->has_uv ? PICTURE_BUFFER_DESC_FULL_MASK : PICTURE_BUFFER_DESC_LUMA_MASK, is16bit); } else { CHECK_REPORT_ERROR_NC( encode_context_ptr->app_callback_ptr, EB_ENC_CL_ERROR2); } update_av1_mi_map( cu_ptr, context_ptr->cu_origin_x, context_ptr->cu_origin_y, blk_geom, picture_control_set_ptr); if (dlfEnableFlag) { #if !MEMORY_FOOTPRINT_OPT if (blk_geom->has_uv) { availableCoeff = (cu_ptr->prediction_mode_flag == INTER_MODE) ? (EbBool)cu_ptr->block_has_coeff : (cu_ptr->transform_unit_array[0].y_has_coeff || cu_ptr->transform_unit_array[0].v_has_coeff || cu_ptr->transform_unit_array[0].u_has_coeff) ? EB_TRUE : EB_FALSE; } else availableCoeff = (cu_ptr->transform_unit_array[0].y_has_coeff) ? EB_TRUE : EB_FALSE; // Assign the LCU-level QP //NM - To be revisited EncodePassUpdateQp( picture_control_set_ptr, context_ptr, availableCoeff, use_delta_qp, &isDeltaQpNotCoded, picture_control_set_ptr->dif_cu_delta_qp_depth, &(picture_control_set_ptr->enc_prev_coded_qp[oneSegment ? 0 : lcuRowIndex]), &(picture_control_set_ptr->enc_prev_quant_group_coded_qp[oneSegment ? 0 : lcuRowIndex]), sb_qp); #endif } { { // Set the PU Loop Variables pu_ptr = cu_ptr->prediction_unit_array; // Set MvUnit context_ptr->mv_unit.pred_direction = (uint8_t)pu_ptr->inter_pred_direction_index; context_ptr->mv_unit.mv[REF_LIST_0].mv_union = pu_ptr->mv[REF_LIST_0].mv_union; context_ptr->mv_unit.mv[REF_LIST_1].mv_union = pu_ptr->mv[REF_LIST_1].mv_union; } } { CodingUnit *src_cu = &context_ptr->md_context->md_cu_arr_nsq[d1_itr]; CodingUnit *dst_cu = &sb_ptr->final_cu_arr[final_cu_itr++]; move_cu_data(src_cu, dst_cu); } } blk_it += ns_depth_offset[sequence_control_set_ptr->seq_header.sb_size == BLOCK_128X128][context_ptr->blk_geom->depth]; } else blk_it += d1_depth_offset[sequence_control_set_ptr->seq_header.sb_size == BLOCK_128X128][context_ptr->blk_geom->depth]; } // CU Loop #if !MEMORY_FOOTPRINT_OPT sb_ptr->tot_final_cu = final_cu_itr; #endif #if AV1_LF // First Pass Deblocking if (dlfEnableFlag && picture_control_set_ptr->parent_pcs_ptr->loop_filter_mode == 1) { if (picture_control_set_ptr->parent_pcs_ptr->lf.filter_level[0] || picture_control_set_ptr->parent_pcs_ptr->lf.filter_level[1]) { uint8_t LastCol = ((sb_origin_x)+sb_width == sequence_control_set_ptr->seq_header.max_frame_width) ? 1 : 0; loop_filter_sb( recon_buffer, picture_control_set_ptr, NULL, sb_origin_y >> 2, sb_origin_x >> 2, 0, 3, LastCol); } } #endif return; } #if NO_ENCDEC EB_EXTERN void no_enc_dec_pass( SequenceControlSet *sequence_control_set_ptr, PictureControlSet *picture_control_set_ptr, LargestCodingUnit *sb_ptr, uint32_t tbAddr, uint32_t sb_origin_x, uint32_t sb_origin_y, uint32_t sb_qp, EncDecContext *context_ptr) { context_ptr->coded_area_sb = 0; context_ptr->coded_area_sb_uv = 0; uint32_t final_cu_itr = 0; uint32_t blk_it = 0; while (blk_it < sequence_control_set_ptr->max_block_cnt) { CodingUnit *cu_ptr = context_ptr->cu_ptr = &context_ptr->md_context->md_cu_arr_nsq[blk_it]; PartitionType part = cu_ptr->part; const BlockGeom * blk_geom = context_ptr->blk_geom = get_blk_geom_mds(blk_it); sb_ptr->cu_partition_array[blk_it] = context_ptr->md_context->md_cu_arr_nsq[blk_it].part; if (part != PARTITION_SPLIT) { int32_t offset_d1 = ns_blk_offset[(int32_t)part]; //cu_ptr->best_d1_blk; // TOCKECK int32_t num_d1_block = ns_blk_num[(int32_t)part]; // context_ptr->blk_geom->totns; // TOCKECK for (int32_t d1_itr = blk_it + offset_d1; d1_itr < blk_it + offset_d1 + num_d1_block; d1_itr++) { const BlockGeom * blk_geom = context_ptr->blk_geom = get_blk_geom_mds(d1_itr); CodingUnit *cu_ptr = context_ptr->cu_ptr = &context_ptr->md_context->md_cu_arr_nsq[d1_itr]; cu_ptr->delta_qp = 0; cu_ptr->qp = (sequence_control_set_ptr->static_config.improve_sharpness) ? context_ptr->qpm_qp : picture_control_set_ptr->picture_qp; sb_ptr->qp = (sequence_control_set_ptr->static_config.improve_sharpness) ? context_ptr->qpm_qp : picture_control_set_ptr->picture_qp; cu_ptr->org_delta_qp = cu_ptr->delta_qp; { CodingUnit *src_cu = &context_ptr->md_context->md_cu_arr_nsq[d1_itr]; CodingUnit *dst_cu = &sb_ptr->final_cu_arr[final_cu_itr++]; move_cu_data(src_cu, dst_cu); } //copy coeff int32_t txb_1d_offset = 0, txb_1d_offset_uv = 0; int32_t txb_itr = 0; do { uint32_t bwidth = context_ptr->blk_geom->tx_width[txb_itr] < 64 ? context_ptr->blk_geom->tx_width[txb_itr] : 32; uint32_t bheight = context_ptr->blk_geom->tx_height[txb_itr] < 64 ? context_ptr->blk_geom->tx_height[txb_itr] : 32; int32_t* src_ptr = &(((int32_t*)context_ptr->cu_ptr->coeff_tmp->buffer_y)[txb_1d_offset]); int32_t* dst_ptr = &(((int32_t*)sb_ptr->quantized_coeff->buffer_y)[context_ptr->coded_area_sb]); uint32_t j; for (j = 0; j < bheight; j++) memcpy(dst_ptr + j * bwidth, src_ptr + j * bwidth, bwidth * sizeof(int32_t)); if (context_ptr->blk_geom->has_uv) { // Cb bwidth = context_ptr->blk_geom->tx_width_uv[txb_itr]; bheight = context_ptr->blk_geom->tx_height_uv[txb_itr]; src_ptr = &(((int32_t*)context_ptr->cu_ptr->coeff_tmp->buffer_cb)[txb_1d_offset_uv]); dst_ptr = &(((int32_t*)sb_ptr->quantized_coeff->buffer_cb)[context_ptr->coded_area_sb_uv]); for (j = 0; j < bheight; j++) memcpy(dst_ptr + j * bwidth, src_ptr + j * bwidth, bwidth * sizeof(int32_t)); //Cr src_ptr = &(((int32_t*)context_ptr->cu_ptr->coeff_tmp->buffer_cr)[txb_1d_offset_uv]); dst_ptr = &(((int32_t*)sb_ptr->quantized_coeff->buffer_cr)[context_ptr->coded_area_sb_uv]); for (j = 0; j < bheight; j++) memcpy(dst_ptr + j * bwidth, src_ptr + j * bwidth, bwidth * sizeof(int32_t)); } context_ptr->coded_area_sb += context_ptr->blk_geom->tx_width[txb_itr] * context_ptr->blk_geom->tx_height[txb_itr]; if (context_ptr->blk_geom->has_uv) context_ptr->coded_area_sb_uv += context_ptr->blk_geom->tx_width_uv[txb_itr] * context_ptr->blk_geom->tx_height_uv[txb_itr]; txb_1d_offset += context_ptr->blk_geom->tx_width[txb_itr] * context_ptr->blk_geom->tx_height[txb_itr]; if (context_ptr->blk_geom->has_uv) txb_1d_offset_uv += context_ptr->blk_geom->tx_width_uv[txb_itr] * context_ptr->blk_geom->tx_height_uv[txb_itr]; txb_itr++; } while (txb_itr < context_ptr->blk_geom->txb_count); //copy recon { EbPictureBufferDesc *ref_pic; if (picture_control_set_ptr->parent_pcs_ptr->is_used_as_reference_flag) { EbReferenceObject* refObj = (EbReferenceObject*)picture_control_set_ptr->parent_pcs_ptr->reference_picture_wrapper_ptr->object_ptr; ref_pic = refObj->reference_picture; } else ref_pic = picture_control_set_ptr->recon_picture_ptr; context_ptr->cu_origin_x = sb_origin_x + context_ptr->blk_geom->origin_x; context_ptr->cu_origin_y = sb_origin_y + context_ptr->blk_geom->origin_y; uint32_t bwidth = context_ptr->blk_geom->bwidth; uint32_t bheight = context_ptr->blk_geom->bheight; uint8_t* src_ptr = &(((uint8_t*)context_ptr->cu_ptr->recon_tmp->buffer_y)[0]); uint8_t* dst_ptr = ref_pic->buffer_y + ref_pic->origin_x + context_ptr->cu_origin_x + (ref_pic->origin_y + context_ptr->cu_origin_y)*ref_pic->stride_y; uint32_t j; for (j = 0; j < bheight; j++) memcpy(dst_ptr + j * ref_pic->stride_y, src_ptr + j * 128, bwidth * sizeof(uint8_t)); if (context_ptr->blk_geom->has_uv) { bwidth = context_ptr->blk_geom->bwidth_uv; bheight = context_ptr->blk_geom->bheight_uv; src_ptr = &(((uint8_t*)context_ptr->cu_ptr->recon_tmp->buffer_cb)[0]); dst_ptr = ref_pic->buffer_cb + ref_pic->origin_x / 2 + ((context_ptr->cu_origin_x >> 3) << 3) / 2 + (ref_pic->origin_y / 2 + ((context_ptr->cu_origin_y >> 3) << 3) / 2)*ref_pic->stride_cb; for (j = 0; j < bheight; j++) memcpy(dst_ptr + j * ref_pic->stride_cb, src_ptr + j * 64, bwidth * sizeof(uint8_t)); src_ptr = &(((uint8_t*)context_ptr->cu_ptr->recon_tmp->buffer_cr)[0]); dst_ptr = ref_pic->buffer_cr + ref_pic->origin_x / 2 + ((context_ptr->cu_origin_x >> 3) << 3) / 2 + (ref_pic->origin_y / 2 + ((context_ptr->cu_origin_y >> 3) << 3) / 2)*ref_pic->stride_cr; for (j = 0; j < bheight; j++) memcpy(dst_ptr + j * ref_pic->stride_cr, src_ptr + j * 64, bwidth * sizeof(uint8_t)); } } } blk_it += ns_depth_offset[sequence_control_set_ptr->sb_size == BLOCK_128X128][context_ptr->blk_geom->depth]; } else blk_it += d1_depth_offset[sequence_control_set_ptr->sb_size == BLOCK_128X128][context_ptr->blk_geom->depth]; } // CU Loop return; } #endif
812031.c
#include <stdio.h> #include <string.h> #include <rdp.h> #include <serial_datagram.h> #include <unistd.h> #include <signal.h> #include <time.h> #include <fcntl.h> #include <pthread.h> #include <termios.h> pthread_mutex_t communication_lock; pthread_cond_t connected_flag; pthread_mutex_t mp; int cnctd = 0; static struct rdp_connection_s conn; int clsd; int fd; void send_serial(void *arg, const void *data, size_t dlen) { int i; struct rdpos_connection_s *conn = arg; //printf("\nSending %i bytes\n", dlen); //for (i = 0; i < dlen; i++) // printf("%02X ", ((const uint8_t*)data)[i]); //printf("\n"); //printf("state = %i\n", conn->rdp_conn.state); write(fd, data, dlen); } void connected(struct rdp_connection_s *conn) { printf("\nConnected\n"); cnctd = 1; pthread_cond_signal(&connected_flag); } void closed(struct rdp_connection_s *conn) { printf("\nConnection closed\n"); clsd = 1; } void data_send_completed(struct rdp_connection_s *conn) { printf("\nData send completed\n"); } void data_received(struct rdp_connection_s *conn, const uint8_t *buf, size_t len) { printf("\nReceived: %.*s\n", len, buf); } static uint8_t rdp_recv_buf[RDP_MAX_SEGMENT_SIZE]; static uint8_t rdp_outbuf[RDP_MAX_SEGMENT_SIZE]; static uint8_t serial_inbuf[RDP_MAX_SEGMENT_SIZE]; static void dgram_received(const void *dtgrm, size_t len, void *arg) { struct rdp_connection_s *conn = arg; rdp_received(conn, dtgrm, len); } serial_datagram_rcv_handler_t hdl = { .buffer = serial_inbuf, .size = RDP_MAX_SEGMENT_SIZE, .callback_fn = dgram_received, .callback_arg = &conn, }; void *receive(void *arg) { printf("Starting recv thread\n"); while (!clsd) { unsigned char b; int n = read(fd, &b, 1); if (n < 1) { usleep(100); continue; } //printf("%02X ", b); //fflush(stdout); pthread_mutex_lock(&communication_lock); serial_datagram_receive(&hdl, &b, 1); pthread_mutex_unlock(&communication_lock); if (conn.state == RDP_CLOSED) { printf("Exit\n"); break; } } return NULL; } pthread_t tid; /* идентификатор потока */ void handle_exit(int signo) { if (signo == SIGINT) { printf("received SIGINT\n"); pthread_mutex_lock(&communication_lock); rdp_close(&conn); pthread_mutex_unlock(&communication_lock); pthread_join(tid, NULL); pthread_mutex_destroy(&communication_lock); exit(0); } } void rdpclock(union sigval sig) { rdp_clock(&conn, 1000); } static void send_fn(struct rdp_connection_s *conn, const uint8_t *buf, size_t len) { serial_datagram_send(buf, len, send_serial, conn); } int main(int argc, const char **argv) { pthread_attr_t attr; /* отрибуты потока */ const char *serial_port = argv[1]; speed_t brate = B115200; int rdp_port = 1; printf("Opening %s\n", serial_port); fd = open(serial_port, O_RDWR | O_NOCTTY | O_NDELAY); if (fd <= 0) { printf("Error opening\n"); return 0; } rdp_init_connection(&conn, rdp_outbuf, rdp_recv_buf); rdp_set_closed_cb(&conn, closed); rdp_set_connected_cb(&conn, connected); rdp_set_data_received_cb(&conn, data_received); rdp_set_data_send_completed_cb(&conn, data_send_completed); rdp_set_send_cb(&conn, send_fn); clsd = 0; pthread_cond_init(&connected_flag, NULL); pthread_mutex_init(&communication_lock, NULL); timer_t timer; struct sigevent sevt = { .sigev_notify = SIGEV_THREAD, .sigev_notify_function = rdpclock, }; timer_create(CLOCK_REALTIME, &sevt, &timer); struct itimerspec interval = { .it_interval = { .tv_sec = 0, .tv_nsec = 1000000UL, }, .it_value = { .tv_sec = 0, .tv_nsec = 1000000UL, } }; timer_settime(timer, 0, &interval, NULL); usleep(100000); pthread_mutex_lock(&communication_lock); rdp_connect(&conn, 1, 1); pthread_mutex_unlock(&communication_lock); pthread_attr_init(&attr); pthread_create(&tid, &attr, receive, NULL); pthread_cond_wait(&connected_flag, &mp); signal(SIGINT, handle_exit); while (true) { char pbuf[1000]; printf("> "); scanf("%s", pbuf); pthread_mutex_lock(&communication_lock); rdp_send(&conn, pbuf, strlen(pbuf)); pthread_mutex_unlock(&communication_lock); } return 0; }
835777.c
/** * This file is part of the Detox package. * * Copyright (c) Doug Harple <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include "wrapped.h" #ifdef SUPPORT_COVERAGE int wrapped_malloc_failure = 0; int wrapped_strdup_failure = 0; #endif void *wrapped_malloc(size_t size) { void *ret; int err; ret = malloc(size); #ifdef SUPPORT_COVERAGE if (wrapped_malloc_failure != 0) { free(ret); ret = NULL; } #endif if (ret == NULL) { err = errno; fprintf(stderr, "detox: out of memory: %s\n", strerror(err)); exit(EXIT_FAILURE); } return ret; } char *wrapped_strdup(const char *s) { char *ret; int err; ret = strdup(s); #ifdef SUPPORT_COVERAGE if (wrapped_strdup_failure != 0) { free(ret); ret = NULL; } #endif if (ret == NULL) { err = errno; fprintf(stderr, "detox: out of memory: %s\n", strerror(err)); exit(EXIT_FAILURE); } return ret; }
701793.c
#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <ncurses.h> #include <assert.h> #include "cursor.h" #include "game.h" #include "common.h" void cursor_malloc(struct cursor **cursor) { if (!(*cursor = malloc(sizeof(**cursor)))) { tty_solitaire_generic_error(errno, __FILE__, __LINE__); } (*cursor)->window = newwin(1, 1, CURSOR_BEGIN_Y, CURSOR_BEGIN_X); } void cursor_init(struct cursor *cursor) { mvwin(cursor->window, CURSOR_BEGIN_Y, CURSOR_BEGIN_X); cursor->y = CURSOR_BEGIN_Y; cursor->x = CURSOR_BEGIN_X; cursor->marked = false; } void cursor_free(struct cursor *cursor) { delwin(cursor->window); free(cursor); } void cursor_mark(struct cursor *cursor) { cursor->marked = true; } void cursor_unmark(struct cursor *cursor) { cursor->marked = false; } void cursor_move(struct cursor *cursor, enum movement movement) { switch (movement) { case LEFT: if (cursor->x > CURSOR_BEGIN_X) { cursor->x = cursor->x - 8; if (cursor->y > CURSOR_BEGIN_Y) { cursor_move(cursor, UP); cursor_move(cursor, DOWN); } } break; case DOWN: if (cursor->y == CURSOR_BEGIN_Y) { switch (cursor->x - 3) { case MANEUVRE_0_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[0]); break; case MANEUVRE_1_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[1]); break; case MANEUVRE_2_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[2]); break; case MANEUVRE_3_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[3]); break; case MANEUVRE_4_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[4]); break; case MANEUVRE_5_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[5]); break; case MANEUVRE_6_BEGIN_X: cursor->y = cursor->y + 7 + stack_length(deck->maneuvre[6]); break; } } break; case RIGHT: if (cursor->x < 49) { cursor->x = cursor->x + 8; if (cursor->y > CURSOR_BEGIN_Y) { cursor_move(cursor, UP); cursor_move(cursor, DOWN); } } break; case UP: if (cursor->y > CURSOR_BEGIN_Y) { cursor->y = CURSOR_BEGIN_Y; } break; } } enum movement cursor_direction(int key) { switch (key) { case 'h': case KEY_LEFT: return(LEFT); case 'j': case KEY_DOWN: return(DOWN); case 'k': case KEY_UP: return(UP); case 'l': case KEY_RIGHT: return(RIGHT); default: endwin(); game_end(); assert(false && "invalid cursor direction"); } } struct stack **cursor_stack(struct cursor *cursor) { if (cursor->y == CURSOR_BEGIN_Y) { switch (cursor->x) { case CURSOR_STOCK_X: return(&(deck->stock)); case CURSOR_WASTE_PILE_X: return(&(deck->waste_pile)); case CURSOR_FOUNDATION_0_X: return(&(deck->foundation[0])); case CURSOR_FOUNDATION_1_X: return(&(deck->foundation[1])); case CURSOR_FOUNDATION_2_X: return(&(deck->foundation[2])); case CURSOR_FOUNDATION_3_X: return(&(deck->foundation[3])); case CURSOR_INVALID_SPOT_X: return(NULL); default: endwin(); game_end(); assert(false && "invalid stack"); } } else { switch (cursor->x) { case CURSOR_MANEUVRE_0_X: return(&(deck->maneuvre[0])); case CURSOR_MANEUVRE_1_X: return(&(deck->maneuvre[1])); case CURSOR_MANEUVRE_2_X: return(&(deck->maneuvre[2])); case CURSOR_MANEUVRE_3_X: return(&(deck->maneuvre[3])); case CURSOR_MANEUVRE_4_X: return(&(deck->maneuvre[4])); case CURSOR_MANEUVRE_5_X: return(&(deck->maneuvre[5])); case CURSOR_MANEUVRE_6_X: return(&(deck->maneuvre[6])); default: endwin(); game_end(); assert(false && "invalid stack"); } } } bool cursor_on_stock(struct cursor *cursor) { return(cursor_stack(cursor) && *cursor_stack(cursor) == deck->stock); } bool cursor_on_invalid_spot(struct cursor *cursor) { return(!cursor_stack(cursor)); }
566287.c
/***************************************************************************//** * @file descriptors.c * @brief M480 series USBD driver source file * @version 2.0.0 * * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. ******************************************************************************/ /*!<Includes */ #include "NuMicro.h" #include "vcom_serial.h" #include "massstorage.h" /*----------------------------------------------------------------------------*/ /*!<USB Device Descriptor */ uint8_t gu8DeviceDescriptor[] = { LEN_DEVICE, /* bLength */ DESC_DEVICE, /* bDescriptorType */ 0x10, 0x01, /* bcdUSB */ 0xEF, /* bDeviceClass: IAD*/ 0x02, /* bDeviceSubClass */ 0x01, /* bDeviceProtocol */ EP0_MAX_PKT_SIZE, /* bMaxPacketSize0 */ /* idVendor */ USBD_VID & 0x00FF, ((USBD_VID & 0xFF00) >> 8), /* idProduct */ USBD_PID & 0x00FF, ((USBD_PID & 0xFF00) >> 8), 0x00, 0x01, /* bcdDevice */ 0x01, /* iManufacture */ 0x02, /* iProduct */ 0x00, /* iSerialNumber - no serial */ 0x01 /* bNumConfigurations */ }; /*!<USB Configure Descriptor */ uint8_t gu8ConfigDescriptor[] = { LEN_CONFIG, /* bLength */ DESC_CONFIG, /* bDescriptorType */ 0x62, 0x00, /* wTotalLength */ 0x03, /* bNumInterfaces */ 0x01, /* bConfigurationValue */ 0x00, /* iConfiguration */ 0xC0, /* bmAttributes */ 0x32, /* MaxPower */ // IAD 0x08, // bLength: Interface Descriptor size 0x0B, // bDescriptorType: IAD 0x00, // bFirstInterface 0x02, // bInterfaceCount 0x02, // bFunctionClass: CDC 0x02, // bFunctionSubClass 0x01, // bFunctionProtocol 0x00, // iFunction /* VCOM */ /* INTERFACE descriptor */ LEN_INTERFACE, /* bLength */ DESC_INTERFACE, /* bDescriptorType */ 0x00, /* bInterfaceNumber */ 0x00, /* bAlternateSetting */ 0x01, /* bNumEndpoints */ 0x02, /* bInterfaceClass */ 0x02, /* bInterfaceSubClass */ 0x01, /* bInterfaceProtocol */ 0x00, /* iInterface */ /* Communication Class Specified INTERFACE descriptor */ 0x05, /* Size of the descriptor, in bytes */ 0x24, /* CS_INTERFACE descriptor type */ 0x00, /* Header functional descriptor subtype */ 0x10, 0x01, /* Communication device compliant to the communication spec. ver. 1.10 */ /* Communication Class Specified INTERFACE descriptor */ 0x05, /* Size of the descriptor, in bytes */ 0x24, /* CS_INTERFACE descriptor type */ 0x01, /* Call management functional descriptor */ 0x00, /* BIT0: Whether device handle call management itself. */ /* BIT1: Whether device can send/receive call management information over a Data Class Interface 0 */ 0x01, /* Interface number of data class interface optionally used for call management */ /* Communication Class Specified INTERFACE descriptor */ 0x04, /* Size of the descriptor, in bytes */ 0x24, /* CS_INTERFACE descriptor type */ 0x02, /* Abstract control management functional descriptor subtype */ 0x00, /* bmCapabilities */ /* Communication Class Specified INTERFACE descriptor */ 0x05, /* bLength */ 0x24, /* bDescriptorType: CS_INTERFACE descriptor type */ 0x06, /* bDescriptorSubType */ 0x00, /* bMasterInterface */ 0x01, /* bSlaveInterface0 */ /* ENDPOINT descriptor */ LEN_ENDPOINT, /* bLength */ DESC_ENDPOINT, /* bDescriptorType */ (EP_INPUT | INT_IN_EP_NUM), /* bEndpointAddress */ EP_INT, /* bmAttributes */ EP4_MAX_PKT_SIZE, 0x00, /* wMaxPacketSize */ 0x01, /* bInterval */ /* INTERFACE descriptor */ LEN_INTERFACE, /* bLength */ DESC_INTERFACE, /* bDescriptorType */ 0x01, /* bInterfaceNumber */ 0x00, /* bAlternateSetting */ 0x02, /* bNumEndpoints */ 0x0A, /* bInterfaceClass */ 0x00, /* bInterfaceSubClass */ 0x00, /* bInterfaceProtocol */ 0x00, /* iInterface */ /* ENDPOINT descriptor */ LEN_ENDPOINT, /* bLength */ DESC_ENDPOINT, /* bDescriptorType */ (EP_INPUT | BULK_IN_EP_NUM), /* bEndpointAddress */ EP_BULK, /* bmAttributes */ EP2_MAX_PKT_SIZE, 0x00, /* wMaxPacketSize */ 0x00, /* bInterval */ /* ENDPOINT descriptor */ LEN_ENDPOINT, /* bLength */ DESC_ENDPOINT, /* bDescriptorType */ (EP_OUTPUT | BULK_OUT_EP_NUM), /* bEndpointAddress */ EP_BULK, /* bmAttributes */ EP3_MAX_PKT_SIZE, 0x00, /* wMaxPacketSize */ 0x00, /* bInterval */ /* MSC class device */ /* INTERFACE descriptor */ LEN_INTERFACE, // bLength DESC_INTERFACE, // bDescriptorType 0x02, // bInterfaceNumber 0x00, // bAlternateSetting 0x02, // bNumEndpoints 0x08, // bInterfaceClass 0x05, /* bInterfaceSubClass */ 0x50, // bInterfaceProtocol 0x00, // iInterface /* ENDPOINT descriptor */ LEN_ENDPOINT, // bLength DESC_ENDPOINT, // bDescriptorType (EP_INPUT | BULK_IN_EP_NUM_1), // bEndpointAddress EP_BULK, // bmAttributes EP5_MAX_PKT_SIZE, 0x00, // wMaxPacketSize 0x00, // bInterval /* ENDPOINT descriptor */ LEN_ENDPOINT, // bLength DESC_ENDPOINT, // bDescriptorType (EP_OUTPUT | BULK_OUT_EP_NUM_1), // bEndpointAddress EP_BULK, // bmAttributes EP6_MAX_PKT_SIZE, 0x00, // wMaxPacketSize 0x00, // bInterval }; /*!<USB Language String Descriptor */ uint8_t gu8StringLang[4] = { 4, /* bLength */ DESC_STRING, /* bDescriptorType */ 0x09, 0x04 }; /*!<USB Vendor String Descriptor */ uint8_t gu8VendorStringDesc[] = { 16, DESC_STRING, 'N', 0, 'u', 0, 'v', 0, 'o', 0, 't', 0, 'o', 0, 'n', 0 }; /*!<USB Product String Descriptor */ uint8_t gu8ProductStringDesc[] = { 22, /* bLength */ DESC_STRING, /* bDescriptorType */ 'U', 0, 'S', 0, 'B', 0, ' ', 0, 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0 }; /*!<USB BOS Descriptor */ const uint8_t gu8BOSDescriptor[] = { LEN_BOS, /* bLength */ DESC_BOS, /* bDescriptorType */ /* wTotalLength */ 0x0C & 0x00FF, ((0x0C & 0xFF00) >> 8), 0x01, /* bNumDeviceCaps */ /* Device Capability */ 0x7, /* bLength */ DESC_CAPABILITY,/* bDescriptorType */ CAP_USB20_EXT, /* bDevCapabilityType */ 0x02, 0x00, 0x00, 0x00 /* bmAttributes */ }; uint8_t *gpu8UsbString[4] = { gu8StringLang, gu8VendorStringDesc, gu8ProductStringDesc, NULL, }; uint8_t *gu8UsbHidReport[3] = { NULL, NULL, NULL, }; uint32_t gu32UsbHidReportLen[3] = { 0, 0, 0, }; uint32_t gu32ConfigHidDescIdx[3] = { 0, 0, 0, }; const S_USBD_INFO_T gsInfo = { (uint8_t *)gu8DeviceDescriptor, (uint8_t *)gu8ConfigDescriptor, (uint8_t **)gpu8UsbString, (uint8_t **)gu8UsbHidReport, (uint8_t *)gu8BOSDescriptor, (uint32_t *)gu32UsbHidReportLen, (uint32_t *)gu32ConfigHidDescIdx };
106365.c
#include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" #include "fns.h" #include "io.h" #include "../port/error.h" int pcmdebug=0; #define DPRINT if(pcmdebug)iprint #define DPRINT1 if(pcmdebug > 1)iprint #define DPRINT2 if(pcmdebug > 2)iprint #define PCMERR(x) pce(x); enum { Qdir, Qmem, Qattr, Qctl, }; #define SLOTNO(c) ((c->qid.path>>8)&0xff) #define TYPE(c) (c->qid.path&0xff) #define QID(s,t) (((s)<<8)|(t)) /* * Support for 2 card slots usng StrongArm pcmcia support. * */ enum { /* * configuration registers - they start at an offset in attribute * memory found in the CIS. */ Rconfig= 0, Creset= (1<<7), /* reset device */ Clevel= (1<<6), /* level sensitive interrupt line */ }; enum { Maxctab= 8, /* maximum configuration table entries */ Maxslot= 2 }; static struct { Ref; } pcmcia; static PCMslot slot[Maxslot]; static PCMslot *lastslot ; static int nslot = Maxslot; static void slotdis(PCMslot *); static void pcmciaintr(Ureg*, void*); static void pcmciareset(void); static int pcmio(int, ISAConf*); static long pcmread(int, int, void*, long, ulong); static long pcmwrite(int, int, void*, long, ulong); static void slottiming(int, int, int, int, int); static void slotmap(int, ulong, ulong, ulong); static void pcmciadump(PCMslot*); static ulong GPIOrdy[2]; static ulong GPIOeject[2]; static ulong GPIOall[2]; /* * get info about card */ static void slotinfo(PCMslot *pp) { ulong gplr; int was; gplr = GPIOREG->gplr; was = pp->occupied; pp->occupied = (gplr & GPIOeject[pp->slotno]) ? 0 : 1; pp->busy = (gplr & GPIOrdy[pp->slotno]) ? 0 : 1; pp->powered = pcmpowered(pp->slotno); pp->battery = 0; pp->wrprot = 0; if (!was & pp->occupied) print("PCMCIA card %d inserted\n", pp->slotno); if (was & !pp->occupied) print("PCMCIA card %d removed!\n", pp->slotno); } /* * enable the slot card */ static void slotena(PCMslot *pp) { if(pp->enabled) return; DPRINT("Enable slot# %d\n", pp->slotno); DPRINT("pcmcia ready %8.8lux\n", GPIOREG->gplr & GPIOrdy[pp->slotno]); /* get configuration */ slotinfo(pp); if(pp->occupied){ if(pp->cisread == 0){ pcmcisread(pp); pp->cisread = 1; } pp->enabled = 1; } else slotdis(pp); } /* * disable the slot card */ static void slotdis(PCMslot *pp) { if (pp->enabled) DPRINT("Disable slot# %d\n", pp->slotno); pp->enabled = 0; pp->cisread = 0; } /* * status change interrupt */ static void pcmciaintr(Ureg*, void*) { uchar was; PCMslot *pp; if(slot == 0) return; for(pp = slot; pp < lastslot; pp++){ was = pp->occupied; slotinfo(pp); if(0 && !pp->occupied){ if(was != pp->occupied){ slotdis(pp); // if (pp->special && pp->notify.f) // (*pp->notify.f)(ur, pp->notify.a, 1); } } } } static void increfp(PCMslot *pp) { if(up){ wlock(pp); if(waserror()){ wunlock(pp); nexterror(); } } if(incref(&pcmcia) == 1){ pcmpower(pp->slotno, 1); pcmreset(pp->slotno); delay(500); } if(incref(&pp->ref) == 1) slotena(pp); if(up){ poperror(); wunlock(pp); } } static void decrefp(PCMslot *pp) { if(decref(&pp->ref) == 0) slotdis(pp); if(decref(&pcmcia) == 0) pcmpower(pp->slotno, 0); } /* * look for a card whose version contains 'idstr' */ int pcmspecial(char *idstr, ISAConf *isa) { PCMslot *pp; extern char *strstr(char*, char*); pcmciareset(); for(pp = slot; pp < lastslot; pp++){ if(pp->special) continue; /* already taken */ increfp(pp); if(pp->occupied) if(strstr(pp->verstr, idstr)){ DPRINT("PCMslot #%d: Found %s - ",pp->slotno, idstr); if(isa == 0 || pcmio(pp->slotno, isa) == 0){ DPRINT("ok.\n"); pp->special = 1; return pp->slotno; } print("error with isa io for %s\n", idstr); } decrefp(pp); } return -1; } void pcmspecialclose(int slotno) { PCMslot *pp; if(slotno < 0 || slotno >= Maxslot) panic("pcmspecialclose"); pp = slot + slotno; pp->special = 0; /* Is this OK ? */ GPIOREG->gfer &= ~GPIOrdy[pp->slotno]; GPIOREG->grer &= ~GPIOrdy[pp->slotno]; decrefp(pp); } #ifdef CRUD void pcmnotify(int slotno, void (*f)(Ureg*, void*, int), void* a) { PCMslot *pp; if((slotno < 0) || (slotno >= Maxslot)) panic("pcmnotify"); pp = slot + slotno; if (pp->special){ pp->notify.f = f; pp->notify.a = a; } } #endif static int pcmgen(Chan *c, Dirtab *tab, int ntab, int i, Dir *dp) { int slotno; Qid qid; long len; PCMslot *pp; char name[NAMELEN]; USED(tab, ntab); if(i>=3*Maxslot) return -1; slotno = i/3; pp = slot + slotno; len = 0; switch(i%3){ case 0: qid.path = QID(slotno, Qmem); sprint(name, "pcm%dmem", slotno); len = pp->memlen; break; case 1: qid.path = QID(slotno, Qattr); sprint(name, "pcm%dattr", slotno); len = pp->memlen; break; case 2: qid.path = QID(slotno, Qctl); sprint(name, "pcm%dctl", slotno); break; } qid.vers = 0; devdir(c, qid, name, len, eve, 0660, dp); return 1; } static void pcmciadump(PCMslot *pp) { USED(pp); } /* * set up for slot cards */ static void pcmciareset(void) { static int already; int slotno, v; PCMslot *pp; GpioReg *g; if(already) return; already = 1; DPRINT("pcmcia reset\n"); lastslot = slot; for(slotno = 0; slotno < Maxslot; slotno++){ slotmap(slotno, PCMCIAIO(slotno), PCMCIAAttr(slotno), PCMCIAMem(slotno)); slottiming(slotno, 300, 300, 300, 0); /* set timing to the default, 300 */ pp = lastslot++; GPIOeject[slotno] = (1<<pcmpin(slotno, PCMeject)); GPIOrdy[slotno] = (1<<pcmpin(slotno, PCMready)); GPIOall[slotno] = GPIOeject[slotno] | GPIOrdy[slotno]; g = GPIOREG; g->gafr &= ~GPIOall[slotno]; slotdis(pp); //g->gedr = GPIOall[slotno]; /* ??? */ intrenable(pcmpin(slotno, PCMeject), pcmciaintr, 0, BusGPIOrising); if((v = pcmpin(slotno, PCMstschng)) >= 0) /* status change interrupt */ intrenable(v, pcmciaintr, 0, BusGPIOrising); } } static Chan* pcmciaattach(char *spec) { return devattach('y', spec); } static int pcmciawalk(Chan *c, char *name) { return devwalk(c, name, 0, 0, pcmgen); } static void pcmciastat(Chan *c, char *db) { devstat(c, db, 0, 0, pcmgen); } static Chan* pcmciaopen(Chan *c, int omode) { if(c->qid.path == CHDIR){ if(omode != OREAD) error(Eperm); } else increfp(slot + SLOTNO(c)); c->mode = openmode(omode); c->flag |= COPEN; c->offset = 0; return c; } static void pcmciaclose(Chan *c) { if(c->flag & COPEN) if(c->qid.path != CHDIR) decrefp(slot+SLOTNO(c)); } /* a memmove using only bytes */ static void memmoveb(uchar *to, uchar *from, int n) { while(n-- > 0) *to++ = *from++; } static long pcmread(int slotno, int attr, void *a, long n, ulong offset) { PCMslot *pp; long i; uchar *b, *p; pp = slot + slotno; rlock(pp); if(waserror()){ runlock(pp); nexterror(); } if(!pp->occupied) error(Eio); if(pp->memlen < offset){ runlock(pp); poperror(); return 0; } if(pp->memlen < offset + n) n = pp->memlen - offset; if (attr){ b = a; p = (uchar*)PCMCIAAttr(slotno) + offset; for(i=0; i<n; i++){ if(!pp->occupied) error(Eio); b[0] = *p; i++; if(i<n) b[1] = 0; b += 2; p += 2; } }else memmoveb(a, (uchar *)PCMCIAMem(slotno) + offset, n); poperror(); runlock(pp); return n; } static long pcmciaread(Chan *c, void *a, long n, ulong offset) { char *cp, *buf; ulong p; PCMslot *pp; int ii; p = TYPE(c); switch(p){ case Qdir: return devdirread(c, a, n, 0, 0, pcmgen); case Qmem: case Qattr: return pcmread(SLOTNO(c), p==Qattr, a, n, offset); case Qctl: buf = malloc(2048); if(buf == nil) error(Eio); if(waserror()){ free(buf); nexterror(); } cp = buf; pp = slot + SLOTNO(c); if(pp->occupied) cp += sprint(cp, "occupied\n"); if(pp->enabled) cp += sprint(cp, "enabled\n"); if(pp->powered) cp += sprint(cp, "powered\n"); if(pp->configed) cp += sprint(cp, "configed\n"); if(pp->busy) cp += sprint(cp, "busy\n"); if(pp->enabled && (ii = strlen(pp->verstr))) cp += sprint(cp, "verstr %d\n%s\n", ii, pp->verstr); cp += sprint(cp, "battery lvl %d\n", pp->battery); /* DUMP registers here */ cp += sprint(cp, "mecr 0x%lux\n", (SLOTNO(c) ? MEMCFGREG->mecr >> 16 : MEMCFGREG->mecr) & 0x7fff); *cp = 0; n = readstr(offset, a, n, buf); poperror(); free(buf); break; default: n=0; break; } return n; } static long pcmwrite(int slotno, int attr, void *a, long n, ulong offset) { PCMslot *pp; pp = slot + slotno; rlock(pp); if(waserror()){ runlock(pp); nexterror(); } if(pp->memlen < offset) error(Eio); if(pp->memlen < offset + n) error(Eio); memmoveb((uchar *)(attr ? PCMCIAAttr(slotno) : PCMCIAMem(slotno)) + offset, a, n); poperror(); runlock(pp); return n; } /* * the regions are staticly mapped */ static void slotmap(int slotno, ulong regs, ulong attr, ulong mem) { PCMslot *sp; if(slotno >= Maxslot) return; sp = &slot[slotno]; sp->slotno = slotno; sp->memlen = 64*MB; sp->verstr[0] = 0; sp->mem = (void*)mem; sp->memmap.ca = 0; sp->memmap.cea = 64*MB; sp->memmap.isa = (ulong)mem; sp->memmap.len = 64*MB; sp->memmap.attr = 0; sp->attr = (void*)attr; sp->attrmap.ca = 0; sp->attrmap.cea = MB; sp->attrmap.isa = (ulong)attr; sp->attrmap.len = MB; sp->attrmap.attr = 1; sp->regs = (void*)regs; } PCMmap* pcmmap(int slotno, ulong, int, int attr) { if(slotno >= nslot) panic("pcmmap"); if(attr) return &slot[slotno].attrmap; else return &slot[slotno].memmap; } void pcmunmap(int, PCMmap*) { } /* * setup card timings * times are in ns * count = ceiling[access-time/(2*3*T)] - 1, where T is a processor cycle * */ static int ns2count(int ns) { ulong y; /* get 100 times cycle time */ y = 100000000/(conf.cpuspeed/1000); /* get 10 times ns/(cycle*6) */ y = (1000*ns)/(6*y); /* round up */ y += 9; y /= 10; /* subtract 1 */ y = y-1; if(y < 0) y = 0; if(y > 0x1F) y = 0x1F; return y & 0x1F; } static void slottiming(int slotno, int tio, int tattr, int tmem, int fast) { ulong x; MemcfgReg *memconfregs = MEMCFGREG; x = ns2count(tio) << 0; x |= ns2count(tattr) << 5; x |= ns2count(tmem) << 10; if(fast) x |= 1<<15; if(slotno == 0){ x |= memconfregs->mecr & 0xffff0000; } else { x <<= 16; x |= memconfregs->mecr & 0xffff; } memconfregs->mecr = x; } static long pcmciawrite(Chan *c, void *a, long n, ulong offset) { ulong p; PCMslot *pp; char buf[32]; p = TYPE(c); switch(p){ case Qctl: if(n >= sizeof(buf)) n = sizeof(buf) - 1; strncpy(buf, a, n); buf[n] = 0; pp = slot + SLOTNO(c); if(!pp->occupied) error(Eio); if(strncmp(buf, "vpp", 3) == 0) pcmsetvpp(pp->slotno, atoi(buf+3)); break; case Qmem: case Qattr: pp = slot + SLOTNO(c); if(pp->occupied == 0 || pp->enabled == 0) error(Eio); n = pcmwrite(SLOTNO(c), p == Qattr, a, n, offset); if(n < 0) error(Eio); break; default: error(Ebadusefd); } return n; } Dev pcmciadevtab = { 'y', "pcmcia", pcmciareset, devinit, pcmciaattach, devdetach, devclone, pcmciawalk, pcmciastat, pcmciaopen, devcreate, pcmciaclose, pcmciaread, devbread, pcmciawrite, devbwrite, devremove, devwstat, }; /* * configure the PCMslot for IO. We assume very heavily that we can read * configuration info from the CIS. If not, we won't set up correctly. */ static int pce(char *s) { USED(s); DPRINT("pcmio failed: %s\n", s); return -1; } static int pcmio(int slotno, ISAConf *isa) { uchar *p; PCMslot *pp; int i, index; char *cp; if(slotno > Maxslot) return PCMERR("bad slot#"); pp = slot + slotno; if(!pp->occupied) return PCMERR("empty slot"); index = 0; if(pp->def) index = pp->def->index; for(i = 0; i < isa->nopt; i++){ if(strncmp(isa->opt[i], "index=", 6)) continue; index = strtol(&isa->opt[i][6], &cp, 0); if(cp == &isa->opt[i][6] || index < 0 || index >= pp->nctab) return PCMERR("bad index"); break; } /* only touch Rconfig if it is present */ if(pp->cpresent & (1<<Rconfig)){ p = (uchar*)(PCMCIAAttr(slotno) + pp->caddr + Rconfig); *p = index; delay(5); } isa->port = (ulong)pp->regs; isa->mem = (ulong)pp->mem; isa->irq = pcmpin(pp->slotno, PCMready); isa->itype = BusGPIOfalling; return 0; } uchar inb(ulong p) { return *(uchar*)p; } ushort ins(ulong p) { return *(ushort*)p; } ulong inl(ulong p) { return *(ulong*)p; } void outb(ulong p, uchar v) { *(uchar*)p = v; } void outs(ulong p, ushort v) { *(ushort*)p = v; } void outl(ulong p, ulong v) { *(ulong*)p = v; } void inss(ulong p, void* buf, int ns) { ushort *addr; addr = (ushort*)buf; for(;ns > 0; ns--) *addr++ = *(ushort*)p; } void outss(ulong p, void* buf, int ns) { ushort *addr; addr = (ushort*)buf; for(;ns > 0; ns--) *(ushort*)p = *addr++; } void insb(ulong p, void* buf, int ns) { uchar *addr; addr = (uchar*)buf; for(;ns > 0; ns--) *addr++ = *(uchar*)p; } void outsb(ulong p, void* buf, int ns) { uchar *addr; addr = (uchar*)buf; for(;ns > 0; ns--) *(uchar*)p = *addr++; }
121423.c
/* * MIT License * * Copyright (c) 2017 Quentin "Naccyde" Deslandes. * * 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 "subsystem/test.h" /* * O.K. */ Test(subsystem, test_set_default_params) { struct yall_subsystem_params p = { 0 }; set_default_params(&p); cr_assert_eq(p.log_level, yall_debug); cr_assert_eq(p.output_type, yall_console_output); cr_assert_str_eq(p.file.filename, "yall.log"); }
361671.c
/*! \file Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from U.S. Dept. of Energy) All rights reserved. The source code is distributed under BSD license, see the file License.txt at the top-level directory. */ /*! @file zgsequ.c * \brief Computes row and column scalings * * <pre> * -- SuperLU routine (version 2.0) -- * Univ. of California Berkeley, Xerox Palo Alto Research Center, * and Lawrence Berkeley National Lab. * November 15, 1997 * * Modified from LAPACK routine ZGEEQU * </pre> */ /* * File name: zgsequ.c * History: Modified from LAPACK routine ZGEEQU */ #include <math.h> #include "slu_zdefs.h" /*! \brief * * <pre> * Purpose * ======= * * ZGSEQU computes row and column scalings intended to equilibrate an * M-by-N sparse matrix A and reduce its condition number. R returns the row * scale factors and C the column scale factors, chosen to try to make * the largest element in each row and column of the matrix B with * elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1. * * R(i) and C(j) are restricted to be between SMLNUM = smallest safe * number and BIGNUM = largest safe number. Use of these scaling * factors is not guaranteed to reduce the condition number of A but * works well in practice. * * See supermatrix.h for the definition of 'SuperMatrix' structure. * * Arguments * ========= * * A (input) SuperMatrix* * The matrix of dimension (A->nrow, A->ncol) whose equilibration * factors are to be computed. The type of A can be: * Stype = SLU_NC; Dtype = SLU_Z; Mtype = SLU_GE. * * R (output) double*, size A->nrow * If INFO = 0 or INFO > M, R contains the row scale factors * for A. * * C (output) double*, size A->ncol * If INFO = 0, C contains the column scale factors for A. * * ROWCND (output) double* * If INFO = 0 or INFO > M, ROWCND contains the ratio of the * smallest R(i) to the largest R(i). If ROWCND >= 0.1 and * AMAX is neither too large nor too small, it is not worth * scaling by R. * * COLCND (output) double* * If INFO = 0, COLCND contains the ratio of the smallest * C(i) to the largest C(i). If COLCND >= 0.1, it is not * worth scaling by C. * * AMAX (output) double* * Absolute value of largest matrix element. If AMAX is very * close to overflow or very close to underflow, the matrix * should be scaled. * * INFO (output) int* * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: if INFO = i, and i is * <= A->nrow: the i-th row of A is exactly zero * > A->ncol: the (i-M)-th column of A is exactly zero * * ===================================================================== * </pre> */ void zgsequ(SuperMatrix *A, double *r, double *c, double *rowcnd, double *colcnd, double *amax, int *info) { /* Local variables */ NCformat *Astore; doublecomplex *Aval; int i, j, irow; double rcmin, rcmax; double bignum, smlnum; extern double dmach(char *); /* Test the input parameters. */ *info = 0; if ( A->nrow < 0 || A->ncol < 0 || A->Stype != SLU_NC || A->Dtype != SLU_Z || A->Mtype != SLU_GE ) *info = -1; if (*info != 0) { i = -(*info); input_error("zgsequ", &i); return; } /* Quick return if possible */ if ( A->nrow == 0 || A->ncol == 0 ) { *rowcnd = 1.; *colcnd = 1.; *amax = 0.; return; } Astore = A->Store; Aval = Astore->nzval; /* Get machine constants. */ smlnum = dmach("S"); /* slamch_("S"); */ bignum = 1. / smlnum; /* Compute row scale factors. */ for (i = 0; i < A->nrow; ++i) r[i] = 0.; /* Find the maximum element in each row. */ for (j = 0; j < A->ncol; ++j) for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { irow = Astore->rowind[i]; r[irow] = SUPERLU_MAX( r[irow], z_abs1(&Aval[i]) ); } /* Find the maximum and minimum scale factors. */ rcmin = bignum; rcmax = 0.; for (i = 0; i < A->nrow; ++i) { rcmax = SUPERLU_MAX(rcmax, r[i]); rcmin = SUPERLU_MIN(rcmin, r[i]); } *amax = rcmax; if (rcmin == 0.) { /* Find the first zero scale factor and return an error code. */ for (i = 0; i < A->nrow; ++i) if (r[i] == 0.) { *info = i + 1; return; } } else { /* Invert the scale factors. */ for (i = 0; i < A->nrow; ++i) r[i] = 1. / SUPERLU_MIN( SUPERLU_MAX( r[i], smlnum ), bignum ); /* Compute ROWCND = min(R(I)) / max(R(I)) */ *rowcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); } /* Compute column scale factors */ for (j = 0; j < A->ncol; ++j) c[j] = 0.; /* Find the maximum element in each column, assuming the row scalings computed above. */ for (j = 0; j < A->ncol; ++j) for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { irow = Astore->rowind[i]; c[j] = SUPERLU_MAX( c[j], z_abs1(&Aval[i]) * r[irow] ); } /* Find the maximum and minimum scale factors. */ rcmin = bignum; rcmax = 0.; for (j = 0; j < A->ncol; ++j) { rcmax = SUPERLU_MAX(rcmax, c[j]); rcmin = SUPERLU_MIN(rcmin, c[j]); } if (rcmin == 0.) { /* Find the first zero scale factor and return an error code. */ for (j = 0; j < A->ncol; ++j) if ( c[j] == 0. ) { *info = A->nrow + j + 1; return; } } else { /* Invert the scale factors. */ for (j = 0; j < A->ncol; ++j) c[j] = 1. / SUPERLU_MIN( SUPERLU_MAX( c[j], smlnum ), bignum); /* Compute COLCND = min(C(J)) / max(C(J)) */ *colcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); } return; } /* zgsequ */
346137.c
/** * @file SDK_EVAL_Timers.c * @author VMA division - AMS * @version 3.2.1 * @date May 1, 2015 * @brief SDK EVAL timers configuration. * @details * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * THIS SOURCE CODE IS PROTECTED BY A LICENSE. * FOR MORE INFORMATION PLEASE CAREFULLY READ THE LICENSE AGREEMENT FILE LOCATED * IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE. * * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2> */ /* Includes ------------------------------------------------------------------*/ #include "SDK_EVAL_Timers.h" /** * @addtogroup SDK_EVAL_STM32L * @{ */ /** * @addtogroup SDK_EVAL_Timers * @{ */ /** * @defgroup SDK_EVAL_Timers_Private_TypesDefinitions SDK EVAL Timers Private Types Definitions * @{ */ /** *@} */ /** * @defgroup SDK_EVAL_Timers_Private_Defines SDK EVAL Timers Private Defines * @{ */ #define SYSTEM_CLOCK 32000000 /** *@} */ /** * @defgroup SDK_EVAL_Timers_Private_Macros SDK EVAL Timers Private Macros * @{ */ /** *@} */ /** * @defgroup SDK_EVAL_Timers_Private_Variables SDK EVAL Timers Private Variables * @{ */ volatile uint32_t lSystickCounter=0; /** *@} */ /** * @defgroup SDK_EVAL_Timers_Private_FunctionPrototypes SDK EVAL Timers Private Function Prototypes * @{ */ /** *@} */ /** * @defgroup SDK_EVAL_Timers_Private_Functions SDK EVAL Timers Private Functions * @{ */ /** * @brief This function handles SysTick Handler. * @param None * @retval None */ //void SysTick_Handler(void) //{ // lSystickCounter++; //} /** * @brief This function implements return the current * systick with a step of 1 ms. * @param lTimeMs desired delay expressed in ms. * @retval None */ uint32_t SdkGetCurrentSysTick(void) { return lSystickCounter; } void SdkStartSysTick(void) { SysTick_Config(SYSTEM_CLOCK/100); lSystickCounter = 0; } /** * @brief This function implements a delay using the microcontroller * Systick with a step of 100 ms. * @param lTimeMs desired delay expressed in ms. * @retval None */ void SdkDelay10Ms(volatile uint32_t lTime10Ms) { uint32_t nWaitPeriod = ~lSystickCounter; if(nWaitPeriod<lTime10Ms) { while( lSystickCounter != 0xFFFFFFFF); nWaitPeriod = lTime10Ms-nWaitPeriod; } else nWaitPeriod = lTime10Ms+ ~nWaitPeriod; while( lSystickCounter != nWaitPeriod ) ; } void SdkDelay10Ms_ISR(volatile uint32_t lTime10Ms) { uint32_t nWaitPeriod = ~(SysTick->VAL); if(nWaitPeriod<lTime10Ms) { while( (SysTick->VAL) != 0xFFFFFFFF); nWaitPeriod = lTime10Ms-nWaitPeriod; } else nWaitPeriod = lTime10Ms+ ~nWaitPeriod; while( (SysTick->VAL) != nWaitPeriod ) ; } /** *@} */ /** *@} */ /** *@} */ /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
268604.c
/* * Copyright (c) 2000, 2001 Hellmuth Michaelis. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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. * *--------------------------------------------------------------------------- * * i4b_l1dmux.c - isdn4bsd layer 1 driver multiplexer * -------------------------------------------------- * * $FreeBSD: src/sys/i4b/layer1/i4b_l1dmux.c,v 1.3.2.2 2002/04/25 12:29:55 gj Exp $ * * last edit-date: [Wed Jan 10 16:43:24 2001] * *---------------------------------------------------------------------------*/ #include "isic.h" #include "iwic.h" #include "ifpi.h" #include "ifpi2.h" #include "ifpnp.h" #include "ihfc.h" #include "itjc.h" #include <sys/param.h> #include <sys/systm.h> #include <machine/i4b_debug.h> #include <machine/i4b_ioctl.h> #include <machine/i4b_trace.h> #include <i4b/layer1/i4b_l1.h> #include <i4b/include/i4b_l1l2.h> #include <i4b/include/i4b_global.h> /* * this code is nothing but a big dynamic switch to multiplex and demultiplex * layer 1 hardware isdn drivers to a common layer 2. * * when a card is successfully attached at system boot time, the driver for * this card calls the routine i4b_l1_mph_status_ind() with status = STI_ATTACH. * * This command is used to setup the tables for converting a "driver unit" and * "driver type" pair (encoded in the calls from the hardware driver to the * routines in this source file) to a "unit number" used in layer 2 and the * layers above (up to and including the isdnd daemon) and for converting * layer 2 units back to calling the appropriate driver and driver unit * number. * * Example: in my setup, a Winbond (iwic) card is probed first and gets * driver unit number 0, driver type 1 in layer 1. This becomes unit * number 0 in layer 2 and up. The second card probed is a Teles card * (isic) and gets driver unit number 0, driver type 0 in layer 1. This * becomes unit number 1 in layer 1 and up. * * To add support for a new driver, add a new driver number to i4b_l1.h: * currently we have L1DRVR_ISIC and L1DRVR_IWIC, so you would add * L1DRVR_FOO. More you would want to add a L0FOOUNIT to encode unit * numbers in your driver. You then have to add a l1foounittab[] and * add an entry to the getl1tab() routine for your driver. The only * thing left now is to write your driver with the support functions * for this multiplexer ;-) */ unsigned int i4b_l1_debug = L1_DEBUG_DEFAULT; #if NISIC > 0 static int l1isicunittab[MAXL1UNITS]; #endif #if NIWIC > 0 static int l1iwicunittab[MAXL1UNITS]; #endif #if NIFPI > 0 static int l1ifpiunittab[MAXL1UNITS]; #endif #if NIFPI2 > 0 static int l1ifpi2unittab[MAXL1UNITS]; #endif #if NIHFC > 0 static int l1ihfcunittab[MAXL1UNITS]; #endif #if NIFPNP > 0 static int l1ifpnpunittab[MAXL1UNITS]; #endif #if NITJC > 0 static int l1itjcunittab[MAXL1UNITS]; #endif static int numl1units = 0; static int l1drvunittab[MAXL1UNITS]; static struct i4b_l1mux_func *l1mux_func[MAXL1DRVR]; static int i4b_l1_ph_data_req(int, struct mbuf *, int); static int i4b_l1_ph_activate_req(int); /* from i4btrc driver i4b_trace.c */ int get_trace_data_from_l1(int unit, int what, int len, char *buf); /* from layer 2 */ int i4b_ph_data_ind(int unit, struct mbuf *m); int i4b_ph_activate_ind(int unit); int i4b_ph_deactivate_ind(int unit); int i4b_mph_status_ind(int, int, int); /* layer 1 lme */ int i4b_l1_mph_command_req(int, int, void *); /*---------------------------------------------------------------------------* * jump table: interface function pointers L1/L2 interface *---------------------------------------------------------------------------*/ struct i4b_l1l2_func i4b_l1l2_func = { /* Layer 1 --> Layer 2 */ (int (*)(int, struct mbuf *)) i4b_ph_data_ind, (int (*)(int)) i4b_ph_activate_ind, (int (*)(int)) i4b_ph_deactivate_ind, /* Layer 2 --> Layer 1 */ (int (*)(int, struct mbuf *, int)) i4b_l1_ph_data_req, (int (*)(int)) i4b_l1_ph_activate_req, /* Layer 1 --> trace interface driver, ISDN trace data */ (int (*)(i4b_trace_hdr_t *, int, u_char *)) get_trace_data_from_l1, /* Driver control and status information */ (int (*)(int, int, int)) i4b_mph_status_ind, (int (*)(int, int, void *)) i4b_l1_mph_command_req, }; /*---------------------------------------------------------------------------* * return a pointer to a layer 0 drivers unit tab *---------------------------------------------------------------------------*/ static __inline int * getl1tab(int drv) { switch(drv) { #if NISIC > 0 case L1DRVR_ISIC: return(l1isicunittab); break; #endif #if NIWIC > 0 case L1DRVR_IWIC: return(l1iwicunittab); break; #endif #if NIFPI > 0 case L1DRVR_IFPI: return(l1ifpiunittab); break; #endif #if NIFPI2 > 0 case L1DRVR_IFPI2: return(l1ifpi2unittab); break; #endif #if NIHFC > 0 case L1DRVR_IHFC: return(l1ihfcunittab); break; #endif #if NIFPNP > 0 case L1DRVR_IFPNP: return(l1ifpnpunittab); break; #endif #if NITJC > 0 case L1DRVR_ITJC: return(l1itjcunittab); break; #endif default: return(NULL); break; } } /*===========================================================================* * B - Channel (data transfer) *===========================================================================*/ /*---------------------------------------------------------------------------* * return the address of ISDN drivers linktab *---------------------------------------------------------------------------*/ isdn_link_t * i4b_l1_ret_linktab(int unit, int channel) { int drv_unit, ch_unit; drv_unit = L0DRVR(l1drvunittab[unit]); ch_unit = L0UNIT(l1drvunittab[unit]); NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit); if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL || l1mux_func[drv_unit]->ret_linktab == NULL) panic("i4b_l1_ret_linktab: unknown driver type %d\n", drv_unit); return(l1mux_func[drv_unit]->ret_linktab(ch_unit, channel)); } /*---------------------------------------------------------------------------* * set the ISDN driver linktab *---------------------------------------------------------------------------*/ void i4b_l1_set_linktab(int unit, int channel, drvr_link_t *dlt) { int drv_unit, ch_unit; drv_unit = L0DRVR(l1drvunittab[unit]); ch_unit = L0UNIT(l1drvunittab[unit]); NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit); if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL || l1mux_func[drv_unit]->set_linktab == NULL) panic("i4b_l1_set_linktab: unknown driver type %d\n", drv_unit); l1mux_func[drv_unit]->set_linktab(ch_unit, channel, dlt); } /*===========================================================================* * trace D- and B-Channel support *===========================================================================*/ /*---------------------------------------------------------------------------* * L0 -> L1 trace information to trace driver *---------------------------------------------------------------------------*/ int i4b_l1_trace_ind(i4b_trace_hdr_t *hdr, int len, u_char *data) { register int *tab; if((tab = getl1tab(L0DRVR(hdr->unit))) == NULL) panic("i4b_l1_trace_ind: unknown driver type %d\n", L0DRVR(hdr->unit)); NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(hdr->unit), L0UNIT(hdr->unit), tab[L0UNIT(hdr->unit)]); hdr->unit = tab[L0UNIT(hdr->unit)]; return(MPH_Trace_Ind(hdr, len, data)); } /*===========================================================================* * D - Channel (signalling) *===========================================================================*/ /*---------------------------------------------------------------------------* * L0 -> L1 status indication from hardware *---------------------------------------------------------------------------*/ int i4b_l1_mph_status_ind(int drv_unit, int status, int parm, struct i4b_l1mux_func *l1mux_func_p) { register int *tab; /* * in case the status STI_ATTACH is sent from the hardware, the * driver has just attached itself and we need to initialize * the tables and assorted variables. */ if(status == STI_ATTACH) { if (l1mux_func_p == (struct i4b_l1mux_func *)0) panic("i4b_l1_mph_status_ind: i4b_l1mux_func pointer is NULL\n"); if(numl1units < MAXL1UNITS) { if((tab = getl1tab(L0DRVR(drv_unit))) == NULL) panic("i4b_l1_mph_status_ind: unknown driver type %d\n", L0DRVR(drv_unit)); tab[L0UNIT(drv_unit)] = numl1units; l1drvunittab[numl1units] = drv_unit; l1mux_func[L0DRVR(drv_unit)] = l1mux_func_p; switch(L0DRVR(drv_unit)) { #if NISIC > 0 case L1DRVR_ISIC: printf("isic%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif #if NIWIC > 0 case L1DRVR_IWIC: printf("iwic%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif #if NIFPI > 0 case L1DRVR_IFPI: printf("ifpi%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif #if NIFPI2 > 0 case L1DRVR_IFPI2: printf("ifpi2-%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif #if NIFPNP > 0 case L1DRVR_IFPNP: printf("ifpnp%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif #if NIHFC > 0 case L1DRVR_IHFC: printf("ihfc%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif #if NITJC > 0 case L1DRVR_ITJC: printf("itjc%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units); break; #endif } NDBGL1(L1_PRIM, "ATTACH drv %d, drvunit %d -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), numl1units); numl1units++; } } if((tab = getl1tab(L0DRVR(drv_unit))) == NULL) panic("i4b_l1_mph_status_ind: unknown driver type %d\n", L0DRVR(drv_unit)); NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d\n", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]); return(MPH_Status_Ind(tab[L0UNIT(drv_unit)], status, parm)); } /*---------------------------------------------------------------------------* * L0 -> L1 data from hardware *---------------------------------------------------------------------------*/ int i4b_l1_ph_data_ind(int drv_unit, struct mbuf *data) { register int *tab; if((tab = getl1tab(L0DRVR(drv_unit))) == NULL) panic("i4b_l1_ph_data_ind: unknown driver type %d\n", L0DRVR(drv_unit)); #if 0 NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]); #endif return(PH_Data_Ind(tab[L0UNIT(drv_unit)], data)); } /*---------------------------------------------------------------------------* * L0 -> L1 activate indication from hardware *---------------------------------------------------------------------------*/ int i4b_l1_ph_activate_ind(int drv_unit) { register int *tab; if((tab = getl1tab(L0DRVR(drv_unit))) == NULL) panic("i4b_l1_ph_activate_ind: unknown driver type %d\n", L0DRVR(drv_unit)); NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]); return(PH_Act_Ind(tab[L0UNIT(drv_unit)])); } /*---------------------------------------------------------------------------* * L0 -> L1 deactivate indication from hardware *---------------------------------------------------------------------------*/ int i4b_l1_ph_deactivate_ind(int drv_unit) { register int *tab; if((tab = getl1tab(L0DRVR(drv_unit))) == NULL) panic("i4b_l1_ph_deactivate_ind: unknown driver type %d\n", L0DRVR(drv_unit)); NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]); return(PH_Deact_Ind(tab[L0UNIT(drv_unit)])); } /*---------------------------------------------------------------------------* * L2 -> L1 command to hardware *---------------------------------------------------------------------------*/ int i4b_l1_mph_command_req(int unit, int command, void * parm) { register int drv_unit = L0DRVR(l1drvunittab[unit]); register int ch_unit = L0UNIT(l1drvunittab[unit]); NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit); if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL || l1mux_func[drv_unit]->mph_command_req == NULL) panic("i4b_l1_mph_command_req: unknown driver type %d\n", drv_unit); return(l1mux_func[drv_unit]->mph_command_req(ch_unit, command, parm)); } /*---------------------------------------------------------------------------* * L2 -> L1 data to be transmitted to hardware *---------------------------------------------------------------------------*/ int i4b_l1_ph_data_req(int unit, struct mbuf *data, int flag) { register int drv_unit = L0DRVR(l1drvunittab[unit]); register int ch_unit = L0UNIT(l1drvunittab[unit]); #if 0 NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit); #endif if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL || l1mux_func[drv_unit]->ph_data_req == NULL) panic("i4b_l1_ph_data_req: unknown driver type %d\n", drv_unit); return(l1mux_func[drv_unit]->ph_data_req(ch_unit, data, flag)); } /*---------------------------------------------------------------------------* * L2 -> L1 activate request to hardware *---------------------------------------------------------------------------*/ int i4b_l1_ph_activate_req(int unit) { register int drv_unit = L0DRVR(l1drvunittab[unit]); register int ch_unit = L0UNIT(l1drvunittab[unit]); NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit); if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL || l1mux_func[drv_unit]->ph_activate_req == NULL) panic("i4b_l1_ph_activate_req: unknown driver type %d\n", drv_unit); return(l1mux_func[drv_unit]->ph_activate_req(ch_unit)); } /* EOF */
37639.c
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2016 Imagination Technologies * Author: Paul Burton <[email protected]> */ #define pr_fmt(fmt) "yamon-dt: " fmt #include <linux/bug.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/libfdt.h> #include <linux/printk.h> #include <asm/fw/fw.h> #include <asm/yamon-dt.h> #define MAX_MEM_ARRAY_ENTRIES 2 __init int yamon_dt_append_cmdline(void *fdt) { int err, chosen_off; /* find or add chosen node */ chosen_off = fdt_path_offset(fdt, "/chosen"); if (chosen_off == -FDT_ERR_NOTFOUND) chosen_off = fdt_add_subnode(fdt, 0, "chosen"); if (chosen_off < 0) { pr_err("Unable to find or add DT chosen node: %d\n", chosen_off); return chosen_off; } err = fdt_setprop_string(fdt, chosen_off, "bootargs", fw_getcmdline()); if (err) { pr_err("Unable to set bootargs property: %d\n", err); return err; } return 0; } static unsigned int __init gen_fdt_mem_array( const struct yamon_mem_region *regions, __be32 *mem_array, unsigned int max_entries, unsigned long memsize) { const struct yamon_mem_region *mr; unsigned long size; unsigned int entries = 0; for (mr = regions; mr->size && memsize; ++mr) { if (entries >= max_entries) { pr_warn("Number of regions exceeds max %u\n", max_entries); break; } /* How much of the remaining RAM fits in the next region? */ size = min_t(unsigned long, memsize, mr->size); memsize -= size; /* Emit a memory region */ *(mem_array++) = cpu_to_be32(mr->start); *(mem_array++) = cpu_to_be32(size); ++entries; /* Discard the next mr->discard bytes */ memsize -= min_t(unsigned long, memsize, mr->discard); } return entries; } __init int yamon_dt_append_memory(void *fdt, const struct yamon_mem_region *regions) { unsigned long phys_memsize = 0, memsize; __be32 mem_array[2 * MAX_MEM_ARRAY_ENTRIES]; unsigned int mem_entries; int i, err, mem_off; char *var, param_name[10], *var_names[] = { "ememsize", "memsize", }; /* find memory size from the bootloader environment */ for (i = 0; i < ARRAY_SIZE(var_names); i++) { var = fw_getenv(var_names[i]); if (!var) continue; err = kstrtoul(var, 0, &phys_memsize); if (!err) break; pr_warn("Failed to read the '%s' env variable '%s'\n", var_names[i], var); } if (!phys_memsize) { pr_warn("The bootloader didn't provide memsize: defaulting to 32MB\n"); phys_memsize = 32 << 20; } /* default to using all available RAM */ memsize = phys_memsize; /* allow the user to override the usable memory */ for (i = 0; i < ARRAY_SIZE(var_names); i++) { snprintf(param_name, sizeof(param_name), "%s=", var_names[i]); var = strstr(arcs_cmdline, param_name); if (!var) continue; memsize = memparse(var + strlen(param_name), NULL); } /* if the user says there's more RAM than we thought, believe them */ phys_memsize = max_t(unsigned long, phys_memsize, memsize); /* find or add a memory node */ mem_off = fdt_path_offset(fdt, "/memory"); if (mem_off == -FDT_ERR_NOTFOUND) mem_off = fdt_add_subnode(fdt, 0, "memory"); if (mem_off < 0) { pr_err("Unable to find or add memory DT node: %d\n", mem_off); return mem_off; } err = fdt_setprop_string(fdt, mem_off, "device_type", "memory"); if (err) { pr_err("Unable to set memory node device_type: %d\n", err); return err; } mem_entries = gen_fdt_mem_array(regions, mem_array, MAX_MEM_ARRAY_ENTRIES, phys_memsize); err = fdt_setprop(fdt, mem_off, "reg", mem_array, mem_entries * 2 * sizeof(mem_array[0])); if (err) { pr_err("Unable to set memory regs property: %d\n", err); return err; } mem_entries = gen_fdt_mem_array(regions, mem_array, MAX_MEM_ARRAY_ENTRIES, memsize); err = fdt_setprop(fdt, mem_off, "linux,usable-memory", mem_array, mem_entries * 2 * sizeof(mem_array[0])); if (err) { pr_err("Unable to set linux,usable-memory property: %d\n", err); return err; } return 0; } __init int yamon_dt_serial_config(void *fdt) { const char *yamontty, *mode_var; char mode_var_name[9], path[20], parity; unsigned int uart, baud, stop_bits; bool hw_flow; int chosen_off, err; yamontty = fw_getenv("yamontty"); if (!yamontty || !strcmp(yamontty, "tty0")) { uart = 0; } else if (!strcmp(yamontty, "tty1")) { uart = 1; } else { pr_warn("yamontty environment variable '%s' invalid\n", yamontty); uart = 0; } baud = stop_bits = 0; parity = 0; hw_flow = false; snprintf(mode_var_name, sizeof(mode_var_name), "modetty%u", uart); mode_var = fw_getenv(mode_var_name); if (mode_var) { while (mode_var[0] >= '0' && mode_var[0] <= '9') { baud *= 10; baud += mode_var[0] - '0'; mode_var++; } if (mode_var[0] == ',') mode_var++; if (mode_var[0]) parity = mode_var[0]; if (mode_var[0] == ',') mode_var++; if (mode_var[0]) stop_bits = mode_var[0] - '0'; if (mode_var[0] == ',') mode_var++; if (!strcmp(mode_var, "hw")) hw_flow = true; } if (!baud) baud = 38400; if (parity != 'e' && parity != 'n' && parity != 'o') parity = 'n'; if (stop_bits != 7 && stop_bits != 8) stop_bits = 8; WARN_ON(snprintf(path, sizeof(path), "serial%u:%u%c%u%s", uart, baud, parity, stop_bits, hw_flow ? "r" : "") >= sizeof(path)); /* find or add chosen node */ chosen_off = fdt_path_offset(fdt, "/chosen"); if (chosen_off == -FDT_ERR_NOTFOUND) chosen_off = fdt_add_subnode(fdt, 0, "chosen"); if (chosen_off < 0) { pr_err("Unable to find or add DT chosen node: %d\n", chosen_off); return chosen_off; } err = fdt_setprop_string(fdt, chosen_off, "stdout-path", path); if (err) { pr_err("Unable to set stdout-path property: %d\n", err); return err; } return 0; }
540649.c
#include <ctype.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "config.h" #include "messages.h" static CHAR* trim( CHAR* src ) { CHAR* end = strchr( src, '\0' ); while (isspace(*src)) src++; while ((isspace(*(end-1)) && (end > src))) *--end = '\0'; return src; } static BOOL ParseDirective( CONFIG* config, CHAR* name, CHAR* value, BOOL inHeader ) { /* Quick way to reference the current image */ IMAGE* img = config->Images; if (stricmp(name, "Timeout") == 0) { ULONG timeout; CHAR* endptr; if (inHeader) { PrintMessage( MSG_CONF_DIR_INSIDE_SECTION, name ); return FALSE; } timeout = strtoul( value, &endptr, 0 ); if (endptr == value) { PrintMessage( MSG_CONF_INVALID_INTEGER, name ); return FALSE; } config->Timeout = timeout; } else if (!inHeader) { PrintError( MSG_CONF_DIR_OUTSIDE_SECTION, name ); return FALSE; } else if (stricmp(name, "Address") == 0) { CHAR* endptr; img->Address = strtoul( value, &endptr, 0 ); if (endptr == value) { img->Address = 0; } } else if (stricmp(name, "Command") == 0) { CHAR* copy = malloc( strlen( value ) + 1 ); if (copy == NULL) { PrintMessage( MSG_OUT_OF_MEMORY ); return FALSE; } strcpy( copy, value ); img->Command = copy; } else if (stricmp(name, "Drive") == 0) { CHAR* endptr; img->Drive = strtoul( value, &endptr, 0 ); if ((endptr == value) || (img->Drive > 0xFF)) { /* * Default to none if invalid drive is given. * This will get filled in by the bootstrap code to the drive it * was loaded from. */ img->Drive = 0xFFFFFFFF; } } else if (stricmp(name, "Module") == 0) { CHAR* str = malloc( strlen(value) + 1 ); if (str == NULL) { PrintMessage( MSG_OUT_OF_MEMORY ); return FALSE; } strcpy( str, value ); if (img->nModules % 8 == 0) { /* Expand array */ MODULE* tmp = realloc( img->Modules, (img->nModules + 8) * sizeof(MODULE) ); if (tmp == NULL) { PrintMessage( MSG_OUT_OF_MEMORY ); return FALSE; } img->Modules = tmp; } /* * Note that the string member should not include the file path. * This will get removed when the file has been loaded. */ img->Modules[ img->nModules ].ModStart = 0; img->Modules[ img->nModules ].ModEnd = 0; img->Modules[ img->nModules ].String = str; img->Modules[ img->nModules ].Reserved = 0; img->nModules++; } else if (stricmp(name, "Type") == 0) { if (stricmp(value, "Binary") == 0) img->Type = IT_BINARY; else if (stricmp(value, "Multiboot") == 0) img->Type = IT_MULTIBOOT; else if (stricmp(value, "Bootsector") == 0) img->Type = IT_BOOTSECTOR; else if (stricmp(value, "Relocatable") == 0) img->Type = IT_RELOCATABLE; } else if (stricmp(name, "Default") == 0) { CHAR* endptr; ULONG val; val = strtoul( value, &endptr, 10 ); if (endptr == value) { val = (stricmp( value, "Yes" ) == 0); } if (val != 0) { if (config->Default != NULL) { PrintMessage( MSG_CONF_MULTIPLE_DEFAULTS ); return FALSE; } config->Default = img; } } return TRUE; } static BOOL ValidateConfig( CONFIG* config ) { IMAGE* img = config->Images; while (img != NULL) { /* Check for missing required options */ if (img->Command == NULL) { PrintMessage( MSG_CONF_MISSING_PROPERTY, img->Name, "Command" ); return FALSE; } if ((img->Type == IT_BINARY) && (img->Address == 0)) { PrintMessage( MSG_CONF_MISSING_PROPERTY, img->Name, "Address" ); return FALSE; } img = img->Next; } if (config->Default == NULL) { /* Make the first entry the default one if none is given */ config->Default = config->Images; while (config->Default->Next != NULL) { config->Default = config->Default->Next; } } return TRUE; } static IMAGE* CreateImage( CHAR* name ) { IMAGE* image = malloc( sizeof(IMAGE) ); if (image == NULL) { return NULL; } /* Defaults */ image->Type = IT_AUTO; image->Address = 0; image->Drive = 0xFFFFFFFF; image->Command = NULL; image->Modules = NULL; image->nModules = 0; image->Name = malloc( strlen( name ) + 1 ); if (image == NULL) { free( image ); return NULL; } strcpy( image->Name, name ); return image; } BOOL ParseConfigFile( FILE* file, CONFIG* config ) { ULONGLONG size = GetFileSize( file ); CHAR* buffer = malloc( size + 1 ); BOOL inHeader = FALSE; ULONG line = 1; CHAR* src; CHAR* nl; if (buffer == NULL) { PrintMessage( MSG_OUT_OF_MEMORY ); return FALSE; } config->nImages = 0; config->Default = NULL; config->Images = NULL; config->Timeout = 120; /* Default to two minutes */ size = ReadFile( file, buffer, size ); if (size == 0) { return FALSE; } /* Remove NULs */ nl = buffer; while ((nl = memchr( nl, '\0', buffer + size - nl )) != NULL) { memmove( nl, nl + 1, buffer + size - nl ); size--; } buffer[ size ] = '\0'; /* Replace \r\n and \r with \n */ nl = buffer; while ((nl = memchr( nl, '\r', buffer + size - nl )) != NULL) { if (nl[1] == '\n') { memmove( nl + 1, nl + 2, buffer + size - nl - 1 ); size--; } *nl = '\n'; } src = buffer; do { CHAR* sc; nl = strchr( src, '\n' ); if (nl != NULL) *nl = '\0'; /* Ignore comments */ sc = strchr( src, ';' ); if (src != NULL) *sc = '\0'; src = trim( src ); /* Ignore empty lines */ if (*src != '\0') { if (*src == '[') { /* Section Header */ CHAR* name; name = strchr( src, ']' ); if (name == NULL) { PrintMessage( MSG_CONF_ERROR_AT_LINE, line ); free( buffer ); return FALSE; } *name = '\0'; name = trim( src + 1 ); /* Create a new image structure */ IMAGE* image = CreateImage( name ); if (image == NULL) { PrintMessage( MSG_OUT_OF_MEMORY ); return FALSE; } /* Add to list */ image->Next = config->Images; config->Images = image; config->nImages++; inHeader = TRUE; } else { /* Normal line */ CHAR* eq = strchr( src, '=' ); CHAR* name = src; CHAR* value = eq + 1; if (eq == NULL) { PrintMessage( MSG_CONF_ERROR_AT_LINE, line ); free( buffer ); return FALSE; } *eq = '\0'; name = trim( name ); value = trim( value ); if (!ParseDirective( config, name, value, inHeader )) { free( buffer ); return FALSE; } } } line = line + 1; src = nl + 1; } while (nl != NULL); free( buffer ); return ValidateConfig( config ); }
226888.c
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char const *argv[]) { double sigma = 1.0; // 标准差 double bound = 1.125; double probability = 0.5 * erf(bound / (sigma * sqrt(2.0))); // N ~ P[0, bound] printf("N(0,1) ~ P[0, 1.125] = %lf\n", probability); return 0; }
349121.c
/* *----------------------------------------------------------------------------- * Filename: compositor-ias.c *----------------------------------------------------------------------------- * Copyright 2011-2018 Intel Corporation * * 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 (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 * 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. * * Portions Copyright © 2008-2011 Kristian Høgsberg * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of the copyright holders not be used in * advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The copyright holders make * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Unless otherwise agreed by Intel in writing, you may not remove or alter * this notice or any other notice embedded in Materials by Intel or Intel’s * suppliers or licensors in any way. *----------------------------------------------------------------------------- * Description: * IAS Backend *----------------------------------------------------------------------------- */ #include <libweston/backend-ias.h> #include "config.h" #include "ias-backend.h" #include "launcher-util.h" #include "trace-reporter.h" #include <EGL/egl.h> #include <dlfcn.h> #include <time.h> #include "linux-dmabuf.h" #include <EGL/eglext.h> #ifdef HYPER_DMABUF #include <hyper_dmabuf.h> #endif #ifndef EGL_PLATFORM_GBM_KHR #define EGL_PLATFORM_GBM_KHR 0x31D7 #endif #ifdef BUILD_REMOTE_DISPLAY #include "capture-proxy.h" #include "../shared/timespec-util.h" #include "ias-shell-server-protocol.h" #endif #ifndef DRM_CAP_TIMESTAMP_MONOTONIC #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 #endif #ifndef DRM_CAP_RENDER_COMPRESSION #define DRM_CAP_RENDER_COMPRESSION 0x11 #endif #define VIRT_CON_PREFERRED_WIDTH 1920 #define VIRT_CON_PREFERRED_HEIGHT 1080 struct drm_parameters { int connector; int tty; int use_pixman; const char *seat_id; }; extern struct ias_output_model output_model_classic; extern struct ias_output_model output_model_flexible; /* Maximum sprites supported per CRTC */ #define MAX_SPRITE_PER_CRTC 2 struct ias_output; struct ias_crtc; struct gl_renderer_interface *gl_renderer; struct ias_configured_crtc *cur_crtc; static struct wl_list configured_crtc_list; static struct wl_list configured_output_list; static struct wl_list global_env_list; static struct wl_list output_list; #define HYPER_DMABUF_PATH "/dev/hyper_dmabuf" #define HYPER_DMABUF_PATH_LEGACY "/dev/xen/hyper_dmabuf" #define HYPER_DMABUF_UNEXPORT_DELAY 250; static int need_depth; static int need_stencil; static int vm_exec = 0; static int vm_dbg = 0; static int vm_unexport_delay = HYPER_DMABUF_UNEXPORT_DELAY; static int vm_share_only = 1; static char vm_plugin_path[256]; static char vm_plugin_args[256]; /* * Keyboard devices don't use a keymap and just deliver raw evdev keycodes * to clients (this is the expected case in real automotive settings where * the devices that show up as keyboards aren't typical 101-key KB's). * * TODO: Consider changing this default to 'true' in the future. */ static int use_xkbcommon; /* * When normalized rotation is turned on, the compositor will send * swapped width and height in the output geometry event. */ static int normalized_rotation; static int print_fps = 0; static int metrics_timing = 0; static int use_nuclear_flip = 1; static int no_flip_event = 0; static int no_color_correction = 0; static int use_rbc = 0; static int rbc_debug = 0; static int damage_outputs_on_init = 1; static int use_cursor_as_uplane = 0; TRACING_DECLARATIONS; #define SYSFS_LOCATION "/sys/module/emgd" #define SYSFS_BUF_SIZE 100 #define SYSFS_CRTCID_ADJUSTMENT 3 /* Config element handler functions */ void backend_begin(void *userdata, const char **attrs); void crtc_begin(void *userdata, const char **attrs); void output_begin(void *userdata, const char **attrs); void input_begin(void *userdata, const char **attrs); void env_begin(void *userdata, const char **attrs); void capture_begin(void *userdata, const char **attrs); /* Config element mapping for state machine */ static struct xml_element backend_parse_data[] = { { NONE, NULL, NULL, IASCONFIG, NONE }, { IASCONFIG, "iasconfig", NULL, BACKEND, NONE }, { BACKEND, "backend", backend_begin, STARTUP | GLOBAL_ENV | REM_DISP, IASCONFIG }, { STARTUP, "startup", NULL, CRTC, BACKEND }, { CRTC, "crtc", crtc_begin, OUTPUT, STARTUP }, { OUTPUT, "output", output_begin, INPUT, CRTC }, { INPUT, "input", input_begin, NONE, OUTPUT }, { GLOBAL_ENV, "env", env_begin, NONE, BACKEND }, { REM_DISP, "capture", capture_begin, NONE, BACKEND }, }; struct ias_configured_input { char *devnode; struct wl_list link; }; static const char default_seat[] = "seat0"; struct ias_connector { drmModeConnector *connector; int used; }; /* Output model name table. */ static struct ias_output_model *output_model_table[] = { &output_model_classic, &output_model_flexible, }; static int output_model_table_size = sizeof(output_model_table) / sizeof(output_model_table[0]); static drmModePropertyPtr ias_get_prop(int fd, drmModeConnectorPtr connector, const char *name); static int get_sprite_list(struct weston_output *output, struct ias_sprite ***sprite_list); static struct weston_plane * assign_view_to_sprite(struct weston_view *view, /* struct ias_sprite *sprite, */ struct weston_output *output, int *sprite_id, int x, int y, int sprite_width, int sprite_height, pixman_region32_t *surface_region); static int assign_zorder_to_sprite(struct weston_output *output, int sprite_id, int position); static uint32_t is_surface_flippable_on_sprite(struct weston_view *view, struct weston_output *output); static int assign_blending_to_sprite(struct weston_output *output, int sprite_id, int src_factor, int dst_factor, float blend_color, int enable); /* retrieve the number of GL textures associated with a view and their names. * names must point to an array at least big enough to hold num elements */ static void get_tex_info(struct weston_view *view, int *num, GLuint *names); /* retrieve the number of EGLImages associated with a view and their names. * names must point to an array at least big enough to hold num elements */ static void get_egl_image_info(struct weston_view *view, int *num, EGLImageKHR *names); /* have gl-renderer call glViewport */ static void set_viewport(int x, int y, int width, int height); void ias_get_object_properties(int fd, struct ias_properties *drm_props, uint32_t obj_id, uint32_t obj_type, struct ias_sprite *sprite); void ias_get_crtc_object_properties(int fd, struct ias_crtc_properties *drm_props, uint32_t obj_id); /* Set of display components required to build a new display */ struct connector_components { char *connector_name; struct ias_configured_crtc *conf_crtc; struct ias_connector *connector; struct wl_list link; }; /* List containing a set of display components ready to build */ struct components_list { int count_connectors; int num_conf_components; struct ias_connector **connector; struct wl_list list; }; /* Init components list */ static int components_list_create(struct ias_backend *backend, drmModeRes *resources, struct components_list *components_list); /* Free the memory used by components list */ static void components_list_destroy(struct components_list *components_list); /* Creates and adds display components, return successful of not */ static int components_list_add(struct components_list *components_list, char *connector_name, struct ias_configured_crtc *conf_crtc, struct ias_connector *connector); /* Construct the display components list, returns successful or not */ static int components_list_build(struct ias_backend *backend, drmModeRes *resources, struct components_list *components_list); /* Checks if there are any overlapping outputs */ static int has_overlapping_outputs(struct ias_backend *backend); static int ias_crtc_find_by_name(struct ias_backend *backend, char *requested_name); static void centre_pointer(struct ias_backend *backend); static struct ias_crtc * create_single_crtc(struct ias_backend *backend, drmModeRes *resources, struct connector_components *components); /* Update function implemented during hotplugging */ static void ias_update_outputs(struct ias_backend *backend, struct udev_device *event); static int emgd_has_multiplane_drm(struct ias_backend *backend) { struct drm_i915_getparam param; int overlay = 0; int ret; /* * Value 30 is a private definition in EMGD that allows * checking whether multiplane drm is available or not */ param.param = I915_PARAM_HAS_MULTIPLANE_DRM; param.value = &overlay; ret = drmCommandWriteRead(backend->drm.fd, DRM_I915_GETPARAM, &param, sizeof(param)); if (ret) { weston_log("DRM reports no overlay support!\n"); return -1; } return overlay; } void ias_get_object_properties(int fd, struct ias_properties *drm_props, uint32_t obj_id, uint32_t obj_type, struct ias_sprite *sprite) { drmModeObjectPropertiesPtr props; drmModePropertyPtr prop; unsigned int i, j; uint32_t *p; #define F(field) offsetof(struct ias_properties, field) const struct { char *name; int offset; } prop_map[] = { { "type", F(type) }, { "SRC_X", F(src_x) }, { "SRC_Y", F(src_y) }, { "SRC_W", F(src_w) }, { "SRC_H", F(src_h) }, { "CRTC_X", F(crtc_x) }, { "CRTC_Y", F(crtc_y) }, { "CRTC_W", F(crtc_w) }, { "CRTC_H", F(crtc_h) }, { "FB_ID", F(fb_id) }, { "CRTC_ID", F(crtc_id) }, { "rotation", F(rotation) }, { "alpha", F(alpha) }, { "pixel blend mode", F(pixel_blend_mode) }, }; #undef F memset(drm_props, 0, sizeof *drm_props); props = drmModeObjectGetProperties(fd, obj_id, obj_type); if (!props) { return; } weston_log("drm object %u (type 0x%x) properties: ", obj_id, obj_type); for (i = 0; i < props->count_props; i++) { prop = drmModeGetProperty(fd, props->props[i]); if (!prop) { continue; } for (j = 0; j < ARRAY_LENGTH(prop_map); j++) { if (strcmp(prop->name, prop_map[j].name) != 0) { continue; } p = (uint32_t *) ((char *) drm_props + prop_map[j].offset); *p = prop->prop_id; if (!strcmp(prop->name, "type")) { sprite->type = props->prop_values[i]; } if (!strcmp(prop->name, "rotation")) { sprite->rotation = props->prop_values[i]; } weston_log_continue("%s (%u), ", prop->name, prop->prop_id); break; } } weston_log_continue("\n"); } void ias_get_crtc_object_properties(int fd, struct ias_crtc_properties *drm_props, uint32_t obj_id) { drmModeObjectPropertiesPtr props; drmModePropertyPtr prop; unsigned int i, j; uint32_t *p; #define F(field) offsetof(struct ias_crtc_properties, field) const struct { char *name; int offset; } prop_map[] = { { "GAMMA_LUT", F(gamma_lut) }, { "MODE_ID", F(mode_id) }, { "ACTIVE", F(active) }, }; #undef F memset(drm_props, 0, sizeof *drm_props); props = drmModeObjectGetProperties(fd, obj_id, DRM_MODE_OBJECT_CRTC); if (!props) { return; } weston_log("drm crtc object %u (type 0x%x) properties: ", obj_id, DRM_MODE_OBJECT_CRTC); for (i = 0; i < props->count_props; i++) { prop = drmModeGetProperty(fd, props->props[i]); if (!prop) { continue; } for (j = 0; j < ARRAY_LENGTH(prop_map); j++) { if (strcmp(prop->name, prop_map[j].name) != 0) { continue; } p = (uint32_t *) ((char *) drm_props + prop_map[j].offset); *p = prop->prop_id; weston_log_continue("%s (%u), ", prop->name, prop->prop_id); break; } } weston_log_continue("\n"); } static uint32_t is_rbc_resolve_possible_on_sprite(uint32_t rotation, uint32_t format); /* Update output's coordinates * * Function check if output's coordinates related with current CRTC needs to be * adjusted. * The Coordinate adjustment occurs only for extended mode. */ static void ias_update_outputs_coordinate(struct ias_crtc *ias_crtc, struct ias_output *output) { struct ias_configured_output *cfg = NULL; struct ias_crtc *other_crtc = NULL; struct ias_backend *backend = ias_crtc->backend; struct ias_output *relative_output = NULL; int x = 0, y = 0, i = 0; wl_list_for_each(other_crtc, &backend->crtc_list, link) { if (ias_crtc == other_crtc) continue; for(i = 0; i < other_crtc->output_model->outputs_per_crtc; ++i) { cfg = other_crtc->configuration->output[i]; if (cfg->position_target && !strcmp(cfg->position_target, output->name)) { relative_output = other_crtc->output[i]; struct weston_output weston_output = output->base; struct weston_output *rel_base = &relative_output->base; x = rel_base->x; y = rel_base->y; if (cfg->position == OUTPUT_POSITION_RIGHTOF) { x = weston_output.x + weston_output.width; y = weston_output.y; } else if (cfg->position == OUTPUT_POSITION_BELOW) { x = weston_output.x; y = weston_output.y + weston_output.height; } if (x == rel_base->x && y == rel_base->y) continue; rel_base->x = x; rel_base->y = y; /* Do scaling and adjusting of the coordinates */ ias_output_scale(relative_output, rel_base->current_mode->width, rel_base->current_mode->height); /* Update any output relative to the newly moved output */ ias_update_outputs_coordinate(other_crtc, relative_output); } } } } /* * ias CRTC set mode * * Change the mode on the CRTC and update the scanout buffers as * appropriate. * * HDMI Stereo dual-view mode uses two scanout buffers, one for each "eye". * The current assumption is that these will be attached to sprite planes. * But what get's attached to the main display plane? The main display * plane still needs a scanout buffer even if we're not going to render * anything to it. */ static void ias_crtc_set_mode(struct wl_client *client, struct wl_resource *resource, uint32_t mode_id) { struct ias_crtc *ias_crtc = wl_resource_get_user_data(resource); struct ias_backend *backend = ias_crtc->backend; struct ias_mode *m, *old_mode; /* lookup the mode in the list */ wl_list_for_each(m, &ias_crtc->mode_list, link) { if (m->id == mode_id) { weston_log("Found mode to set: %dx%d @ %.1f\n", m->base.width, m->base.height, m->base.refresh/1000.0); /* Set the mode, m, on the CRTC */ /* * If the new mode has the same width/height as the current mode * then we don't need to do much other than call drmModeSetCrtc() * However, it is isn't the same, we'll need to allocate new * buffer objects. */ /* What is the current mode on the crtc? */ if (m == ias_crtc->current_mode) { return; } else if ((m->base.width == ias_crtc->current_mode->base.width) && (m->base.height == ias_crtc->current_mode->base.height)) { old_mode = ias_crtc->current_mode; ias_crtc->current_mode = m; if (ias_crtc->output_model->set_mode(ias_crtc) == 0){ ias_crtc->current_mode->base.flags &= ~WL_OUTPUT_MODE_CURRENT; ias_crtc->current_mode->base.flags |= WL_OUTPUT_MODE_CURRENT; } else { /* restore old mode in ias_crtc */ ias_crtc->current_mode = old_mode; } return; } if (ias_crtc->output_model->allocate_scanout(ias_crtc, m) == -1) { return; } ias_crtc->current_mode->base.flags &= ~WL_OUTPUT_MODE_CURRENT; ias_crtc->current_mode = m; ias_crtc->current_mode->base.flags |= WL_OUTPUT_MODE_CURRENT; ias_crtc->request_set_mode = 1; weston_compositor_damage_all(backend->compositor); if (ias_crtc->output_model->switch_mode) { ias_crtc->output_model->switch_mode(ias_crtc, m); } ias_update_outputs_coordinate(ias_crtc, ias_crtc->output[0]); return; /* Sucess */ } } IAS_ERROR("Failed to find matching mode for ID %d\n", mode_id); return; } static int32_t ias_get_object_prop(int fd, uint32_t id, uint32_t object_type, const char *name, uint32_t *prop_id, uint64_t *prop_value) { int32_t ret = -1; uint32_t i; drmModePropertyPtr prop; drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(fd, id, object_type); for (i = 0; i < props->count_props; i++) { prop = drmModeGetProperty(fd, props->props[i]); if (!prop) { continue; } if (!strcmp(prop->name, name)) { if (prop_id) { *prop_id = props->props[i]; } if (prop_value) { *prop_value = props->prop_values[i]; } ret = 1; drmModeFreeProperty(prop); break; } drmModeFreeProperty(prop); } drmModeFreeObjectProperties(props); return ret; } static void ias_set_crtc_lut(int fd, uint32_t crtc_id, const char *lut_name, struct drm_color_lut* lut, uint32_t lut_size) { uint32_t blob_id; uint32_t lut_id; int32_t ret; ret = drmModeCreatePropertyBlob(fd, lut, sizeof(struct drm_color_lut)* lut_size, &blob_id); if (ret < 0) { IAS_ERROR("Cannot create blob property"); return; } ret = ias_get_object_prop(fd, crtc_id, DRM_MODE_OBJECT_CRTC, lut_name, &lut_id, NULL); if (ret < 0) { IAS_ERROR("Cannot find %s property of CRTC %d\n", lut_name, crtc_id); } else { drmModeObjectSetProperty(fd, crtc_id, DRM_MODE_OBJECT_CRTC, lut_id, blob_id); } drmModeDestroyPropertyBlob(fd, blob_id); } static float transform_contrast_brightness(float value, float brightness, float contrast) { float result; result = (value - 0.5) * contrast + 0.5 + brightness; if (result < 0.0) result = 0.0; if (result > 1.0) result = 1.0; return result; } static float transform_gamma(float value, float gamma) { float result; result = pow(value, 1.0 - gamma); if (result < 0.0) result = 0.0; if (result > 1.0) result = 1.0; return result; } /* * update_color_correction() * * Color correction settings are controlled via DRM properties. * Each CRTC exposes two properties representing lookup table * that should be use for color correction (one for gamma and one for degamma . * We need to build correct tables for gamma, brightness and * contrast corrections. * If color correction needs to be updated atomically, color correction table is * built and then wrapped around DRM blob and saved to be used during atomic * pageflip by backend. */ static void update_color_correction(struct ias_crtc *ias_crtc, uint32_t atomic) { struct ias_backend *backend = ias_crtc->backend; uint64_t lut_size; struct drm_color_lut *lut; float brightness[3]; float contrast[3]; float gamma[3]; uint8_t temp[3]; int32_t ret; uint32_t i; ret = ias_get_object_prop(backend->drm.fd, ias_crtc->crtc_id, DRM_MODE_OBJECT_CRTC, "GAMMA_LUT_SIZE", NULL, &lut_size); if (ret < 0) { IAS_ERROR("Cannot query LUT size"); return; } lut = malloc(lut_size* sizeof(struct drm_color_lut)); if (!lut) { IAS_ERROR("Cannot allocate LUT memory"); return; } /* Unpack brightness values for each channel */ temp[0] = (ias_crtc->brightness >> 16) & 0xFF; temp[1] = (ias_crtc->brightness >> 8) & 0xFF; temp[2] = (ias_crtc->brightness) & 0xFF; /* Map brightness from -128 - 127 range into -0.5 - 0.5 range */ brightness[0] = (float)(temp[0] - 128)/255; brightness[1] = (float)(temp[1] - 128)/255; brightness[2] = (float)(temp[2] - 128)/255; /* Unpack contrast values for each channel */ temp[0] = (ias_crtc->contrast >> 16) & 0xFF; temp[1] = (ias_crtc->contrast >> 8) & 0xFF; temp[2] = (ias_crtc->contrast) & 0xFF; /* Map contrast from 0 - 255 range into 0.0 - 2.0 range */ contrast[0] = (float)(temp[0])/128; contrast[1] = (float)(temp[1])/128; contrast[2] = (float)(temp[2])/128; /* Unpack gamma values for each channel */ temp[0] = (ias_crtc->gamma >> 16) & 0xFF; temp[1] = (ias_crtc->gamma >> 8) & 0xFF; temp[2] = (ias_crtc->gamma) & 0xFF; /* Map gamma from 0 - 255 range into -0.5 - 0.5 */ gamma[0] = (float)(temp[0] - 128)/255; gamma[1] = (float)(temp[1] - 128)/255; gamma[2] = (float)(temp[2] - 128)/255; for (i = 0; i < lut_size; i++) { lut[i].red = (lut_size - 1) * transform_gamma(transform_contrast_brightness((float)(i)/(lut_size-1), brightness[0], contrast[0]), gamma[0]); lut[i].green = (lut_size - 1) * transform_gamma(transform_contrast_brightness((float)(i)/(lut_size-1), brightness[1], contrast[1]), gamma[1]); lut[i].blue = (lut_size - 1) * transform_gamma(transform_contrast_brightness((float)(i)/(lut_size-1), brightness[2], contrast[2]), gamma[2]); /* * When calculating LUT values, integer values from 0 - (lut_size-1) range * are mapped into 0.0 - 1.0 float range and after that converted back to 0 - (lut_size -1) range. * DRM expects LUT values in 0 - 65535 range, so here expand it accordingly. * When that setp is combined with previous one it may produce slighty different values than * expected due to working on float. */ lut[i].red *= (0xFFFF +1)/lut_size; lut[i].green *= (0xFFFF +1)/lut_size; lut[i].blue *= (0xFFFF +1)/lut_size; } if (atomic) { /* * For atomic update of color correction, just prepare LUT table and create DRM * blob id out of it, then just pass that id to backend to be used during atomic pageflip. * After flip is done, backend should destroy that blob, but in case that it was not done, * free it here to prevent memory leaks. */ if (ias_crtc->color_correction_blob_id) { drmModeDestroyPropertyBlob(backend->drm.fd, ias_crtc->color_correction_blob_id); ias_crtc->color_correction_blob_id = 0; } ret = drmModeCreatePropertyBlob(backend->drm.fd, lut, sizeof(struct drm_color_lut)* lut_size, &ias_crtc->color_correction_blob_id); if (ret < 0) { IAS_ERROR("Cannot create blob property"); free(lut); return; } } else { ias_set_crtc_lut(backend->drm.fd, ias_crtc->crtc_id, "GAMMA_LUT", lut, lut_size); } free(lut); } static void ias_crtc_set_gamma(struct wl_client *client, struct wl_resource *resource, uint32_t red, uint32_t green, uint32_t blue) { struct ias_crtc *ias_crtc = wl_resource_get_user_data(resource); red &= 0xFF; green &= 0xFF; blue &= 0xFF; ias_crtc->gamma = (red << 16) | (green << 8) | (blue); update_color_correction(ias_crtc, 0); ias_crtc_send_gamma(resource, red, green, blue); } static void ias_crtc_set_contrast(struct wl_client *client, struct wl_resource *resource, uint32_t red, uint32_t green, uint32_t blue) { struct ias_crtc *ias_crtc = wl_resource_get_user_data(resource); red &= 0xFF; green &= 0xFF; blue &= 0xFF; ias_crtc->contrast = (red << 16) | (green << 8) | (blue); update_color_correction(ias_crtc, 0); ias_crtc_send_contrast(resource, red, green, blue); } static void ias_crtc_set_brightness(struct wl_client *client, struct wl_resource *resource, uint32_t red, uint32_t green, uint32_t blue) { struct ias_crtc *ias_crtc = wl_resource_get_user_data(resource); red &= 0xFF; green &= 0xFF; blue &= 0xFF; ias_crtc->brightness = (red << 16) | (green << 8) | (blue); update_color_correction(ias_crtc, 0); ias_crtc_send_brightness(resource, red, green, blue); } static int cp_handler(void *data) { struct wl_resource *resource = data; struct ias_crtc *ias_crtc = wl_resource_get_user_data(resource); int32_t ret; struct ias_backend *backend; uint32_t cp_prop_id; uint64_t cp_val; backend = ias_crtc->backend; ret = ias_get_object_prop(backend->drm.fd, ias_crtc->connector_id, DRM_MODE_OBJECT_CONNECTOR, "Content Protection", &cp_prop_id, &cp_val); if (ret < 0) { IAS_ERROR("Cannot query content protection"); return 0; } /* * We have set a limit of 10 for cp_handler to be called. Either * CP has been enabled by the driver by then or there is some problem * and we shouldn't unnecessarily wait for the driver to turn on CP so we * will turn this timer off. */ if(++ias_crtc->cp_timer_index < 10 && !cp_val) { wl_event_source_timer_update(ias_crtc->cp_timer, 16); } else { if(cp_val) { ias_crtc_send_content_protection_enabled(resource); } wl_event_source_remove(ias_crtc->cp_timer); } return 1; } static void ias_output_set_fb_transparency(struct wl_client *client, struct wl_resource *resource, uint32_t enabled) { struct ias_output *ias_output = wl_resource_get_user_data(resource); ias_output->transparency_enabled = enabled; return; } static void ias_crtc_set_content_protection(struct wl_client *client, struct wl_resource *resource, uint32_t enabled) { struct ias_crtc *ias_crtc = wl_resource_get_user_data(resource); int32_t ret; struct ias_backend *backend; uint32_t cp_prop_id; uint64_t cp_val; struct wl_event_loop *loop; if(!ias_crtc) { IAS_ERROR("Invalid crtc provided"); return; } /* Make this value a 1 or a 0 */ enabled = !!enabled; backend = ias_crtc->backend; ret = ias_get_object_prop(backend->drm.fd, ias_crtc->connector_id, DRM_MODE_OBJECT_CONNECTOR, "Content Protection", &cp_prop_id, &cp_val); if (ret < 0) { IAS_ERROR("Cannot query content protection"); return; } /* * If the client is asking to enable/disable CP, but the driver already has * that value set, then reject this request. Also, make sure that we can * use nuclear pageflipping. */ if((uint32_t) cp_val != enabled && backend->has_nuclear_pageflip) { cp_val = (uint64_t) enabled; ret = drmModeObjectSetProperty(backend->drm.fd, ias_crtc->connector_id, DRM_MODE_OBJECT_CONNECTOR, cp_prop_id, cp_val); if (ret < 0) { IAS_ERROR("Cannot set content protection property"); return; } /* * According to the spec, userspace can only request to turn on CP by setting the flag * DRM_MODE_CONTENT_PROTECTION_DESIRED, but it is up to driver to decide if it really * will be enabled and change that property to DRM_MODE_CONTENT_PROTECTION_ENABLED. * We must check to see if the driver changed this DESIRED to ENABLED and then report * back to our client that CP indeed got turned on. * Here we start polling and this timer function will be called every 16 ms. */ if(enabled) { /* * Check once to see if the driver already turned on CP. If it did, perfect! We * will inform the client about it. If not, then we have to poll */ ret = ias_get_object_prop(backend->drm.fd, ias_crtc->connector_id, DRM_MODE_OBJECT_CONNECTOR, "Content Protection", &cp_prop_id, &cp_val); if (ret < 0) { IAS_ERROR("Cannot query content protection"); return; } if(cp_val) { ias_crtc_send_content_protection_enabled(resource); } else { loop = wl_display_get_event_loop(backend->compositor->wl_display); ias_crtc->cp_timer_index = 0; ias_crtc->cp_timer = wl_event_loop_add_timer(loop, cp_handler, resource); wl_event_source_timer_update(ias_crtc->cp_timer, 16); } } } } /* * After moving an output, check to see if any pointers also need * to be moved. * * If they do, move them just enough to get them back on the screen. */ static void ias_move_pointer(struct weston_compositor *compositor, struct ias_output *ias_output, int x, int y, int w, int h) { struct ias_backend *backend = (struct ias_backend *) ias_output->base.compositor->backend; struct weston_seat *seat; struct weston_pointer *pointer; struct ias_output *output; struct ias_crtc *crtc; int i, px, py; int valid; wl_list_for_each(seat, &compositor->seat_list, link) { /* Make sure that this seat is for this output only */ if (!(seat->output_mask & (1 << ias_output->base.id))) { continue; } /* Make sure this seat actually has a pointer device */ if (!seat->pointer_device_count) { continue; } pointer = weston_seat_get_pointer(seat); if (!pointer) { continue; } valid = 0; px = wl_fixed_to_int(pointer->x); py = wl_fixed_to_int(pointer->y); wl_list_for_each(crtc, &backend->crtc_list, link) { for (i = 0; i < crtc->num_outputs; i++) { output = crtc->output[i]; if (pixman_region32_contains_point(&output->base.region, px, py, NULL)) { valid = 1; } } } if (!valid) { /* * The pointer is off screen. Ideally we want to move * it just enough to bring it back on screen. */ if (px < x) { px = x; } else if (px > x + w) { px = x + w - 1; } if (py < y) { py = y; } else if (py > y + h) { py = y + h - 1; } pointer->x = wl_fixed_from_int(px); pointer->y = wl_fixed_from_int(py); if (pointer->sprite) { weston_view_set_position(pointer->sprite, px - pointer->hotspot_x, px - pointer->hotspot_y); weston_compositor_schedule_repaint(backend->compositor); } } } } struct ias_crtc_interface ias_crtc_implementation = { ias_crtc_set_mode, ias_crtc_set_gamma, ias_crtc_set_contrast, ias_crtc_set_brightness, ias_crtc_set_content_protection, }; static int ias_add_mode(struct ias_crtc *crtc, drmModeModeInfo *info, uint32_t mode_number) { struct ias_mode *mode; uint64_t refresh; mode = malloc(sizeof *mode); if (mode == NULL) return -1; mode->base.flags = 0; mode->base.width = info->hdisplay; mode->base.height = info->vdisplay; /* Calculate higher precision (mHz) refresh rate */ refresh = (info->clock * 1000000LL / info->htotal + info->vtotal / 2) / info->vtotal; if (info->flags & DRM_MODE_FLAG_INTERLACE) refresh *= 2; if (info->flags & DRM_MODE_FLAG_DBLSCAN) refresh /= 2; if (info->vscan > 1) refresh /= info->vscan; mode->base.refresh = refresh; memcpy(&mode->mode_info, info, sizeof *info); mode->id = mode_number; if (info->type & DRM_MODE_TYPE_PREFERRED) mode->base.flags |= WL_OUTPUT_MODE_PREFERRED; wl_list_insert(crtc->mode_list.prev, &mode->link); return 0; } static void bind_ias_crtc(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wl_resource *resource; struct ias_crtc *ias_crtc = data; struct ias_mode *m; int i; resource = wl_resource_create(client, &ias_crtc_interface, 1, id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &ias_crtc_implementation, data, NULL); /* Loop through the mode list and send each mode to the client */ i = 1; wl_list_for_each(m, &ias_crtc->mode_list, link) { #if 0 weston_log_continue(" mode %dx%d @ %.1f%s%s\n", m->base.width, m->base.height, m->base.refresh / 1000.0, m->base.flags & WL_OUTPUT_MODE_PREFERRED ? ", preferred" : "", m->base.flags & WL_OUTPUT_MODE_CURRENT ? ", current" : ""); #endif /* Send actual refresh or refresh * 1000 for more precision? */ ias_crtc_send_mode(resource, m->id, m->base.width, m->base.height, (uint32_t)(m->base.refresh / 1000)); i++; } ias_crtc_send_gamma(resource, (ias_crtc->gamma >> 16) & 0xFF, (ias_crtc->gamma >> 8) & 0xFF, ias_crtc->gamma & 0xFF); ias_crtc_send_contrast(resource, (ias_crtc->contrast >> 16) & 0xFF, (ias_crtc->contrast >> 8) & 0xFF, ias_crtc->contrast & 0xFF); ias_crtc_send_brightness(resource, (ias_crtc->brightness >> 16) & 0xFF, (ias_crtc->brightness >> 8) & 0xFF, ias_crtc->brightness & 0xFF); ias_crtc_send_id(resource, ias_crtc->connector_id); } static struct ias_crtc* ias_crtc_create(struct ias_backend *backend) { struct ias_crtc *ias_crtc = calloc(1, sizeof *ias_crtc); if (!ias_crtc) { IAS_ERROR("Failed to allocate CRTC: out of memory"); exit(1); } ias_crtc->backend = backend; ias_crtc->global = wl_global_create(backend->compositor->wl_display, &ias_crtc_interface, 1, ias_crtc, bind_ias_crtc); wl_list_init(&ias_crtc->mode_list); return ias_crtc; } static void ias_crtc_destroy(struct ias_crtc *ias_crtc) { drmModeCrtcPtr origcrtc = ias_crtc->original_crtc; if (ias_crtc->prop_set) { drmModeAtomicFree(ias_crtc->prop_set); ias_crtc->prop_set = NULL; } /* Restore original CRTC state */ if (origcrtc) { drmModeSetCrtc(ias_crtc->backend->drm.fd, origcrtc->crtc_id, origcrtc->buffer_id, origcrtc->x, origcrtc->y, &ias_crtc->connector_id, 1, &origcrtc->mode); drmModeFreeCrtc(origcrtc); } wl_global_destroy(ias_crtc->global); free(ias_crtc); } static void ias_output_set_xy(struct wl_client *client, struct wl_resource *resource, uint32_t x, uint32_t y) { struct ias_output *ias_output = wl_resource_get_user_data(resource); struct weston_compositor *compositor = ias_output->base.compositor; ias_output->base.dirty = 1; weston_output_damage(&ias_output->base); weston_output_move(&ias_output->base, x, y); ias_move_pointer(compositor, ias_output, x, y, ias_output->base.current_mode->width, ias_output->base.current_mode->height); wl_signal_emit(&ias_output->update_signal, ias_output); weston_compositor_damage_all(compositor); } static void ias_output_disable(struct wl_client *client, struct wl_resource *resource) { struct ias_output *ias_output = wl_resource_get_user_data(resource); ias_output->ias_crtc->output_model->disable_output(ias_output); } static void ias_output_enable(struct wl_client *client, struct wl_resource *resource) { struct ias_output *ias_output = wl_resource_get_user_data(resource); ias_output->ias_crtc->output_model->enable_output(ias_output); } /* * Scale the output. * * This allows us to have an output that has different dimensions from * the actual display resolution. * * Note that this is modifying the output transforms based on IAS API's. * The Weston core isn't aware of our modifications and will overwrite * them if the weston_output is ever marked 'dirty'. */ void ias_output_scale(struct ias_output *ias_output, uint32_t width, uint32_t height) { struct weston_output *output; struct weston_compositor *compositor = ias_output->base.compositor; output = &ias_output->base; /* If current output size is the same as requested one, do nothing */ if ((uint32_t)output->width == width && (uint32_t)output->height == height) return; output->dirty = 1; /* Set the output to the new (scaled ) width / height */ output->width = width; output->height = height; /* * If this output is rotated by 90 or 270, then we need to swap * the output's width and height similar to how * weston_output_transform_init() does it. */ switch (output->transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: output->width = height; output->height = width; /* * If normalized_rotation is turned on, then we update mm_width * and mm_height so that all the clients that bind to this output * will receive the swapped width and height. */ if (compositor->normalized_rotation) { weston_head_set_physical_size(&ias_output->head, height, width); } break; } /* * "Move" the output to its current position; this will help update * some internal structures like the output region. */ weston_output_move(&ias_output->base, output->x, output->y); weston_output_damage(&ias_output->base); /* * The previous frame's damage is also completely invalid now that we've * resized. Re-initialize it to the entire (new) output size. */ pixman_region32_fini(&ias_output->prev_damage); pixman_region32_init(&ias_output->prev_damage); pixman_region32_copy(&ias_output->prev_damage, &output->region); ias_move_pointer(compositor, ias_output, output->x, output->y, ias_output->base.current_mode->width, ias_output->base.current_mode->height); ias_output->is_resized = 1; wl_signal_emit(&ias_output->update_signal, ias_output); weston_compositor_damage_all(compositor); } static void ias_output_scale_to(struct wl_client *client, struct wl_resource *resource, uint32_t width, uint32_t height) { struct ias_output *ias_output = wl_resource_get_user_data(resource); ias_output_scale(ias_output, width, height); } struct ias_output_interface ias_output_implementation = { ias_output_set_xy, ias_output_disable, ias_output_enable, ias_output_scale_to, ias_output_set_fb_transparency, }; static void bind_ias_output(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wl_resource *resource; struct ias_output *ias_output = data; resource = wl_resource_create(client, &ias_output_interface, 1, id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &ias_output_implementation, data, NULL); ias_output_send_name(resource, ias_output->name); } static struct ias_output* ias_output_create(struct ias_backend *backend) { struct ias_output *ias_output = calloc(1, sizeof *ias_output); if (!ias_output) { IAS_ERROR("Failed to allocate output: out of memory"); exit(1); } ias_output->global = wl_global_create(backend->compositor->wl_display, &ias_output_interface, 1, ias_output, bind_ias_output); ias_output->plugin_redraw_always = 1; return ias_output; } void ias_fb_destroy_callback(struct gbm_bo *bo, void *data) { struct ias_fb *fb = data; struct gbm_device *gbm = gbm_bo_get_device(bo); if (fb->fb_id) drmModeRmFB(gbm_device_get_fd(gbm), fb->fb_id); weston_buffer_reference(&fb->buffer_ref, NULL); free(data); } #define DRM_MODE_FB_AUX_PLANE (1<<2) #ifndef EGL_STRIDE #define EGL_STRIDE 0x3060 #endif #ifndef EGL_OFFSET #define EGL_OFFSET 0x3061 #endif struct ias_fb * ias_fb_get_from_bo(struct gbm_bo *bo, struct weston_buffer *buffer, struct ias_output *output, enum ias_fb_type fb_type) { struct ias_fb *fb = gbm_bo_get_user_data(bo); struct ias_backend *backend = (struct ias_backend *) output->base.compositor->backend; uint32_t width, height; uint32_t format, strides[4] = {0}, handles[4] = {0}, offsets[4] = {0}; uint64_t modifier, modifiers[4] = {0}; uint32_t stride, handle; int ret; int flags = 0; struct ias_crtc *ias_crtc = output->ias_crtc; struct linux_dmabuf_buffer *dmabuf = NULL; int i; if (fb) { if (fb->fb_id) drmModeRmFB(backend->drm.fd, fb->fb_id); /* TODO: need to find better way instead of creating fb again */ free(fb); } fb = malloc(sizeof *fb); if (!fb) { IAS_ERROR("Failed to allocate fb: out of memory"); exit(1); } fb->bo = bo; fb->output = output; fb->is_client_buffer = 0; fb->buffer_ref.buffer = NULL; fb->is_compressed = 0; width = gbm_bo_get_width(bo); height = gbm_bo_get_height(bo); format = gbm_bo_get_format(bo); modifier = gbm_bo_get_modifier(bo); if ((!ias_crtc->sprites_are_broken && fb_type != IAS_FB_CURSOR) || (!ias_crtc->cursors_are_broken && fb_type == IAS_FB_CURSOR)) { /* if transparency is not enabled disable alpha channel only * when scanout == true, otherwise leave format unchanged */ if (fb_type == IAS_FB_SCANOUT && !output->transparency_enabled && format == GBM_FORMAT_ARGB8888) { format = GBM_FORMAT_XRGB8888; } if (bo == ias_crtc->cursor_bo[0] || bo == ias_crtc->cursor_bo[1]) { format = GBM_FORMAT_ARGB8888; } if (buffer) dmabuf = linux_dmabuf_buffer_get(buffer->resource); if (dmabuf) { for (i = 0; i < dmabuf->attributes.n_planes; i++) { handles[i] = gbm_bo_get_handle(bo).u32; strides[i] = dmabuf->attributes.stride[i]; offsets[i] = dmabuf->attributes.offset[i]; modifiers[i] = dmabuf->attributes.modifier[i]; if (modifiers[i] > 0) { flags |= DRM_MODE_FB_MODIFIERS; if (modifiers[i] == I915_FORMAT_MOD_Y_TILED_CCS || modifiers[i] == I915_FORMAT_MOD_Yf_TILED_CCS) fb->is_compressed = 1; } } } else { if (format == GBM_FORMAT_NV12) { if (buffer != NULL) { gl_renderer->query_buffer(backend->compositor, buffer->legacy_buffer, EGL_STRIDE, (EGLint *)strides); gl_renderer->query_buffer(backend->compositor, buffer->legacy_buffer, EGL_OFFSET, (EGLint *)offsets); } handles[0] = gbm_bo_get_handle(bo).u32; handles[1] = gbm_bo_get_handle(bo).u32; } else if (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_ARGB8888) { strides[0] = gbm_bo_get_stride(bo); handles[0] = gbm_bo_get_handle(bo).u32; offsets[0] = 0; } if (modifier && modifier != DRM_FORMAT_MOD_INVALID) { modifiers[0] = modifier; flags |= DRM_MODE_FB_MODIFIERS; } } ret = drmModeAddFB2WithModifiers(backend->drm.fd, width, height, format, handles, strides, offsets, modifiers, &fb->fb_id, flags); if (ret) { ias_crtc->sprites_are_broken = 1; weston_log("failed to create kms fb: %m, trying support for " "older kernels.\n"); } } if ((ias_crtc->sprites_are_broken && fb_type != IAS_FB_CURSOR) || (ias_crtc->cursors_are_broken && fb_type == IAS_FB_CURSOR)) { stride = gbm_bo_get_stride(bo); handle = gbm_bo_get_handle(bo).u32; ret = drmModeAddFB(backend->drm.fd, width, height, 24, 32, stride, handle, &fb->fb_id); if (ret) { /* Try depth = 32 FB */ ret = drmModeAddFB(backend->drm.fd, width, height, 32, 32, stride, handle, &fb->fb_id); if (ret) { weston_log("failed to create kms fb: %m\n"); free(fb); return NULL; } } } fb->format = format; gbm_bo_set_user_data(bo, fb, ias_fb_destroy_callback); return fb; } /* * ias_attempt_scanout_for_view() * * Attempts to use a client buffer as the scanout for an output. This * function is only used when running in non-dualview/non-stereo mode. * * This function tries to use a surface (weston_surface *es) directly * as a scanout buffer (gbm_bo *bo). This is an optimization to try and * get the display to directly flip to this buffer, rather than have to * composite this surface with other surfaces. This will only work if the * geometry matches exactly, so the surface takes up the full screen. Also * the surface must be fully opaque, so you don't have to blend it with * surfaces that may be below this surface. There are some additional cases * where this will not work, and some that might get added over time as they * are discovered. Some of these additional cases are: * Transformed surfaces, surfaces with non-standard shaders, surfaces with SHM * buffers. * Where this optimization will not work, we do not bother creating the gbm_bo * scanout buffer (or discarding the one we started creating), since we'll have * to do some compositing to another gbm_bo scanout buffer later. * * This function returns the weston_plane for the scanout if the * surface is suitable. Otherwise it returns NULL. * */ static struct weston_plane * ias_attempt_scanout_for_view(struct weston_output *_output, struct weston_view *ev, uint32_t check_xy) { struct ias_output *output = (struct ias_output *) _output; struct ias_backend *c = (struct ias_backend *) output->base.compositor->backend; struct gbm_bo *bo = NULL; struct ias_crtc *ias_crtc = output->ias_crtc; struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; struct linux_dmabuf_buffer *dmabuf; struct ias_fb *ias_fb; uint32_t format; uint32_t resolve_needed = 0; struct ias_sprite *ias_sprite; int i; if (ias_crtc->output_model->get_next_fb(output)) { return NULL; } /* * Check if this surface overlaps with output region, if no just skip it, * there is no way that it could be used as scanout buffer. * Additionally it may cause problems with RBC, as the same surface will be * checked for different outputs and on one of them it can be resolved in display * controller, but not in the other one, depending on order of outputs checked, * RBC may be disabled for that surface even if it will be possible to resolve it */ pixman_region32_t output_overlap; pixman_region32_init(&output_overlap); pixman_region32_intersect(&output_overlap, &ev->transform.boundingbox, &output->base.region); if (!pixman_region32_not_empty(&output_overlap)) { return NULL; } if (buffer) { if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource))) { struct gbm_import_fd_data gbm_dmabuf = { .fd = dmabuf->attributes.fd[0], .width = dmabuf->attributes.width, .height = dmabuf->attributes.height, .stride = dmabuf->attributes.stride[0], .format = dmabuf->attributes.format }; for (i = 0; i < dmabuf->attributes.n_planes; i++) { if (dmabuf->attributes.modifier[i] == I915_FORMAT_MOD_Y_TILED_CCS || dmabuf->attributes.modifier[i] == I915_FORMAT_MOD_Yf_TILED_CCS) { resolve_needed = 1; break; } } bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_FD, &gbm_dmabuf, GBM_BO_USE_SCANOUT); } else { bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER, buffer->resource, GBM_BO_USE_SCANOUT); } } if (!bo) { return NULL; } format = gbm_bo_get_format(bo); wl_list_for_each(ias_sprite, &ias_crtc->sprite_list, link) { if ((c->use_cursor_as_uplane || ias_sprite->type != DRM_PLANE_TYPE_CURSOR) && (uint32_t)ias_sprite->output_id == output->scanout) { break; } } /* * Make output specific call to check if this surface is flippable. * Additionaly check if sprite used for given output is able to resolve given buffer if there is such need. */ if(!ias_crtc->output_model->is_surface_flippable || !ias_crtc->output_model->is_surface_flippable(ev, _output, check_xy) || (resolve_needed && !(c->rbc_enabled && ias_sprite->supports_rbc && is_rbc_resolve_possible_on_sprite(0, format)))) { if (resolve_needed && c->rbc_debug) { weston_log("[RBC] Cannot handle compressed buffer on scanout %d, requesing resolve in DRI\n", output->scanout); } gbm_bo_destroy(bo); return NULL; } ias_fb = ias_fb_get_from_bo(bo, buffer, output, IAS_FB_SCANOUT); if (!ias_fb) { gbm_bo_destroy(bo); return NULL; } ias_fb->is_client_buffer = 1; weston_buffer_reference(&ias_fb->buffer_ref, buffer); ias_crtc->output_model->set_next_fb(output, ias_fb); return &output->fb_plane; } /* * ias_output_render() * * Render an output buffer for presentation. Note that this function may be * skipped in non-dualview cases where we determine that we have a suitable * fullscreen, top-level client buffer that we can just flip to directly. */ void ias_output_render(struct ias_output *output, pixman_region32_t *new_damage) { struct ias_backend *b = (struct ias_backend *) output->base.compositor->backend; struct ias_crtc *ias_crtc = output->ias_crtc; //GLfloat saved_clearcolor[4]; int ret; pixman_region32_t damage; /* * Clear out scanout_surface */ output->scanout_surface = NULL; /* * Combine this frame's damage with previous frame's damage to figure out * which areas of the scanout need to be drawn (since we swap between * scanout buffers, we need to accumulate two frames of damage). */ pixman_region32_init(&damage); pixman_region32_union(&damage, new_damage, &output->prev_damage); /* Save away our new damage so that it can be re-used next frame */ pixman_region32_copy(&output->prev_damage, new_damage); /* Bind buffers/contexts in preparation for rendering */ ret = ias_crtc->output_model->pre_render(output); if (ret) { return; } /* * If the output is disabled or it's a virtual connector, then we don't * waste our time compositing a scanout buffer for it. */ if (!output->disabled && ias_crtc->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) { if (output->plugin) { /* This output might be scaled. Setup the real viewport for the output */ //glViewport(0, 0, output->width, output->height); /* Call the plugin-loaded draw function */ output->plugin->draw_plugin(output); } else { /* Standard output drawing function */ b->compositor->renderer->repaint_output_base(&output->base, &damage); } } pixman_region32_fini(&damage); wl_signal_emit(&output->base.frame_signal, output); /* Complete rendering process */ ias_crtc->output_model->post_render(output); TRACEPOINT_ONCE("Backend post render complete"); } static void vblank_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) { struct ias_sprite *s = (struct ias_sprite *)data; struct ias_backend *c = s->compositor; struct ias_crtc *ias_crtc = s->ias_crtc; struct timespec ts; uint32_t flags = WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION | WP_PRESENTATION_FEEDBACK_KIND_HW_CLOCK; ias_crtc->vblank_pending = 0; wl_list_for_each(s, &ias_crtc->sprite_list, link) { /* TODO: Mimicing similar functionality from compositor-drm.c; * need to verify. */ drmModeRmFB(c->drm.fd, s->current->fb_id); s->current = s->next; s->next = NULL; } if (!ias_crtc->page_flip_pending) { ts.tv_sec = sec; ts.tv_nsec = usec * 1000; weston_output_finish_frame(&ias_crtc->output[0]->base, &ts, flags); } } /* * page_flip_handler() * * Handle page flip completion on a CRTC. * * There may be more than one, for example there could be flis pending * on the main plane and both sprite planes (stereo or other dual view * modes). */ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) { struct ias_crtc *ias_crtc = (struct ias_crtc *) data; TRACEPOINT_ONCE("First frame visible"); if (ias_crtc->output_model->flip_handler) { ias_crtc->output_model->flip_handler(ias_crtc, sec, usec, 0, 0); } else { IAS_ERROR("Page flip handling not supported yet for this output model"); } } /* * Emulate page flip even for virtual display, * so that weston repaint timer will be reset correctly */ static int virtual_pageflip(void *data) { struct ias_crtc *ias_crtc = (struct ias_crtc *) data; struct timespec ts; clock_gettime(ias_crtc->backend->clock, &ts); /* * For simplicity, as each output model is tracking flip state in private data, * assume that if its page_flip_handler will be called without any pending flip it * will handle that gracefully */ page_flip_handler(-1, 0, ts.tv_sec, ts.tv_nsec/1000, data); /* * There may be issue with precision of below timer, * as its resolution is in ms, so it is hard to match * actuall refresh rate of display which may be eg. 16.66 ms */ wl_event_source_timer_update(ias_crtc->pageflip_timer, 1000000/ias_crtc->current_mode->base.refresh); return 0; } #if 0 static void atomic_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, uint32_t obj_id, uint32_t old_fb_id, void *data) { struct ias_crtc *ias_crtc = (struct ias_crtc *)data; if (ias_crtc->output_model->flip_handler) { ias_crtc->output_model->flip_handler(ias_crtc, sec, usec, old_fb_id, obj_id); } else { IAS_ERROR("Atomic page flip handling not supported yet for this output model"); } } #endif static void drm_set_cursor(struct ias_backend *c, struct ias_crtc *ias_crtc, struct ias_sprite *s, uint32_t w, uint32_t h) { drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.crtc_id, ias_crtc->crtc_id); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.src_x, 0 << 16); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.src_y, 0 << 16); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.src_w, w << 16); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.src_h, h << 16); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.crtc_w, w); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.crtc_h, h); } static void drm_move_cursor(struct ias_backend *c, struct ias_crtc *ias_crtc, struct ias_sprite *s, int32_t x, int32_t y) { drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.crtc_x, x); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.crtc_y, y); } /* * ias_update_cursor() * * Move/set the cursor image during repaint. */ static void ias_update_cursor(struct ias_crtc *ias_crtc) { struct weston_view *ev = ias_crtc->cursor_view; struct ias_backend *c = (struct ias_backend *)ias_crtc->backend; struct ias_output *output = ias_crtc->output[0]; struct weston_buffer *buffer; EGLint handle, stride; struct gbm_bo *bo; struct ias_fb *fb; uint32_t buf[64 * 64]; unsigned char *shm_buf; struct ias_sprite *s; int i, x, y; /* Clear cursor surface in prep for next frame */ ias_crtc->cursor_view = NULL; /* If HW cursors are not available, abort */ if (ias_crtc->cursors_are_broken) { return; } wl_list_for_each(s, &ias_crtc->sprite_list, link) { if (s->type == DRM_PLANE_TYPE_CURSOR) { break; } } /* * If no surface was assigned for this frame, turn off the hardware cursor */ if (ev == NULL) { if (ias_crtc->output_model->hw_cursor) { if (!c->has_nuclear_pageflip) { drmModeSetCursor(c->drm.fd, ias_crtc->crtc_id, 0, 0, 0); } else if(!ias_crtc->disable_cursor_once) { /* * If a cursor has been disabled once already, then don't waste * time disabling it again */ drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.fb_id, 0); drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.crtc_id, 0); ias_crtc->disable_cursor_once = 1; } } return; } /* * Looks like a cursor has been set. So if later it ever gets removed, then * disable it only once */ ias_crtc->disable_cursor_once = 0; buffer = ev->surface->buffer_ref.buffer; /* * If the cursor image has been damaged, generate a new GEM bo we can * set as the cursor image. */ if (buffer && pixman_region32_not_empty(&ias_crtc->cursor_plane.damage)) { /* Clear damage */ pixman_region32_fini(&ias_crtc->cursor_plane.damage); pixman_region32_init(&ias_crtc->cursor_plane.damage); /* Switch back/front buffers for cursor */ ias_crtc->current_cursor ^= 1; bo = ias_crtc->cursor_bo[ias_crtc->current_cursor]; memset(buf, 0, sizeof buf); stride = wl_shm_buffer_get_stride(buffer->shm_buffer); shm_buf = wl_shm_buffer_get_data(buffer->shm_buffer); wl_shm_buffer_begin_access(buffer->shm_buffer); for (i = 0; i < ev->surface->height; i++) { memcpy(buf + i * 64, shm_buf + i * stride, ev->surface->width * 4); } wl_shm_buffer_end_access(buffer->shm_buffer); if (gbm_bo_write(bo, buf, sizeof buf) < 0) { IAS_ERROR("Failed to update cursor: %m"); /* Ignore error and try to continue... */ } fb = ias_fb_get_from_bo(bo, buffer, output, IAS_FB_CURSOR); if (!fb) { IAS_ERROR("Failed to get fb for cursor: %m"); ias_crtc->cursors_are_broken = 1; } else { drmModeAtomicAddProperty(ias_crtc->prop_set, s->plane_id, s->prop.fb_id, fb->fb_id); } if (c->has_nuclear_pageflip) { drm_set_cursor(c, ias_crtc, s, 64, 64); } else { /* Call KMS to set cursor image */ handle = gbm_bo_get_handle(bo).s32; drmModeSetCursor(c->drm.fd, ias_crtc->crtc_id, handle, 64, 64); } } /* Program cursor plane to surface position */ x = ev->geometry.x - output->base.x; y = ev->geometry.y - output->base.y; if (x < 0) x = 0; if (y < 0) y = 0; if (ias_crtc->cursor_plane.x != x || ias_crtc->cursor_plane.y != y) { if (c->has_nuclear_pageflip) { drm_move_cursor(c, ias_crtc, s, x, y); } else { drmModeMoveCursor(c->drm.fd, ias_crtc->crtc_id, x, y); } ias_crtc->cursor_plane.x = x; ias_crtc->cursor_plane.y = y; } } static int32_t is_surface_flippable_on_cursor(struct ias_crtc *ias_crtc, struct weston_view *ev) { struct ias_output *ias_output = ias_crtc->output[0]; struct weston_transform *transform; struct weston_buffer *buffer; /* If HW cursors are not available, abort */ if (ias_crtc->cursors_are_broken) { return 0; } /* Make sure the surface is visible on this output and this output only */ if (ev->output_mask != (1u << ias_output->base.id)) { return 0; }; wl_list_for_each(transform, &ev->geometry.transformation_list, link) { if (transform != &ev->transform.position) { return 0; } } buffer = ev->surface->buffer_ref.buffer; /* * If there's no buffer attached, or the buffer is too big, we can't * use the cursor plane. */ if (buffer == NULL || ev->surface->width > 64 || ev->surface->height > 64) { return 0; } /* * We only handle CPU-rendered shm buffers for cursors. Don't try to use * a GPU-rendered cursor on the cursor plane. */ if (!wl_shm_buffer_get(buffer->resource)) { return 0; } /* Shouldn't use hardware cursor on scaled outputs */ if (ias_crtc->current_mode->base.width != ias_output->width || ias_crtc->current_mode->base.height != ias_output->height) { return 0; } return 1; } /* * ias_attempt_cursor_for_view() * * Attempts to use a CRTC's cursor plane to display a surface. This function * should only be used for non-dualview, non-stereo configurations. */ static struct weston_plane * ias_attempt_cursor_for_view(struct ias_crtc *ias_crtc, struct weston_view *ev) { #if 0 struct ias_output *ias_output = ias_crtc->output[0]; struct ias_backend *backend = ias_crtc->backend; struct weston_buffer *buffer; struct gbm_bo *bo; uint32_t buf[64 * 64]; uint32_t stride; int32_t handle; unsigned char *s; int i, x, y; #endif assert(ias_crtc->output_model != NULL); /* If we've already assigned something to the cursor plane, bail out */ if (ias_crtc->cursor_view) { return NULL; } if (!is_surface_flippable_on_cursor(ias_crtc, ev)) { return NULL; } /* Okay, looks like this is a suitable surface. */ ias_crtc->cursor_view = ev; return &ias_crtc->cursor_plane; #if 0 /* * If this surface wasn't * on the cursor plane before, or if it was, but has been damaged, we * need to update the cursor bo with the new surface contents. */ if (ias_crtc->last_cursor_view != ev || pixman_region32_not_empty(&ev->surface->damage)) { /* Switch back/front buffers for cursor */ ias_crtc->current_cursor ^= 1; bo = ias_crtc->cursor_bo[ias_crtc->current_cursor]; memset(buf, 0, sizeof buf); stride = wl_shm_buffer_get_stride(buffer->shm_buffer); s = wl_shm_buffer_get_data(buffer->shm_buffer); wl_shm_buffer_begin_access(buffer->shm_buffer); for (i = 0; i < ev->surface->height; i++) memcpy(buf + i * 64, s + i * stride, ev->surface->width * 4); wl_shm_buffer_end_access(buffer->shm_buffer); if (gbm_bo_write(bo, buf, sizeof buf) < 0) return NULL; handle = gbm_bo_get_handle(bo).s32; if (drm_set_cursor(compositor, ias_crtc, handle, 64, 64)) { IAS_ERROR("failed to set cursor: %m"); return NULL; } } /* Now position the cursor plane on the screen */ x = (ev->geometry.x - ias_output->base.x); y = (ev->geometry.y - ias_output->base.y); if (x < 0) x = 0; if (y < 0) y = 0; if (ias_crtc->cursor_x != x || ias_crtc->cursor_y != y) { if (drm_move_cursor(compositor, ias_crtc, x, y)) { weston_log("failed to move cursor: %m\n"); return NULL; } ias_crtc->cursor_x = x; ias_crtc->cursor_y = y; } ias_crtc->cursor_view = ev; return &ias_crtc->cursor_plane; #endif } /* * ias_assign_planes() * * Try to assign surfaces to hardware planes. We may assign surfaces to a * cursor or sprite plane, or we may decide to flip to a client buffer directly * onto the display plane. */ static void ias_assign_planes(struct weston_output *output, void *repaint_data) { struct weston_view *ev, *next; pixman_region32_t overlap, surface_overlap; struct weston_plane *primary_plane, *next_plane; struct ias_output *ias_output = (struct ias_output *)output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct ias_output_model *output_model = ias_crtc->output_model; struct ias_backend *backend = ias_crtc->backend; /* * If this output model can neither flip client surfaces or use a hardware * cursor, there's nothing we can do here. */ if (!output_model->hw_cursor && !output_model->can_client_flip) { return; } /* * Assuming this output model supports it, the cursor is available for use * for matching surfaces */ ias_crtc->last_cursor_view = ias_crtc->cursor_view; ias_crtc->cursor_view = NULL; /* * Track the area of all surfaces above that will overlap with future * surfaces. */ pixman_region32_init(&overlap); /* Walk surface list from top/highest to bottom/lowest */ primary_plane = &backend->compositor->primary_plane; wl_list_for_each_safe(ev, next, &backend->compositor->view_list, link) { if (!(ev->output_mask & (1 <<output->id))) continue; /* * If this surface is meant for remote SoC, then we must hide it from * the local one by assigning it to NULL plane. This way, the client * will continue to provide us with buffers but we will just not be * showing them on any Wayland output. */ if(ev->surface->role_name && !strcmp(ev->surface->role_name, "remote_soc")) { weston_view_move_to_plane(ev, NULL); continue; } /* * Surfaces that can be flipped onto the display plane or the cursor plane * need to have their buffer kept around. */ if((ias_crtc->output_model->is_surface_flippable && ias_crtc->output_model->is_surface_flippable(ev, output, 1)) || is_surface_flippable_on_cursor(ias_crtc, ev)) { ev->surface->keep_buffer = 1; } /* * If a plugin is active, then we cannot let surfaces be assigned to * hardware planes. */ if (!ias_output->plugin) { /* * Figure out what areas of this surface (after transformations are * applied) are covered by higher surfaces that we've already * iterated over. */ pixman_region32_init(&surface_overlap); pixman_region32_intersect(&surface_overlap, &overlap, &ev->transform.boundingbox); next_plane = NULL; /* * If this surface is clipped by any higher surfaces, it's not a * candidate for the cursor plane or flipping directly to the display * plane. */ if (pixman_region32_not_empty(&surface_overlap)) { next_plane = primary_plane; } /* See if it looks like a cursor */ if (next_plane == NULL && output_model->hw_cursor) { next_plane = ias_attempt_cursor_for_view(ias_crtc, ev); } /* See if it can be flipped directly as a scanout */ if (next_plane == NULL && output_model->can_client_flip) { next_plane = ias_attempt_scanout_for_view(output, ev, 1); } /* All other options failed; we're going to blit it to the main fb */ if (next_plane == NULL) { next_plane = primary_plane; } /* * Let weston figure out what needs to be damaged when using this * plane to present this surface. */ weston_view_move_to_plane(ev, next_plane); /* Update region of main FB being redrawn */ if (next_plane == primary_plane) { pixman_region32_union(&overlap, &overlap, &ev->transform.boundingbox); } pixman_region32_fini(&surface_overlap); } else { /* * If this surface can be flipped onto the sprite plane, * then it's buffer needs to be kep around. */ if (is_surface_flippable_on_sprite(ev, output)) { ev->surface->keep_buffer = 1; } } if(!ev->surface->keep_buffer && ev->surface->role_name && !strcmp(ev->surface->role_name, "ivi_surface")) { ev->surface->keep_buffer = 1; } } pixman_region32_fini(&overlap); } static int ias_output_start_repaint_loop(struct weston_output *output_base) { struct timespec ts; struct ias_backend *backend = (struct ias_backend *) output_base->compositor->backend; clock_gettime(backend->compositor->presentation_clock, &ts); weston_output_finish_frame(output_base, &ts, WP_PRESENTATION_FEEDBACK_INVALID); return 0; } /* * Does the ias_output have a link to the CRTC? If so, then check * the crtc to see how many outputs are attached. Will have to behave * differently if there are multiple outputs attached. * * Should all the next/current info be moved to the crtc? * */ static int ias_output_repaint(struct weston_output *output_base, pixman_region32_t *damage, void *repaint_data) { struct ias_output *output = (struct ias_output *) output_base; struct ias_backend *backend = (struct ias_backend *) output->base.compositor->backend; struct ias_crtc *ias_crtc = output->ias_crtc; if (output->disabled) { return 1; } if (!ias_crtc->output_model->generate_crtc_scanout( ias_crtc, output, damage)) { return 1; } if (ias_crtc->request_color_correction_reset) { ias_crtc->request_color_correction_reset = 0; update_color_correction(ias_crtc, backend->has_nuclear_pageflip); } /* * The order we do the cursor/sprite/display plane updates depends on * if we have atomic page flip capabilites. */ if (backend->has_nuclear_pageflip) { /* If hardware cursor enabled, program that now. */ ias_update_cursor(ias_crtc); /* Prepare the sprite planes for flipping. */ if(ias_crtc->output_model->update_sprites) { ias_crtc->output_model->update_sprites(ias_crtc); } /* * generate_crtc_scanout() should setup the next scanout buffer(s) * that need to be flipped. Call the output model's flip function * to schedule the actual flip(s). */ ias_crtc->output_model->flip(backend->drm.fd, ias_crtc, output->scanout); } else { /* * generate_crtc_scanout() should setup the next scanout buffer(s) * that need to be flipped. Call the output model's flip function * to schedule the actual flip(s). */ ias_crtc->output_model->flip(backend->drm.fd, ias_crtc, output->scanout); /* If hardware cursor enabled, program that now. */ ias_update_cursor(ias_crtc); } return 0; } static void ias_output_destroy(struct weston_output *output_base) { struct ias_output *output = (struct ias_output *) output_base; struct ias_backend *c = (struct ias_backend *) output->base.compositor->backend; struct ias_mode *ias_mode, *next; /* * If this was a non-dualview / non-stereo setup, we might have been * using the hardware cursor. Turn it off. */ drmModeSetCursor(c->drm.fd, output->ias_crtc->crtc_id, 0, 0, 0); weston_plane_release(&output->fb_plane); weston_output_release(&output->base); wl_list_for_each_safe(ias_mode, next, &output->ias_crtc->mode_list, link) { wl_list_remove(&ias_mode->link); free(ias_mode); } //wl_list_remove(&output->base.link); wl_list_remove(&output->link); weston_head_release(&output->head); wl_global_destroy(output->global); free(output); } /* * ias_repeat_redraw() * * Indicates whether this output should immediately schedule another redraw * after finishing the previous redraw. This is the default behavior when * using a layout plugin, but can be changed by a plugin via the * ias_set_plugin_redraw_behavior() helper function. */ static int ias_repeat_redraw(struct weston_output *output) { struct ias_output *ias_output = (struct ias_output *)output; return (ias_output->plugin != NULL && ias_output->plugin_redraw_always); } static int on_ias_input(int fd, uint32_t mask, void *data) { drmEventContext evctx; memset(&evctx, 0, sizeof evctx); evctx.version = DRM_EVENT_CONTEXT_VERSION; evctx.page_flip_handler = page_flip_handler; evctx.vblank_handler = vblank_handler; drmHandleEvent(fd, &evctx); return 1; } static int ias_subpixel_to_wayland(int ias_value) { switch (ias_value) { default: case DRM_MODE_SUBPIXEL_UNKNOWN: return WL_OUTPUT_SUBPIXEL_UNKNOWN; case DRM_MODE_SUBPIXEL_NONE: return WL_OUTPUT_SUBPIXEL_NONE; case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB: return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR: return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; case DRM_MODE_SUBPIXEL_VERTICAL_RGB: return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; case DRM_MODE_SUBPIXEL_VERTICAL_BGR: return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; } } static drmModePropertyPtr ias_get_prop(int fd, drmModeConnectorPtr connector, const char *name) { drmModePropertyPtr props; int i; for (i = 0; i < connector->count_props; i++) { props = drmModeGetProperty(fd, connector->props[i]); if (!props) continue; if (!strcmp(props->name, name)) return props; drmModeFreeProperty(props); } return NULL; } void add_connector_id(struct ias_crtc *ias_crtc) { struct ias_backend *backend = ias_crtc->backend; drmModeConnectorPtr connector = NULL; drmModePropertyPtr prop; connector = drmModeGetConnector(backend->drm.fd, ias_crtc->connector_id); if (connector) { prop = ias_get_prop(backend->drm.fd, connector, "CRTC_ID"); if (prop) { drmModeAtomicAddProperty(ias_crtc->prop_set, ias_crtc->connector_id, prop->prop_id, ias_crtc->crtc_id); drmModeFreeProperty(prop); } drmModeFreeConnector(connector); } } void ias_set_dpms(struct ias_crtc *ias_crtc, enum dpms_enum level) { struct ias_backend *c = ias_crtc->backend; drmModeConnectorPtr connector; drmModePropertyPtr prop; connector = drmModeGetConnector(c->drm.fd, ias_crtc->connector_id); if (!connector) return; prop = ias_get_prop(c->drm.fd, connector, "DPMS"); if (!prop) { drmModeFreeConnector(connector); return; } drmModeConnectorSetProperty(c->drm.fd, connector->connector_id, prop->prop_id, level); drmModeFreeProperty(prop); drmModeFreeConnector(connector); } static const char *connector_type_names[] = { "None", "VGA", "DVI", "DVI", "DVI", "Composite", "TV", "LVDS", "CTV", "DIN", "DP", "HDMI", "HDMI", "TV", "eDP", "Virtual", "DSI", "DPI" }; /* * create_crtc_for_connector() * * Creates a CRTC object for a connector. This needs to pick an appropriate * hardware CRTC to use. If there's already a CRTC associated with the * connector by the initial DRM configuration, we'll continue to use that. * Otherwise we'll pick one that's compatible. */ static struct ias_crtc * create_crtc_for_connector(struct ias_backend *backend, drmModeRes *resources, struct ias_crtc *ias_crtc, drmModeConnector *connector) { drmModeEncoder *encoder; int i; if (connector->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) { /* * Grab the connector's encoder since it's really the encoder * that's associated with a CRTC. */ encoder = drmModeGetEncoder(backend->drm.fd, connector->encoders[0]); if (encoder == NULL) { weston_log("No encoder for connector.\n"); return NULL; } /* Is there already a CRTC associated? */ if (encoder->crtc_id) { ias_crtc->crtc_id = encoder->crtc_id; goto found_crtc; } /* No CRTC associated with the connector yet. Find a suitable one. */ for (i = 0; i < resources->count_crtcs; i++) { if (encoder->possible_crtcs & (1 << i) && !(backend->crtc_allocator & (1 << resources->crtcs[i]))) break; } /* Did we find a suitable CRTC? that isn't already in use? */ if (i == resources->count_crtcs) { /* Couldn't find a suitable CRTC */ drmModeFreeEncoder(encoder); weston_log("No suitable CRTC for connector\n"); return NULL; } else { ias_crtc->crtc_id = resources->crtcs[i]; } } else { ias_crtc->crtc_id = -1; } found_crtc: ias_crtc->connector_id = connector->connector_id; ias_crtc->subpixel = connector->subpixel; ias_crtc->connector_type = connector->connector_type; /* * Mark the CRTC as used. This is a bit strange since crtc_id will * generally already be a power of 2, but at least we'll still have * a unique bit in the allocator field. */ backend->crtc_allocator |= (1 << ias_crtc->crtc_id); if (ias_crtc->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) { /* Save original settings for CRTC */ ias_crtc->original_crtc = drmModeGetCrtc(backend->drm.fd, ias_crtc->crtc_id); drmModeFreeEncoder(encoder); } return ias_crtc; } static void destroy_sprites_atomic(struct ias_backend *backend) { struct ias_sprite *sprite, *next; struct ias_crtc *ias_crtc; int ret; wl_list_for_each(ias_crtc, &backend->crtc_list, link) { if (!ias_crtc->prop_set) { ias_crtc->prop_set = drmModeAtomicAlloc(); } wl_list_for_each_safe(sprite, next, &ias_crtc->sprite_list, link) { drmModeAtomicAddProperty(ias_crtc->prop_set, sprite->plane_id, sprite->prop.fb_id, 0); drmModeAtomicAddProperty(ias_crtc->prop_set, sprite->plane_id, sprite->prop.crtc_id, 0); if (sprite->current) { drmModeRmFB(backend->drm.fd, sprite->current->fb_id); } free(sprite); } if (ias_crtc->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) { ret = drmModeAtomicCommit(backend->drm.fd, ias_crtc->prop_set, 0, ias_crtc); if (ret) { IAS_ERROR("Queueing atomic pageflip failed: %m (%d)", ret); IAS_ERROR("This failure will prevent clients from updating."); } } drmModeAtomicFree(ias_crtc->prop_set); ias_crtc->prop_set = NULL; } } static void destroy_sprites(struct ias_backend *backend) { struct ias_sprite *sprite, *next; struct ias_crtc *ias_crtc; if (backend->has_nuclear_pageflip) { destroy_sprites_atomic(backend); return; } wl_list_for_each(ias_crtc, &backend->crtc_list, link) { wl_list_for_each_safe(sprite, next, &ias_crtc->sprite_list, link) { /* drmModeSetPlane(compositor->drm.fd, */ DRM_SET_PLANE(backend, backend->drm.fd, sprite->plane_id, ias_crtc->crtc_id, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (sprite->current) { drmModeRmFB(backend->drm.fd, sprite->current->fb_id); } free(sprite); } } } #if 0 static int ias_is_input_per_output(struct weston_output *output) { return ((struct ias_output *) output)->ias_crtc->backend->input_present; } #endif static int ias_backend_output_enable(struct weston_output *base) { struct ias_output *ias_output = (struct ias_output *)base; struct ias_output *output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct ias_configured_output *cfg; int i; int found = 0; for (i = 0; i < ias_crtc->num_outputs; i++) { if (ias_crtc->output[i] == ias_output) break; } if (i == ias_crtc->num_outputs) { IAS_ERROR("Couldn't find output\n"); return -1; } cfg = ias_crtc->configuration->output[i]; /* By default set position of output to 0x0 */ ias_output->base.x = 0; ias_output->base.y = 0; if (cfg->position == OUTPUT_POSITION_CUSTOM) { ias_output->base.x = cfg->x; ias_output->base.y = cfg->y; } else if (cfg->position == OUTPUT_POSITION_RIGHTOF && cfg->position_target) { /* Look for the relative output */ found = 0; wl_list_for_each(output, &output_list, link) { if (strcmp(output->name, cfg->position_target) == 0) { /* use the scaled / transformed width */ ias_output->base.x = output->base.x + output->base.width; ias_output->base.y = output->base.y; found = 1; break; } } if (!found) /* Didn't find the specified output */ IAS_ERROR("Couldn't find output named '%s'", cfg->position_target); } else if (cfg->position == OUTPUT_POSITION_BELOW && cfg->position_target) { /* Look for the relative output */ found = 0; wl_list_for_each(output, &output_list, link) { if (strcmp(output->name, cfg->position_target) == 0) { /* use the scaled / transformed height */ ias_output->base.x = output->base.x; ias_output->base.y = output->base.y + output->base.height; found = 1; break; } } if (!found) /* Didn't find the specified output */ IAS_ERROR("Couldn't find output named '%s'", cfg->position_target); } else { if (cfg->position != OUTPUT_POSITION_ORIGIN) IAS_ERROR("Unknown output position %d for %s!", cfg->position, ias_output->name); } weston_head_set_physical_size(&ias_output->head, ias_output->width, ias_output->height); /* Hook up implementation */ ias_output->base.repaint = ias_output_repaint; ias_output->base.destroy = ias_output_destroy; ias_output->base.start_repaint_loop = ias_output_start_repaint_loop; ias_output->base.assign_planes = ias_assign_planes; ias_output->base.set_dpms = NULL; ias_output->base.repeat_redraw = ias_repeat_redraw; return 0; } static int ias_backend_output_disable(struct weston_output *base) { return 0; } /* * create_outputs_for_crtc() * * Creates outputs associated with a CRTC. */ static void create_outputs_for_crtc(struct ias_backend *backend, struct ias_crtc *ias_crtc) { struct ias_output *ias_output; struct ias_configured_output *cfg; int i, scale; char *temp_name = NULL; struct timeval curr_time; for (i = 0; i < ias_crtc->num_outputs; i++) { if (ias_crtc->configuration == NULL) { IAS_ERROR("Configuration not set for CRTC '%s'", ias_crtc->name); return; } cfg = ias_crtc->configuration->output[i]; if (!cfg) { IAS_ERROR("Lacking configuration for CRTC '%s' output #%d", ias_crtc->name, i); return; } weston_log("Doing configuration for CRTC '%s' output #%d (%s)\n", ias_crtc->name, i, cfg->name); /* Create Wayland output object */ ias_output = ias_output_create(backend); /* Associate output and CRTC */ ias_crtc->output[i] = ias_output; ias_output->ias_crtc = ias_crtc; ias_output->vm = ias_crtc->configuration->output[i]->vm; /* Use connector name from ias.conf also for head*/ weston_head_init(&ias_output->head, ias_crtc->name); weston_compositor_add_head(backend->compositor, &ias_output->head); weston_head_set_connection_status(&ias_output->head, true); /* * Initialize output size according to output model. The general case * that we assume here is that the output inherits its dimensions from * the CRTC in an output model-specific manner. We may override the * sizing farther below if this output is supposed to be scaled. */ ias_crtc->output_model->init_output(ias_output, cfg); /* * Generate a fake mode object for the output in dualview/stereo where * we can't just use the CRTC's mode. */ ias_output->mode.width = ias_output->width; ias_output->mode.height = ias_output->height; ias_output->mode.refresh = ias_crtc->current_mode->base.refresh; ias_output->mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; ias_output->base.current_mode = &ias_output->mode; ias_output->base.original_mode = &ias_output->mode; wl_signal_init(&ias_output->update_signal); wl_signal_init(&ias_output->printfps_signal); #if defined(BUILD_VAAPI_RECORDER) || defined(BUILD_REMOTE_DISPLAY) wl_signal_init(&ias_output->next_scanout_ready_signal); #endif #ifdef BUILD_REMOTE_DISPLAY wl_signal_init(&ias_output->base.commit_signal); #endif /* Position output */ switch (cfg->rotation) { case 0: ias_output->rotation = ias_crtc->output_model->render_flipped ? WL_OUTPUT_TRANSFORM_FLIPPED_180 : WL_OUTPUT_TRANSFORM_NORMAL; break; case 90: ias_output->rotation = WL_OUTPUT_TRANSFORM_90; break; case 180: ias_output->rotation = ias_crtc->output_model->render_flipped ? WL_OUTPUT_TRANSFORM_FLIPPED : WL_OUTPUT_TRANSFORM_180; break; case 270: ias_output->rotation = WL_OUTPUT_TRANSFORM_270; break; default: ias_output->rotation = ias_crtc->output_model->render_flipped ? WL_OUTPUT_TRANSFORM_FLIPPED_180 : WL_OUTPUT_TRANSFORM_NORMAL; IAS_ERROR("Unknown output rotation setting '%d', defaulting to 0", cfg->rotation); break; } /* General output initialization */ scale = 1; /* Setup the output name. Use CRTC's name if not configured */ if (cfg->name) { temp_name = strdup(cfg->name); } else if (ias_crtc->num_outputs == 1) { temp_name = strdup(ias_crtc->name); } else { temp_name = calloc(1, strlen(ias_crtc->name) + 3); if (!temp_name) { IAS_ERROR("Failed to allocate output name: out of memory"); exit(1); } sprintf(temp_name, "%s-%d", ias_crtc->name, i+1); } /* * Sending temp_name to weston_output_init so that it can set * ias_output->base.name */ weston_output_init(&ias_output->base, backend->compositor, temp_name); /* No use of temp_name anymore so free it */ free(temp_name); ias_output->name = ias_output->base.name; ias_output->base.enable = ias_backend_output_enable; ias_output->base.destroy = ias_output_destroy; ias_output->base.disable = ias_backend_output_disable; gettimeofday(&curr_time, NULL); ias_output->prev_time_ms = (curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000); weston_head_set_monitor_strings(&ias_output->head, "unknown", "unknown", "unknown"); weston_head_set_subpixel(&ias_output->head, ias_subpixel_to_wayland(ias_crtc->subpixel)); wl_list_insert(&ias_output->base.mode_list, &ias_output->mode.link); weston_output_set_scale(&ias_output->base, scale); weston_output_set_transform(&ias_output->base, ias_output->rotation); weston_output_attach_head(&ias_output->base, &ias_output->head); weston_output_enable(&ias_output->base); weston_plane_init(&ias_output->fb_plane, backend->compositor, ias_output->base.x, ias_output->base.y); /* Setup scaling if requested by config */ ias_output_scale(ias_output, ias_output->width, ias_output->height); wl_list_insert(output_list.prev, &ias_output->link); } } /* * expose_3d_modes() * * Make libdrm expose 3D modes for a connector. The current S3D * patches on the mailing list require this to be performed in order to * see any stereo modes on a connector. * * TODO: Double check this when the patches go upstream. This may change! */ static void expose_3d_modes(struct ias_backend *backend, drmModeConnector **connector, uint32_t connector_id) { drmModePropertyRes *property; int i, ret; for (i = 0; i < (*connector)->count_props; i++) { property = drmModeGetProperty(backend->drm.fd, (*connector)->props[i]); if (!property) { continue; } IAS_DEBUG("Connector property: '%s'", property->name); /* Is this the stereo mode property? If so, set it on. */ if (strcmp(property->name, "expose 3D modes") == 0) { ret = drmModeConnectorSetProperty(backend->drm.fd, (*connector)->connector_id, property->prop_id, 1); IAS_DEBUG("Set 'expose 3D' property returns '%d'", ret); drmModeFreeProperty(property); return; } drmModeFreeProperty(property); } /* Release and re-grab the connector for 3D modes to show up. */ drmModeFreeConnector(*connector); *connector = drmModeGetConnector(backend->drm.fd, connector_id); UNUSED_IN_RELEASE(ret); } static struct ias_crtc * create_single_crtc(struct ias_backend *backend, drmModeRes *resources, struct connector_components *components) { struct ias_crtc *ias_crtc; int j, ret; int is_stereo; drmModeCrtc *crtc; struct ias_mode *ias_mode, *crtc_mode; struct ias_connector *connector; connector = components->connector; /* Create the compositor CRTC object */ ias_crtc = ias_crtc_create(backend); if (!ias_crtc) { weston_log("Failed to create IAS CRTC object\n"); return NULL; } TRACEPOINT(" * Created CRTC for connector"); ias_crtc->configuration = components->conf_crtc; for (j = 0; j < output_model_table_size; j++) { if (strcasecmp(ias_crtc->configuration->model, output_model_table[j]->name) == 0) { ias_crtc->output_model = output_model_table[j]; if (ias_crtc->output_model->stereoscopic) { /* Ask for stereo modes if we're setup for stereo output */ expose_3d_modes(backend, &connector->connector, resources->connectors[j]); } weston_log("Using the %s output model.\n", ias_crtc->output_model->name); break; } } /* * The config file referred to this connector. Create the IAS crtc * object for it. */ if (!create_crtc_for_connector(backend, resources, ias_crtc, connector->connector)) { ias_crtc_destroy(ias_crtc); return NULL; } /* If this CRTC is disabled, turn it off with KMS and return */ if (ias_crtc->output_model == NULL) { IAS_DEBUG("Disabling CRTC %s", connector_name); drmModeSetCrtc(backend->drm.fd, ias_crtc->crtc_id, 0, 0, 0, 0, 0, NULL); wl_list_remove(&ias_crtc->link); backend->crtc_allocator &= ~(1 << ias_crtc->crtc_id); ias_crtc_destroy(ias_crtc); return NULL; } for (j = 0; j < resources->count_crtcs; j++) { if (ias_crtc->crtc_id == resources->crtcs[j]) { break; } } if (j == resources->count_crtcs) { /* Couldn't find a suitable CRTC */ if (ias_crtc->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) weston_log("No suitable CRTC found\n"); ias_crtc->index=0; } else { ias_crtc->index = j; } ias_crtc->name = strdup(ias_crtc->configuration->name); wl_list_init(&ias_crtc->sprite_list); if (ias_crtc->output_model) { ias_crtc->output_model->init(ias_crtc); } else { weston_log("No output model exists for the CRTC configuration\n"); ias_crtc_destroy(ias_crtc); return NULL; } /* Make sure configuration matches model requirements */ /*if (ias_crtc->configuration->output_num != ias_crtc->output_model->outputs_per_crtc) { IAS_ERROR("Invalid output configuration for CRTC."); ias_crtc_destroy(ias_crtc); return NULL; }*/ /* Build the CRTC mode list */ wl_list_init(&ias_crtc->mode_list); for (j = 0; j < connector->connector->count_modes; j++) { is_stereo = connector->connector->modes[j].flags & DRM_MODE_FLAG_3D_MASK; /* * When configured for stereo, only add stereo modes. When not * configured for stereo mode, skip the stereo modes. * * TODO: Current patches on the mailing list indicate we won't * even see the 3D modes unless we set the "expose 3D modes" * property on the connector, but that may change. We'll assume * for now that they'll always show up and we can remove some * of this logic later if it isn't necessary. */ if (ias_crtc->output_model->stereoscopic && is_stereo) { ias_add_mode(ias_crtc, &connector->connector->modes[j], j); } else if (!ias_crtc->output_model->stereoscopic && !is_stereo) { ias_add_mode(ias_crtc, &connector->connector->modes[j], j); } } TRACEPOINT(" * Build mode list for CRTC"); /* Determine current CRTC mode */ crtc = drmModeGetCrtc(backend->drm.fd, ias_crtc->crtc_id); if (crtc) { wl_list_for_each(ias_mode, &ias_crtc->mode_list, link) { if (memcmp(&crtc->mode, &ias_mode->mode_info, sizeof crtc->mode) == 0) { ias_crtc->current_mode = ias_mode; break; } } drmModeFreeCrtc(crtc); } TRACEPOINT(" * Got current CRTC mode"); /* Determine desired mode and allocate scanout buffer for this CRTC */ crtc_mode = NULL; switch (ias_crtc->configuration->config) { case CRTC_CONFIG_PREFERRED: wl_list_for_each(ias_mode, &ias_crtc->mode_list, link) { if (ias_mode->base.flags & WL_OUTPUT_MODE_PREFERRED) { crtc_mode = ias_mode; break; } } /* * If there's no preferred mode in the mode list, we'll * fall through to just using the current mode. */ if (crtc_mode) { break; } __attribute__((fallthrough)); case CRTC_CONFIG_CURRENT: /* Use current mode */ crtc_mode = ias_crtc->current_mode; break; case CRTC_CONFIG_MODE: wl_list_for_each(ias_mode, &ias_crtc->mode_list, link) { if ( (ias_mode->base.width == ias_crtc->configuration->width) && (ias_mode->base.height == ias_crtc->configuration->height) && ( (ias_mode->base.refresh / 1000 == ias_crtc->configuration->refresh) || (ias_crtc->configuration->refresh == 0) )) { crtc_mode = ias_mode; break; } } break; } /* * We should have a mode now. If we don't for some reason, we'll just * have to treat the CRTC as disabled. */ if (!crtc_mode) { IAS_ERROR("Failed to get mode for CRTC %s; disabling", components->connector_name); drmModeSetCrtc(backend->drm.fd, ias_crtc->crtc_id, 0, 0, 0, 0, 0, NULL); backend->crtc_allocator &= ~(1 << ias_crtc->crtc_id); ias_crtc_destroy(ias_crtc); return NULL; } ias_crtc->current_mode = crtc_mode; /* Setup virtual page flip timer for virtual connectors */ if (ias_crtc->connector_type == DRM_MODE_CONNECTOR_VIRTUAL) { struct wl_event_loop *loop = NULL; struct weston_compositor *ec = backend->compositor; loop = wl_display_get_event_loop(ec->wl_display); assert(loop); ias_crtc->pageflip_timer = wl_event_loop_add_timer(loop, virtual_pageflip, ias_crtc); wl_event_source_timer_update(ias_crtc->pageflip_timer, 1000000/ias_crtc->current_mode->base.refresh); } /* Allocate cursor scanout buffers */ ias_crtc->cursor_bo[0] = gbm_bo_create(backend->gbm, 64, 64, GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE); ias_crtc->cursor_bo[1] = gbm_bo_create(backend->gbm, 64, 64, GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE); if (backend->use_cursor_as_uplane || !ias_crtc->cursor_bo[0] || !ias_crtc->cursor_bo[1]) { IAS_ERROR("Cursor buffers could not be created; using software cursor"); ias_crtc->cursors_are_broken = 1; } TRACEPOINT(" * Allocated cursor buffers"); /* Initialize plane objects */ weston_plane_init(&ias_crtc->cursor_plane, backend->compositor, 0, 0); /* Get the initial state of the output properties */ ias_get_crtc_object_properties(backend->drm.fd, &ias_crtc->prop, ias_crtc->crtc_id); ias_crtc->prop_set = drmModeAtomicAlloc(); /* Create outputs associated with this CRTC */ create_outputs_for_crtc(backend, ias_crtc); TRACEPOINT(" * Created outputs for CRTC"); /* Create scanout buffer(s) */ if (ias_crtc->output_model->allocate_scanout(ias_crtc, crtc_mode) == -1) { backend->crtc_allocator &= ~(1 << ias_crtc->crtc_id); for (j = 0; j < ias_crtc->num_outputs; j++) { ias_output_destroy(&ias_crtc->output[j]->base); } ias_crtc_destroy(ias_crtc); return NULL; } /* Make sure we do the drmModeSetCrtc on the next repaint */ if (ias_crtc->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) ias_crtc->request_set_mode = 1; ias_crtc->brightness = 0x808080; ias_crtc->contrast = 0x808080; ias_crtc->gamma = 0x808080; if (no_color_correction == 0 && ias_crtc->connector_type != DRM_MODE_CONNECTOR_VIRTUAL) { ias_crtc->request_color_correction_reset = 1; } /* * Perform any CRTC initialization which is specific to the current * output model. Some output models perform GL operations here, * which is why this is handled separately from the create_crtcs * call previously. */ if (ias_crtc->output_model->init_crtc) { ret = ias_crtc->output_model->init_crtc(ias_crtc); if (ret) { wl_list_remove(&ias_crtc->link); backend->crtc_allocator &= ~(1 << ias_crtc->crtc_id); ias_crtc_destroy(ias_crtc); } return NULL; } return ias_crtc; } /* * Query the DRM and use config settings to setup the CRTC objects. */ static int create_crtcs(struct ias_backend *backend) { struct components_list components_list; int count_crtcs = 0; struct ias_crtc *ias_crtc; struct connector_components *connector_components; drmModeRes *resources; int ret; TRACEPOINT(" * Create CRTCs entry"); resources = drmModeGetResources(backend->drm.fd); if (!resources) { weston_log("drmModeGetResources failed\n"); goto err_res_failed; } TRACEPOINT(" * After getting resources"); ret = components_list_create(backend, resources, &components_list); if (ret) { IAS_DEBUG("Failed to allocate memory and initialize" " display components list"); goto err_comp_failed; } /* Match any suitable display components and store in a list. If any * are found, loop through the list and build them */ ret = components_list_build(backend, resources, &components_list); if (ret) { IAS_DEBUG("Failed to allocate memory and build" " display components list"); goto err_comp_failed; } wl_list_for_each_reverse(connector_components, &components_list.list, link) { ias_crtc = create_single_crtc(backend, resources, connector_components); /* CRTC creation failed, skip */ if (ias_crtc == NULL) { continue; } /* Increment CRTC counts and add the new CRTC to the list */ count_crtcs++; backend->num_compositor_crtcs++; wl_list_insert(&backend->crtc_list, &ias_crtc->link); weston_log("CRTC created: name = %s, ID = %d," " connector ID = %d \n", ias_crtc->name, ias_crtc->crtc_id, ias_crtc->connector_id); } /* Check if the final compositor CRTC list has any data */ if (wl_list_empty(&backend->crtc_list)) { IAS_ERROR("Could not build any suitable CRTC's"); goto err_list_empty; } TRACEPOINT(" - CRTC's setup"); /* If the compositor contains more than one CRTC then the coordinates * may need to be updated if the new display is in extended mode. * Correct alignment is given in each CRTC's config file i.e. rightof. */ if (backend->num_compositor_crtcs > 1) { ias_crtc = NULL; wl_list_for_each(ias_crtc, &backend->crtc_list, link) { ias_update_outputs_coordinate(ias_crtc, ias_crtc->output[0]); } } err_list_empty: /* Free memory use by components list */ components_list_destroy(&components_list); err_comp_failed: drmModeFreeResources(resources); err_res_failed: return count_crtcs; } static void ias_destroy(struct weston_compositor *compositor) { struct ias_backend *d = (struct ias_backend *)compositor->backend; struct ias_configured_output *o, *n; struct ias_crtc *ias_crtc, *next_crtc; udev_input_destroy(&d->input); wl_event_source_remove(d->udev_ias_source); wl_event_source_remove(d->ias_source); destroy_sprites(d); wl_list_for_each_safe(o, n, &configured_output_list, link) free(o); weston_compositor_shutdown(compositor); wl_list_for_each_safe(ias_crtc, next_crtc, &d->crtc_list, link) { weston_log("Destorying crtc %d\n", ias_crtc->crtc_id); ias_crtc_destroy(ias_crtc); } if (d->gbm) gbm_device_destroy(d->gbm); udev_monitor_unref(d->udev_monitor); udev_unref(d->udev); weston_launcher_destroy(compositor->launcher); close(d->drm.fd); free(d); } static int atomic_ioctl_supported(int fd) { int ret; drmModeAtomicReqPtr prop; /*struct drm_set_client_cap client_cap; client_cap.capability = DRM_CLIENT_CAP_ATOMIC; client_cap.value = 1; ret = drmIoctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &client_cap);*/ drmSetClientCap(fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); drmSetClientCap(fd, DRM_CLIENT_CAP_ATOMIC, 1); prop = drmModeAtomicAlloc(); ret = drmModeAtomicCommit(fd, prop, DRM_MODE_ATOMIC_TEST_ONLY, NULL); drmModeAtomicFree(prop); if (ret) { return 0; /* not supported */ } else { return 1; /* supported */ } } static int render_buffer_compression_supported(struct ias_backend *backend) { struct weston_compositor *compositor = backend->compositor; int *formats = NULL; uint64_t *modifiers = NULL; int num_formats, num_modifiers; int i, j; int rbc_supported = 0; /* * Use EGL_EXT_image_dma_buf_import_modifiers to query and advertise * format/modifier codes. */ compositor->renderer->query_dmabuf_formats(compositor, &formats, &num_formats); for (i = 0; i < num_formats; i++) { compositor->renderer->query_dmabuf_modifiers(compositor, formats[i], &modifiers, &num_modifiers); for (j = 0; j < num_modifiers; j++) { if (modifiers[j] == I915_FORMAT_MOD_Y_TILED_CCS || modifiers[j] == I915_FORMAT_MOD_Yf_TILED_CCS) { rbc_supported = 1; free(modifiers); goto out; } } free(modifiers); } out: free(formats); return rbc_supported; } static void session_notify(struct wl_listener *listener, void *data) { struct weston_compositor *compositor = data; struct ias_crtc *ias_crtc, *next_crtc; struct ias_sprite *sprite, *next; struct ias_output *output; struct ias_backend *backend = container_of(compositor->backend, struct ias_backend, base); if (compositor->session_active) { weston_log("activating session\n"); compositor->state = backend->prev_state; wl_list_for_each_safe(ias_crtc, next_crtc, &backend->crtc_list, link) { ias_crtc->request_set_mode = 1; } weston_compositor_damage_all(compositor); udev_input_enable(&backend->input); } else { weston_log("deactivating session\n"); udev_input_disable(&backend->input); backend->prev_state = compositor->state; weston_compositor_offscreen(compositor); /* If we have a repaint scheduled (either from a * pending pageflip or the idle handler), make sure we * cancel that so we don't try to pageflip when we're * vt switched away. The OFFSCREEN state will prevent * further attemps at repainting. When we switch * back, we schedule a repaint, which will process * pending frame callbacks. */ wl_list_for_each(output, &compositor->output_list, base.link) { output->base.repaint_needed = 0; } wl_list_for_each(ias_crtc, &backend->crtc_list, link) { drmModeSetCursor(backend->drm.fd, ias_crtc->crtc_id, 0, 0, 0); wl_list_for_each_safe(sprite, next, &ias_crtc->sprite_list, link) { /* drmModeSetPlane(compositor->drm.fd, */ DRM_SET_PLANE(backend, backend->drm.fd, sprite->plane_id, ias_crtc->crtc_id, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } } #ifdef HYPER_DMABUF static int init_hyper_dmabuf(struct ias_backend *backend) { struct ioctl_hyper_dmabuf_tx_ch_setup msg; int ret; weston_log("Initializing hyper dmabuf\n"); backend->hyper_dmabuf_fd = open(HYPER_DMABUF_PATH, O_RDWR); /* If opening failed, try old dev node used by hyper dmabuf */ if (backend->hyper_dmabuf_fd < 0) backend->hyper_dmabuf_fd = open(HYPER_DMABUF_PATH_LEGACY, O_RDWR); if (backend->hyper_dmabuf_fd < 0) { weston_log("Cannot open hyper dmabuf device\n"); return -1; } /* TODO: add config option to specify which domains should be used, for now we share always with dom0 */ msg.remote_domain = 0; ret = ioctl(backend->hyper_dmabuf_fd, IOCTL_HYPER_DMABUF_TX_CH_SETUP, &msg); if (ret) { weston_log("%s: ioctl failed with error %d\n", __func__, ret); close(backend->hyper_dmabuf_fd); backend->hyper_dmabuf_fd = -1; return -1; } return 0; } static void cleanup_hyper_dmabuf(struct ias_backend *backend) { if (backend->hyper_dmabuf_fd >= 0) { close(backend->hyper_dmabuf_fd); backend->hyper_dmabuf_fd = -1; } } #endif #ifdef BUILD_REMOTE_DISPLAY static void capture_proxy_destroy_from_output(struct ias_output *output) { if (output->cp) { weston_log("[WESTON] Destroying frame capture for output.\n"); wl_list_remove(&output->capture_proxy_frame_listener.link); capture_proxy_destroy(output->cp); output->cp = NULL; } else { weston_log("ERROR: Trying to destroy capture proxy that doesn't exist for this output.\n"); } output->base.disable_planes--; } static void capture_proxy_destroy_from_surface(struct ias_backend *ias_backend, struct weston_surface *surface) { struct ias_surface_capture *capture_item = NULL; struct ias_surface_capture *tmp_list_item = NULL; weston_log("[WESTON] Destroying frame capture for surface %p...\n", surface); wl_list_for_each_safe(capture_item, tmp_list_item, &ias_backend->capture_proxy_list, link) { if (capture_item->capture_surface == surface) { if (!capture_item->cp) { weston_log("ERROR: Trying to destroy capture proxy that doesn't exist for this surface.\n"); } else { capture_proxy_destroy(capture_item->cp); capture_item->cp = NULL; } weston_log("[WESTON] Removing callbacks...\n"); wl_list_remove(&capture_item->capture_commit_listener.link); wl_list_remove(&capture_item->capture_vsync_listener.link); wl_list_remove(&capture_item->link); free(capture_item); } } } static struct ias_fb * ias_capture_fb_get_from_bo(struct gbm_bo *bo, struct weston_buffer *buffer, struct ias_backend *backend) { struct ias_fb *fb = gbm_bo_get_user_data(bo); uint32_t width, height; uint32_t format, strides[4] = {0}, handles[4] = {0}, offsets[4] = {0}; uint64_t modifiers[4] = {0}; int ret; int flags = 0; struct linux_dmabuf_buffer *dmabuf = NULL; int i; if (fb) { if (fb->fb_id) { drmModeRmFB(backend->drm.fd, fb->fb_id); } /* TODO: need to find better way instead of creating fb again */ free(fb); } fb = calloc(1, sizeof *fb); if (!fb) { IAS_ERROR("Failed to allocate fb: out of memory"); exit(1); } fb->bo = bo; width = gbm_bo_get_width(bo); height = gbm_bo_get_height(bo); format = gbm_bo_get_format(bo); if (buffer) dmabuf = linux_dmabuf_buffer_get(buffer->resource); if (dmabuf) { for (i = 0; i < dmabuf->attributes.n_planes; i++) { handles[i] = gbm_bo_get_handle(bo).u32; strides[i] = dmabuf->attributes.stride[i]; offsets[i] = dmabuf->attributes.offset[i]; modifiers[i] = dmabuf->attributes.modifier[i]; if (modifiers[i] > 0) { flags |= DRM_MODE_FB_MODIFIERS; if (modifiers[i] == I915_FORMAT_MOD_Y_TILED_CCS || modifiers[i] == I915_FORMAT_MOD_Yf_TILED_CCS) fb->is_compressed = 1; } } } else { if (format == GBM_FORMAT_NV12) { if (buffer != NULL) { gl_renderer->query_buffer(backend->compositor, buffer->legacy_buffer, EGL_STRIDE, (EGLint *)strides); gl_renderer->query_buffer(backend->compositor, buffer->legacy_buffer, EGL_OFFSET, (EGLint *)offsets); } handles[0] = gbm_bo_get_handle(bo).u32; handles[1] = gbm_bo_get_handle(bo).u32; } else if (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_ARGB8888) { strides[0] = gbm_bo_get_stride(bo); handles[0] = gbm_bo_get_handle(bo).u32; offsets[0] = 0; } } ret = drmModeAddFB2WithModifiers(backend->drm.fd, width, height, format, handles, strides, offsets, modifiers, &fb->fb_id, flags); if (ret) { weston_log("Failed to create kms fb: %m.\n"); free(fb); return NULL; } gbm_bo_set_user_data(bo, fb, ias_fb_destroy_callback); return fb; } /* We may well be sending the frame over RTP, so a timestamp is * needed. RFC6184 says that "A 90 kHz clock rate MUST be used." */ #define PIPELINE_CLOCK 90000 /* Callback that is called when a frame has been composited * and is ready to be displayed on the relevant output. */ static void capture_frame_notify(struct wl_listener *listener, void *data) { struct ias_output *output; struct ias_backend *c; struct ias_fb *fb; int fd, ret; uint32_t handle; int64_t start = 0; uint64_t frame_time; /* in microseconds */ struct timespec start_spec; uint32_t timestamp = 0; #ifdef PROFILE_REMOTE_DISPLAY struct timespec end_spec; int64_t duration, finish; #endif /* The timestamp forms part of the RTP header and thus must be * updated per frame. It is a 32-bit value that wraps. */ clock_gettime(CLOCK_REALTIME, &start_spec); frame_time = start_spec.tv_sec * US_IN_SEC + start_spec.tv_nsec / NS_IN_US; timestamp = (PIPELINE_CLOCK * frame_time / US_IN_SEC) & 0xFFFFFFFF; output = container_of(listener, struct ias_output, capture_proxy_frame_listener); c = (struct ias_backend *) output->base.compositor->backend; if (!output->cp) { weston_log("Error: capture_frame_notify - output has no capture proxy!\n"); return; } if (capture_proxy_profiling_is_enabled(output->cp)) { struct timespec start_spec; clock_gettime(CLOCK_REALTIME, &start_spec); start = timespec_to_nsec(&start_spec); weston_log("WESTON: Frame[%d] start: %ld ns for output.\n", capture_get_frame_count(output->cp), start); } /* get_next_fb() cannot fail in this case, since we have just been * notified that a frame is available. */ fb = output->ias_crtc->output_model->get_next_fb(output); handle = gbm_bo_get_handle(fb->bo).u32; ret = drmPrimeHandleToFD(c->drm.fd, handle, DRM_CLOEXEC, &fd); if (ret) { weston_log("[capture proxy] " "failed to create prime fd for front buffer\n"); return; } ret = capture_proxy_handle_frame(output->cp, NULL, fd, gbm_bo_get_stride(fb->bo), CP_FORMAT_RGB, timestamp); if (ret < 0) { weston_log("[capture proxy] aborted: %m\n"); capture_proxy_destroy_from_output(output); } #ifdef PROFILE_REMOTE_DISPLAY clock_gettime(CLOCK_REALTIME, &end_spec); finish = timespec_to_nsec(&end_spec); duration = finish - start; weston_log("WESTON: capture_frame_notify - start: %ld ns, finish: %ld ns, duration: %ld ns.\n", start, finish, duration); #endif } /* Callback that is called when any application commits a surface. */ static void capture_commit_notify(struct wl_listener *listener, void *data) { struct ias_backend *c; struct ias_fb *fb; int fd, ret; int abort = false; uint32_t handle; uint32_t format; struct weston_surface *surface = (struct weston_surface *)data; struct weston_buffer *buffer; struct linux_dmabuf_buffer *dmabuf; struct gbm_bo *bo; struct wl_shm_buffer *shm_buffer; struct ias_surface_capture *capture_item = NULL; struct ias_surface_capture *capture_tmp = NULL; struct ias_surface_capture *capture = NULL; static uint32_t extra_frames; int64_t start = 0; uint64_t frame_time; /* in microseconds */ struct timespec start_spec; uint32_t timestamp = 0; #ifdef PROFILE_REMOTE_DISPLAY struct timespec end_spec; int64_t duration, finish; #endif /* The timestamp forms part of the RTP header and thus must be * updated per frame. It is a 32-bit value that wraps. */ clock_gettime(CLOCK_REALTIME, &start_spec); frame_time = start_spec.tv_sec * US_IN_SEC + start_spec.tv_nsec / NS_IN_US; timestamp = (PIPELINE_CLOCK * frame_time / US_IN_SEC) & 0xFFFFFFFF; capture_item = container_of(listener, struct ias_surface_capture, capture_commit_listener); c = capture_item->backend; if (!c) { weston_log("Error: capture_commit_notify: no backend\n"); return; } wl_list_for_each(capture_tmp, &c->capture_proxy_list, link) { if (capture_tmp->capture_surface == surface) { capture = capture_tmp; break; } } if (!capture) { /* Not a surface we are tracking. */ return; } /* Allow a maximum of two frames to be encoded between composite * events, to reduce load on the encoder. Only allowing a single frame * is too aggressive. This could become a config option in future. */ if (!vsync_received(capture->cp)) { extra_frames++; if (extra_frames > 1) { return; } } if (vsync_received(capture->cp)) { clear_vsyncs(capture->cp); if (extra_frames > 1) { weston_log("Dropped %d frames between composite events.\n", extra_frames - 1); } extra_frames = 0; } if (!capture->capture_surface->buffer_ref.buffer) { /* We believe this is the case when the GPU has been * bottle-necked and the buffer isn't ready in time. */ if (capture_proxy_verbose_is_enabled(capture->cp)) { weston_log("Warning - no buffer.\n"); } return; } if (capture_proxy_profiling_is_enabled(capture->cp)) { start = timespec_to_nsec(&start_spec); weston_log("WESTON: Frame[%d] start: %ld ns for surface.\n", capture_get_frame_count(capture->cp), start); } buffer = capture->capture_surface->buffer_ref.buffer; shm_buffer = wl_shm_buffer_get(buffer->resource); if (shm_buffer) { ret = capture_proxy_handle_frame(capture->cp, shm_buffer, -1, 0, CP_FORMAT_RGB, timestamp); if (ret < 0) { weston_log("[capture proxy] shm buffer aborted: %m\n"); /* This error is fatal. */ capture_proxy_destroy_from_surface(c, capture->capture_surface); } #ifdef PROFILE_REMOTE_DISPLAY clock_gettime(CLOCK_REALTIME, &end_spec); finish = timespec_to_nsec(&end_spec); duration = finish - start; weston_log("WESTON: capture_commit_notify (shm) - start: %ld ns, finish: %ld ns, duration: %ld ns.\n", start, finish, duration); #endif return; } else { if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource))) { struct gbm_import_fd_data gbm_dmabuf = { .fd = dmabuf->attributes.fd[0], .width = dmabuf->attributes.width, .height = dmabuf->attributes.height, .stride = dmabuf->attributes.stride[0], .format = dmabuf->attributes.format }; bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_FD, &gbm_dmabuf, GBM_BO_USE_SCANOUT); } else { bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER, buffer->resource, GBM_BO_USE_SCANOUT); } if (!bo) { weston_log("[capture proxy]: Failed to import bo for wl_resource at %p - giving up.\n", buffer->resource); return; } } fb = ias_capture_fb_get_from_bo(bo, buffer, c); if (!fb) { weston_log("[capture proxy]: Failed to get fb from bo.\n"); goto err_commit; } handle = gbm_bo_get_handle(fb->bo).u32; ret = drmPrimeHandleToFD(c->drm.fd, handle, DRM_CLOEXEC, &fd); if (ret) { weston_log("[capture proxy]: Failed to create prime fd for front buffer.\n"); goto err_commit; } format = gbm_bo_get_format(bo); if (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_ARGB8888) { ret = capture_proxy_handle_frame(capture->cp, NULL, fd, gbm_bo_get_stride(fb->bo), CP_FORMAT_RGB, timestamp); } else if (format == GBM_FORMAT_NV12) { ret = capture_proxy_handle_frame(capture->cp, NULL, fd, gbm_bo_get_stride(fb->bo), CP_FORMAT_NV12, timestamp); } else { weston_log("[capture proxy]: Unsupported surface format.\n"); ret = -1; } if (ret < 0) { abort = true; } err_commit: /* We've asked for the buffer to be kept alive long enough for us to * encode it, so dereference it now that we're done with it. Note that * the client keeps an open fd to the data until it is done. */ if (fb != NULL) { gbm_bo_destroy(fb->bo); } weston_buffer_reference(&capture->capture_surface->buffer_ref, NULL); if (abort) { weston_log("[capture proxy]: Aborted: %m.\n"); /* This error is fatal. */ capture_proxy_destroy_from_surface(c, capture->capture_surface); } #ifdef PROFILE_REMOTE_DISPLAY clock_gettime(CLOCK_REALTIME, &end_spec); finish = timespec_to_nsec(&end_spec); duration = finish - start; weston_log("WESTON: capture_commit_notify - start: %ld ns, finish: %ld ns, duration: %ld ns.\n", start, finish, duration); #endif } /* Callback that is called when a vsync has occurred on the relevant * output. */ static void capture_vsync_notify(struct wl_listener *listener, void *data) { struct ias_surface_capture *capture_item = container_of( listener, struct ias_surface_capture, capture_vsync_listener); vsync_notify(capture_item->cp); } static void * create_capture_proxy(struct ias_backend *c, struct wl_client *client) { int fd; drm_magic_t magic; void *cp = NULL; fd = open(c->drm.filename, O_RDWR | O_CLOEXEC); if (fd < 0) { return NULL; } drmGetMagic(fd, &magic); drmAuthMagic(c->drm.fd, magic); cp = capture_proxy_create(fd, client); if (cp == NULL) { close(fd); } return cp; } static int start_capture(struct wl_client *client, struct ias_backend *ias_backend, struct wl_resource *resource, struct weston_surface *surface, const uint32_t output_number, const int profile, const int verbose) { struct ias_output *output = NULL; pid_t pid; /* Make sure that we're using the IAS backend... */ if (ias_backend->magic != BACKEND_MAGIC) { IAS_ERROR("Backend does not match."); return IAS_HMI_FCAP_ERROR_INVALID; } wl_client_get_credentials(client, &pid, NULL, NULL); if (surface) { /* If a weston_surface was passed in, then we're capturing the * buffers of that surface. */ struct ias_surface_capture *capture_proxy_item; struct ias_surface_capture *capture_check = NULL; if (surface->output) { output = container_of(surface->output, struct ias_output, base); } else { weston_log("Error - set_recording - No output associated with surface %p.\n", surface); return IAS_HMI_FCAP_ERROR_INVALID; } /* Check whether we're already recording this surface... */ wl_list_for_each(capture_check, &ias_backend->capture_proxy_list, link) { if (capture_check->capture_surface == surface) { weston_log("Surface already has a capture client.\n"); return IAS_HMI_FCAP_ERROR_DUPLICATE; } } surface->keep_buffer = 1; capture_proxy_item = calloc(1, sizeof(struct ias_surface_capture)); capture_proxy_item->backend = ias_backend; capture_proxy_item->capture_surface = surface; capture_proxy_item->cp = create_capture_proxy(ias_backend, client); capture_proxy_set_size(capture_proxy_item->cp, surface->width, surface->height); if (!capture_proxy_item->cp) { weston_log("Failed to create capture proxy.\n"); free(capture_proxy_item); return IAS_HMI_FCAP_ERROR_NO_CAPTURE_PROXY; } capture_proxy_item->capture_commit_listener.notify = capture_commit_notify; wl_signal_add(&surface->commit_signal, &capture_proxy_item->capture_commit_listener); wl_list_init(&capture_proxy_item->link); wl_list_insert(&ias_backend->capture_proxy_list, &capture_proxy_item->link); /* We need to know when a vsync has occurred, even if we are not * capturing an output, in order to limit the number of frames * that are handled from applications that commit at very * high framerates. */ capture_proxy_item->capture_vsync_listener.notify = capture_vsync_notify; wl_signal_add(&output->next_scanout_ready_signal, &capture_proxy_item->capture_vsync_listener); if (profile) { capture_proxy_enable_profiling(capture_proxy_item->cp, 1); } capture_proxy_set_verbose(capture_proxy_item->cp, verbose); capture_proxy_set_resource(capture_proxy_item->cp, resource); } else { /* We are capturing an output framebuffer... */ struct wl_list *output_list = &ias_backend->compositor->output_list; uint32_t found_output = 0; wl_list_for_each(output, output_list, base.link) { if (output->base.id == output_number) { weston_log("Starting capture for output %d.\n", output_number); found_output = 1; break; } } if (!found_output) { weston_log("start_capture - Invalid output selection %u.\n", output_number); return IAS_HMI_FCAP_ERROR_INVALID; } if (ias_backend->format != GBM_FORMAT_XRGB8888) { weston_log("Failed to start capture proxy: output format not supported.\n"); return IAS_HMI_FCAP_ERROR_NO_CAPTURE_PROXY; } if (output->cp) { weston_log("Output is already being captured.\n"); return IAS_HMI_FCAP_ERROR_DUPLICATE; } output->cp = create_capture_proxy(ias_backend, client); capture_proxy_set_size(output->cp, output->width, output->height); if (!output->cp) { weston_log("Failed to create capture proxy.\n"); return IAS_HMI_FCAP_ERROR_NO_CAPTURE_PROXY; } output->capture_proxy_frame_listener.notify = capture_frame_notify; wl_signal_add(&output->next_scanout_ready_signal, &output->capture_proxy_frame_listener); weston_output_schedule_repaint(&output->base); if (profile) { capture_proxy_enable_profiling(output->cp, 1); } capture_proxy_set_verbose(output->cp, verbose); capture_proxy_set_resource(output->cp, resource); output->base.disable_planes++; } weston_log("start_capture done.\n"); return IAS_HMI_FCAP_ERROR_OK; } static int stop_capture(struct wl_client *client, struct ias_backend *ias_backend, struct wl_resource *resource, struct weston_surface *surface, const uint32_t output_number) { struct ias_output *output = NULL; pid_t pid; /* Make sure that we're using the IAS backend... */ if (ias_backend->magic != BACKEND_MAGIC) { IAS_ERROR("Backend does not match."); return IAS_HMI_FCAP_ERROR_INVALID; } wl_client_get_credentials(client, &pid, NULL, NULL); if (surface) { /* If a weston_surface was passed in, then we were capturing the * buffers of that surface. */ if (surface->output) { output = container_of(surface->output, struct ias_output, base); } else { weston_log("Error - stop_capture - No output associated with surface %p.\n", surface); return IAS_HMI_FCAP_ERROR_INVALID; } weston_log("Destroying capture proxy for surface %p.\n", surface); capture_proxy_destroy_from_surface(ias_backend, surface); } else { /* We were capturing an output framebuffer... */ struct wl_list *output_list = &ias_backend->compositor->output_list; uint32_t found_output = 0; wl_list_for_each(output, output_list, base.link) { if (output->base.id == output_number) { weston_log("Stopping capture for output %d.\n", output_number); found_output = 1; break; } } if (!found_output) { weston_log("stop_capture - Invalid output selection %u.\n", output_number); return IAS_HMI_FCAP_ERROR_INVALID; } weston_log("Stopping capture for output %d.\n", output_number); capture_proxy_destroy_from_output(output); } weston_log("stop_capture done.\n"); return IAS_HMI_FCAP_ERROR_OK; } static int release_buffer_handle(struct ias_backend *ias_backend, uint32_t surfid, uint32_t bufid, uint32_t imageid, struct weston_surface *surface, uint32_t output_number) { if (surface) { struct ias_surface_capture *capture_item = NULL; struct ias_surface_capture *tmp_item = NULL; wl_list_for_each_safe(capture_item, tmp_item, &ias_backend->capture_proxy_list, link) { if (capture_item->capture_surface == surface) { capture_proxy_release_buffer(capture_item->cp, surfid, bufid, imageid); } } } else { struct ias_output *output = NULL; struct wl_list *output_list = &ias_backend->compositor->output_list; uint32_t i = 0; wl_list_for_each(output, output_list, base.link) { if (output->base.id == output_number) { break; } i++; } if (i > output_number) { weston_log("release_buffer_handle - Invalid output selection %u.\n", output_number); return IAS_HMI_FCAP_ERROR_INVALID; } capture_proxy_release_buffer(output->cp, 0, 0, 0); } return IAS_HMI_FCAP_ERROR_OK; } int change_capture_output(struct ias_backend *ias_backend, struct weston_surface *surface) { struct ias_surface_capture *capture_item; struct ias_output *output; if (surface->output) { output = container_of(surface->output, struct ias_output, base); } else { weston_log("Error - No output associated with surface %p.\n", surface); return IAS_HMI_FCAP_ERROR_INVALID; } wl_list_for_each(capture_item, &ias_backend->capture_proxy_list, link) { if (capture_item->capture_surface == surface) { /* Remove the old output's link from capture_vsync_listener */ wl_list_remove(&capture_item->capture_vsync_listener.link); /* Add the new output's link into capture_vsync_listener */ capture_item->capture_vsync_listener.notify = capture_vsync_notify; wl_signal_add(&output->next_scanout_ready_signal, &capture_item->capture_vsync_listener); } } return IAS_HMI_FCAP_ERROR_OK; } #endif /*BUILD_REMOTE_DISPLAY*/ static int init_drm(struct ias_backend *backend, struct udev_device *device) { const char *filename, *sysnum; uint64_t cap; int fd, ret; sysnum = udev_device_get_sysnum(device); if (sysnum) backend->drm.id = atoi(sysnum); if (!sysnum || backend->drm.id < 0) { weston_log("cannot get device sysnum\n"); return -1; } filename = udev_device_get_devnode(device); fd = weston_launcher_open(backend->compositor->launcher, filename, O_RDWR); if (fd < 0) { /* Probably permissions error */ weston_log("couldn't open %s, skipping\n", udev_device_get_devnode(device)); return -1; } weston_log("using %s\n", filename); backend->drm.fd = fd; backend->drm.filename = strdup(filename); ret = drmGetCap(fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap); if (ret == 0 && cap == 1) backend->clock = CLOCK_MONOTONIC; else backend->clock = CLOCK_REALTIME; return 0; } static struct gbm_device * create_gbm_device(int fd) { struct gbm_device *gbm; gl_renderer = weston_load_module("gl-renderer.so", "gl_renderer_interface"); if (!gl_renderer) return NULL; /* GBM will load a dri driver, but even though they need symbols from * libglapi, in some version of Mesa they are not linked to it. Since * only the gl-renderer module links to it, the call above won't make * these symbols globally available, and loading the DRI driver fails. * Workaround this by dlopen()'ing libglapi with RTLD_GLOBAL. */ dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL); gbm = gbm_create_device(fd); #ifdef HYPER_DMABUF gl_renderer->vm_exec = vm_exec; gl_renderer->vm_dbg = vm_dbg; gl_renderer->vm_unexport_delay = vm_unexport_delay; gl_renderer->vm_plugin_path = vm_plugin_path; gl_renderer->vm_plugin_args = vm_plugin_args; gl_renderer->vm_share_only = vm_share_only; #endif /* HYPER_DMABUF */ return gbm; } /* When initializing EGL, if the preferred buffer format isn't available * we may be able to susbstitute an ARGB format for an XRGB one. * * This returns 0 if substitution isn't possible, but 0 might be a * legitimate format for other EGL platforms, so the caller is * responsible for checking for 0 before calling gl_renderer->create(). * * This works around https://bugs.freedesktop.org/show_bug.cgi?id=89689 * but it's entirely possible we'll see this again on other implementations. */ static int fallback_format_for(uint32_t format) { switch (format) { case GBM_FORMAT_XRGB8888: return GBM_FORMAT_ARGB8888; case GBM_FORMAT_XRGB2101010: return GBM_FORMAT_ARGB2101010; default: return 0; } } static int ias_compositor_create_gl_renderer(struct ias_backend *backend) { EGLint format[2] = { backend->format, fallback_format_for(backend->format), }; int n_formats = 1; int use_vm = 0; #ifdef HYPER_DMABUF if(gl_renderer->vm_exec) { backend->format = GBM_FORMAT_ARGB8888; } use_vm = gl_renderer->vm_exec; #endif /* HYPER_DMABUF */ if (format[1]) n_formats = 2; if (gl_renderer->display_create(backend->compositor, EGL_PLATFORM_GBM_KHR, (void *)backend->gbm, NULL, use_vm ? gl_renderer->alpha_attribs : gl_renderer->opaque_attribs, format, n_formats) < 0) { return -1; } return 0; } static int init_egl(struct ias_backend *backend, struct udev_device *device) { backend->gbm = create_gbm_device(backend->drm.fd); if (!backend->gbm) return -1; if (ias_compositor_create_gl_renderer(backend) < 0) { gbm_device_destroy(backend->gbm); return -1; } TRACEPOINT(" - GLES2 renderer initialized"); return 0; } static int udev_event_is_hotplug(struct ias_backend *backend, struct udev_device *device) { const char *sysnum; const char *val; sysnum = udev_device_get_sysnum(device); if (!sysnum || atoi(sysnum) != backend->drm.id) return 0; val = udev_device_get_property_value(device, "HOTPLUG"); if (!val) return 0; return strcmp(val, "1") == 0; } static int udev_ias_event(int fd, uint32_t mask, void *data) { struct ias_backend *backend = data; struct udev_device *event; event = udev_monitor_receive_device(backend->udev_monitor); if (udev_event_is_hotplug(backend, event)) { ias_update_outputs(backend, event); } udev_device_unref(event); return 1; } static struct udev_device *find_drm_device( struct ias_backend *backend, struct udev_enumerate *e, const char *seat_id, const char **path) { struct udev_list_entry *entry; struct udev_device *device, *drm_device; const char *device_seat; udev_enumerate_scan_devices(e); drm_device = NULL; udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { *path = udev_list_entry_get_name(entry); device = udev_device_new_from_syspath(backend->udev, *path); device_seat = udev_device_get_property_value(device, "ID_SEAT"); if (!device_seat) device_seat = default_seat; if (strcmp(device_seat, seat_id) == 0) { drm_device = device; break; } udev_device_unref(device); } return drm_device; } static struct ias_backend * ias_compositor_create(struct weston_compositor *compositor, struct weston_ias_backend_config *config) { struct ias_backend *backend; struct udev_enumerate *e; struct udev_device *drm_device; const char *path; struct wl_event_loop *loop; uint32_t counter = 0; const char *seat_id = default_seat; weston_log("initializing Intel Automotive Solutions backend\n"); set_unset_env(&global_env_list); backend = malloc(sizeof *backend); if (backend == NULL) return NULL; memset(backend, 0, sizeof *backend); backend->compositor = compositor; /* * Set compositor's keyboard/keymap setting to what we read from the * config before initializing the base weston compositor. */ compositor->use_xkbcommon = use_xkbcommon; compositor->normalized_rotation = normalized_rotation; compositor->damage_outputs_on_init = damage_outputs_on_init; backend->print_fps = print_fps; backend->metrics_timing = metrics_timing; backend->no_flip_event = no_flip_event; if (config->gbm_format) { if (strcmp(config->gbm_format, "xrgb8888") == 0) backend->format = GBM_FORMAT_XRGB8888; else if (strcmp(config->gbm_format, "argb8888") == 0) backend->format = GBM_FORMAT_ARGB8888; else if (strcmp(config->gbm_format, "rgb565") == 0) backend->format = GBM_FORMAT_RGB565; else if (strcmp(config->gbm_format, "xrgb2101010") == 0) backend->format = GBM_FORMAT_XRGB2101010; else { weston_log("fatal: unrecognized pixel format: %s\n", config->gbm_format); goto err_base; } } else { backend->format = GBM_FORMAT_XRGB8888; } backend->use_pixman = config->use_pixman; if (config->seat_id) seat_id = config->seat_id; if (config->tty == 0) config->tty = 1; /* Check if we run ias-backend using weston-launch */ compositor->launcher = weston_launcher_connect(compositor, config->tty, seat_id, true); if (compositor->launcher == NULL) { weston_log("fatal: IAS backend should be run " "using weston-launch binary or as root\n"); goto err_compositor; } /* * Set a magic number so the shell module can verify that it's running on * the IAS backend. */ backend->magic = BACKEND_MAGIC; backend->udev = udev_new(); if (backend->udev == NULL) { weston_log("failed to initialize udev context\n"); goto err_compositor; } backend->session_listener.notify = session_notify; wl_signal_add(&compositor->session_signal, &backend->session_listener); TRACEPOINT(" - Before finding drm device"); /* Worst case is that we wait for 2 seconds to find the drm device */ drm_device = NULL; while(!drm_device && counter < 2000) { e = udev_enumerate_new(backend->udev); udev_enumerate_add_match_subsystem(e, "drm"); udev_enumerate_add_match_sysname(e, "card[0-9]*"); drm_device = find_drm_device(backend, e, seat_id, &path); if(!drm_device) { udev_enumerate_unref(e); usleep(5000); counter++; } } TRACEPOINT(" - After finding drm device"); if (drm_device == NULL) { weston_log("no drm device found\n"); goto err_udev_enum; } TRACEPOINT(" - udev and tty setup complete"); if (init_drm(backend, drm_device) < 0) { weston_log("failed to initialize kms\n"); goto err_udev_dev; } if (init_egl(backend, drm_device) < 0) { weston_log("failed to initialize egl\n"); goto err_udev_dev; } #ifdef HYPER_DMABUF if (vm_exec && init_hyper_dmabuf(backend) < 0) { weston_log("Failed to initialize hyper dmabuf\n"); goto err_udev_dev; } #endif TRACEPOINT(" - EGL initialized"); backend->base.destroy = ias_destroy; backend->prev_state = WESTON_COMPOSITOR_ACTIVE; weston_setup_vt_switch_bindings(compositor); #ifdef BUILD_REMOTE_DISPLAY wl_list_init(&backend->capture_proxy_list); #endif /* * Query KMS to see if atomic/nuclear page fliping is supported. */ backend->has_nuclear_pageflip = atomic_ioctl_supported(backend->drm.fd); if (!use_nuclear_flip) { backend->has_nuclear_pageflip = 0; } backend->rbc_debug = rbc_debug; backend->use_cursor_as_uplane = use_cursor_as_uplane; /* * Query KMS for the number of crtc's and create * an ias_crtc for each and create a global object list of crtc's * similar to how the list of outputs is created. */ wl_list_init(&output_list); wl_list_init(&backend->crtc_list); if (create_crtcs(backend) <= 0) { weston_log("failed to create crtcs for %s\n", path); goto err_sprite; } if (emgd_has_multiplane_drm(backend)) { backend->private_multiplane_drm = 0; } else { backend->private_multiplane_drm = 1; } TRACEPOINT(" - Sprites initialized"); path = NULL; if (udev_input_init(&backend->input, compositor, backend->udev, seat_id, config->configure_device) < 0) { weston_log("failed to create input devices\n"); goto err_sprite; } TRACEPOINT(" - Input initialized"); loop = wl_display_get_event_loop(compositor->wl_display); backend->ias_source = wl_event_loop_add_fd(loop, backend->drm.fd, WL_EVENT_READABLE, on_ias_input, backend); backend->udev_monitor = udev_monitor_new_from_netlink(backend->udev, "udev"); if (backend->udev_monitor == NULL) { weston_log("failed to intialize udev monitor\n"); goto err_ias_source; } udev_monitor_filter_add_match_subsystem_devtype(backend->udev_monitor, "drm", NULL); backend->udev_ias_source = wl_event_loop_add_fd(loop, udev_monitor_get_fd(backend->udev_monitor), WL_EVENT_READABLE, udev_ias_event, backend); if (udev_monitor_enable_receiving(backend->udev_monitor) < 0) { weston_log("failed to enable udev-monitor receiving\n"); goto err_udev_monitor; } udev_device_unref(drm_device); backend->get_sprite_list = get_sprite_list; backend->assign_view_to_sprite = assign_view_to_sprite; backend->assign_zorder_to_sprite = assign_zorder_to_sprite; backend->assign_blending_to_sprite = assign_blending_to_sprite; backend->attempt_scanout_for_view = ias_attempt_scanout_for_view; backend->get_tex_info = get_tex_info; backend->get_egl_image_info = get_egl_image_info; backend->set_viewport = set_viewport; #ifdef BUILD_REMOTE_DISPLAY backend->start_capture = start_capture; backend->stop_capture = stop_capture; backend->release_buffer_handle = release_buffer_handle; backend->change_capture_output = change_capture_output; #endif centre_pointer(backend); if (backend->has_nuclear_pageflip) { /* * The renderer needs to know if it should filter out RBC modes so provide a * flag to it. */ gl_renderer->rbc = use_rbc; backend->rbc_supported = render_buffer_compression_supported(backend); backend->rbc_enabled = backend->rbc_supported && use_rbc && !has_overlapping_outputs(backend); if (backend->rbc_debug) { weston_log("[RBC] RBC support in DRM = %d\n", backend->rbc_supported); weston_log("[RBC] RBC enabled in compositor = %d\n", backend->rbc_enabled); } } if (compositor->renderer->import_dmabuf) { if (linux_dmabuf_setup(compositor) < 0) weston_log("Error: initializing dmabuf " "support failed.\n"); } compositor->backend = &backend->base; return backend; err_udev_monitor: wl_event_source_remove(backend->udev_ias_source); udev_monitor_unref(backend->udev_monitor); err_ias_source: wl_event_source_remove(backend->ias_source); udev_input_destroy(&backend->input); err_sprite: compositor->renderer->destroy(compositor); compositor->renderer = NULL; gbm_device_destroy(backend->gbm); destroy_sprites(backend); #ifdef HYPER_DMABUF if (vm_exec) cleanup_hyper_dmabuf(backend); #endif err_udev_dev: if(backend->drm.fd) { close(backend->drm.fd); } udev_device_unref(drm_device); err_udev_enum: udev_enumerate_unref(e); err_compositor: weston_compositor_shutdown(compositor); err_base: free(backend); return NULL; } /*** *** Worker functions for plugin manager helper funcs ***/ /* * get_sprite_list() */ static int get_sprite_list(struct weston_output *output, struct ias_sprite ***sprite_list) { struct ias_output *ias_output = (struct ias_output*)output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct ias_sprite *ias_sprite; int num_sprites = ias_crtc->num_sprites; int i; /* If sprites are broken (e.g., kernel too old), return none */ if (ias_crtc->sprites_are_broken) { *sprite_list = NULL; return 0; } /* If we're in dualview or stereo mode, no sprites are available */ if (!ias_crtc->output_model->sprites_are_usable) { *sprite_list = NULL; return 0; } /* Build a sprite list for the plugin */ i = 0; *sprite_list = calloc(num_sprites, sizeof(struct ias_sprite*)); if (!*sprite_list) { IAS_ERROR("Failed to allocate sprite list: out of memory"); return 0; } wl_list_for_each(ias_sprite, &ias_crtc->sprite_list, link) { assert(i < num_sprites); if ((1<<ias_sprite->pipe_id) & ias_sprite->possible_crtcs) (*sprite_list)[i++] = ias_sprite; } assert(i == num_sprites); return num_sprites; } static int assign_blending_to_sprite(struct weston_output *output, int sprite_id, int src_factor, int dst_factor, float blend_color, int enable) { struct ias_output *ias_output = (struct ias_output*)output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct ias_sprite *s; int ret = -1; uint32_t format; /* Make sure sprites are actually functioning (e.g., new enough kernel) */ if (ias_crtc->sprites_are_broken) { IAS_ERROR("Cannot use sprite; sprites are broken"); return -1; } wl_list_for_each(s, &ias_crtc->sprite_list, link) { if (s->plane_id == sprite_id) { format = s->next->format; if ((src_factor == SPUG_BLEND_FACTOR_AUTO && dst_factor == SPUG_BLEND_FACTOR_AUTO) || (src_factor == SPUG_BLEND_FACTOR_ONE && dst_factor == SPUG_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA)) { s->constant_alpha = 1.0f; s->pixel_blend_mode = (format == GBM_FORMAT_ARGB8888) ? DRM_MODE_BLEND_PREMULTI : DRM_MODE_BLEND_PIXEL_NONE; } else if (src_factor == SPUG_BLEND_FACTOR_ONE && dst_factor == SPUG_BLEND_FACTOR_ZERO) { s->constant_alpha = 1.0f; s->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE; } else if (src_factor == SPUG_BLEND_FACTOR_SRC_ALPHA && dst_factor == SPUG_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA) { s->constant_alpha = 1.0f; s->pixel_blend_mode = (format == GBM_FORMAT_ARGB8888) ? DRM_MODE_BLEND_COVERAGE : DRM_MODE_BLEND_PIXEL_NONE; } else if (src_factor == SPUG_BLEND_FACTOR_CONSTANT_ALPHA && dst_factor == SPUG_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA) { s->constant_alpha = blend_color; s->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE; } else if (src_factor == SPUG_BLEND_FACTOR_CONSTANT_ALPHA && dst_factor == SPUG_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA_TIMES_SRC_ALPHA) { s->constant_alpha = blend_color; s->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI; } else if (src_factor == SPUG_BLEND_FACTOR_CONSTANT_ALPHA_TIMES_SRC_ALPHA && dst_factor == SPUG_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA_TIMES_SRC_ALPHA) { s->constant_alpha = blend_color; s->pixel_blend_mode = DRM_MODE_BLEND_COVERAGE; } else { IAS_ERROR("Invalid blend factor combination"); return -1; } s->blending_enabled = enable; s->sprite_dirty |= SPRITE_DIRTY_BLENDING; s->view->alpha = s->constant_alpha; ret = 0; } } return ret; } static int assign_zorder_to_sprite(struct weston_output *output, int sprite_id, int position) { struct ias_output *ias_output = (struct ias_output*)output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct ias_sprite *s; int ret = -1; /* Make sure sprites are actually functioning (e.g., new enough kernel) */ if (ias_crtc->sprites_are_broken) { IAS_ERROR("Cannot use sprite; sprites are broken"); return -1; } wl_list_for_each(s, &ias_crtc->sprite_list, link) { if (s->plane_id == sprite_id) { s->zorder = position; s->sprite_dirty |= SPRITE_DIRTY_ZORDER; ret = 0; } } return ret; } /* * Checks if compressed buffer meets all requrements to be resolved in display controller. * Assumes that buffer is Y or Yf tiled with CSS enabled. */ static uint32_t is_rbc_resolve_possible_on_sprite(uint32_t rotation, uint32_t format) { if (rotation != 0 && rotation != 180) { return 0; } if (format != GBM_FORMAT_ARGB8888 && format != GBM_FORMAT_XRGB8888) { return 0; } return 1; } /* Check if a surface is flippable on a sprite in this output model */ static uint32_t is_surface_flippable_on_sprite(struct weston_view *view, struct weston_output *output) { struct ias_output *ias_output = (struct ias_output*)output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct weston_surface *surface = view->surface; /* Make sure sprites are actually functioning (e.g., new enough kernel) */ if (ias_crtc->sprites_are_broken) { IAS_DEBUG("Cannot use sprite; sprites are broken"); return 0; } /* Don't use sprites on scaled outputs */ if (ias_crtc->current_mode->base.width != ias_output->width || ias_crtc->current_mode->base.height != ias_output->height) { IAS_DEBUG("Sprite usage is not supported on scaled outputs."); return 0; } /* If there's no buffer attached to this surface, bail out. */ if (!surface->buffer_ref.buffer) { return 0; } /* SHM buffers can't be placed on a sprite plane */ if (wl_shm_buffer_get(surface->buffer_ref.buffer->resource)) { IAS_DEBUG("SHM buffers can't be assigned to a sprite plane"); return 0; } return 1; } /* * Crops src_rect by the same ratio that cropped_dest_rect * was cropped comparing to orig_dest_rect. */ static void crop_rect_scaled(pixman_region32_t *src_rect, pixman_region32_t *orig_dest_rect, pixman_region32_t *cropped_dest_rect) { pixman_box32_t *orig_extents; pixman_box32_t *cropped_extents; pixman_box32_t *src_extents; float x_ratio,y_ratio,w_ratio,h_ratio; int32_t cropped_w, cropped_h, orig_w, orig_h, src_w, src_h; orig_extents = pixman_region32_extents(orig_dest_rect); cropped_extents = pixman_region32_extents(cropped_dest_rect); orig_w = orig_extents->x2 - orig_extents->x1; orig_h = orig_extents->y2 - orig_extents->y1; cropped_w = cropped_extents->x2 - cropped_extents->x1; cropped_h = cropped_extents->y2 - cropped_extents->y1; /* Calculate by what ratio x,y,w,h of destination rectangle was cropped */ x_ratio = ((float)(cropped_extents->x1 - orig_extents->x1)) / orig_w; y_ratio = ((float)(cropped_extents->y1 - orig_extents->y1)) / orig_h; w_ratio = ((float)(cropped_w - orig_w)) / orig_w; h_ratio = ((float)(cropped_h - orig_h)) / orig_h; src_extents = pixman_region32_extents(src_rect); src_w = src_extents->x2 - src_extents->x1; src_h = src_extents->y2 - src_extents->y1; /* Crop source rectangle using the same ratio like for destination rectangle */ src_extents->x1 += x_ratio * src_w; src_extents->y1 += y_ratio * src_h; src_extents->x2 += x_ratio * src_w + w_ratio * src_w; src_extents->y2 += y_ratio * src_h + h_ratio * src_h; } /* * assign_surface_to_sprite() * * Assigns the specified surface (or subregion of the surface) to a sprite for * the frame currently being rendered and positions it at the specified * position on the screen. This function should be called by a plugin's 'draw' * entrypoint each frame. If the plugin does not call this function, the * sprite will automatically be turned off and not used for the current frame. */ static struct weston_plane * assign_view_to_sprite(struct weston_view *view, /* struct ias_sprite *sprite, */ struct weston_output *output, int *sprite_id, int x, int y, int sprite_width, int sprite_height, pixman_region32_t *view_region) { struct ias_output *ias_output = (struct ias_output*)output; struct ias_crtc *ias_crtc = ias_output->ias_crtc; struct ias_backend *backend = ias_crtc->backend; struct ias_sprite *ias_sprite, *sprite; struct weston_surface *surface = view->surface; struct gbm_bo *bo; uint32_t format; uint32_t resolve_needed = 0; uint32_t downscaling = 0; struct linux_dmabuf_buffer *dmabuf; int i; wl_fixed_t sx1, sy1, sx2, sy2; pixman_box32_t *sprite_extents; pixman_region32_t src_rect, dest_rect, orig_dest_rect, crtc_rect; ias_sprite = NULL; sprite = NULL; if (!is_surface_flippable_on_sprite(view, output)) { return NULL; } if (x >= output->current_mode->width) { x = output->current_mode->width - 1; } if (y >= output->current_mode->height) { y = output->current_mode->height - 1; } /* Import the surface buffer as a GBM bo that we can flip */ if ((dmabuf = linux_dmabuf_buffer_get(surface->buffer_ref.buffer->resource))) { struct gbm_import_fd_data gbm_dmabuf = { .fd = dmabuf->attributes.fd[0], .width = dmabuf->attributes.width, .height = dmabuf->attributes.height, .stride = dmabuf->attributes.stride[0], .format = dmabuf->attributes.format }; for (i = 0; i < dmabuf->attributes.n_planes; i++) { if (dmabuf->attributes.modifier[i] == I915_FORMAT_MOD_Y_TILED_CCS || dmabuf->attributes.modifier[i] == I915_FORMAT_MOD_Yf_TILED_CCS) { resolve_needed = 1; break; } } bo = gbm_bo_import(backend->gbm, GBM_BO_IMPORT_FD, &gbm_dmabuf, GBM_BO_USE_SCANOUT); } else { bo = gbm_bo_import(backend->gbm, GBM_BO_IMPORT_WL_BUFFER, surface->buffer_ref.buffer->resource, GBM_BO_USE_SCANOUT); } if (!bo) { IAS_ERROR("Could not import surface buffer as GBM bo"); return NULL; } format = gbm_bo_get_format(bo); /* * Sprites should only get surfaces assigned once per frame. We could * handle this if we really wanted to (after releasing the GBM bo and * DRM framebuffer), but most likely replacing a previous sprite * assignment is likely a sign of programming error and it's better to * reject it. */ wl_list_for_each(ias_sprite, &ias_crtc->sprite_list, link) { if (ias_sprite->type == DRM_PLANE_TYPE_OVERLAY || (backend->use_cursor_as_uplane && ias_sprite->type == DRM_PLANE_TYPE_CURSOR)) { if (*sprite_id == 0) { if (ias_sprite->locked) continue; if (resolve_needed && !(backend->rbc_enabled && ias_sprite->supports_rbc && is_rbc_resolve_possible_on_sprite(0, format))) { continue; } sprite = ias_sprite; ias_sprite->locked = 1; break; } else if (ias_sprite->plane_id == *sprite_id) { if (resolve_needed && !(backend->rbc_enabled && ias_sprite->supports_rbc && is_rbc_resolve_possible_on_sprite(0, format))) { continue; } //if (ias_sprite->locked) continue; sprite = ias_sprite; ias_sprite->locked = 1; break; } } } if (!sprite) { IAS_ERROR("All sprites already has surface assigned"); /* * Sprite was not found, check if buffer was compressed as that could be * reason of not being able to use any of currently free sprites. * Mark that DRI should resolve buffer for next frames */ if (resolve_needed) { weston_log("No RBC capable sprite available"); } gbm_bo_destroy(bo); return NULL; } *sprite_id = sprite->plane_id; /* do not disable alpha channel for sprites, * use scanout=false in ias_fb_get_from_bo() */ sprite->next = ias_fb_get_from_bo(bo, surface->buffer_ref.buffer, ias_output, IAS_FB_OVERLAY); if (!sprite->next) { gbm_bo_destroy(bo); return NULL; } /* Get surface region into global coordinates */ if (!view_region) { /* * There was no surface region provided, so initialize src rectange * to be of whole surface size. */ pixman_region32_init_rect(&src_rect, 0, 0, surface->width, surface->height); /* * If custom sprite width and height was provided use it as size * for dst rectangle, at the same time check if provided sprite * width and height will require surface downscaling. * If 0 was provided as sprite width or height use surface size * as dst rectangle size instead. */ if (sprite_width != 0 && sprite_height != 0) { /* Check if downscaling */ if (sprite_width < surface->width || sprite_height < surface->height) { downscaling = 1; } pixman_region32_init_rect(&dest_rect, x, y, sprite_width, sprite_height); } else { pixman_region32_init_rect(&dest_rect, x, y, surface->width, surface->height); } } else { /* There was surface subregion provided, so use it as src rectangle */ pixman_region32_init(&src_rect); pixman_region32_copy(&src_rect, view_region); /* * If custom sprite width and height was provided use it as size * for dst rectangle, at the same time check if provided sprite * width and heigh will require surface downscaling. * If 0 was provided as sprite width or height use provided * surface subregion size as dst rectangle size instead. */ if (sprite_width != 0 && sprite_height != 0) { sprite_extents = pixman_region32_extents(view_region); /* Check if downscaling */ if (sprite_width < (sprite_extents->x2 - sprite_extents->x1) || sprite_height < (sprite_extents->y2 - sprite_extents->y1)) { downscaling = 1; } pixman_region32_init_rect(&dest_rect, x, y, sprite_width, sprite_height); pixman_region32_translate(&dest_rect, sprite_extents->x1, sprite_extents->y1); } else { pixman_region32_init(&dest_rect); pixman_region32_copy(&dest_rect, view_region); pixman_region32_translate(&dest_rect, x, y); } } /* * Not supporting downscaling due to limited max downscale * factor supported by HW scaler. */ if (downscaling) { IAS_ERROR("Sprite downscaling not supported"); pixman_region32_fini(&src_rect); pixman_region32_fini(&dest_rect); sprite->next = NULL; gbm_bo_destroy(bo); return NULL; } /* Get the output region into global coordinates */ pixman_region32_init(&crtc_rect); pixman_region32_copy(&crtc_rect, &output->region); pixman_region32_translate(&crtc_rect, -output->x, -output->y); if (ias_output->rotation) { crtc_rect.extents.x2 = output->current_mode->width; crtc_rect.extents.y2 = output->current_mode->height; } /* * Make a copy of original dst rectange, so in case of scaling we * will be able to check how it was cropped when doing intersect * with crtc rectangle and then crop src rectangle by the same amount, * otherwise surface on sprite will be stretched or squeezed instead * of properly scaled. */ pixman_region32_init(&orig_dest_rect); pixman_region32_copy(&orig_dest_rect, &dest_rect); pixman_region32_intersect(&dest_rect, &crtc_rect, &dest_rect); sprite_extents = pixman_region32_extents(&dest_rect); sprite->plane.x = sprite_extents->x1; sprite->plane.y = sprite_extents->y1; sprite->dest_w = sprite_extents->x2 - sprite_extents->x1; sprite->dest_h = sprite_extents->y2 - sprite_extents->y1; /* * Crop src rectangle by the same relative amount that dst * rectange was cropped by crct rectangle. */ crop_rect_scaled(&src_rect, &orig_dest_rect, &dest_rect); sprite_extents = pixman_region32_extents(&src_rect); weston_view_from_global_fixed(view, wl_fixed_from_int(sprite_extents->x1), wl_fixed_from_int(sprite_extents->y1), &sx1, &sy1); weston_view_from_global_fixed(view, wl_fixed_from_int(sprite_extents->x2), wl_fixed_from_int(sprite_extents->y2), &sx2, &sy2); /* Make sure the sprite is fully visible on main display plane */ if (sx1 < 0) sx1 = 0; if (sy1 < 0) sy1 = 0; if (sx2 > wl_fixed_from_int(output->current_mode->width)) sx2 = wl_fixed_from_int(output->current_mode->width); if (sy2 > wl_fixed_from_int(output->current_mode->height)) sy2 = wl_fixed_from_int(output->current_mode->height); /* The wl_fixed_from_int function converts the sprite plane extents into * a 24.8 format; however, since the DRM driver expects the framebuffer * and crtc coordinates to be in a 16.16 format, we convert the extents * into a 16.16 format by shifting the values left by 8 bits. */ sprite->src_x = sx1 << 8; sprite->src_y = sy1 << 8; sprite->src_w = (sx2 - sx1) << 8; sprite->src_h = (sy2 - sy1) << 8; pixman_region32_fini(&src_rect); pixman_region32_fini(&dest_rect); pixman_region32_fini(&orig_dest_rect); pixman_region32_fini(&crtc_rect); /* * HW scaler has limitation regarding minimal src/dst width and height */ if (sprite_width != 0 && sprite_height != 0 && ((sprite->src_w >> 16) < 10 || (sprite->src_h >> 16) < 10 || sprite->dest_w < 10 || sprite->dest_h < 10)) { IAS_ERROR("Sprite source or destination rectangle to small"); sprite->next = NULL; gbm_bo_destroy(bo); return NULL; } /* Associate sprite with surface and save coordinates/region */ sprite->view = view; view->plane = &sprite->plane; /* * Reference buffer to prevent weston_surface_attach() from * releasing this buffer if a new buffer is attached to the client's * surface. The buffer will be released by calling weston_buffer_reference() * inside flip_handler_classic() once a new buffer is flipped. */ weston_buffer_reference(&sprite->next->buffer_ref, surface->buffer_ref.buffer); if (view->alpha != sprite->constant_alpha) { sprite->sprite_dirty |= SPRITE_DIRTY_BLENDING; sprite->constant_alpha = view->alpha; } return &ias_output->fb_plane; } static void get_tex_info(struct weston_view *view, int *num, GLuint *names) { int names_size, i; /* if they passed us num, get them the number of textures */ if(num) { names_size = *num; *num = gl_renderer->get_num_textures(view->surface); /* if they also passed in names, give them either all of the * texture names, or however many they asked for. Whichever * is smaller. */ if(names) { if(*num < names_size) { names_size = *num; } for(i = 0; i < names_size; i++) { names[i] = gl_renderer->get_texture_name(view->surface, i); } } /* if they didn't pass in num, but they did pass in names, just * give them the first name */ } else if(names) { names[0] = gl_renderer->get_texture_name(view->surface, 0); } /* else nop */ } static void get_egl_image_info(struct weston_view *view, int *num, EGLImageKHR *names) { int names_size, i; /* if they passed us num, get them the number of EGLImages */ if(num) { names_size = *num; *num = gl_renderer->get_num_egl_images(view->surface); /* if they also passed in names, give them either all of the * EGLImages, or however many they asked for. Whichever * is smaller. */ if(names) { if(*num < names_size) { names_size = *num; } for(i = 0; i < names_size; i++) { names[i] = gl_renderer->get_egl_image_name(view->surface, i); } } /* if they didn't pass in num, but they did pass in names, just * give them the first name */ } else if(names) { names[0] = gl_renderer->get_egl_image_name(view->surface, 0); } /* else nop */ } static void set_viewport(int x, int y, int width, int height) { gl_renderer->set_viewport(x, y, width, height); } /*** *** Config parsing functions ***/ /* * backend_begin() * * Parses backend attributes from XML. */ void backend_begin(void *userdata, const char **attrs) { while (attrs[0]) { if (strcmp(attrs[0], "depth") == 0) { need_depth = atoi(attrs[1]); } else if (strcmp(attrs[0], "stencil") == 0) { need_stencil = atoi(attrs[1]); } else if (strcmp(attrs[0], "raw_keyboards") == 0) { use_xkbcommon = !(atoi(attrs[1])); } else if (strcmp(attrs[0], "normalized_rotation") == 0) { normalized_rotation = atoi(attrs[1]); } else if (strcmp(attrs[0], "print_fps") == 0) { print_fps = atoi(attrs[1]); } else if (strcmp(attrs[0], "metrics_timing") == 0) { metrics_timing = atoi(attrs[1]); } else if (strcmp(attrs[0], "use_nuclear_flip") == 0) { use_nuclear_flip = atoi(attrs[1]); } else if (strcmp(attrs[0], "no_flip_event") == 0) { no_flip_event = atoi(attrs[1]); } else if (strcmp(attrs[0], "no_color_correction") == 0 ) { no_color_correction = atoi(attrs[1]); } else if (strcmp(attrs[0], "use_rbc") == 0) { use_rbc = atoi(attrs[1]); } else if (strcmp(attrs[0], "rbc_debug") == 0) { rbc_debug = atoi(attrs[1]); } else if (strcmp(attrs[0], "damage_outputs_on_init") == 0) { damage_outputs_on_init = atoi(attrs[1]); } else if (strcmp(attrs[0], "vm") == 0) { vm_exec = atoi(attrs[1]); } else if (strcmp(attrs[0], "vm_dbg") == 0) { vm_dbg = atoi(attrs[1]); } else if (strcmp(attrs[0], "vm_unexport_delay") == 0) { vm_unexport_delay = atoi(attrs[1]); } else if (strcmp(attrs[0], "vm_plugin_path") == 0) { strncpy(vm_plugin_path, attrs[1], 255); } else if (strcmp(attrs[0], "vm_plugin_args") == 0) { strncpy(vm_plugin_args, attrs[1], 255); } else if (strcmp(attrs[0], "use_cursor_as_uplane") == 0) { use_cursor_as_uplane = atoi(attrs[1]); } else if (strcmp(attrs[0], "vm_share_only") == 0) { vm_share_only = atoi(attrs[1]); } attrs += 2; } } /* * crtc_begin() * * Parses CRTC attributes from XML. */ void crtc_begin(void *userdata, const char **attrs) { struct ias_configured_crtc *crtc; int x, y, refresh; cur_crtc = NULL; crtc = calloc(1, sizeof *crtc); if (!crtc) { IAS_ERROR("Failed to allocate crtc structure while parsing config"); return; } while (attrs[0]) { if (strcmp(attrs[0], "name") == 0) { /* Avoid a klockworks memory leak warning */ free(crtc->name); crtc->name = strdup(attrs[1]); } else if (strcmp(attrs[0], "mode") == 0) { /* How do we set the mode for this CRTC? */ if (strcmp(attrs[1], "preferred") == 0) { crtc->config = CRTC_CONFIG_PREFERRED; } else if (strcmp(attrs[1], "current") == 0) { crtc->config = CRTC_CONFIG_CURRENT; } else if (sscanf(attrs[1], "%dx%d@%d", &x, &y, &refresh) == 3) { crtc->config = CRTC_CONFIG_MODE; crtc->width = x; crtc->height = y; crtc->refresh = refresh; } else if (sscanf(attrs[1], "%dx%d", &x, &y)) { crtc->config = CRTC_CONFIG_MODE; crtc->width = x; crtc->height = y; crtc->refresh = 0; } else { IAS_ERROR("Unknown CRTC mode config setting '%s'", attrs[1]); } } else if (strcmp(attrs[0], "model") == 0) { /* Is this CRTC a single display, a dualview display, or off? */ free(crtc->model); crtc->model = strdup(attrs[1]); } else { IAS_ERROR("Unknown attribute '%s' to config element", attrs[0]); } attrs += 2; } if (!crtc->name) { IAS_ERROR("CRTC specified in config file with no name"); free(crtc->model); free(crtc); return; } if (!crtc->model) { IAS_ERROR("No output model specified for CRTC"); free(crtc->name); free(crtc); return; } cur_crtc = crtc; wl_list_insert(&configured_crtc_list, &crtc->link); } /* * output_begin() * * Parses output attributes from XML. */ void output_begin(void *userdata, const char **attrs) { struct ias_configured_output *output; int x, y, r; int len; int extra = 0; static struct ias_configured_output *prev_output = NULL; if (cur_crtc == NULL) return; output = calloc(1, sizeof *output); if (!output) { IAS_ERROR("Failed to allocate output structure while parsing config"); return; } if (cur_crtc->output_num >= MAX_OUTPUTS_PER_CRTC) { IAS_ERROR("Too many outputs defined for CRTC %s\n", cur_crtc->name); free(output); return; } else if (cur_crtc->output_num == MAX_OUTPUTS_PER_CRTC - 1 && !use_cursor_as_uplane) { IAS_ERROR("Ignoring last configured output for CRTC %s\n", cur_crtc->name); free(output); return; } /* Associate output with CRTC */ cur_crtc->output[cur_crtc->output_num] = output; while (attrs[0]) { if (strcmp(attrs[0], "name") == 0) { free(output->name); output->name = strdup(attrs[1]); } else if (strcmp(attrs[0], "size") == 0) { free(output->size); output->size = strdup(attrs[1]); } else if (strcmp(attrs[0], "position") == 0) { /* How do we position this output? */ if (strcmp(attrs[1], "rightof") == 0) { output->position = OUTPUT_POSITION_RIGHTOF; } else if (strcmp(attrs[1], "below") == 0) { output->position = OUTPUT_POSITION_BELOW; } else if (strcmp(attrs[1], "origin") == 0) { output->position = OUTPUT_POSITION_ORIGIN; output->x = 0; output->y = 0; } else if (sscanf(attrs[1], "%d,%d", &x, &y)) { output->position = OUTPUT_POSITION_CUSTOM; output->x = x; output->y = y; } else { IAS_ERROR("Unknown output position setting '%s'", attrs[1]); } } else if (strcmp(attrs[0], "target") == 0) { free(output->position_target); output->position_target = strdup(attrs[1]); } else if (strcmp(attrs[0], "rotation") == 0) { if (sscanf(attrs[1], "%d", &r)) { output->rotation = r; } } else if (strcmp(attrs[0], "vm") == 0) { output->vm = atoi(attrs[1]); } else { /* Save any unknown output elements and pass to output model */ extra += 2; output->attrs = realloc(output->attrs, ((extra + 1) * sizeof(char *))); if (output->attrs) { output->attrs[extra-2] = strdup(attrs[0]); output->attrs[extra-1] = strdup(attrs[1]); output->attrs[extra] = NULL; } else { IAS_ERROR("Allocation failed for extra output attributes.\n"); exit(1); } } attrs += 2; } /* * If no name was specified for this output, generate one for it. */ if (!output->name) { len = strlen(cur_crtc->name); output->name = calloc(1, len + 3); if (!output->name) { IAS_ERROR("Failed to allocate output name: out of memory"); exit(1); } strcpy(output->name, cur_crtc->name); output->name[len] = '-'; output->name[len+1] = cur_crtc->output_num; } cur_crtc->output_num++; /* * If no position was set, assume that this output should be to the right * of the previous output (or origin if this is the first output). */ if (output->position == OUTPUT_POSITION_UNDEFINED) { if (!prev_output) { output->position = OUTPUT_POSITION_ORIGIN; } else { output->position = OUTPUT_POSITION_RIGHTOF; output->position_target = strdup(prev_output->name); } } wl_list_insert(&configured_output_list, &output->link); } /* * input_begin() * * Parses input attributes from XML. */ void input_begin(void *userdata, const char **attrs) { struct ias_configured_input *input; if (cur_crtc == NULL) return; input = calloc(1, sizeof *input); if (!input) { IAS_ERROR("Failed to allocate input structure while parsing config"); return; } while (attrs[0]) { if (strcmp(attrs[0], "devnode") == 0) { /* Avoid a klockworks memory leak warning */ free(input->devnode); input->devnode = strdup(attrs[1]); } else { IAS_ERROR("Unknown attribute '%s' to input element", attrs[0]); } attrs += 2; } /* * If no name was specified for this input, ignore the tag */ if (!input->devnode) { IAS_ERROR("No input name specified"); free(input); return; } free(input->devnode); free(input); } /* * env_begin() * * Parses env attributes from XML. */ void env_begin(void *userdata, const char **attrs) { handle_env_common(attrs, &global_env_list); } /* * capture_begin() * * Parses env attributes from XML. */ void capture_begin(void *userdata, const char **attrs) { #ifndef BUILD_REMOTE_DISPLAY weston_log("warning: frame capture options set in " CFG_FILENAME " but frame capture not compiled in\n"); #endif } /* * This function will determine and return the number of views on * this output excluding the cursor view. */ int num_views_on_output(struct weston_output *output) { struct weston_view *ev, *next; struct weston_compositor *compositor = output->compositor; struct ias_output *ias_output = (struct ias_output *) output; int num_views = 0; wl_list_for_each_safe(ev, next, &compositor->view_list, link) { /* Make sure that the view is on this output */ if (ev->output_mask == (1u << output->id) && /* Make sure it's not a cursor */ ias_output->ias_crtc->cursor_view != ev) { num_views++; } } return num_views; } /* * This function will determine if a surface's opaque region * covers the entire output. If it does, then the function * returns 1 else returns 0. */ int surface_covers_output(struct weston_surface *surface, struct weston_output *output) { int ret; pixman_region32_t r; /* We can scanout an ARGB buffer if the surface's * opaque region covers the whole output, but we have * to use XRGB as the KMS format code. */ pixman_region32_init_rect(&r, 0, 0, output->width, output->height); pixman_region32_subtract(&r, &r, &surface->opaque); ret = pixman_region32_not_empty(&r); pixman_region32_fini(&r); return !ret; } static void config_init_to_defaults(struct weston_ias_backend_config *config) { } static int components_list_create(struct ias_backend *backend, drmModeRes *resources, struct components_list *components_list) { int i, stop_searching, num_virt_connectors = 0; char connector_name[32]; const char *type_name; struct ias_configured_crtc *confcrtc; drmModeConnector *connector; drmModeModeInfo *mode; /* Create virtual connectors if any */ wl_list_for_each_reverse(confcrtc, &configured_crtc_list, link) { if (!strncasecmp(confcrtc->name, "Virtual", 7)) { num_virt_connectors++; } } components_list->count_connectors = resources->count_connectors + num_virt_connectors; components_list->num_conf_components = 0; wl_list_init(&components_list->list); /* Cache the connectors upfront to avoid calling drmModeGetConnector * later. */ components_list->connector = (struct ias_connector **)calloc(resources->count_connectors + num_virt_connectors, sizeof(struct ias_connector *)); if (!components_list->connector) { IAS_ERROR("Cannot allocate memory for connector."); return -1; } for (i = 0; i < resources->count_connectors; i++) { components_list->connector[i] = calloc(1, sizeof *components_list->connector[i]); if (!components_list->connector[i]) { IAS_ERROR("Cannot allocate memory for connector."); for(; i >= 0; i--) { free(components_list->connector[i]); } free(components_list->connector); return -1; } TRACEPOINT(" * Before getting connector"); components_list->connector[i]->connector = drmModeGetConnector(backend->drm.fd, resources->connectors[i]); TRACEPOINT(" * After getting connector"); /* Do we recognize this connector type? If not, it's unknown */ if (components_list->connector[i]->connector->connector_type >= ARRAY_LENGTH(connector_type_names)) { type_name = "UNKNOWN"; IAS_DEBUG("Unrecognized KMS connector type %d", connector[i]->connector_type); } else { type_name = connector_type_names[components_list->connector[i]->connector->connector_type]; } /* Determine the name we should match against in the config file */ snprintf(connector_name, sizeof(connector_name), "%s%d", type_name, components_list->connector[i]->connector->connector_type_id); /* * Assuming we will find the connector this time around. The idea * behind the following code is that the user knew what crtcs they * wanted to be used with IAS as they provided the specific names * via ias.conf. So why bother looking for extra connectors that are * not going to be used by IAS anyways and will add extra time delay * in its startup. */ stop_searching = 1; wl_list_for_each_reverse(confcrtc, &configured_crtc_list, link) { if (strcmp(confcrtc->name, connector_name) == 0) { confcrtc->found = 1; } stop_searching &= confcrtc->found; } if(stop_searching) { resources->count_connectors = i+1; break; } } /* * We need to create virtual connectors */ i = resources->count_connectors; wl_list_for_each_reverse(confcrtc, &configured_crtc_list, link) { /* * We are only interested in virtual connectors so continue if we can't * find one */ if (strncasecmp(confcrtc->name, "Virtual", 7)) { continue; } components_list->connector[i] = calloc(1, sizeof *components_list->connector[i]); if (!components_list->connector[i]) { IAS_ERROR("Cannot allocate memory for connector."); for(; i >= 0; i--) { free(components_list->connector[i]); } free(components_list->connector); return -1; } components_list->connector[i]->connector = calloc(1, sizeof *components_list->connector[i]->connector); connector = components_list->connector[i]->connector; connector->connector_type = DRM_MODE_CONNECTOR_VIRTUAL; connector->connector_type_id = 1; connector->connection = DRM_MODE_CONNECTED; /* * Virtual display only requires one mode, the one that was specified in * our config file. */ connector->count_modes = 1; connector->modes = calloc(1, sizeof(drmModeModeInfo)); mode = &connector->modes[0]; /* * If the user didn't specify an exact mode, and instead chose preferred * then we need to select a default with/height which we have defined * above. */ if(confcrtc->config == CRTC_CONFIG_PREFERRED) { confcrtc->width = VIRT_CON_PREFERRED_WIDTH; confcrtc->height = VIRT_CON_PREFERRED_HEIGHT; } mode->hdisplay = mode->htotal = confcrtc->width; mode->vdisplay = mode->vtotal = confcrtc->height; /* We want 60 Hz refresh rate so calculating the clock accordingly */ mode->clock = (((unsigned long long) (mode->vtotal * 60000) - mode->vtotal / 2) * mode->htotal) / 1000000LL; mode->type = DRM_MODE_TYPE_PREFERRED; i++; } return 0; } static void components_list_destroy(struct components_list *components_list) { struct connector_components *connector_components, *next; int i; for (i = 0; i < components_list->count_connectors; i++) { if (components_list->connector[i]) { if(components_list->connector[i]->connector->connector_type == DRM_MODE_CONNECTOR_VIRTUAL) { free(components_list->connector[i]->connector->modes); free(components_list->connector[i]->connector); free(components_list->connector[i]); } else { drmModeFreeConnector(components_list->connector[i]->connector); free(components_list->connector[i]); } } } free(components_list->connector); wl_list_for_each_safe(connector_components, next, &components_list->list, link) { wl_list_remove(&connector_components->link); free(connector_components); } } static int components_list_add(struct components_list *components_list, char *connector_name, struct ias_configured_crtc *conf_crtc, struct ias_connector *connector) { struct connector_components *components; components = malloc(sizeof(struct connector_components)); if (components == NULL) { IAS_DEBUG("Cannot allocated memory to add components to list"); return -1; } components->connector_name = connector_name; components->conf_crtc = conf_crtc; components->connector = connector; components_list->num_conf_components++; wl_list_insert(&components_list->list, &components->link); return 0; } static int components_list_build(struct ias_backend *backend, drmModeRes *resources, struct components_list *components_list) { struct ias_configured_crtc *confcrtc; struct ias_connector **connector; const char *type_name; char connector_name[32]; int i; connector = components_list->connector; /* * Loop over KMS connectors and create a CRTC for any that match CRTC's * defined in the IAS config. */ backend->num_kms_crtcs = resources->count_crtcs; wl_list_for_each_reverse(confcrtc, &configured_crtc_list, link) { for(i = 0; i < components_list->count_connectors; i++) { /* Skip the connector if NULL or currently in use */ if (connector[i] == NULL || connector[i]->used) { continue; } /* Skip the connector if not connected to system */ if (connector[i]->connector->connection != 1) { continue; } TRACEPOINT(" * Got connector"); /* Do we recognize this connector type? If not, it's unknown */ if (connector[i]->connector->connector_type >= ARRAY_LENGTH(connector_type_names)) { type_name = "UNKNOWN"; IAS_DEBUG("Unrecognized KMS connector type %d", connector[i]->connector->connector_type); } else { type_name = connector_type_names[connector[i]->connector->connector_type]; } /* Determine the name we should match against in the config file */ snprintf(connector_name, sizeof(connector_name), "%s%d", type_name, connector[i]->connector->connector_type_id); if (strcmp(confcrtc->name, connector_name) == 0) { IAS_DEBUG("Found match for connector %s", confcrtc->name); /* Check if CRTC already exists, no need to add copies */ if (ias_crtc_find_by_name(backend, connector_name) == 0) { weston_log("CRTC matching connector %s exists \n", connector_name); } else if (components_list_add(components_list, connector_name, confcrtc, connector[i]) == 0) { connector[i]->used = 1; break; } else { return -1; } } } if (i == components_list->count_connectors) { IAS_DEBUG("Could not find a connector for this CRTC."); continue; } } weston_log("Found %d matching sets of display components to build \n", components_list->num_conf_components); return 0; } static int has_overlapping_outputs(struct ias_backend *backend) { struct ias_crtc *ias_crtc,*ias_crtc2; pixman_region32_t overlap; int i,j,has_overlapping = 0; wl_list_for_each(ias_crtc, &backend->crtc_list, link) { wl_list_for_each(ias_crtc2, &backend->crtc_list, link) { if (ias_crtc == ias_crtc2) continue; for (i = 0; i < ias_crtc->num_outputs; i++) { for (j = 0; j < ias_crtc2->num_outputs; j++) { pixman_region32_init(&overlap); pixman_region32_intersect(&overlap, &ias_crtc->output[i]->base.region, &ias_crtc2->output[j]->base.region); if (pixman_region32_not_empty(&overlap)) { has_overlapping = 1; } pixman_region32_fini(&overlap); if (has_overlapping) { return 1; } } } } } return 0; } static int ias_crtc_find_by_name(struct ias_backend *backend, char *requested_name) { struct ias_crtc *ias_crtc = NULL; /* Compare elements in list with the string name value */ wl_list_for_each(ias_crtc, &backend->crtc_list, link) { if (strcmp(ias_crtc->name, requested_name) == 0) return 0; } /* No element matching the sting name found */ return -1; } static void centre_pointer(struct ias_backend *backend) { /* * Position the mouse pointer in the middle of the first output. We need * to make sure that it's initially located in one of the outputs' bounding * boxes, otherwise we'll crash in core weston as soon as it moves. */ struct weston_seat *w_seat; struct weston_output *w_output; struct ias_output *ias_output; /* Put pointers into the outputs they're bound to. */ wl_list_for_each(w_seat, &backend->compositor->seat_list, link) { wl_list_for_each(w_output, &backend->compositor->output_list, link) { if (w_seat->output_mask & (1 << w_output->id)) { ias_output = (struct ias_output *)w_output; ias_move_pointer(backend->compositor, ias_output, ias_output->base.x, ias_output->base.y, ias_output->width, ias_output->height); } } } if(backend->input_present) { struct weston_pointer *pointer; wl_list_for_each(w_seat, &backend->compositor->seat_list, link) { wl_list_for_each(w_output, &backend->compositor->output_list, link) { if ((w_seat->output_mask & (1 << w_output->id))) { pointer = weston_seat_get_pointer(w_seat); if (pointer) { pointer->x = wl_fixed_from_int(w_output->x); pointer->y = wl_fixed_from_int(w_output->y); } } } } } } static void ias_update_outputs(struct ias_backend *backend, struct udev_device *event) { int ret; struct weston_view *curr_view, *next_view; /* Create any required CRTC's using the available resources */ ret = create_crtcs(backend); if (ret <= 0) { weston_log("No new CRTCS created during hotplugging \n"); return; } else { weston_log("Created %d new CRTCS during hotplugging \n", ret); } centre_pointer(backend); /* Dirty all of the compositor views to ensure that they get updated */ wl_list_for_each_safe(curr_view, next_view, &backend->compositor->view_list, link) { weston_view_geometry_dirty(curr_view); } } /*** *** Backend initial entrypoint ***/ WL_EXPORT int weston_backend_init(struct weston_compositor *compositor, struct weston_backend_config *config_base) { int ret; struct ias_backend *b; struct weston_ias_backend_config config = {{0, }}; TRACING_MODULE_INIT(); if (config_base == NULL || config_base->struct_version != WESTON_IAS_BACKEND_CONFIG_VERSION || config_base->struct_size > sizeof(struct weston_ias_backend_config)) { weston_log("ias backend config structure is invalid\n"); return -1; } config_init_to_defaults(&config); memcpy(&config, config_base, config_base->struct_size); wl_list_init(&configured_crtc_list); wl_list_init(&configured_output_list); wl_list_init(&global_env_list); ret = ias_read_configuration(CFG_FILENAME, backend_parse_data, sizeof(backend_parse_data) / sizeof(backend_parse_data[0]), NULL); if (ret) { IAS_ERROR("Failed to read configuration; bailing out"); return 0; } b = ias_compositor_create(compositor, &config); if (b == NULL) return -1; return 0; }
109373.c
/* * test status notifications * * Copyright 2008 Hans Leidekker for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include <stdarg.h> #include <stdlib.h> #include <windef.h> #include <winbase.h> #include <winsock2.h> #include <ws2tcpip.h> #include <winhttp.h> #include "wine/test.h" static DWORD (WINAPI *pWinHttpWebSocketClose)(HINTERNET,USHORT,void*,DWORD); static HINTERNET (WINAPI *pWinHttpWebSocketCompleteUpgrade)(HINTERNET,DWORD_PTR); static DWORD (WINAPI *pWinHttpWebSocketQueryCloseStatus)(HINTERNET,USHORT*,void*,DWORD,DWORD*); static DWORD (WINAPI *pWinHttpWebSocketReceive)(HINTERNET,void*,DWORD,DWORD*,WINHTTP_WEB_SOCKET_BUFFER_TYPE*); static DWORD (WINAPI *pWinHttpWebSocketSend)(HINTERNET,WINHTTP_WEB_SOCKET_BUFFER_TYPE,void*,DWORD); static DWORD (WINAPI *pWinHttpWebSocketShutdown)(HINTERNET,USHORT,void*,DWORD); enum api { winhttp_connect = 1, winhttp_open_request, winhttp_send_request, winhttp_receive_response, winhttp_websocket_complete_upgrade, winhttp_websocket_send, winhttp_websocket_receive, winhttp_websocket_shutdown, winhttp_websocket_close, winhttp_query_data, winhttp_read_data, winhttp_write_data, winhttp_close_handle }; struct notification { enum api function; /* api responsible for notification */ unsigned int status; /* status received */ DWORD flags; /* a combination of NF_* flags */ }; #define NF_ALLOW 0x0001 /* notification may or may not happen */ #define NF_WINE_ALLOW 0x0002 /* wine sends notification when it should not */ #define NF_SIGNAL 0x0004 /* signal wait handle when notified */ struct info { enum api function; const struct notification *test; unsigned int count; unsigned int index; HANDLE wait; unsigned int line; DWORD last_thread_id; DWORD last_status; }; struct test_request { HINTERNET session; HINTERNET connection; HINTERNET request; }; static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID buffer, DWORD buflen ) { BOOL status_ok, function_ok; struct info *info = (struct info *)context; info->last_status = status; info->last_thread_id = GetCurrentThreadId(); if (status == WINHTTP_CALLBACK_STATUS_HANDLE_CREATED) { DWORD size = sizeof(struct info *); WinHttpQueryOption( handle, WINHTTP_OPTION_CONTEXT_VALUE, &info, &size ); } while (info->index < info->count && info->test[info->index].status != status && (info->test[info->index].flags & NF_ALLOW)) info->index++; while (info->index < info->count && (info->test[info->index].flags & NF_WINE_ALLOW)) { todo_wine ok(info->test[info->index].status != status, "unexpected %x notification\n", status); if (info->test[info->index].status == status) break; info->index++; } ok(info->index < info->count, "%u: unexpected notification 0x%08x\n", info->line, status); if (info->index >= info->count) return; status_ok = (info->test[info->index].status == status); function_ok = (info->test[info->index].function == info->function); ok(status_ok, "%u: expected status 0x%08x got 0x%08x\n", info->line, info->test[info->index].status, status); ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[info->index].function, info->function); if (status_ok && function_ok && info->test[info->index++].flags & NF_SIGNAL) { SetEvent( info->wait ); } } static const struct notification cache_test[] = { { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void setup_test( struct info *info, enum api function, unsigned int line ) { if (info->wait) ResetEvent( info->wait ); info->function = function; info->line = line; while (info->index < info->count && info->test[info->index].function != function && (info->test[info->index].flags & (NF_ALLOW | NF_WINE_ALLOW))) info->index++; ok_(__FILE__,line)(info->test[info->index].function == function, "unexpected function %u, expected %u. probably some notifications were missing\n", info->test[info->index].function, function); info->last_thread_id = 0xdeadbeef; info->last_status = 0xdeadbeef; } static void end_test( struct info *info, unsigned int line ) { ok_(__FILE__,line)(info->index == info->count, "some notifications were missing: %x\n", info->test[info->index].status); } static void test_connection_cache( void ) { HANDLE ses, con, req, event; DWORD size, status, err; BOOL ret, unload = TRUE; struct info info, *context = &info; info.test = cache_test; info.count = ARRAY_SIZE( cache_test ); info.index = 0; info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); event = CreateEventW( NULL, FALSE, FALSE, NULL ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); if (!ret) { win_skip("Unload event not supported\n"); unload = FALSE; } WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); ok(req != NULL, "failed to open a request %u\n", GetLastError()); setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; } ok(ret, "failed to send request %u\n", GetLastError()); setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); ok(ret, "failed to receive response %u\n", GetLastError()); size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); ok(ret, "failed unexpectedly %u\n", GetLastError()); ok(status == 200, "request failed unexpectedly %u\n", status); ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; } ok(ret, "failed to send request %u\n", GetLastError()); setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); ok(ret, "failed to receive response %u\n", GetLastError()); size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); ok(ret, "failed unexpectedly %u\n", GetLastError()); ok(status == 200, "request failed unexpectedly %u\n", status); ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WaitForSingleObject( info.wait, INFINITE ); if (unload) { status = WaitForSingleObject( event, 0 ); ok(status == WAIT_TIMEOUT, "got %08x\n", status); } setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); if (unload) { status = WaitForSingleObject( event, 100 ); ok(status == WAIT_OBJECT_0, "got %08x\n", status); } ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); if (unload) { ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); ok(ret, "failed to set unload option\n"); } WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; } ok(ret, "failed to send request %u\n", GetLastError()); setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); ok(ret, "failed to receive response %u\n", GetLastError()); size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); ok(ret, "failed unexpectedly %u\n", GetLastError()); ok(status == 200, "request failed unexpectedly %u\n", status); ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; } ok(ret, "failed to send request %u\n", GetLastError()); setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); ok(ret, "failed to receive response %u\n", GetLastError()); size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); ok(ret, "failed unexpectedly %u\n", GetLastError()); ok(status == 200, "request failed unexpectedly %u\n", status); setup_test( &info, winhttp_close_handle, __LINE__ ); done: WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WaitForSingleObject( info.wait, INFINITE ); if (unload) { status = WaitForSingleObject( event, 0 ); ok(status == WAIT_TIMEOUT, "got %08x\n", status); } setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); end_test( &info, __LINE__ ); if (unload) { status = WaitForSingleObject( event, 100 ); ok(status == WAIT_OBJECT_0, "got %08x\n", status); } CloseHandle( event ); } static const struct notification redirect_test[] = { { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_ALLOW }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_ALLOW }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_ALLOW }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_ALLOW }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void test_redirect( void ) { HANDLE ses, con, req; DWORD size, status, err; BOOL ret; struct info info, *context = &info; info.test = redirect_test; info.count = ARRAY_SIZE( redirect_test ); info.index = 0; info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/redirect", NULL, NULL, NULL, 0 ); ok(req != NULL, "failed to open a request %u\n", GetLastError()); setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; } ok(ret, "failed to send request %u\n", GetLastError()); setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); ok(ret, "failed to receive response %u\n", GetLastError()); size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); ok(ret, "failed unexpectedly %u\n", GetLastError()); ok(status == 200, "request failed unexpectedly %u\n", status); setup_test( &info, winhttp_close_handle, __LINE__ ); done: WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); end_test( &info, __LINE__ ); } static const struct notification async_test[] = { { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE, NF_SIGNAL }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, NF_SIGNAL }, { winhttp_query_data, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, NF_SIGNAL }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SIGNAL }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void test_async( void ) { HANDLE ses, con, req, event; DWORD size, status, err; BOOL ret, unload = TRUE; struct info info, *context = &info; char buffer[1024]; info.test = async_test; info.count = ARRAY_SIZE( async_test ); info.index = 0; info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); ses = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); event = CreateEventW( NULL, FALSE, FALSE, NULL ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); if (!ret) { win_skip("Unload event not supported\n"); unload = FALSE; } SetLastError( 0xdeadbeef ); WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); err = GetLastError(); ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); SetLastError( 0xdeadbeef ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); err = GetLastError(); ok(ret, "failed to set context value %u\n", err); ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); setup_test( &info, winhttp_connect, __LINE__ ); SetLastError( 0xdeadbeef ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); err = GetLastError(); ok(con != NULL, "failed to open a connection %u\n", err); ok(err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %u\n", err); setup_test( &info, winhttp_open_request, __LINE__ ); SetLastError( 0xdeadbeef ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); err = GetLastError(); ok(req != NULL, "failed to open a request %u\n", err); ok(err == ERROR_SUCCESS, "got %u\n", err); setup_test( &info, winhttp_send_request, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); CloseHandle( info.wait ); return; } ok(ret, "failed to send request %u\n", err); ok(err == ERROR_SUCCESS, "got %u\n", err); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_receive_response, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpReceiveResponse( req, NULL ); err = GetLastError(); ok(ret, "failed to receive response %u\n", err); ok(err == ERROR_SUCCESS, "got %u\n", err); WaitForSingleObject( info.wait, INFINITE ); size = sizeof(status); SetLastError( 0xdeadbeef ); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); err = GetLastError(); ok(ret, "failed unexpectedly %u\n", err); ok(status == 200, "request failed unexpectedly %u\n", status); ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); setup_test( &info, winhttp_query_data, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpQueryDataAvailable( req, NULL ); err = GetLastError(); ok(ret, "failed to query data available %u\n", err); ok(err == ERROR_SUCCESS || err == ERROR_IO_PENDING || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); WaitForSingleObject( info.wait, INFINITE ); ok(info.last_status == WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, "got status %#x.\n", status); ok((err == ERROR_SUCCESS && info.last_thread_id == GetCurrentThreadId()) || (err == ERROR_IO_PENDING && info.last_thread_id != GetCurrentThreadId()), "Got unexpected thread %#x, err %#x.\n", info.last_thread_id, err); setup_test( &info, winhttp_read_data, __LINE__ ); ret = WinHttpReadData( req, buffer, sizeof(buffer), NULL ); ok(ret, "failed to read data %u\n", err); WaitForSingleObject( info.wait, INFINITE ); ok(info.last_status == WINHTTP_CALLBACK_STATUS_READ_COMPLETE, "got status %#x.\n", status); ok((err == ERROR_SUCCESS && info.last_thread_id == GetCurrentThreadId()) || (err == ERROR_IO_PENDING && info.last_thread_id != GetCurrentThreadId()), "Got unexpected thread %#x, err %#x.\n", info.last_thread_id, err); setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); if (unload) { status = WaitForSingleObject( event, 0 ); ok(status == WAIT_TIMEOUT, "got %08x\n", status); } WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); end_test( &info, __LINE__ ); if (unload) { status = WaitForSingleObject( event, 2000 ); ok(status == WAIT_OBJECT_0, "got %08x\n", status); } CloseHandle( event ); CloseHandle( info.wait ); end_test( &info, __LINE__ ); } static const struct notification websocket_test[] = { { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE, NF_SIGNAL }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, NF_SIGNAL }, { winhttp_websocket_complete_upgrade, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, NF_SIGNAL }, { winhttp_websocket_send, WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE, NF_SIGNAL }, { winhttp_websocket_receive, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SIGNAL }, { winhttp_websocket_shutdown, WINHTTP_CALLBACK_STATUS_SHUTDOWN_COMPLETE, NF_SIGNAL }, { winhttp_websocket_close, WINHTTP_CALLBACK_STATUS_CLOSE_COMPLETE, NF_SIGNAL }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void test_websocket(void) { HANDLE session, connection, request, socket, event; WINHTTP_WEB_SOCKET_BUFFER_TYPE type; DWORD size, status, err; BOOL ret, unload = TRUE; struct info info, *context = &info; char buffer[1024]; USHORT close_status; if (!pWinHttpWebSocketCompleteUpgrade) { win_skip( "WinHttpWebSocketCompleteUpgrade not supported\n" ); return; } info.test = websocket_test; info.count = ARRAY_SIZE( websocket_test ); info.index = 0; info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); session = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); ok( session != NULL, "got %u\n", GetLastError() ); event = CreateEventW( NULL, FALSE, FALSE, NULL ); ret = WinHttpSetOption( session, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); if (!ret) { win_skip( "Unload event not supported\n" ); unload = FALSE; } SetLastError( 0xdeadbeef ); WinHttpSetStatusCallback( session, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); err = GetLastError(); ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err ); SetLastError( 0xdeadbeef ); ret = WinHttpSetOption( session, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(context) ); err = GetLastError(); ok( ret, "got %u\n", err ); ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); setup_test( &info, winhttp_connect, __LINE__ ); SetLastError( 0xdeadbeef ); connection = WinHttpConnect( session, L"echo.websocket.org", 0, 0 ); err = GetLastError(); ok( connection != NULL, "got %u\n", err); ok( err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %u\n", err ); setup_test( &info, winhttp_open_request, __LINE__ ); SetLastError( 0xdeadbeef ); request = WinHttpOpenRequest( connection, NULL, L"/", NULL, NULL, NULL, 0 ); err = GetLastError(); ok( request != NULL, "got %u\n", err ); ok( err == ERROR_SUCCESS, "got %u\n", err ); ret = WinHttpSetOption( request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0 ); ok( ret, "got %u\n", GetLastError() ); setup_test( &info, winhttp_send_request, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpSendRequest( request, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip( "connection failed, skipping\n" ); WinHttpCloseHandle( request ); WinHttpCloseHandle( connection ); WinHttpCloseHandle( session ); CloseHandle( info.wait ); return; } ok( ret, "got %u\n", err ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_receive_response, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpReceiveResponse( request, NULL ); err = GetLastError(); ok( ret, "got %u\n", err ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); size = sizeof(status); SetLastError( 0xdeadbeef ); ret = WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); err = GetLastError(); ok( ret, "failed unexpectedly %u\n", err ); ok( status == 101, "got %u\n", status ); ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err ); setup_test( &info, winhttp_websocket_complete_upgrade, __LINE__ ); SetLastError( 0xdeadbeef ); socket = pWinHttpWebSocketCompleteUpgrade( request, (DWORD_PTR)context ); err = GetLastError(); ok( socket != NULL, "got %u\n", err ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_websocket_send, __LINE__ ); err = pWinHttpWebSocketSend( socket, 0, (void *)"hello", sizeof("hello") ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_websocket_receive, __LINE__ ); buffer[0] = 0; size = 0xdeadbeef; type = 0xdeadbeef; err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); ok( size == 0xdeadbeef, "got %u\n", size ); ok( type == 0xdeadbeef, "got %u\n", type ); ok( buffer[0], "unexpected data\n" ); setup_test( &info, winhttp_websocket_shutdown, __LINE__ ); err = pWinHttpWebSocketShutdown( socket, 1000, (void *)"success", sizeof("success") ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); setup_test( &info, winhttp_websocket_close, __LINE__ ); ret = pWinHttpWebSocketClose( socket, 1000, (void *)"success", sizeof("success") ); ok( err == ERROR_SUCCESS, "got %u\n", err ); WaitForSingleObject( info.wait, INFINITE ); close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); ok( err == ERROR_SUCCESS, "got %u\n", err ); ok( close_status == 1000, "got %u\n", close_status ); ok( size <= sizeof(buffer), "got %u\n", size ); setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( socket ); WinHttpCloseHandle( request ); WinHttpCloseHandle( connection ); if (unload) { status = WaitForSingleObject( event, 0 ); ok( status == WAIT_TIMEOUT, "got %08x\n", status ); } WinHttpCloseHandle( session ); WaitForSingleObject( info.wait, INFINITE ); end_test( &info, __LINE__ ); if (unload) { status = WaitForSingleObject( event, 2000 ); ok( status == WAIT_OBJECT_0, "got %08x\n", status ); } CloseHandle( event ); CloseHandle( info.wait ); end_test( &info, __LINE__ ); } static const char okmsg[] = "HTTP/1.1 200 OK\r\n" "Server: winetest\r\n" "\r\n"; static const char page1[] = "<HTML>\r\n" "<HEAD><TITLE>winhttp test page</TITLE></HEAD>\r\n" "<BODY>The quick brown fox jumped over the lazy dog<P></BODY>\r\n" "</HTML>\r\n\r\n"; struct server_info { HANDLE event; int port; }; static int server_socket; static HANDLE server_socket_available, server_socket_done; static DWORD CALLBACK server_thread(LPVOID param) { struct server_info *si = param; int r, c = -1, i, on; SOCKET s; struct sockaddr_in sa; char buffer[0x100]; WSADATA wsaData; int last_request = 0; WSAStartup(MAKEWORD(1,1), &wsaData); s = socket(AF_INET, SOCK_STREAM, 0); if (s == INVALID_SOCKET) return 1; on = 1; setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof on); memset(&sa, 0, sizeof sa); sa.sin_family = AF_INET; sa.sin_port = htons(si->port); sa.sin_addr.S_un.S_addr = inet_addr("127.0.0.1"); r = bind(s, (struct sockaddr *)&sa, sizeof(sa)); if (r < 0) return 1; listen(s, 0); SetEvent(si->event); do { if (c == -1) c = accept(s, NULL, NULL); memset(buffer, 0, sizeof buffer); for(i = 0; i < sizeof buffer - 1; i++) { r = recv(c, &buffer[i], 1, 0); if (r != 1) break; if (i < 4) continue; if (buffer[i - 2] == '\n' && buffer[i] == '\n' && buffer[i - 3] == '\r' && buffer[i - 1] == '\r') break; } if (strstr(buffer, "GET /quit")) { send(c, okmsg, sizeof okmsg - 1, 0); send(c, page1, sizeof page1 - 1, 0); last_request = 1; } else if(strstr(buffer, "GET /socket")) { server_socket = c; SetEvent(server_socket_available); WaitForSingleObject(server_socket_done, INFINITE); ResetEvent(server_socket_available); } shutdown(c, 2); closesocket(c); c = -1; } while (!last_request); closesocket(s); return 0; } static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path) { HINTERNET ses, con, req; char buffer[0x100]; DWORD count, status, size; BOOL ret; ses = WinHttpOpen(NULL, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, L"localhost", port, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); req = WinHttpOpenRequest(con, verb, path, NULL, NULL, NULL, 0); ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); ok(ret, "failed to send request %u\n", GetLastError()); ret = WinHttpReceiveResponse(req, NULL); ok(ret, "failed to receive response %u\n", GetLastError()); status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); ok(ret, "failed to query status code %u\n", GetLastError()); ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); count = 0; memset(buffer, 0, sizeof(buffer)); ret = WinHttpReadData(req, buffer, sizeof buffer, &count); ok(ret, "failed to read data %u\n", GetLastError()); ok(count == sizeof page1 - 1, "count was wrong\n"); ok(!memcmp(buffer, page1, sizeof page1), "http data wrong\n"); WinHttpCloseHandle(req); WinHttpCloseHandle(con); WinHttpCloseHandle(ses); } static const struct notification open_socket_request_test[] = { { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_ALLOW }, /* some versions call it twice. why? */ { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE, NF_SIGNAL } }; static const struct notification reuse_socket_request_test[] = { { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE, NF_SIGNAL }, }; static void open_async_request(int port, struct test_request *req, struct info *info, const WCHAR *path, BOOL reuse_connection) { BOOL ret; info->index = 0; if (reuse_connection) { info->test = reuse_socket_request_test; info->count = ARRAY_SIZE( reuse_socket_request_test ); } else { info->test = open_socket_request_test; info->count = ARRAY_SIZE( open_socket_request_test ); } req->session = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); ok(req->session != NULL, "failed to open session %u\n", GetLastError()); WinHttpSetOption( req->session, WINHTTP_OPTION_CONTEXT_VALUE, &info, sizeof(struct info *) ); WinHttpSetStatusCallback( req->session, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); setup_test( info, winhttp_connect, __LINE__ ); req->connection = WinHttpConnect( req->session, L"localhost", port, 0 ); ok(req->connection != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( info, winhttp_open_request, __LINE__ ); req->request = WinHttpOpenRequest( req->connection, NULL, path, NULL, NULL, NULL, 0 ); ok(req->request != NULL, "failed to open a request %u\n", GetLastError()); setup_test( info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req->request, NULL, 0, NULL, 0, 0, 0 ); ok(ret, "failed to send request %u\n", GetLastError()); } static void open_socket_request(int port, struct test_request *req, struct info *info) { ResetEvent( server_socket_done ); open_async_request( port, req, info, L"/socket", FALSE ); WaitForSingleObject( server_socket_available, INFINITE ); } static const struct notification server_reply_test[] = { { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NF_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, NF_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, NF_SIGNAL } }; static void server_send_reply(struct test_request *req, struct info *info, const char *msg) { BOOL ret; send( server_socket, msg, strlen( msg ), 0 ); WaitForSingleObject( info->wait, INFINITE ); info->test = server_reply_test; info->count = ARRAY_SIZE( server_reply_test ); info->index = 0; setup_test( info, winhttp_send_request, __LINE__ ); ret = WinHttpReceiveResponse( req->request, NULL ); ok(ret, "failed to receive response %u\n", GetLastError()); WaitForSingleObject( info->wait, INFINITE ); end_test( info, __LINE__ ); } #define server_read_data(a) _server_read_data(a,__LINE__) static void _server_read_data(const char *expect_prefix, unsigned int line) { char buf[1024]; DWORD size, len; size = recv( server_socket, buf, sizeof(buf), 0 ); len = strlen( expect_prefix ); ok_(__FILE__,line)(size > len, "data too short\n"); if (size >= len) { buf[len] = 0; ok_(__FILE__,line)(!strcmp( buf, expect_prefix ), "unexpected data \"%s\"\n", buf); } } static const struct notification close_request_test[] = { { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static const struct notification close_allow_connection_close_request_test[] = { { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void close_request(struct test_request *req, struct info *info, BOOL allow_closing_connection) { BOOL ret; if (allow_closing_connection) { info->test = close_allow_connection_close_request_test; info->count = ARRAY_SIZE( close_allow_connection_close_request_test ); } else { info->test = close_request_test; info->count = ARRAY_SIZE( close_request_test ); } info->index = 0; setup_test( info, winhttp_close_handle, __LINE__ ); ret = WinHttpCloseHandle( req->request ); ok(ret, "WinHttpCloseHandle failed: %u\n", GetLastError()); ret = WinHttpCloseHandle( req->connection ); ok(ret, "WinHttpCloseHandle failed: %u\n", GetLastError()); ret = WinHttpCloseHandle( req->session ); ok(ret, "WinHttpCloseHandle failed: %u\n", GetLastError()); WaitForSingleObject( info->wait, INFINITE ); end_test( info, __LINE__ ); } static const struct notification read_test[] = { { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SIGNAL } }; static const struct notification read_allow_close_test[] = { { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SIGNAL } }; #define read_request_data(a,b,c,d) _read_request_data(a,b,c,d,__LINE__) static void _read_request_data(struct test_request *req, struct info *info, const char *expected_data, BOOL closing_connection, unsigned line) { char buffer[1024]; DWORD len; BOOL ret; if (closing_connection) { info->test = read_allow_close_test; info->count = ARRAY_SIZE( read_allow_close_test ); } else { info->test = read_test; info->count = ARRAY_SIZE( read_test ); } info->index = 0; setup_test( info, winhttp_read_data, line ); memset(buffer, '?', sizeof(buffer)); ret = WinHttpReadData( req->request, buffer, sizeof(buffer), NULL ); ok(ret, "failed to read data %u\n", GetLastError()); WaitForSingleObject( info->wait, INFINITE ); len = strlen(expected_data); ok(!memcmp(buffer, expected_data, len), "unexpected data\n"); } static void test_persistent_connection(int port) { struct test_request req; struct info info; trace("Testing persistent connection...\n"); info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); open_socket_request( port, &req, &info ); server_send_reply( &req, &info, "HTTP/1.1 200 OK\r\n" "Server: winetest\r\n" "Connection: keep-alive\r\n" "Content-Length: 1\r\n" "\r\n" "X" ); read_request_data( &req, &info, "X", FALSE ); close_request( &req, &info, FALSE ); /* chunked connection test */ open_async_request( port, &req, &info, L"/test", TRUE ); server_read_data( "GET /test HTTP/1.1\r\n" ); server_send_reply( &req, &info, "HTTP/1.1 200 OK\r\n" "Server: winetest\r\n" "Transfer-Encoding: chunked\r\n" "Connection: keep-alive\r\n" "\r\n" "9\r\n123456789\r\n" "0\r\n\r\n" ); read_request_data( &req, &info, "123456789", FALSE ); close_request( &req, &info, FALSE ); /* HTTP/1.1 connections are persistent by default, no additional header is needed */ open_async_request( port, &req, &info, L"/test", TRUE ); server_read_data( "GET /test HTTP/1.1\r\n" ); server_send_reply( &req, &info, "HTTP/1.1 200 OK\r\n" "Server: winetest\r\n" "Content-Length: 2\r\n" "\r\n" "xx" ); read_request_data( &req, &info, "xx", FALSE ); close_request( &req, &info, FALSE ); open_async_request( port, &req, &info, L"/test", TRUE ); server_read_data( "GET /test HTTP/1.1\r\n" ); server_send_reply( &req, &info, "HTTP/1.1 200 OK\r\n" "Server: winetest\r\n" "Content-Length: 2\r\n" "Connection: close\r\n" "\r\n" "yy" ); close_request( &req, &info, TRUE ); SetEvent( server_socket_done ); CloseHandle( info.wait ); } struct test_recursion_context { HANDLE request; HANDLE wait; LONG recursion_count, max_recursion_query, max_recursion_read; BOOL read_from_callback; BOOL have_sync_callback; }; /* The limit is 128 before Win7 and 3 on newer Windows. */ #define TEST_RECURSION_LIMIT 128 static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR context_ptr, DWORD status, void *buffer, DWORD buflen ) { struct test_recursion_context *context = (struct test_recursion_context *)context_ptr; DWORD err; BOOL ret; BYTE b; switch (status) { case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: SetEvent( context->wait ); break; case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: if (!context->read_from_callback) { SetEvent( context->wait ); break; } if (!*(DWORD *)buffer) { SetEvent( context->wait ); break; } ok(context->recursion_count < TEST_RECURSION_LIMIT, "Got unexpected context->recursion_count %u, thread %#x.\n", context->recursion_count, GetCurrentThreadId()); context->max_recursion_query = max( context->max_recursion_query, context->recursion_count ); InterlockedIncrement( &context->recursion_count ); ret = WinHttpReadData( context->request, &b, 1, NULL ); err = GetLastError(); ok(ret, "Failed to read data, GetLastError() %u.\n", err); ok(err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "Got unexpected err %u.\n", err); if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break; case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: if (!buflen) { SetEvent( context->wait ); break; } ok(context->recursion_count < TEST_RECURSION_LIMIT, "Got unexpected context->recursion_count %u, thread %#x.\n", context->recursion_count, GetCurrentThreadId()); context->max_recursion_read = max( context->max_recursion_read, context->recursion_count ); context->read_from_callback = TRUE; InterlockedIncrement( &context->recursion_count ); ret = WinHttpQueryDataAvailable( context->request, NULL ); err = GetLastError(); ok(ret, "Failed to query data available, GetLastError() %u.\n", err); ok(err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "Got unexpected err %u.\n", err); if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break; } } static void test_recursion(void) { struct test_recursion_context context; HANDLE session, connection, request; DWORD size, status, err; BOOL ret; BYTE b; memset( &context, 0, sizeof(context) ); context.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); session = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); ok(!!session, "Failed to open session, GetLastError() %u.\n", GetLastError()); WinHttpSetStatusCallback( session, test_recursion_callback, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); connection = WinHttpConnect( session, L"test.winehq.org", 0, 0 ); ok(!!connection, "Failed to open a connection, GetLastError() %u.\n", GetLastError()); request = WinHttpOpenRequest( connection, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); ok(!!request, "Failed to open a request, GetLastError() %u.\n", GetLastError()); context.request = request; ret = WinHttpSendRequest( request, NULL, 0, NULL, 0, 0, (DWORD_PTR)&context ); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("Connection failed, skipping\n"); WinHttpSetStatusCallback( session, NULL, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); WinHttpCloseHandle( request ); WinHttpCloseHandle( connection ); WinHttpCloseHandle( session ); CloseHandle( context.wait ); return; } ok(ret, "Failed to send request, GetLastError() %u.\n", GetLastError()); WaitForSingleObject( context.wait, INFINITE ); ret = WinHttpReceiveResponse( request, NULL ); ok(ret, "Failed to receive response, GetLastError() %u.\n", GetLastError()); WaitForSingleObject( context.wait, INFINITE ); size = sizeof(status); ret = WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); ok(ret, "Request failed, GetLastError() %u.\n", GetLastError()); ok(status == 200, "Request failed unexpectedly, status %u.\n", status); ret = WinHttpQueryDataAvailable( request, NULL ); ok(ret, "Failed to query data available, GetLastError() %u.\n", GetLastError()); WaitForSingleObject( context.wait, INFINITE ); ret = WinHttpReadData( request, &b, 1, NULL ); ok(ret, "Failed to read data, GetLastError() %u.\n", GetLastError()); WaitForSingleObject( context.wait, INFINITE ); if (context.have_sync_callback) { ok(context.max_recursion_query >= 2, "Got unexpected max_recursion_query %u.\n", context.max_recursion_query); ok(context.max_recursion_read >= 2, "Got unexpected max_recursion_read %u.\n", context.max_recursion_read); } else { skip("No sync callbacks.\n"); } WinHttpSetStatusCallback( session, NULL, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); WinHttpCloseHandle( request ); WinHttpCloseHandle( connection ); WinHttpCloseHandle( session ); CloseHandle( context.wait ); } START_TEST (notification) { HMODULE mod = GetModuleHandleA( "winhttp.dll" ); struct server_info si; HANDLE thread; DWORD ret; pWinHttpWebSocketClose = (void *)GetProcAddress( mod, "WinHttpWebSocketClose" ); pWinHttpWebSocketCompleteUpgrade = (void *)GetProcAddress( mod, "WinHttpWebSocketCompleteUpgrade" ); pWinHttpWebSocketQueryCloseStatus = (void *)GetProcAddress( mod, "WinHttpWebSocketQueryCloseStatus" ); pWinHttpWebSocketReceive = (void *)GetProcAddress( mod, "WinHttpWebSocketReceive" ); pWinHttpWebSocketSend = (void *)GetProcAddress( mod, "WinHttpWebSocketSend" ); pWinHttpWebSocketShutdown = (void *)GetProcAddress( mod, "WinHttpWebSocketShutdown" ); test_connection_cache(); test_redirect(); test_async(); test_websocket(); test_recursion(); si.event = CreateEventW( NULL, 0, 0, NULL ); si.port = 7533; thread = CreateThread( NULL, 0, server_thread, &si, 0, NULL ); ok(thread != NULL, "failed to create thread %u\n", GetLastError()); server_socket_available = CreateEventW( NULL, 0, 0, NULL ); server_socket_done = CreateEventW( NULL, 0, 0, NULL ); ret = WaitForSingleObject( si.event, 10000 ); ok(ret == WAIT_OBJECT_0, "failed to start winhttp test server %u\n", GetLastError()); if (ret != WAIT_OBJECT_0) { CloseHandle(thread); return; } test_persistent_connection( si.port ); /* send the basic request again to shutdown the server thread */ test_basic_request( si.port, NULL, L"/quit" ); WaitForSingleObject( thread, 3000 ); CloseHandle( thread ); CloseHandle( server_socket_available ); CloseHandle( server_socket_done ); }
606478.c
/* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */ /* Disassembler interface for targets using CGEN. -*- C -*- CGEN: Cpu tools GENerator THIS FILE IS MACHINE GENERATED WITH CGEN. - the resultant file is machine generated, cgen-dis.in isn't Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of libopcodes. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* ??? Eventually more and more of this stuff can go to cpu-independent files. Keep that in mind. */ #include "sysdep.h" #include <stdio.h> #include "ansidecl.h" #include "disassemble.h" #include "bfd.h" #include "symcat.h" #include "libiberty.h" #include "m32c-desc.h" #include "m32c-opc.h" #include "opintl.h" /* Default text to print if an instruction isn't recognized. */ #define UNKNOWN_INSN_MSG _("*unknown*") static void print_normal (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); static void print_address (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED; static void print_keyword (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED; static void print_insn_normal (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int); static int print_insn (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned); static int default_print_insn (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED; static int read_insn (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *, unsigned long *); /* -- disassembler routines inserted here. */ /* -- dis.c */ #include "elf/m32c.h" #include "elf-bfd.h" /* Always print the short insn format suffix as ':<char>'. */ static void print_suffix (void * dis_info, char suffix) { disassemble_info *info = dis_info; (*info->fprintf_func) (info->stream, ":%c", suffix); } static void print_S (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value ATTRIBUTE_UNUSED, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { print_suffix (dis_info, 's'); } static void print_G (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value ATTRIBUTE_UNUSED, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { print_suffix (dis_info, 'g'); } static void print_Q (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value ATTRIBUTE_UNUSED, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { print_suffix (dis_info, 'q'); } static void print_Z (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value ATTRIBUTE_UNUSED, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { print_suffix (dis_info, 'z'); } /* Print the empty suffix. */ static void print_X (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { return; } static void print_r0l_r0h (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { disassemble_info *info = dis_info; if (value == 0) (*info->fprintf_func) (info->stream, "r0h,r0l"); else (*info->fprintf_func) (info->stream, "r0l,r0h"); } static void print_unsigned_bitbase (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, unsigned long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { disassemble_info *info = dis_info; (*info->fprintf_func) (info->stream, "%ld,0x%lx", value & 0x7, value >> 3); } static void print_signed_bitbase (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, signed long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { disassemble_info *info = dis_info; (*info->fprintf_func) (info->stream, "%ld,%ld", value & 0x7, value >> 3); } static void print_size (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value ATTRIBUTE_UNUSED, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { /* Always print the size as '.w'. */ disassemble_info *info = dis_info; (*info->fprintf_func) (info->stream, ".w"); } #define POP 0 #define PUSH 1 static void print_pop_regset (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); static void print_push_regset (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); /* Print a set of registers, R0,R1,A0,A1,SB,FB. */ static void print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED, int push) { static char * m16c_register_names [] = { "r0", "r1", "r2", "r3", "a0", "a1", "sb", "fb" }; disassemble_info *info = dis_info; int mask; int reg_index = 0; char* comma = ""; if (push) mask = 0x80; else mask = 1; if (value & mask) { (*info->fprintf_func) (info->stream, "%s", m16c_register_names [0]); comma = ","; } for (reg_index = 1; reg_index <= 7; ++reg_index) { if (push) mask >>= 1; else mask <<= 1; if (value & mask) { (*info->fprintf_func) (info->stream, "%s%s", comma, m16c_register_names [reg_index]); comma = ","; } } } static void print_pop_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { print_regset (cd, dis_info, value, attrs, pc, length, POP); } static void print_push_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { print_regset (cd, dis_info, value, attrs, pc, length, PUSH); } static void print_signed4n (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void * dis_info, signed long value, unsigned int attrs ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { disassemble_info *info = dis_info; (*info->fprintf_func) (info->stream, "%ld", -value); } void m32c_cgen_print_operand (CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *, void const *, bfd_vma, int); /* Main entry point for printing operands. XINFO is a `void *' and not a `disassemble_info *' to not put a requirement of dis-asm.h on cgen.h. This function is basically just a big switch statement. Earlier versions used tables to look up the function to use, but - if the table contains both assembler and disassembler functions then the disassembler contains much of the assembler and vice-versa, - there's a lot of inlining possibilities as things grow, - using a switch statement avoids the function call overhead. This function could be moved into `print_insn_normal', but keeping it separate makes clear the interface between `print_insn_normal' and each of the handlers. */ void m32c_cgen_print_operand (CGEN_CPU_DESC cd, int opindex, void * xinfo, CGEN_FIELDS *fields, void const *attrs ATTRIBUTE_UNUSED, bfd_vma pc, int length) { disassemble_info *info = (disassemble_info *) xinfo; switch (opindex) { case M32C_OPERAND_A0 : print_keyword (cd, info, & m32c_cgen_opval_h_a0, 0, 0); break; case M32C_OPERAND_A1 : print_keyword (cd, info, & m32c_cgen_opval_h_a1, 0, 0); break; case M32C_OPERAND_AN16_PUSH_S : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_4_1, 0); break; case M32C_OPERAND_BIT16AN : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst16_an, 0); break; case M32C_OPERAND_BIT16RN : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst16_rn, 0); break; case M32C_OPERAND_BIT3_S : print_normal (cd, info, fields->f_imm3_S, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BIT32ANPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_prefixed, 0); break; case M32C_OPERAND_BIT32ANUNPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0); break; case M32C_OPERAND_BIT32RNPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_prefixed_QI, 0); break; case M32C_OPERAND_BIT32RNUNPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_unprefixed_QI, 0); break; case M32C_OPERAND_BITBASE16_16_S8 : print_signed_bitbase (cd, info, fields->f_dsp_16_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_BITBASE16_16_U16 : print_unsigned_bitbase (cd, info, fields->f_dsp_16_u16, 0, pc, length); break; case M32C_OPERAND_BITBASE16_16_U8 : print_unsigned_bitbase (cd, info, fields->f_dsp_16_u8, 0, pc, length); break; case M32C_OPERAND_BITBASE16_8_U11_S : print_unsigned_bitbase (cd, info, fields->f_bitbase16_u11_S, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED : print_signed_bitbase (cd, info, fields->f_bitbase32_16_s11_unprefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED : print_signed_bitbase (cd, info, fields->f_bitbase32_16_s19_unprefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED : print_unsigned_bitbase (cd, info, fields->f_bitbase32_16_u11_unprefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED : print_unsigned_bitbase (cd, info, fields->f_bitbase32_16_u19_unprefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED : print_unsigned_bitbase (cd, info, fields->f_bitbase32_16_u27_unprefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_24_S11_PREFIXED : print_signed_bitbase (cd, info, fields->f_bitbase32_24_s11_prefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_24_S19_PREFIXED : print_signed_bitbase (cd, info, fields->f_bitbase32_24_s19_prefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_24_U11_PREFIXED : print_unsigned_bitbase (cd, info, fields->f_bitbase32_24_u11_prefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_24_U19_PREFIXED : print_unsigned_bitbase (cd, info, fields->f_bitbase32_24_u19_prefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITBASE32_24_U27_PREFIXED : print_unsigned_bitbase (cd, info, fields->f_bitbase32_24_u27_prefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_BITNO16R : print_normal (cd, info, fields->f_dsp_16_u8, 0, pc, length); break; case M32C_OPERAND_BITNO32PREFIXED : print_normal (cd, info, fields->f_bitno32_prefixed, 0, pc, length); break; case M32C_OPERAND_BITNO32UNPREFIXED : print_normal (cd, info, fields->f_bitno32_unprefixed, 0, pc, length); break; case M32C_OPERAND_DSP_10_U6 : print_normal (cd, info, fields->f_dsp_10_u6, 0, pc, length); break; case M32C_OPERAND_DSP_16_S16 : print_normal (cd, info, fields->f_dsp_16_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_16_S8 : print_normal (cd, info, fields->f_dsp_16_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_16_U16 : print_normal (cd, info, fields->f_dsp_16_u16, 0, pc, length); break; case M32C_OPERAND_DSP_16_U20 : print_normal (cd, info, fields->f_dsp_16_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_16_U24 : print_normal (cd, info, fields->f_dsp_16_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_16_U8 : print_normal (cd, info, fields->f_dsp_16_u8, 0, pc, length); break; case M32C_OPERAND_DSP_24_S16 : print_normal (cd, info, fields->f_dsp_24_s16, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_24_S8 : print_normal (cd, info, fields->f_dsp_24_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_24_U16 : print_normal (cd, info, fields->f_dsp_24_u16, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_24_U20 : print_normal (cd, info, fields->f_dsp_24_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_24_U24 : print_normal (cd, info, fields->f_dsp_24_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_24_U8 : print_normal (cd, info, fields->f_dsp_24_u8, 0, pc, length); break; case M32C_OPERAND_DSP_32_S16 : print_normal (cd, info, fields->f_dsp_32_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_32_S8 : print_normal (cd, info, fields->f_dsp_32_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_32_U16 : print_normal (cd, info, fields->f_dsp_32_u16, 0, pc, length); break; case M32C_OPERAND_DSP_32_U20 : print_normal (cd, info, fields->f_dsp_32_u24, 0, pc, length); break; case M32C_OPERAND_DSP_32_U24 : print_normal (cd, info, fields->f_dsp_32_u24, 0, pc, length); break; case M32C_OPERAND_DSP_32_U8 : print_normal (cd, info, fields->f_dsp_32_u8, 0, pc, length); break; case M32C_OPERAND_DSP_40_S16 : print_normal (cd, info, fields->f_dsp_40_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_40_S8 : print_normal (cd, info, fields->f_dsp_40_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_40_U16 : print_normal (cd, info, fields->f_dsp_40_u16, 0, pc, length); break; case M32C_OPERAND_DSP_40_U20 : print_normal (cd, info, fields->f_dsp_40_u20, 0, pc, length); break; case M32C_OPERAND_DSP_40_U24 : print_normal (cd, info, fields->f_dsp_40_u24, 0, pc, length); break; case M32C_OPERAND_DSP_40_U8 : print_normal (cd, info, fields->f_dsp_40_u8, 0, pc, length); break; case M32C_OPERAND_DSP_48_S16 : print_normal (cd, info, fields->f_dsp_48_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_48_S8 : print_normal (cd, info, fields->f_dsp_48_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_48_U16 : print_normal (cd, info, fields->f_dsp_48_u16, 0, pc, length); break; case M32C_OPERAND_DSP_48_U20 : print_normal (cd, info, fields->f_dsp_48_u20, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_48_U24 : print_normal (cd, info, fields->f_dsp_48_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_DSP_48_U8 : print_normal (cd, info, fields->f_dsp_48_u8, 0, pc, length); break; case M32C_OPERAND_DSP_8_S24 : print_normal (cd, info, fields->f_dsp_8_s24, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_8_S8 : print_normal (cd, info, fields->f_dsp_8_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_DSP_8_U16 : print_normal (cd, info, fields->f_dsp_8_u16, 0, pc, length); break; case M32C_OPERAND_DSP_8_U24 : print_normal (cd, info, fields->f_dsp_8_u24, 0, pc, length); break; case M32C_OPERAND_DSP_8_U6 : print_normal (cd, info, fields->f_dsp_8_u6, 0, pc, length); break; case M32C_OPERAND_DSP_8_U8 : print_normal (cd, info, fields->f_dsp_8_u8, 0, pc, length); break; case M32C_OPERAND_DST16AN : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst16_an, 0); break; case M32C_OPERAND_DST16AN_S : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst16_an_s, 0); break; case M32C_OPERAND_DST16ANHI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst16_an, 0); break; case M32C_OPERAND_DST16ANQI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst16_an, 0); break; case M32C_OPERAND_DST16ANQI_S : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst16_rn_QI_s, 0); break; case M32C_OPERAND_DST16ANSI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_SI, fields->f_dst16_an, 0); break; case M32C_OPERAND_DST16RNEXTQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_ext_QI, fields->f_dst16_rn_ext, 0); break; case M32C_OPERAND_DST16RNHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst16_rn, 0); break; case M32C_OPERAND_DST16RNQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst16_rn, 0); break; case M32C_OPERAND_DST16RNQI_S : print_keyword (cd, info, & m32c_cgen_opval_h_r0l_r0h, fields->f_dst16_rn_QI_s, 0); break; case M32C_OPERAND_DST16RNSI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_dst16_rn, 0); break; case M32C_OPERAND_DST32ANEXTUNPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0); break; case M32C_OPERAND_DST32ANPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_prefixed, 0); break; case M32C_OPERAND_DST32ANPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst32_an_prefixed, 0); break; case M32C_OPERAND_DST32ANPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst32_an_prefixed, 0); break; case M32C_OPERAND_DST32ANPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_prefixed, 0); break; case M32C_OPERAND_DST32ANUNPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0); break; case M32C_OPERAND_DST32ANUNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst32_an_unprefixed, 0); break; case M32C_OPERAND_DST32ANUNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst32_an_unprefixed, 0); break; case M32C_OPERAND_DST32ANUNPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0); break; case M32C_OPERAND_DST32R0HI_S : print_keyword (cd, info, & m32c_cgen_opval_h_r0, 0, 0); break; case M32C_OPERAND_DST32R0QI_S : print_keyword (cd, info, & m32c_cgen_opval_h_r0l, 0, 0); break; case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_ext_HI, fields->f_dst32_rn_ext_unprefixed, 0); break; case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_ext_QI, fields->f_dst32_rn_ext_unprefixed, 0); break; case M32C_OPERAND_DST32RNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst32_rn_prefixed_HI, 0); break; case M32C_OPERAND_DST32RNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_prefixed_QI, 0); break; case M32C_OPERAND_DST32RNPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_dst32_rn_prefixed_SI, 0); break; case M32C_OPERAND_DST32RNUNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst32_rn_unprefixed_HI, 0); break; case M32C_OPERAND_DST32RNUNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_unprefixed_QI, 0); break; case M32C_OPERAND_DST32RNUNPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_dst32_rn_unprefixed_SI, 0); break; case M32C_OPERAND_G : print_G (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_12_S4 : print_normal (cd, info, fields->f_imm_12_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_12_S4N : print_signed4n (cd, info, fields->f_imm_12_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_13_U3 : print_normal (cd, info, fields->f_imm_13_u3, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_16_HI : print_normal (cd, info, fields->f_dsp_16_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_16_QI : print_normal (cd, info, fields->f_dsp_16_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_16_SI : print_normal (cd, info, fields->f_dsp_16_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_IMM_20_S4 : print_normal (cd, info, fields->f_imm_20_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_24_HI : print_normal (cd, info, fields->f_dsp_24_s16, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_IMM_24_QI : print_normal (cd, info, fields->f_dsp_24_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_24_SI : print_normal (cd, info, fields->f_dsp_24_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_IMM_32_HI : print_normal (cd, info, fields->f_dsp_32_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_32_QI : print_normal (cd, info, fields->f_dsp_32_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_32_SI : print_normal (cd, info, fields->f_dsp_32_s32, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_40_HI : print_normal (cd, info, fields->f_dsp_40_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_40_QI : print_normal (cd, info, fields->f_dsp_40_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_40_SI : print_normal (cd, info, fields->f_dsp_40_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_IMM_48_HI : print_normal (cd, info, fields->f_dsp_48_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_48_QI : print_normal (cd, info, fields->f_dsp_48_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_48_SI : print_normal (cd, info, fields->f_dsp_48_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_IMM_56_HI : print_normal (cd, info, fields->f_dsp_56_s16, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_IMM_56_QI : print_normal (cd, info, fields->f_dsp_56_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_64_HI : print_normal (cd, info, fields->f_dsp_64_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_8_HI : print_normal (cd, info, fields->f_dsp_8_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_8_QI : print_normal (cd, info, fields->f_dsp_8_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_8_S4 : print_normal (cd, info, fields->f_imm_8_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_8_S4N : print_signed4n (cd, info, fields->f_imm_8_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM_SH_12_S4 : print_keyword (cd, info, & m32c_cgen_opval_h_shimm, fields->f_imm_12_s4, 0); break; case M32C_OPERAND_IMM_SH_20_S4 : print_keyword (cd, info, & m32c_cgen_opval_h_shimm, fields->f_imm_20_s4, 0); break; case M32C_OPERAND_IMM_SH_8_S4 : print_keyword (cd, info, & m32c_cgen_opval_h_shimm, fields->f_imm_8_s4, 0); break; case M32C_OPERAND_IMM1_S : print_normal (cd, info, fields->f_imm1_S, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_IMM3_S : print_normal (cd, info, fields->f_imm3_S, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_LAB_16_8 : print_address (cd, info, fields->f_lab_16_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB_24_8 : print_address (cd, info, fields->f_lab_24_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB_32_8 : print_address (cd, info, fields->f_lab_32_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB_40_8 : print_address (cd, info, fields->f_lab_40_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB_5_3 : print_address (cd, info, fields->f_lab_5_3, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB_8_16 : print_address (cd, info, fields->f_lab_8_16, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_SIGN_OPT)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB_8_24 : print_address (cd, info, fields->f_lab_8_24, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_ABS_ADDR), pc, length); break; case M32C_OPERAND_LAB_8_8 : print_address (cd, info, fields->f_lab_8_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length); break; case M32C_OPERAND_LAB32_JMP_S : print_address (cd, info, fields->f_lab32_jmp_s, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR)|(1<<CGEN_OPERAND_VIRTUAL), pc, length); break; case M32C_OPERAND_Q : print_Q (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_R0 : print_keyword (cd, info, & m32c_cgen_opval_h_r0, 0, 0); break; case M32C_OPERAND_R0H : print_keyword (cd, info, & m32c_cgen_opval_h_r0h, 0, 0); break; case M32C_OPERAND_R0L : print_keyword (cd, info, & m32c_cgen_opval_h_r0l, 0, 0); break; case M32C_OPERAND_R1 : print_keyword (cd, info, & m32c_cgen_opval_h_r1, 0, 0); break; case M32C_OPERAND_R1R2R0 : print_keyword (cd, info, & m32c_cgen_opval_h_r1r2r0, 0, 0); break; case M32C_OPERAND_R2 : print_keyword (cd, info, & m32c_cgen_opval_h_r2, 0, 0); break; case M32C_OPERAND_R2R0 : print_keyword (cd, info, & m32c_cgen_opval_h_r2r0, 0, 0); break; case M32C_OPERAND_R3 : print_keyword (cd, info, & m32c_cgen_opval_h_r3, 0, 0); break; case M32C_OPERAND_R3R1 : print_keyword (cd, info, & m32c_cgen_opval_h_r3r1, 0, 0); break; case M32C_OPERAND_REGSETPOP : print_pop_regset (cd, info, fields->f_8_8, 0, pc, length); break; case M32C_OPERAND_REGSETPUSH : print_push_regset (cd, info, fields->f_8_8, 0, pc, length); break; case M32C_OPERAND_RN16_PUSH_S : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_4_1, 0); break; case M32C_OPERAND_S : print_S (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_SRC16AN : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src16_an, 0); break; case M32C_OPERAND_SRC16ANHI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_src16_an, 0); break; case M32C_OPERAND_SRC16ANQI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_src16_an, 0); break; case M32C_OPERAND_SRC16RNHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_src16_rn, 0); break; case M32C_OPERAND_SRC16RNQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_src16_rn, 0); break; case M32C_OPERAND_SRC32ANPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_prefixed, 0); break; case M32C_OPERAND_SRC32ANPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_src32_an_prefixed, 0); break; case M32C_OPERAND_SRC32ANPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_src32_an_prefixed, 0); break; case M32C_OPERAND_SRC32ANPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_prefixed, 0); break; case M32C_OPERAND_SRC32ANUNPREFIXED : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_unprefixed, 0); break; case M32C_OPERAND_SRC32ANUNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_src32_an_unprefixed, 0); break; case M32C_OPERAND_SRC32ANUNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_src32_an_unprefixed, 0); break; case M32C_OPERAND_SRC32ANUNPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_unprefixed, 0); break; case M32C_OPERAND_SRC32RNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_src32_rn_prefixed_HI, 0); break; case M32C_OPERAND_SRC32RNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_src32_rn_prefixed_QI, 0); break; case M32C_OPERAND_SRC32RNPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_src32_rn_prefixed_SI, 0); break; case M32C_OPERAND_SRC32RNUNPREFIXEDHI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_src32_rn_unprefixed_HI, 0); break; case M32C_OPERAND_SRC32RNUNPREFIXEDQI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_src32_rn_unprefixed_QI, 0); break; case M32C_OPERAND_SRC32RNUNPREFIXEDSI : print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_src32_rn_unprefixed_SI, 0); break; case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL : print_r0l_r0h (cd, info, fields->f_5_1, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_X : print_X (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_Z : print_Z (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; case M32C_OPERAND_COND16_16 : print_keyword (cd, info, & m32c_cgen_opval_h_cond16, fields->f_dsp_16_u8, 0); break; case M32C_OPERAND_COND16_24 : print_keyword (cd, info, & m32c_cgen_opval_h_cond16, fields->f_dsp_24_u8, 0); break; case M32C_OPERAND_COND16_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cond16, fields->f_dsp_32_u8, 0); break; case M32C_OPERAND_COND16C : print_keyword (cd, info, & m32c_cgen_opval_h_cond16c, fields->f_cond16, 0); break; case M32C_OPERAND_COND16J : print_keyword (cd, info, & m32c_cgen_opval_h_cond16j, fields->f_cond16, 0); break; case M32C_OPERAND_COND16J5 : print_keyword (cd, info, & m32c_cgen_opval_h_cond16j_5, fields->f_cond16j_5, 0); break; case M32C_OPERAND_COND32 : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_cond32, 0|(1<<CGEN_OPERAND_VIRTUAL)); break; case M32C_OPERAND_COND32_16 : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_16_u8, 0); break; case M32C_OPERAND_COND32_24 : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_24_u8, 0); break; case M32C_OPERAND_COND32_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_32_u8, 0); break; case M32C_OPERAND_COND32_40 : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_40_u8, 0); break; case M32C_OPERAND_COND32J : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_cond32j, 0|(1<<CGEN_OPERAND_VIRTUAL)); break; case M32C_OPERAND_CR1_PREFIXED_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cr1_32, fields->f_21_3, 0); break; case M32C_OPERAND_CR1_UNPREFIXED_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cr1_32, fields->f_13_3, 0); break; case M32C_OPERAND_CR16 : print_keyword (cd, info, & m32c_cgen_opval_h_cr_16, fields->f_9_3, 0); break; case M32C_OPERAND_CR2_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cr2_32, fields->f_13_3, 0); break; case M32C_OPERAND_CR3_PREFIXED_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cr3_32, fields->f_21_3, 0); break; case M32C_OPERAND_CR3_UNPREFIXED_32 : print_keyword (cd, info, & m32c_cgen_opval_h_cr3_32, fields->f_13_3, 0); break; case M32C_OPERAND_FLAGS16 : print_keyword (cd, info, & m32c_cgen_opval_h_flags, fields->f_9_3, 0); break; case M32C_OPERAND_FLAGS32 : print_keyword (cd, info, & m32c_cgen_opval_h_flags, fields->f_13_3, 0); break; case M32C_OPERAND_SCCOND32 : print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_cond16, 0); break; case M32C_OPERAND_SIZE : print_size (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length); break; default : /* xgettext:c-format */ opcodes_error_handler (_("internal error: unrecognized field %d while printing insn"), opindex); abort (); } } cgen_print_fn * const m32c_cgen_print_handlers[] = { print_insn_normal, }; void m32c_cgen_init_dis (CGEN_CPU_DESC cd) { m32c_cgen_init_opcode_table (cd); m32c_cgen_init_ibld_table (cd); cd->print_handlers = & m32c_cgen_print_handlers[0]; cd->print_operand = m32c_cgen_print_operand; } /* Default print handler. */ static void print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void *dis_info, long value, unsigned int attrs, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { disassemble_info *info = (disassemble_info *) dis_info; /* Print the operand as directed by the attributes. */ if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) ; /* nothing to do */ else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) (*info->fprintf_func) (info->stream, "%ld", value); else (*info->fprintf_func) (info->stream, "0x%lx", value); } /* Default address handler. */ static void print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void *dis_info, bfd_vma value, unsigned int attrs, bfd_vma pc ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { disassemble_info *info = (disassemble_info *) dis_info; /* Print the operand as directed by the attributes. */ if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) ; /* Nothing to do. */ else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR)) (*info->print_address_func) (value, info); else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR)) (*info->print_address_func) (value, info); else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) (*info->fprintf_func) (info->stream, "%ld", (long) value); else (*info->fprintf_func) (info->stream, "0x%lx", (long) value); } /* Keyword print handler. */ static void print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, void *dis_info, CGEN_KEYWORD *keyword_table, long value, unsigned int attrs ATTRIBUTE_UNUSED) { disassemble_info *info = (disassemble_info *) dis_info; const CGEN_KEYWORD_ENTRY *ke; ke = cgen_keyword_lookup_value (keyword_table, value); if (ke != NULL) (*info->fprintf_func) (info->stream, "%s", ke->name); else (*info->fprintf_func) (info->stream, "???"); } /* Default insn printer. DIS_INFO is defined as `void *' so the disassembler needn't know anything about disassemble_info. */ static void print_insn_normal (CGEN_CPU_DESC cd, void *dis_info, const CGEN_INSN *insn, CGEN_FIELDS *fields, bfd_vma pc, int length) { const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); disassemble_info *info = (disassemble_info *) dis_info; const CGEN_SYNTAX_CHAR_TYPE *syn; CGEN_INIT_PRINT (cd); for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) { if (CGEN_SYNTAX_MNEMONIC_P (*syn)) { (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn)); continue; } if (CGEN_SYNTAX_CHAR_P (*syn)) { (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn)); continue; } /* We have an operand. */ m32c_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info, fields, CGEN_INSN_ATTRS (insn), pc, length); } } /* Subroutine of print_insn. Reads an insn into the given buffers and updates the extract info. Returns 0 if all is well, non-zero otherwise. */ static int read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, bfd_vma pc, disassemble_info *info, bfd_byte *buf, int buflen, CGEN_EXTRACT_INFO *ex_info, unsigned long *insn_value) { int status = (*info->read_memory_func) (pc, buf, buflen, info); if (status != 0) { (*info->memory_error_func) (status, pc, info); return -1; } ex_info->dis_info = info; ex_info->valid = (1 << buflen) - 1; ex_info->insn_bytes = buf; *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); return 0; } /* Utility to print an insn. BUF is the base part of the insn, target byte order, BUFLEN bytes long. The result is the size of the insn in bytes or zero for an unknown insn or -1 if an error occurs fetching data (memory_error_func will have been called). */ static int print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info, bfd_byte *buf, unsigned int buflen) { CGEN_INSN_INT insn_value; const CGEN_INSN_LIST *insn_list; CGEN_EXTRACT_INFO ex_info; int basesize; /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ basesize = cd->base_insn_bitsize < buflen * 8 ? cd->base_insn_bitsize : buflen * 8; insn_value = cgen_get_insn_value (cd, buf, basesize); /* Fill in ex_info fields like read_insn would. Don't actually call read_insn, since the incoming buffer is already read (and possibly modified a la m32r). */ ex_info.valid = (1 << buflen) - 1; ex_info.dis_info = info; ex_info.insn_bytes = buf; /* The instructions are stored in hash lists. Pick the first one and keep trying until we find the right one. */ insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value); while (insn_list != NULL) { const CGEN_INSN *insn = insn_list->insn; CGEN_FIELDS fields; int length; unsigned long insn_value_cropped; #ifdef CGEN_VALIDATE_INSN_SUPPORTED /* Not needed as insn shouldn't be in hash lists if not supported. */ /* Supported by this cpu? */ if (! m32c_cgen_insn_supported (cd, insn)) { insn_list = CGEN_DIS_NEXT_INSN (insn_list); continue; } #endif /* Basic bit mask must be correct. */ /* ??? May wish to allow target to defer this check until the extract handler. */ /* Base size may exceed this instruction's size. Extract the relevant part from the buffer. */ if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen && (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), info->endian == BFD_ENDIAN_BIG); else insn_value_cropped = insn_value; if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) == CGEN_INSN_BASE_VALUE (insn)) { /* Printing is handled in two passes. The first pass parses the machine insn and extracts the fields. The second pass prints them. */ /* Make sure the entire insn is loaded into insn_value, if it can fit. */ if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) && (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) { unsigned long full_insn_value; int rc = read_insn (cd, pc, info, buf, CGEN_INSN_BITSIZE (insn) / 8, & ex_info, & full_insn_value); if (rc != 0) return rc; length = CGEN_EXTRACT_FN (cd, insn) (cd, insn, &ex_info, full_insn_value, &fields, pc); } else length = CGEN_EXTRACT_FN (cd, insn) (cd, insn, &ex_info, insn_value_cropped, &fields, pc); /* Length < 0 -> error. */ if (length < 0) return length; if (length > 0) { CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length); /* Length is in bits, result is in bytes. */ return length / 8; } } insn_list = CGEN_DIS_NEXT_INSN (insn_list); } return 0; } /* Default value for CGEN_PRINT_INSN. The result is the size of the insn in bytes or zero for an unknown insn or -1 if an error occured fetching bytes. */ #ifndef CGEN_PRINT_INSN #define CGEN_PRINT_INSN default_print_insn #endif static int default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info) { bfd_byte buf[CGEN_MAX_INSN_SIZE]; int buflen; int status; /* Attempt to read the base part of the insn. */ buflen = cd->base_insn_bitsize / 8; status = (*info->read_memory_func) (pc, buf, buflen, info); /* Try again with the minimum part, if min < base. */ if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) { buflen = cd->min_insn_bitsize / 8; status = (*info->read_memory_func) (pc, buf, buflen, info); } if (status != 0) { (*info->memory_error_func) (status, pc, info); return -1; } return print_insn (cd, pc, info, buf, buflen); } /* Main entry point. Print one instruction from PC on INFO->STREAM. Return the size of the instruction (in bytes). */ typedef struct cpu_desc_list { struct cpu_desc_list *next; CGEN_BITSET *isa; int mach; int endian; CGEN_CPU_DESC cd; } cpu_desc_list; int print_insn_m32c (bfd_vma pc, disassemble_info *info) { static cpu_desc_list *cd_list = 0; cpu_desc_list *cl = 0; static CGEN_CPU_DESC cd = 0; static CGEN_BITSET *prev_isa; static int prev_mach; static int prev_endian; int length; CGEN_BITSET *isa; int mach; int endian = (info->endian == BFD_ENDIAN_BIG ? CGEN_ENDIAN_BIG : CGEN_ENDIAN_LITTLE); enum bfd_architecture arch; /* ??? gdb will set mach but leave the architecture as "unknown" */ #ifndef CGEN_BFD_ARCH #define CGEN_BFD_ARCH bfd_arch_m32c #endif arch = info->arch; if (arch == bfd_arch_unknown) arch = CGEN_BFD_ARCH; /* There's no standard way to compute the machine or isa number so we leave it to the target. */ #ifdef CGEN_COMPUTE_MACH mach = CGEN_COMPUTE_MACH (info); #else mach = info->mach; #endif #ifdef CGEN_COMPUTE_ISA { static CGEN_BITSET *permanent_isa; if (!permanent_isa) permanent_isa = cgen_bitset_create (MAX_ISAS); isa = permanent_isa; cgen_bitset_clear (isa); cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info)); } #else isa = info->private_data; #endif /* If we've switched cpu's, try to find a handle we've used before */ if (cd && (cgen_bitset_compare (isa, prev_isa) != 0 || mach != prev_mach || endian != prev_endian)) { cd = 0; for (cl = cd_list; cl; cl = cl->next) { if (cgen_bitset_compare (cl->isa, isa) == 0 && cl->mach == mach && cl->endian == endian) { cd = cl->cd; prev_isa = cd->isas; break; } } } /* If we haven't initialized yet, initialize the opcode table. */ if (! cd) { const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach); const char *mach_name; if (!arch_type) abort (); mach_name = arch_type->printable_name; prev_isa = cgen_bitset_copy (isa); prev_mach = mach; prev_endian = endian; cd = m32c_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa, CGEN_CPU_OPEN_BFDMACH, mach_name, CGEN_CPU_OPEN_ENDIAN, prev_endian, CGEN_CPU_OPEN_END); if (!cd) abort (); /* Save this away for future reference. */ cl = xmalloc (sizeof (struct cpu_desc_list)); cl->cd = cd; cl->isa = prev_isa; cl->mach = mach; cl->endian = endian; cl->next = cd_list; cd_list = cl; m32c_cgen_init_dis (cd); } /* We try to have as much common code as possible. But at this point some targets need to take over. */ /* ??? Some targets may need a hook elsewhere. Try to avoid this, but if not possible try to move this hook elsewhere rather than have two hooks. */ length = CGEN_PRINT_INSN (cd, pc, info); if (length > 0) return length; if (length < 0) return -1; (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG); return cd->default_insn_bitsize / 8; }
240154.c
/* IBEX UK LTD http://www.ibexuk.com Electronic Product Design Specialists RELEASED SOFTWARE The MIT License (MIT) Copyright (c) 2013, IBEX UK Ltd, http://ibexuk.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ //Project Name: TCP/IP DRIVER //SMTP (SIMPLE MAIL TRANSFER PROTOCOL) C CODE FILE #include "main.h" //Global data type definitions (see https://github.com/ibexuk/C_Generic_Header_File ) #define ETH_SMTP_C #include "eth-smtp.h" #undef ETH_SMTP_C #include "eth-main.h" #include "eth-tcp.h" #include "eth-arp.h" #include "eth-nic.h" #ifdef STACK_USE_DNS #include "eth-dns.h" #endif #ifdef STACK_USE_POP3 #include "eth-pop3.h" #endif #include "ap-main.h" //Your application file that includes the definition for the function used to process //received pop3 emails and the variables for the SMTP server strings if used //-------------------------------------------------------------------------- //----- GENERATE COMPILE ERROR IF SMTP HAS NOT BEEN DEFINED TO BE USED ----- //-------------------------------------------------------------------------- #ifndef STACK_USE_SMTP #error SMTP file is included in project but not defined to be used - remove file from project to reduce code size. #endif //******************************** //******************************** //********** SEND EMAIL ********** //******************************** //******************************** //Returns:- // 0 = unable to start process at the current time // 1 = mail receive process started BYTE email_start_send (BYTE use_authenticated_login, BYTE include_file_attachment) { //----- CHECK WE ARE CONNECTED ----- if (!nic_linked_and_ip_address_valid) return(0); //----- DON'T SEND EMAIL WHILE WE'RE RECEIVING EMAIL ----- #ifdef STACK_USE_POP3 if (email_is_receive_active()) return(0); #endif //----- CHECK WE'RE NOT ALREADY SENDING EMAIL ----- if (email_is_send_active()) return(0); //----- FLAG IF WE'RE TO DO AN AUTHENTICATED LOGIN ----- if (use_authenticated_login) smtp_use_authenticated_login = 1; //1 = use SMTP authenticated login (username and password requried), 0 = normal login else smtp_use_authenticated_login = 0; //----- FLAG IF WE'RE GOING TO INCLUDE A FILE ATTACHMENT ----- if (include_file_attachment) smtp_include_file_attachment = 1; //1 = use SMTP authenticated login (username and password requried), 0 = normal login else smtp_include_file_attachment = 0; //----- START SEND EMAIL PROCESS ----- send_email_body_byte_number = 0xffff; sm_send_email_data = SM_SEND_EMAIL_DATA_MIME_HEADER; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; sm_smtp = SM_SMTP_SEND_EMAIL; //Trigger state machine to do the send email process //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_null; smtp_email_progress_string_update = 0; #endif return(1); } //****************************************************** //****************************************************** //********** ARE WE CURRRENTLY SENDING EMAIL? ********** //****************************************************** //****************************************************** //Returns 1 is receive is active, 0 if not BYTE email_is_send_active (void) { if (sm_smtp == SM_SMTP_IDLE) return(0); else return(1); } //**************************************** //**************************************** //********** PROCESS SEND EMAIL ********** //**************************************** //**************************************** //This function is called reguarly by tcp_ip_process_stack void email_process_smtp (void) { static BYTE smtp_10ms_clock_timer_last; BYTE received_byte; BYTE loop_count; WORD count; BYTE b_temp; BYTE b_temp1; BYTE base64_source[3]; BYTE base64_converted[4]; BYTE temp_string[64]; IP_ADDR dns_resolved_ip_address; BYTE resend_flag; //----------------------------------- //----- CHECK FOR UPDATE TIMERS ----- //----------------------------------- if ((BYTE)((BYTE)(ethernet_10ms_clock_timer & 0x000000ff) - smtp_10ms_clock_timer_last) >= 10) { smtp_10ms_clock_timer_last = (BYTE)(ethernet_10ms_clock_timer & 0x000000ff); //OUT TIMEOUT TIMER if (smtp_100ms_timeout_timer) smtp_100ms_timeout_timer--; } if ((sm_smtp != SM_SMTP_IDLE) && (sm_smtp != SM_SMTP_FAILED)) { //------------------------------------------------- //----- SEND IS ACTIVE - DO BACKGROUND CHECKS ----- //------------------------------------------------- //CHECK FOR RESPONSE TIMEOUT if (smtp_100ms_timeout_timer == 0) goto process_send_email_tcp_failed; //CHECK FOR LOST ETHERNET CONNECTION if (!nic_is_linked) goto process_send_email_tcp_failed; } switch(sm_smtp) { case SM_SMTP_IDLE: //---------------- //---------------- //----- IDLE ----- //---------------- //---------------- break; case SM_SMTP_SEND_EMAIL: //---------------------- //---------------------- //----- SEND EMAIL ----- //---------------------- //---------------------- //GET THE IP ADDRESS OF THE SMTP SERVER email_return_smtp_url(&temp_string[0], sizeof(temp_string)); if (!do_dns_query(temp_string, QNS_QUERY_TYPE_HOST)) { //DNS query not available - try again next time break; } sm_smtp = SM_SMTP_WAITING_DNS_RESPONSE; smtp_100ms_timeout_timer = EMAIL_DO_DNS_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_dns_resp; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAITING_DNS_RESPONSE: //------------------------------------------------ //------------------------------------------------ //----- WAITING FOR SMTP SERVER DNS RESPONSE ----- //------------------------------------------------ //------------------------------------------------ //SEE IF DNS RESPONSE HAS BEEN RECEIVED dns_resolved_ip_address = check_dns_response(); if (dns_resolved_ip_address.Val == 0xffffffff) { //----- DNS QUERY FAILED ----- sm_smtp = SM_SMTP_FAILED; break; } if (dns_resolved_ip_address.Val) { //----- DNS QUERY SUCESSFUL ----- //Store the IP address smtp_server_node.ip_address.Val = dns_resolved_ip_address.Val; sm_smtp = SM_SMTP_SEND_DNS_ARP_REQUEST; } break; case SM_SMTP_SEND_DNS_ARP_REQUEST: //------------------------------------------------------------ //------------------------------------------------------------ //----- SEND ARP REQUEST FOR THE DNS RETURNED IP ADDRESS ----- //------------------------------------------------------------ //------------------------------------------------------------ //Do ARP query to get the MAC address of the server or our gateway if (!arp_resolve_ip_address(&smtp_server_node.ip_address)) { //ARP request cannot be sent right now - try again next time break; } //ARP REQUEST WAS SENT smtp_100ms_timeout_timer = EMAIL_DO_ARP_TIMEOUT_x100MS; sm_smtp = SM_SMTP_WAIT_FOR_ARP_RESPONSE; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_arp_resp; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_ARP_RESPONSE: //--------------------------------- //--------------------------------- //----- WAIT FOR ARP RESPONSE ----- //--------------------------------- //--------------------------------- //Wait for the ARP response if (arp_is_resolve_complete(&smtp_server_node.ip_address, &smtp_server_node.mac_address)) { //----- ARP RESPONSE RECEVIED ----- sm_smtp = SM_SMTP_OPEN_TCP_CONNECTION; } break; case SM_SMTP_OPEN_TCP_CONNECTION: //------------------------------- //------------------------------- //----- OPEN TCP CONNECTION ----- //------------------------------- //------------------------------- //CREATE A TCP CONNECTION TO THE SMTP SERVER AND WAIT FOR THE GREETING MESSAGE if (smtp_tcp_socket != TCP_INVALID_SOCKET) //We shouldn't have a socket currently, but make sure tcp_close_socket(smtp_tcp_socket); smtp_tcp_socket = tcp_connect_socket(&smtp_server_node, SMTP_REMOTE_PORT); if (smtp_tcp_socket == TCP_INVALID_SOCKET) { //No socket available - try again next time break; } smtp_100ms_timeout_timer = EMAIL_WAIT_TCP_CONNECTION_TIMEOUT_x100MS; sm_smtp = SM_SMTP_WAIT_FOR_TCP_CONNECTION; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_tcp_conn; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_TCP_CONNECTION: //-------------------------------------- //-------------------------------------- //----- WAITING FOR TCP CONNECTION ----- //-------------------------------------- //-------------------------------------- //Has connection been made? if (tcp_is_socket_connected(smtp_tcp_socket)) { sm_smtp = SM_SMTP_WAIT_FOR_SMTP_SERVER_GREETING; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_greeting; smtp_email_progress_string_update = 1; #endif } break; case SM_SMTP_WAIT_FOR_SMTP_SERVER_GREETING: //----------------------------------------------------------- //----------------------------------------------------------- //----- WAITING FOR SMTP SERVER GREETING TO BE RECEIVED ----- //----------------------------------------------------------- //----------------------------------------------------------- //Check for packet received if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '2') //A leading 2 character indicates the server is happy (3 used for data transfers, 4 & 5 = error) { //RESPONSE IS GOOD tcp_dump_rx_packet(); //Dump the remainder of the recevied packet sm_smtp = SM_SMTP_SEND_SMTP_HELO; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_SMTP_HELO: //--------------------- //--------------------- //----- SEND HELO ----- //--------------------- //--------------------- if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Send the hello if (smtp_use_authenticated_login) { //Special command for authenticated login tcp_write_next_byte('E'); tcp_write_next_byte('H'); } else { //Normal command tcp_write_next_byte('H'); tcp_write_next_byte('E'); } tcp_write_next_byte('L'); tcp_write_next_byte('O'); tcp_write_next_byte(' '); tcp_write_next_byte('E'); //EMB is our computer name (can be anything) tcp_write_next_byte('M'); tcp_write_next_byte('B'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_HELO_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //Reset ready for the next line of response smtp_receive_message_string_len = 0; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_helo; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_HELO_RESPONSE: //---------------------------------------- //---------------------------------------- //----- WAITING FOR RESPONSE TO HELO ----- //---------------------------------------- //---------------------------------------- //DO WE NEED TO RE-SEND THE LAST PACKET? //(TCP requires resending of packets if they are not acknowledged and to avoid requiring a large RAM buffer the application needs to remember the last packet sent on a socket //so it can be resent if requried - If your application has ram available to store a copy of the last sent packet then the tcp driver could be modified to use it instead). if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_SMTP_HELO; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { //----- PACKET RECEIVED ----- while (tcp_read_next_rx_byte(&received_byte)) //Get next byte, returns 0 if end of packet { //----- RECEIVE EACH LINE ----- //(EHLO EXTENDED SMTP responses are multiline) if (received_byte != '\r') //Do until we get the CR character { if (smtp_receive_message_string_len < SMTP_RECEIVE_MESSAGE_STRING_MAX_LEN - 1 && received_byte != '\n') //Don't include the line feed character smtp_receive_message_string[smtp_receive_message_string_len++] = received_byte; } else { //---------------------------------------------------- //----- CR CHARACTER RECEIVED - PROCESS THE LINE ----- //---------------------------------------------------- //receive_message_string[receive_message_string_len] = 0x00; //Add null termination to the string //strlwr(&receive_message_string[0]); //Convert string to lower case if (smtp_receive_message_string[0] == '2') //A leading 2 character indicates the server is happy (3 used for data transfers, 4 & 5 = error) { //RESPONSE IS GOOD if (smtp_use_authenticated_login) { //----- USING EXTENDED SMTP - CHECK FOR FURTHER RESPONSE DUE ----- if (smtp_receive_message_string[3] == '-') //A trailing '-' instead of a space indicates that another response will follow { //GET ADDITIONAL RESPONSE(S) //(Either in this packet or in additional [ackets) //Reset ready for the next line smtp_receive_message_string_len = 0; continue; } } //----- IF NOT DOING AUTHENTICATED LOGIN THEN SETUP TO START SENDING EMAIL ----- //----- IF DOING AUTHENTICATED LOGIN THEN SETUP TO DO LOGIN ----- if (smtp_use_authenticated_login) { //DOING AUTHENTICATED LOGIN sm_smtp = SM_SMTP_SEND_AUTH_LOGIN_COMMAND; } else { //DOING NORMAL NON-AUTHENTICATED LOGIN sm_smtp = SM_SMTP_SEND_MAIL_FROM_COMMAND; } } else { //----- RESPONSE IS NOT GOOD - ERROR ----- goto process_send_email_tcp_failed; } //Reset ready for the next line smtp_receive_message_string_len = 0; } } //Packet processed - dump it tcp_dump_rx_packet(); } break; case SM_SMTP_SEND_AUTH_LOGIN_COMMAND: //------------------------------------------------------ //------------------------------------------------------ //----- SEND MAIL SMTP AUTHENTICATED LOGIN COMMAND ----- //------------------------------------------------------ //------------------------------------------------------ //(We only support AUTH LOGIN - other AUTH methods are available and a server is not requried to support all types, however AUTH LOGIN is typical) if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Send MAIL FROM tcp_write_next_byte('A'); tcp_write_next_byte('U'); tcp_write_next_byte('T'); tcp_write_next_byte('H'); tcp_write_next_byte(' '); tcp_write_next_byte('L'); tcp_write_next_byte('O'); tcp_write_next_byte('G'); tcp_write_next_byte('I'); tcp_write_next_byte('N'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_AUTH_LOGIN_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_auth_login; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_AUTH_LOGIN_RESPONSE: //------------------------------------------------------ //------------------------------------------------------ //----- WAITING FOR RESPONSE TO AUTH LOGIN COMMAND ----- //------------------------------------------------------ //------------------------------------------------------ //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_AUTH_LOGIN_COMMAND; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '3') //A leading 3 character indicates the server is in data transfer mode, 4 & 5 = error) { //RESPONSE IS GOOD - SEND THE LOGIN USERNAME tcp_dump_rx_packet(); //Dump the remainder of the recevied packet sm_smtp = SM_SMTP_SEND_AUTH_USERNAME; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_AUTH_USERNAME: //------------------------------ //------------------------------ //----- SEND AUTH USERNAME ----- //------------------------------ //------------------------------ if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Get the username email_return_smtp_username(&temp_string[0], sizeof(temp_string)); //Write the string b_temp = 0; while (b_temp < 32) { //Write the next 3 bytes as Base64 encoded if (temp_string[b_temp] != 0) { base64_source[0] = temp_string[b_temp++]; b_temp1 = 1; } else { break; //All characters done } if (temp_string[b_temp] != 0) { base64_source[1] = temp_string[b_temp++]; b_temp1 = 2; } if (temp_string[b_temp] != 0) { base64_source[2] = temp_string[b_temp++]; b_temp1 = 3; } //Convert to 4 bytes of base 64 email_convert_3_bytes_to_base64(&base64_source[0], &base64_converted[0], b_temp1); tcp_write_next_byte(base64_converted[0]); tcp_write_next_byte(base64_converted[1]); tcp_write_next_byte(base64_converted[2]); tcp_write_next_byte(base64_converted[3]); if (b_temp1 < 3) break; //All characters done } tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_AUTH_USERNAME_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_username; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_AUTH_USERNAME_RESPONSE: //--------------------------------------------------------- //--------------------------------------------------------- //----- WAITING FOR RESPONSE TO AUTH USERNAME COMMAND ----- //--------------------------------------------------------- //--------------------------------------------------------- //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_AUTH_USERNAME; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '3') //A leading 3 character indicates the server is in data transfer mode, 4 & 5 = error) { //RESPONSE IS GOOD - SEND THE LOGIN PASSWORD tcp_dump_rx_packet(); //Dump the remainder of the recevied packet sm_smtp = SM_SMTP_SEND_AUTH_PASSWORD; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_AUTH_PASSWORD: //------------------------------ //------------------------------ //----- SEND AUTH PASSWORD ----- //------------------------------ //------------------------------ if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Get the password email_return_smtp_password(&temp_string[0], sizeof(temp_string)); //Write the string b_temp = 0; while (b_temp < 32) { //Write the next 3 bytes as Base64 encoded if (temp_string[b_temp] != 0) { base64_source[0] = temp_string[b_temp++]; b_temp1 = 1; } else { break; //All characters done } if (temp_string[b_temp] != 0) { base64_source[1] = temp_string[b_temp++]; b_temp1 = 2; } if (temp_string[b_temp] != 0) { base64_source[2] = temp_string[b_temp++]; b_temp1 = 3; } //Convert to 4 bytes of base 64 email_convert_3_bytes_to_base64(&base64_source[0], &base64_converted[0], b_temp1); tcp_write_next_byte(base64_converted[0]); tcp_write_next_byte(base64_converted[1]); tcp_write_next_byte(base64_converted[2]); tcp_write_next_byte(base64_converted[3]); if (b_temp1 < 3) break; //All characters done } tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_AUTH_PASSWORD_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_password; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_AUTH_PASSWORD_RESPONSE: //--------------------------------------------------------- //--------------------------------------------------------- //----- WAITING FOR RESPONSE TO AUTH PASSWORD COMMAND ----- //--------------------------------------------------------- //--------------------------------------------------------- //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_AUTH_PASSWORD; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '2') //A leading 2 character indicates the server is happy (3 used for data transfers, 4 & 5 = error) { //RESPONSE IS GOOD tcp_dump_rx_packet(); //Dump the remainder of the recevied packet //Login complete - now send email as normal sm_smtp = SM_SMTP_SEND_MAIL_FROM_COMMAND; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_MAIL_FROM_COMMAND: //---------------------------------- //---------------------------------- //----- SEND MAIL FROM COMMAND ----- //---------------------------------- //---------------------------------- if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Send MAIL FROM tcp_write_next_byte('M'); tcp_write_next_byte('A'); tcp_write_next_byte('I'); tcp_write_next_byte('L'); tcp_write_next_byte(' '); tcp_write_next_byte('F'); tcp_write_next_byte('R'); tcp_write_next_byte('O'); tcp_write_next_byte('M'); tcp_write_next_byte(':'); tcp_write_next_byte(' '); tcp_write_next_byte('<'); //Get the from address email_return_smtp_sender(&temp_string[0], sizeof(temp_string)); for (loop_count = 0; temp_string[loop_count] != 0x00; loop_count++) { tcp_write_next_byte(temp_string[loop_count]); } tcp_write_next_byte('>'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_MAIL_FROM_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_from; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_MAIL_FROM_RESPONSE: //--------------------------------------------- //--------------------------------------------- //----- WAITING FOR RESPONSE TO MAIL FROM ----- //--------------------------------------------- //--------------------------------------------- //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_MAIL_FROM_COMMAND; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '2') //A leading 2 character indicates the server is happy (3 used for data transfers, 4 & 5 = error) { //RESPONSE IS GOOD - SEND THE RCPT TO FIELD tcp_dump_rx_packet(); //Dump the remainder of the recevied packet sm_smtp = SM_SMTP_SEND_RCPT_TO; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_RCPT_TO: //-------------------------------- //-------------------------------- //----- SEND MAIL TO COMMAND ----- //-------------------------------- //-------------------------------- if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Send MAIL FROM tcp_write_next_byte('R'); tcp_write_next_byte('C'); tcp_write_next_byte('P'); tcp_write_next_byte('T'); tcp_write_next_byte(' '); tcp_write_next_byte('T'); tcp_write_next_byte('O'); tcp_write_next_byte(':'); tcp_write_next_byte(' '); tcp_write_next_byte('<'); //Get the to address email_return_smtp_to(&temp_string[0], sizeof(temp_string)); for (loop_count = 0; temp_string[loop_count] != 0x00; loop_count++) { tcp_write_next_byte(temp_string[loop_count]); } tcp_write_next_byte('>'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_RCPT_TO_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_to; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_RCPT_TO_RESPONSE: //-------------------------------------------- //-------------------------------------------- //----- WAITING FOR RESPONSE TO RCPT TO ----- //-------------------------------------------- //-------------------------------------------- //(Once the response is recevied we could continue sending RCPT TO fields for additional recipients if we wanted to) //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_RCPT_TO; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '2') //A leading 2 character indicates the server is happy (3 used for data transfers, 4 & 5 = error) { //RESPONSE IS GOOD - SEND DATA COMMAND TO START THE EMAIL TRANSFER tcp_dump_rx_packet(); //Dump the remainder of the recevied packet sm_smtp = SM_SMTP_SEND_DATA_COMMAND; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_DATA_COMMAND: //----------------------------- //----------------------------- //----- SEND DATA COMMAND ----- //----------------------------- //----------------------------- if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Send the command tcp_write_next_byte('D'); tcp_write_next_byte('A'); tcp_write_next_byte('T'); tcp_write_next_byte('A'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_DATA_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_data; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_DATA_RESPONSE: //------------------------------------------------ //------------------------------------------------ //----- WAITING FOR RESPONSE TO DATA REQUEST ----- //------------------------------------------------ //------------------------------------------------ //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_DATA_COMMAND; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '3') //A leading 3 character indicates the server is in data transfer mode, 4 & 5 = error) { //RESPONSE IS GOOD tcp_dump_rx_packet(); //Dump the remainder of the received packet sm_smtp = SM_SMTP_SEND_EMAIL_HEADER; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_SEND_EMAIL_HEADER: //--------------------------------- //--------------------------------- //----- SEND THE EMAIL HEADER ----- //--------------------------------- //--------------------------------- if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //SEND THE 'FROM' FIELD ON ITS OWN LINE tcp_write_next_byte('F'); tcp_write_next_byte('R'); tcp_write_next_byte('O'); tcp_write_next_byte('M'); tcp_write_next_byte(':'); tcp_write_next_byte(' '); tcp_write_next_byte('<'); //Get the from address email_return_smtp_sender(&temp_string[0], sizeof(temp_string)); for (loop_count = 0; temp_string[loop_count] != 0x00; loop_count++) { tcp_write_next_byte(temp_string[loop_count]); } tcp_write_next_byte('>'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF //SEND THE 'TO' FIELD ON ITS OWN LINE tcp_write_next_byte('T'); tcp_write_next_byte('O'); tcp_write_next_byte(':'); tcp_write_next_byte(' '); tcp_write_next_byte('<'); //Get to address email_return_smtp_to(&temp_string[0], sizeof(temp_string)); for (loop_count = 0; temp_string[loop_count] != 0x00; loop_count++) { tcp_write_next_byte(temp_string[loop_count]); } tcp_write_next_byte('>'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF //SEND THE 'SUBJECT' FIELD ON ITS OWN LINE tcp_write_next_byte('S'); tcp_write_next_byte('u'); tcp_write_next_byte('b'); tcp_write_next_byte('j'); tcp_write_next_byte('e'); tcp_write_next_byte('c'); tcp_write_next_byte('t'); tcp_write_next_byte(':'); tcp_write_next_byte(' '); //Get the subject email_return_smtp_subject(&temp_string[0], sizeof(temp_string)); for (loop_count = 0; temp_string[loop_count] != 0x00; loop_count++) { tcp_write_next_byte(temp_string[loop_count]); } tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_EMAIL_HEADER_ACK; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_sending_smtp_data; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_EMAIL_HEADER_ACK: //-------------------------------------------------------- //-------------------------------------------------------- //----- WAIT FOR TCP ACK FOR THE EMAIL HEADER PACKET ----- //-------------------------------------------------------- //-------------------------------------------------------- //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_EMAIL_HEADER; break; } //CHECK FOR TCP ACK RETURNED BY SERVER if (tcp_is_socket_ready_to_tx_new_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_SEND_SMTP_EMAIL_BODY; } break; case SM_SMTP_SEND_SMTP_EMAIL_BODY: //------------------------------- //------------------------------- //----- SEND THE EMAIL BODY ----- //------------------------------- //------------------------------- //(This state may be called more than once depending on the length of the email) //DO WE NEED TO RE-SEND THE LAST PACKET? //(TCP requires resending of packets if they are not acknowledged and to avoid requiring a large RAM buffer the application needs to remember the last packet sent on a socket //so it can be resent if requried - If your application has ram available to store a copy of the last sent packet then the tcp driver could be modified to use it instead). resend_flag = 0x01; //Default to this is first byte of a new packet - functions should copy working registers in case a resend is needed if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { resend_flag = 0x02; //Flag that functions should restore the copies of working registers as this packet is going to be a re-send } //---------------------------------------- //---------------------------------------- //----- GET NEXT BLOCK OF EMAIL DATA ----- //---------------------------------------- //---------------------------------------- if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } for (count = 0; count < 1400; count++) //Max 1500 bytes in an IP datagram. Min IP header is 20 bytes, min TCP header is 20 bytes. Limit to 1400 bytes to provide some slack { //CALL SEPERATE FUNCTION TO GET THE NEXT DATA BYTE TO SEND b_temp = send_email_get_next_byte(&received_byte, resend_flag); if (b_temp) { //Send next byte tcp_write_next_byte(received_byte); if (b_temp == 2) break; //Moving from email body to file attachment - start a new packet to make life simple if we have to do a resend } else { //NO MORE BYTES TO SEND //End of email marker tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_write_next_byte('.'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; sm_smtp = SM_SMTP_WAIT_FOR_SMTP_EMAIL_BODY_REPONSE; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_data_resp; smtp_email_progress_string_update = 1; #endif break; } resend_flag = 0; } tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet if (sm_smtp != SM_SMTP_WAIT_FOR_SMTP_EMAIL_BODY_REPONSE) { smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; sm_smtp = SM_SMTP_SEND_SMTP_EMAIL_BODY; //Repeate this state until all of email body is sent (there is no SMTP server acknowledgement until the email body is complete) } //There is not response in this part of the transfer - just keep sending the data until we're done break; case SM_SMTP_WAIT_FOR_SMTP_EMAIL_BODY_REPONSE: //---------------------------------------------- //---------------------------------------------- //----- WAITING FOR RESPONSE TO EMAIL DATA ----- //---------------------------------------------- //---------------------------------------------- //(A response from the server is only send once all of the email has been sent and the special <CR><LF>.<CR><LF> end of message has been sent) //Check for packet received if (tcp_check_socket_for_rx(smtp_tcp_socket)) { tcp_read_next_rx_byte(&received_byte); if (received_byte == '2') //A leading 2 character indicates the server is is happy (3 used for data transfers, 4 & 5 = error) { tcp_dump_rx_packet(); //Dump the remainder of the received packet sm_smtp = SM_SMTP_DO_QUIT; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_data_accepted; smtp_email_progress_string_update = 1; #endif break; } else { //RESPONSE IS NOT GOOD - ERROR goto process_send_email_tcp_failed; } } break; case SM_SMTP_DO_QUIT: //------------------------------------------ //------------------------------------------ //----- QUIT CONNECTION TO SMTP SERVER ----- //------------------------------------------ //------------------------------------------ if (!tcp_setup_socket_tx(smtp_tcp_socket)) { //Can't send currently - try again next time break; } //Send the username tcp_write_next_byte('Q'); tcp_write_next_byte('U'); tcp_write_next_byte('I'); tcp_write_next_byte('T'); tcp_write_next_byte('\r'); //CR tcp_write_next_byte('\n'); //LF tcp_socket_tx_packet(smtp_tcp_socket); //Send the packet sm_smtp = SM_SMTP_WAIT_FOR_SMTP_QUIT_RESPONSE; smtp_100ms_timeout_timer = EMAIL_WAIT_SERVER_MESSAGE_TIMEOUT_x100MS; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_wait_smtp_quit; smtp_email_progress_string_update = 1; #endif break; case SM_SMTP_WAIT_FOR_SMTP_QUIT_RESPONSE: //---------------------------------- //---------------------------------- //----- WAIT FOR QUIT RESPONSE ----- //---------------------------------- //---------------------------------- //DO WE NEED TO RE-SEND THE LAST PACKET? if (tcp_does_socket_require_resend_of_last_packet(smtp_tcp_socket)) { sm_smtp = SM_SMTP_DO_QUIT; break; } //CHECK FOR PACKET RECEIVED if (tcp_check_socket_for_rx(smtp_tcp_socket)) { //----- ALL DONE - DUMP THE TCP CONNECTION AND RETURN TO IDLE MODE ----- tcp_request_disconnect_socket(smtp_tcp_socket); sm_smtp = SM_SMTP_IDLE; //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_complete; smtp_email_progress_string_update = 1; #endif } break; case SM_SMTP_FAILED: //------------------------------------- //------------------------------------- //----- SEND EMAIL PROCESS FAILED ----- //------------------------------------- //------------------------------------- //UPDATE USER DISPLAYED STRING IF IN USE #ifdef DO_SMTP_PROGRESS_STRING smtp_email_progress_string_pointer = smtp_email_progress_string_failed; smtp_email_progress_string_update = 1; #endif sm_smtp = SM_SMTP_IDLE; break; } return; process_send_email_tcp_failed: //----------------------------------------------------------------------------------- //----- FAILED DURING TCP TRANSFER - CLOSE CONNECTION AND CHANGE STATE TO ERROR ----- //----------------------------------------------------------------------------------- if ((sm_smtp != SM_SMTP_SEND_EMAIL) && (sm_smtp != SM_SMTP_WAIT_FOR_ARP_RESPONSE) && (sm_smtp != SM_SMTP_WAITING_DNS_RESPONSE)) { tcp_dump_rx_packet(); //Dump the remainder of any received packet tcp_request_disconnect_socket(smtp_tcp_socket); //Close connection } sm_smtp = SM_SMTP_FAILED; return; } //**************************************************************** //**************************************************************** //********** SEND EMAIL PROVIDE NEXT BYTE OF EMAIL BODY ********** //**************************************************************** //**************************************************************** //Once the connection has been establised to the smtp server and the email header sent this function will be called for each //byte to be included in the email body. //The first call will be the start of the line following the 'subject' field of the header. //Additional header lines may be added if requried (i.e. MIME header if attaching a file to the email) //To start sending the email body you must first send a blank line to indicate the end of the header and the beginning of the //email body //Returns: // 2 = there are more bytes to send but start a new packet (we ensure a new packet is started before sending a file attachment for simplicity) // 1 = there are more bytes to send // 0 = the last byte has already been sent and there is no more data. //The calling function will add the <CR><LF>.<CR><LF> end of email marker // //resend_flags: // 0x00 Get next byte as normal. // 0x01 The byte being requested is the first byte of a new TCP packet. The previous packet was sucessfully sent. // 0x02 The byte being requested is the first byte of a re-send of the last packet. // This is requried as TCP requires resending of packets if they are not acknowledged and to avoid requiring a large RAM buffer the // application needs to remember the last packet sent on a socket so it can be re-sent if requried. // (If your application has ram available to store a copy of the last sent packet then the tcp driver could be modified to use it instead). BYTE send_email_get_next_byte(BYTE *data, BYTE resend_flags) { static BYTE mime_base64_byte[4]; static BYTE mime_line_character_count; static BYTE sm_send_email_data_copy; static WORD send_email_body_byte_number_copy; static BYTE mime_line_character_count_copy; static BYTE mime_base64_byte_copy[4]; static WORD resend_possible_move_back_bytes; static WORD resend_move_back_bytes; static BYTE file_attachment_last_byte_sent; static BYTE get_data_started_new_tcp_packet; BYTE b_temp; BYTE bytes_to_encode[3]; BYTE bytes_to_encode_len; //TO SEND A BASIC ASCII EMAIL:- //Send a blank line "\r\n" //Send the email text, using "\r\n" on the end of each line, with a maximum of 1000 charcters permitted per line (RFC821) //Finally return with 0x00 so that the SMTP function adds the end of email marker and finishes sending the email //TO SEND A MIME EMAIL WITH AN ATTACHMENT:- //Send mime_header_for_text_string //Send email_body_message_string or any ascii text to be displayed in the email body //Send mime_body_for_file_string //Send the file encoded in base64 format //Send mime_body_end_of_mime_string //Finally return with 0x00 so that the SMTP function adds the end of email marker and finishes sending the email if (resend_flags == 0x01) { //------------------------------------------------------------------------------- //----- COPY ALL WORKING REGISTERS AS THIS IS THE START OF A NEW TCP PACKET ----- //------------------------------------------------------------------------------- sm_send_email_data_copy = sm_send_email_data; send_email_body_byte_number_copy = send_email_body_byte_number; mime_line_character_count_copy = mime_line_character_count; mime_base64_byte_copy[0] = mime_base64_byte[0]; mime_base64_byte_copy[1] = mime_base64_byte[1]; mime_base64_byte_copy[2] = mime_base64_byte[2]; mime_base64_byte_copy[3] = mime_base64_byte[3]; resend_possible_move_back_bytes = 0; resend_move_back_bytes = 0; get_data_started_new_tcp_packet = 1; } else if (resend_flags == 0x02) { //------------------------------------------------------------------------------------- //----- RESTORE ALL WORKING REGISTERS AS THIS IS A RE-SEND OF THE LAST TCP PACKET ----- //------------------------------------------------------------------------------------- sm_send_email_data = sm_send_email_data_copy; send_email_body_byte_number = send_email_body_byte_number_copy; mime_line_character_count = mime_line_character_count_copy; mime_base64_byte[0] = mime_base64_byte_copy[0]; mime_base64_byte[1] = mime_base64_byte_copy[1]; mime_base64_byte[2] = mime_base64_byte_copy[2]; mime_base64_byte[3] = mime_base64_byte_copy[3]; resend_move_back_bytes = resend_possible_move_back_bytes; resend_possible_move_back_bytes = 0; get_data_started_new_tcp_packet = 0; file_attachment_last_byte_sent = 0; } send_email_get_next_byte_redo: send_email_body_byte_number++; switch(sm_send_email_data) { case SM_SEND_EMAIL_DATA_MIME_HEADER: //------------------------------------------------------------------------------ //----- THE MIME HEADER USED JUST FOLLOWING THE STANDARD EMAIL BODY HEADER ----- //------------------------------------------------------------------------------ *data = mime_header_for_text_string[(WORD)send_email_body_byte_number]; if (mime_header_for_text_string[(WORD)send_email_body_byte_number + 1] == 0x00) { send_email_body_byte_number = 0xffff; sm_send_email_data = SM_SEND_EMAIL_BODY_ASCII; resend_possible_move_back_bytes = 0; } return(1); case SM_SEND_EMAIL_BODY_ASCII: //-------------------------------------------------------- //----- ASCII TEXT TO BE DISPLAYED IN THE EMAIL BODY ----- //-------------------------------------------------------- //----- GET NEXT BYTE FROM USER APLICATION ----- b_temp = SMTP_GET_NEXT_DATA_BYTE_FUNCTION(1, get_data_started_new_tcp_packet, resend_move_back_bytes, data); resend_move_back_bytes = 0; get_data_started_new_tcp_packet = 0; if (b_temp) { //----- WE HAVE THE NEXT BYTE TO SEND ----- resend_possible_move_back_bytes++; return(1); } else { //----- NO MORE BYTES TO SEND ----- send_email_body_byte_number = 0xffff; #ifdef EMAIL_ATTACHMENT_FILENAME if (smtp_include_file_attachment) sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_FILE_HEADER_1; //User flagged that a file would be included when send email was origianlly called else sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_END_OF_BODY; //Not using send an attachment #else sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_END_OF_BODY; //Not using send attachment functionality #endif goto send_email_get_next_byte_redo; } #ifdef EMAIL_ATTACHMENT_FILENAME //Don't include file attachment code if this functionality is not being used case SM_SEND_EMAIL_BODY_MIME_FILE_HEADER_1: //-------------------------------------------------------- //----- START OF MIME HEADER FOR THE FILE ATTACHMENT ----- //-------------------------------------------------------- *data = mime_body_file_header_string_1[(WORD)send_email_body_byte_number]; if (mime_body_file_header_string_1[(WORD)send_email_body_byte_number + 1] == 0x00) { send_email_body_byte_number = 0xffff; mime_line_character_count = 0xff; sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_FILE_HEADER_2; } return(1); case SM_SEND_EMAIL_BODY_MIME_FILE_HEADER_2: //----------------------------------------------------------- //----- FILENAME OF MIME HEADER FOR THE FILE ATTACHMENT ----- //----------------------------------------------------------- //(This includes the file name) *data = EMAIL_ATTACHMENT_FILENAME[(WORD)send_email_body_byte_number]; if (EMAIL_ATTACHMENT_FILENAME[(WORD)send_email_body_byte_number + 1] == 0x00) { send_email_body_byte_number = 0xffff; mime_line_character_count = 0xff; sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_FILE_HEADER_3; } return(1); case SM_SEND_EMAIL_BODY_MIME_FILE_HEADER_3: //------------------------------------------------------ //----- END OF MIME HEADER FOR THE FILE ATTACHMENT ----- //------------------------------------------------------ *data = mime_body_file_header_string_2[(WORD)send_email_body_byte_number]; if (mime_body_file_header_string_2[(WORD)send_email_body_byte_number + 1] == 0x00) { send_email_body_byte_number = 0xffff; mime_line_character_count = 0xff; sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_FILE_DATA; resend_possible_move_back_bytes = 0; file_attachment_last_byte_sent = 0; return(2); } return(1); case SM_SEND_EMAIL_BODY_MIME_FILE_DATA: //----------------------------------- //----- THE FILE DATA IN BASE64 ----- //----------------------------------- //MAXIMUM PERMITTED LINE LENGTH IS 76 CHARACTERS mime_line_character_count++; if (mime_line_character_count == 74) { send_email_body_byte_number--; *data = '\r'; return (1); } else if (mime_line_character_count == 75) { send_email_body_byte_number--; mime_line_character_count = 0xff; *data = '\n'; return (1); } if ((send_email_body_byte_number & 0x0003) == 0) { //----- GET NEW BLOCK OF 3 BYTES READY TO BE ENCODED ----- bytes_to_encode_len = 0; while (bytes_to_encode_len < 3) { if (file_attachment_last_byte_sent) break; //----- GET NEXT FILE BYTE FROM USER APLICATION ----- b_temp = SMTP_GET_NEXT_DATA_BYTE_FUNCTION(0, get_data_started_new_tcp_packet, resend_move_back_bytes, &bytes_to_encode[bytes_to_encode_len]); resend_move_back_bytes = 0; get_data_started_new_tcp_packet = 0; if (b_temp) { //------ WE HAVE NEXT BYTE TO SEND ----- resend_possible_move_back_bytes++; bytes_to_encode_len++; } else { //----- THERE ARE NO MORE BYTES TO SEND ----- file_attachment_last_byte_sent = 1; } } if (file_attachment_last_byte_sent && (bytes_to_encode_len == 0)) { //----- NO MORE FILE BYTES TO SEND ----- send_email_body_byte_number = 0xffff; sm_send_email_data = SM_SEND_EMAIL_BODY_MIME_END_OF_BODY; goto send_email_get_next_byte_redo; } //----- CONVERT TO 4 BYTES OF BASE 64 ----- email_convert_3_bytes_to_base64(&bytes_to_encode[0], &mime_base64_byte[0], bytes_to_encode_len); } //----- RETURN WITH THE NEXT ENCODED BYTE ----- if ((send_email_body_byte_number & 0x0003) == 0) { *data = mime_base64_byte[0]; return(1); } else if ((send_email_body_byte_number & 0x0003) == 1) { *data = mime_base64_byte[1]; return(1); } else if ((send_email_body_byte_number & 0x0003) == 2) { *data = mime_base64_byte[2]; return(1); } else { *data = mime_base64_byte[3]; return(1); } #endif //#ifdef EMAIL_ATTACHMENT_FILENAME case SM_SEND_EMAIL_BODY_MIME_END_OF_BODY: //------------------------------ //----- END OF MIME MARKER ----- //------------------------------ *data = mime_body_end_of_mime_string[send_email_body_byte_number]; if (mime_body_end_of_mime_string[send_email_body_byte_number + 1] == 0x00) { send_email_body_byte_number = 0xffff; sm_send_email_data = SM_SEND_EMAIL_BODY_DONE; } return(1); case SM_SEND_EMAIL_BODY_DONE: //-------------------------------- //----- NO MORE DATA TO SEND ----- //-------------------------------- return (0); } return(0); } //*************************************************************** //*************************************************************** //********** CONVERT 3 BYTES TO 4 BYTE BASE 64 ENCODED ********** //*************************************************************** //*************************************************************** //source = start of 3 byte array containing the 3 bytes to be converted //dest = start of 4 byte array that the encoded bytes will be written to void email_convert_3_bytes_to_base64 (BYTE *source, BYTE *dest, BYTE len) { //Base64 uses an efficient 8bit to 7 bit conversion but without the encoded data being human readable. //It uses a 65 character subset of US-ASCII, with 6 bits represented per printable character. The 65th //character '=' is used as a special marker. The characters are selected so as to be universally representable, //and they exclude characters with particular significance to SMTP and MIME (e.g. ".", CR, LF, "-"). //Each 24 bits (3 bytes) of the data being encoded is represented //by 4 characters, resulting in approximately 33% larger size overall. //Working from left to right, the next 3 bytes to send are joined together to form 24 bits and this is then split up //into 4 groups of 6 bits, with each 6 bit group represented by a character from the base64 alphabet: // 0 'A' 16 'Q' 32 'g' 48 'w' PAD '=' // 1 'B' 17 'R' 33 'h' 49 'x' // 2 'C' 18 'S' 34 'i' 50 'y' // 3 'D' 19 'T' 35 'j' 51 'z' // 4 'E' 20 'U' 36 'k' 52 '0' // 5 'F' 21 'V' 37 'l' 53 '1' // 6 'G' 22 'W' 38 'm' 54 '2' // 7 'H' 23 'X' 39 'n' 55 '3' // 8 'I' 24 'Y' 40 'o' 56 '4' // 9 'J' 25 'Z' 41 'p' 57 '5' // 10 'K' 26 'a' 42 'q' 58 '6' // 11 'L' 27 'b' 43 'r' 59 '7' // 12 'M' 28 'c' 44 's' 60 '8' // 13 'N' 29 'd' 45 't' 61 '9' // 14 'O' 30 'e' 46 'u' 62 '+' // 15 'P' 31 'f' 47 'v' 63 '/' //Rules: //When decoding any character not included in the base64 alphabet must be ignored. //The encoded output must have line lengths of no more than 76 characters. //If there are less than 24 bits available at the end of the encoded data then zero bits must be added to the right //of the final bits to reach the next 6 bit group boundary. The '=' character is then added to make up any //remaining characters of the last 4 character group. This allows 3 posibilities. Where there are 24 bits to make //up the final 4 character output there will be no '=' padding character. Where there are only 16 bits there will //be 3 characters followed by 1 '=' padding character. Where there are only 8 bits there will be 2 characters //followed by 2 '=' padding characters. dest[0] = 0; dest[1] = 0; dest[2] = 0; dest[3] = 0; dest[0] |= ((source[0] >> 2) & 0x3f); dest[1] |= ((source[0] << 4) & 0x30); if (len == 1) { //ONLY 1 BYTE TO BE ENCODED dest[2] = 0xff; //Flag to set byte to '=' (for null) dest[3] = 0xff; //Flag to set byte to '=' (for null) } else { // > 1 BYTE TO BE ENCODED dest[1] |= ((source[1] >> 4) & 0x0f); dest[2] |= ((source[1] << 2) & 0x3c); if (len == 2) { //ONLY 2 BYTES TO BE ENCODED dest[3] = 0xff; //Flag to set byte to '=' (for null) } else { //ALL 3 BYTES TO BE ENCODED dest[2] |= ((source[2] >> 6) & 0x03); dest[3] |= (source[2] & 0x3f); } } dest[0] = email_convert_byte_to_base64_alphabet(dest[0]); dest[1] = email_convert_byte_to_base64_alphabet(dest[1]); dest[2] = email_convert_byte_to_base64_alphabet(dest[2]); dest[3] = email_convert_byte_to_base64_alphabet(dest[3]); } //************************************************************ //************************************************************ //********** SEND EMAIL CONVERT CHAR TO BASE64 CHAR ********** //************************************************************ //************************************************************ BYTE email_convert_byte_to_base64_alphabet (BYTE data) { if (data < 26) return (data + 'A'); else if (data < 52) return (data + 'a' - 26); else if (data < 62) return (data + '0' - 52); else if (data == 62) return ('+'); else if (data == 63) return ('/'); else return ('='); } //******************************************** //******************************************** //********** RETURN SMTP SERVER URL ********** //******************************************** //******************************************** void email_return_smtp_url (BYTE *string_pointer, BYTE max_length) { BYTE count = 0; #ifdef SMTP_USING_CONST_ROM_SETTINGS CONSTANT BYTE *p_source_string; //Using hard coded constant strings #else BYTE *p_source_string; //Using variable strings #endif p_source_string = &SMTP_SERVER_STRING[0]; do { //Check for overflow if (++count == max_length) { *string_pointer++ = 0x00; return; } //Copy next byte *string_pointer++ = *p_source_string; } while (*p_source_string++ != 0x00); } //****************************************** //****************************************** //********** RETURN SMTP USERNAME ********** //****************************************** //****************************************** //(Only used if authorised login is used) void email_return_smtp_username (BYTE *string_pointer, BYTE max_length) { BYTE count = 0; #ifdef SMTP_USING_CONST_ROM_SETTINGS CONSTANT BYTE *p_source_string; //Using hard coded constant strings #else BYTE *p_source_string; //Using variable strings #endif p_source_string = &SMTP_USERNAME_STRING[0]; do { //Check for overflow if (++count == max_length) { *string_pointer++ = 0x00; return; } //Copy next byte *string_pointer++ = *p_source_string; } while (*p_source_string++ != 0x00); } //****************************************** //****************************************** //********** RETURN SMTP PASSWORD ********** //****************************************** //****************************************** //(Only used if authorised login is used) void email_return_smtp_password (BYTE *string_pointer, BYTE max_length) { BYTE count = 0; #ifdef SMTP_USING_CONST_ROM_SETTINGS CONSTANT BYTE *p_source_string; //Using hard coded constant strings #else BYTE *p_source_string; //Using variable strings #endif p_source_string = &SMTP_PASSWORD_STRING[0]; do { //Check for overflow if (++count == max_length) { *string_pointer++ = 0x00; return; } //Copy next byte *string_pointer++ = *p_source_string; } while (*p_source_string++ != 0x00); } //******************************************** //******************************************** //********** RETURN SMTP TO ADDRESS ********** //******************************************** //******************************************** //(The email to be used as the destination address) void email_return_smtp_to (BYTE *string_pointer, BYTE max_length) { BYTE count = 0; #ifdef SMTP_USING_CONST_ROM_SETTINGS CONSTANT BYTE *p_source_string; //Using hard coded constant strings #else BYTE *p_source_string; //Using variable strings #endif p_source_string = &SMTP_TO_STRING[0]; do { //Check for overflow if (++count == max_length) { *string_pointer++ = 0x00; return; } //Copy next byte *string_pointer++ = *p_source_string; } while (*p_source_string++ != 0x00); } //********************************************** //********************************************** //********** RETURN SMTP FROM ADDRESS ********** //********************************************** //********************************************** //(The email to be used as the from address) void email_return_smtp_sender (BYTE *string_pointer, BYTE max_length) { BYTE count = 0; #ifdef SMTP_USING_CONST_ROM_SETTINGS CONSTANT BYTE *p_source_string; //Using hard coded constant strings #else BYTE *p_source_string; //Using variable strings #endif p_source_string = &SMTP_SENDER_STRING[0]; do { //Check for overflow if (++count == max_length) { *string_pointer++ = 0x00; return; } //Copy next byte *string_pointer++ = *p_source_string; } while (*p_source_string++ != 0x00); } //***************************************** //***************************************** //********** RETURN SMTP SUBJECT ********** //***************************************** //***************************************** void email_return_smtp_subject (BYTE *string_pointer, BYTE max_length) { BYTE count = 0; #ifdef SMTP_USING_CONST_ROM_SETTINGS CONSTANT BYTE *p_source_string; #else BYTE *p_source_string; #endif p_source_string = &SMTP_SUBJECT_STRING[0]; do { //Check for overflow if (++count == max_length) { *string_pointer++ = 0x00; return; } //Copy next byte *string_pointer++ = *p_source_string; } while (*p_source_string++ != 0x00); }
267612.c
/* { dg-do compile } */ void foo(void); int vfork(void); int *p; void bar(void) { foo(); *p = vfork(); }
568119.c
/*****************************************************************************/ /* */ /* intstack.c */ /* */ /* Integer stack used for program settings */ /* */ /* */ /* */ /* (C) 2004-2010, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: [email protected] */ /* */ /* */ /* This software is provided 'as-is', without any expressed 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. */ /* */ /*****************************************************************************/ /* common */ #include "check.h" #include "intstack.h" /*****************************************************************************/ /* Code */ /*****************************************************************************/ long IS_Get (const IntStack* S) /* Get the value on top of an int stack */ { PRECONDITION (S->Count > 0); return S->Stack[S->Count-1]; } void IS_Set (IntStack* S, long Val) /* Set the value on top of an int stack */ { PRECONDITION (S->Count > 0); S->Stack[S->Count-1] = Val; } void IS_Drop (IntStack* S) /* Drop a value from an int stack */ { PRECONDITION (S->Count > 0); --S->Count; } void IS_Push (IntStack* S, long Val) /* Push a value onto an int stack */ { PRECONDITION (S->Count < sizeof (S->Stack) / sizeof (S->Stack[0])); S->Stack[S->Count++] = Val; } long IS_Pop (IntStack* S) /* Pop a value from an int stack */ { PRECONDITION (S->Count > 0); return S->Stack[--S->Count]; }
933714.c
// RUN: %clang_cc1 -emit-llvm %s -o %t const int globalInt = 1; int globalIntWithFloat = 1.5f; int globalIntArray[5] = { 1, 2 }; int globalIntFromSizeOf = sizeof(globalIntArray); char globalChar = 'a'; char globalCharArray[5] = { 'a', 'b' }; float globalFloat = 1.0f; float globalFloatWithInt = 1; float globalFloatArray[5] = { 1.0f, 2.0f }; double globalDouble = 1.0; double globalDoubleArray[5] = { 1.0, 2.0 }; char *globalString = "abc"; char *globalStringArray[5] = { "123", "abc" }; long double globalLongDouble = 1; long double globalLongDoubleArray[5] = { 1.0, 2.0 }; struct Struct { int member1; float member2; char *member3; }; struct Struct globalStruct = { 1, 2.0f, "foobar"};
914052.c
/* Copyright (c) 2013, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <par-res-kern_general.h> #include <par-res-kern_fenix.h> #define ARRAY(i,j) vector[i+1+(j)*(segment_size+1)] void time_step(int my_ID, int root, int final, long m, long n, long start, long end, long segment_size, int Num_procs, int grp, double * RESTRICT vector, double *inbuf, double *outbuf) { double corner_val; int i, j, jj, jjsize; /* execute pipeline algorithm for grid lines 1 through n-1 (skip bottom line) */ if (grp==1) for (j=1; j<n; j++) { /* special case for no grouping */ /* if I am not at the left boundary, I need to wait for my left neighbor to send data */ if (my_ID > 0) { MPI_Recv(&(ARRAY(start-1,j)), 1, MPI_DOUBLE, my_ID-1, j, MPI_COMM_WORLD, MPI_STATUSES_IGNORE); } for (i=start; i<= end; i++) { ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); } /* if I am not on the right boundary, send data to my right neighbor */ if (my_ID < Num_procs-1) { MPI_Send(&(ARRAY(end,j)), 1, MPI_DOUBLE, my_ID+1, j, MPI_COMM_WORLD); } } else for (j=1; j<n; j+=grp) { /* apply grouping */ jjsize = MIN(grp, n-j); /* if I am not at the left boundary, I need to wait for my left neighbor to send data */ if (my_ID > 0) { MPI_Recv(inbuf, jjsize, MPI_DOUBLE, my_ID-1, j, MPI_COMM_WORLD, MPI_STATUSES_IGNORE); for (jj=0; jj<jjsize; jj++) { ARRAY(start-1,jj+j) = inbuf[jj]; } } for (jj=0; jj<jjsize; jj++) for (i=start; i<= end; i++) { ARRAY(i,jj+j) = ARRAY(i-1,jj+j) + ARRAY(i,jj+j-1) - ARRAY(i-1,jj+j-1); } /* if I am not on the right boundary, send data to my right neighbor */ if (my_ID < Num_procs-1) { for (jj=0; jj<jjsize; jj++) { outbuf[jj] = ARRAY(end,jj+j); } MPI_Send(outbuf, jjsize, MPI_DOUBLE, my_ID+1, j, MPI_COMM_WORLD); } } /* copy top right corner value to bottom left corner to create dependency */ if (Num_procs >1) { if (my_ID==final) { corner_val = -ARRAY(end,n-1); MPI_Send(&corner_val,1,MPI_DOUBLE,root,888,MPI_COMM_WORLD); } if (my_ID==root) { MPI_Recv(&(ARRAY(0,0)),1,MPI_DOUBLE,final,888,MPI_COMM_WORLD,MPI_STATUSES_IGNORE); } } else ARRAY(0,0)= -ARRAY(end,n-1); }
161931.c
/*------------------------------------------------------------------------- * * parse_expr.c * handle expressions in parser * * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/parser/parse_expr.c * *------------------------------------------------------------------------- */ #include "postgres.h" #include "catalog/pg_type.h" #include "commands/dbcommands.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "optimizer/tlist.h" #include "optimizer/var.h" #include "parser/analyze.h" #include "parser/parse_clause.h" #include "parser/parse_coerce.h" #include "parser/parse_collate.h" #include "parser/parse_expr.h" #include "parser/parse_func.h" #include "parser/parse_oper.h" #include "parser/parse_relation.h" #include "parser/parse_target.h" #include "parser/parse_type.h" #include "parser/parse_agg.h" #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/xml.h" /* GUC parameters */ bool operator_precedence_warning = false; bool Transform_null_equals = false; /* * Node-type groups for operator precedence warnings * We use zero for everything not otherwise classified */ #define PREC_GROUP_POSTFIX_IS 1 /* postfix IS tests (NullTest, etc) */ #define PREC_GROUP_INFIX_IS 2 /* infix IS (IS DISTINCT FROM, etc) */ #define PREC_GROUP_LESS 3 /* < > */ #define PREC_GROUP_EQUAL 4 /* = */ #define PREC_GROUP_LESS_EQUAL 5 /* <= >= <> */ #define PREC_GROUP_LIKE 6 /* LIKE ILIKE SIMILAR */ #define PREC_GROUP_BETWEEN 7 /* BETWEEN */ #define PREC_GROUP_IN 8 /* IN */ #define PREC_GROUP_NOT_LIKE 9 /* NOT LIKE/ILIKE/SIMILAR */ #define PREC_GROUP_NOT_BETWEEN 10 /* NOT BETWEEN */ #define PREC_GROUP_NOT_IN 11 /* NOT IN */ #define PREC_GROUP_POSTFIX_OP 12 /* generic postfix operators */ #define PREC_GROUP_INFIX_OP 13 /* generic infix operators */ #define PREC_GROUP_PREFIX_OP 14 /* generic prefix operators */ /* * Map precedence groupings to old precedence ordering * * Old precedence order: * 1. NOT * 2. = * 3. < > * 4. LIKE ILIKE SIMILAR * 5. BETWEEN * 6. IN * 7. generic postfix Op * 8. generic Op, including <= => <> * 9. generic prefix Op * 10. IS tests (NullTest, BooleanTest, etc) * * NOT BETWEEN etc map to BETWEEN etc when considered as being on the left, * but to NOT when considered as being on the right, because of the buggy * precedence handling of those productions in the old grammar. */ static const int oldprecedence_l[] = { 0, 10, 10, 3, 2, 8, 4, 5, 6, 4, 5, 6, 7, 8, 9 }; static const int oldprecedence_r[] = { 0, 10, 10, 3, 2, 8, 4, 5, 6, 1, 1, 1, 7, 8, 9 }; static Node *transformExprRecurse(ParseState *pstate, Node *expr); static Node *transformParamRef(ParseState *pstate, ParamRef *pref); static Node *transformAExprOp(ParseState *pstate, A_Expr *a); static Node *transformAExprOpAny(ParseState *pstate, A_Expr *a); static Node *transformAExprOpAll(ParseState *pstate, A_Expr *a); static Node *transformAExprDistinct(ParseState *pstate, A_Expr *a); static Node *transformAExprNullIf(ParseState *pstate, A_Expr *a); static Node *transformAExprOf(ParseState *pstate, A_Expr *a); static Node *transformAExprIn(ParseState *pstate, A_Expr *a); static Node *transformAExprBetween(ParseState *pstate, A_Expr *a); static Node *transformBoolExpr(ParseState *pstate, BoolExpr *a); static Node *transformFuncCall(ParseState *pstate, FuncCall *fn); static Node *transformMultiAssignRef(ParseState *pstate, MultiAssignRef *maref); static Node *transformCaseExpr(ParseState *pstate, CaseExpr *c); static Node *transformSubLink(ParseState *pstate, SubLink *sublink); static Node *transformArrayExpr(ParseState *pstate, A_ArrayExpr *a, Oid array_type, Oid element_type, int32 typmod); static Node *transformRowExpr(ParseState *pstate, RowExpr *r); static Node *transformCoalesceExpr(ParseState *pstate, CoalesceExpr *c); static Node *transformMinMaxExpr(ParseState *pstate, MinMaxExpr *m); static Node *transformXmlExpr(ParseState *pstate, XmlExpr *x); static Node *transformXmlSerialize(ParseState *pstate, XmlSerialize *xs); static Node *transformBooleanTest(ParseState *pstate, BooleanTest *b); static Node *transformCurrentOfExpr(ParseState *pstate, CurrentOfExpr *cexpr); static Node *transformColumnRef(ParseState *pstate, ColumnRef *cref); static Node *transformWholeRowRef(ParseState *pstate, RangeTblEntry *rte, int location); static Node *transformIndirection(ParseState *pstate, Node *basenode, List *indirection); static Node *transformTypeCast(ParseState *pstate, TypeCast *tc); static Node *transformCollateClause(ParseState *pstate, CollateClause *c); static Node *make_row_comparison_op(ParseState *pstate, List *opname, List *largs, List *rargs, int location); static Node *make_row_distinct_op(ParseState *pstate, List *opname, RowExpr *lrow, RowExpr *rrow, int location); static Expr *make_distinct_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree, int location); static int operator_precedence_group(Node *node, const char **nodename); static void emit_precedence_warnings(ParseState *pstate, int opgroup, const char *opname, Node *lchild, Node *rchild, int location); /* * transformExpr - * Analyze and transform expressions. Type checking and type casting is * done here. This processing converts the raw grammar output into * expression trees with fully determined semantics. */ Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind) { Node *result; ParseExprKind sv_expr_kind; /* Save and restore identity of expression type we're parsing */ Assert(exprKind != EXPR_KIND_NONE); sv_expr_kind = pstate->p_expr_kind; pstate->p_expr_kind = exprKind; result = transformExprRecurse(pstate, expr); pstate->p_expr_kind = sv_expr_kind; return result; } static Node * transformExprRecurse(ParseState *pstate, Node *expr) { Node *result; if (expr == NULL) return NULL; /* Guard against stack overflow due to overly complex expressions */ check_stack_depth(); switch (nodeTag(expr)) { case T_ColumnRef: result = transformColumnRef(pstate, (ColumnRef *) expr); break; case T_ParamRef: result = transformParamRef(pstate, (ParamRef *) expr); break; case T_A_Const: { A_Const *con = (A_Const *) expr; Value *val = &con->val; result = (Node *) make_const(pstate, val, con->location); break; } case T_A_Indirection: { A_Indirection *ind = (A_Indirection *) expr; result = transformExprRecurse(pstate, ind->arg); result = transformIndirection(pstate, result, ind->indirection); break; } case T_A_ArrayExpr: result = transformArrayExpr(pstate, (A_ArrayExpr *) expr, InvalidOid, InvalidOid, -1); break; case T_TypeCast: result = transformTypeCast(pstate, (TypeCast *) expr); break; case T_CollateClause: result = transformCollateClause(pstate, (CollateClause *) expr); break; case T_A_Expr: { A_Expr *a = (A_Expr *) expr; switch (a->kind) { case AEXPR_OP: result = transformAExprOp(pstate, a); break; case AEXPR_OP_ANY: result = transformAExprOpAny(pstate, a); break; case AEXPR_OP_ALL: result = transformAExprOpAll(pstate, a); break; case AEXPR_DISTINCT: result = transformAExprDistinct(pstate, a); break; case AEXPR_NULLIF: result = transformAExprNullIf(pstate, a); break; case AEXPR_OF: result = transformAExprOf(pstate, a); break; case AEXPR_IN: result = transformAExprIn(pstate, a); break; case AEXPR_LIKE: case AEXPR_ILIKE: case AEXPR_SIMILAR: /* we can transform these just like AEXPR_OP */ result = transformAExprOp(pstate, a); break; case AEXPR_BETWEEN: case AEXPR_NOT_BETWEEN: case AEXPR_BETWEEN_SYM: case AEXPR_NOT_BETWEEN_SYM: result = transformAExprBetween(pstate, a); break; case AEXPR_PAREN: result = transformExprRecurse(pstate, a->lexpr); break; default: elog(ERROR, "unrecognized A_Expr kind: %d", a->kind); result = NULL; /* keep compiler quiet */ break; } break; } case T_BoolExpr: result = transformBoolExpr(pstate, (BoolExpr *) expr); break; case T_FuncCall: result = transformFuncCall(pstate, (FuncCall *) expr); break; case T_MultiAssignRef: result = transformMultiAssignRef(pstate, (MultiAssignRef *) expr); break; case T_GroupingFunc: result = transformGroupingFunc(pstate, (GroupingFunc *) expr); break; case T_NamedArgExpr: { NamedArgExpr *na = (NamedArgExpr *) expr; na->arg = (Expr *) transformExprRecurse(pstate, (Node *) na->arg); result = expr; break; } case T_SubLink: result = transformSubLink(pstate, (SubLink *) expr); break; case T_CaseExpr: result = transformCaseExpr(pstate, (CaseExpr *) expr); break; case T_RowExpr: result = transformRowExpr(pstate, (RowExpr *) expr); break; case T_CoalesceExpr: result = transformCoalesceExpr(pstate, (CoalesceExpr *) expr); break; case T_MinMaxExpr: result = transformMinMaxExpr(pstate, (MinMaxExpr *) expr); break; case T_XmlExpr: result = transformXmlExpr(pstate, (XmlExpr *) expr); break; case T_XmlSerialize: result = transformXmlSerialize(pstate, (XmlSerialize *) expr); break; case T_NullTest: { NullTest *n = (NullTest *) expr; if (operator_precedence_warning) emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_IS, "IS", (Node *) n->arg, NULL, n->location); n->arg = (Expr *) transformExprRecurse(pstate, (Node *) n->arg); /* the argument can be any type, so don't coerce it */ n->argisrow = type_is_rowtype(exprType((Node *) n->arg)); result = expr; break; } case T_BooleanTest: result = transformBooleanTest(pstate, (BooleanTest *) expr); break; case T_CurrentOfExpr: result = transformCurrentOfExpr(pstate, (CurrentOfExpr *) expr); break; /* * CaseTestExpr and SetToDefault don't require any processing; * they are only injected into parse trees in fully-formed state. * * Ordinarily we should not see a Var here, but it is convenient * for transformJoinUsingClause() to create untransformed operator * trees containing already-transformed Vars. The best * alternative would be to deconstruct and reconstruct column * references, which seems expensively pointless. So allow it. */ case T_CaseTestExpr: case T_SetToDefault: case T_Var: { result = (Node *) expr; break; } default: /* should not reach here */ elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr)); result = NULL; /* keep compiler quiet */ break; } return result; } /* * helper routine for delivering "column does not exist" error message * * (Usually we don't have to work this hard, but the general case of field * selection from an arbitrary node needs it.) */ static void unknown_attribute(ParseState *pstate, Node *relref, char *attname, int location) { RangeTblEntry *rte; if (IsA(relref, Var) && ((Var *) relref)->varattno == InvalidAttrNumber) { /* Reference the RTE by alias not by actual table name */ rte = GetRTEByRangeTablePosn(pstate, ((Var *) relref)->varno, ((Var *) relref)->varlevelsup); ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("column %s.%s does not exist", rte->eref->aliasname, attname), parser_errposition(pstate, location))); } else { /* Have to do it by reference to the type of the expression */ Oid relTypeId = exprType(relref); if (ISCOMPLEX(relTypeId)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("column \"%s\" not found in data type %s", attname, format_type_be(relTypeId)), parser_errposition(pstate, location))); else if (relTypeId == RECORDOID) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("could not identify column \"%s\" in record data type", attname), parser_errposition(pstate, location))); else ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("column notation .%s applied to type %s, " "which is not a composite type", attname, format_type_be(relTypeId)), parser_errposition(pstate, location))); } } static Node * transformIndirection(ParseState *pstate, Node *basenode, List *indirection) { Node *result = basenode; List *subscripts = NIL; int location = exprLocation(basenode); ListCell *i; /* * We have to split any field-selection operations apart from * subscripting. Adjacent A_Indices nodes have to be treated as a single * multidimensional subscript operation. */ foreach(i, indirection) { Node *n = lfirst(i); if (IsA(n, A_Indices)) subscripts = lappend(subscripts, n); else if (IsA(n, A_Star)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("row expansion via \"*\" is not supported here"), parser_errposition(pstate, location))); } else { Node *newresult; Assert(IsA(n, String)); /* process subscripts before this field selection */ if (subscripts) result = (Node *) transformArraySubscripts(pstate, result, exprType(result), InvalidOid, exprTypmod(result), subscripts, NULL); subscripts = NIL; newresult = ParseFuncOrColumn(pstate, list_make1(n), list_make1(result), NULL, location); if (newresult == NULL) unknown_attribute(pstate, result, strVal(n), location); result = newresult; } } /* process trailing subscripts, if any */ if (subscripts) result = (Node *) transformArraySubscripts(pstate, result, exprType(result), InvalidOid, exprTypmod(result), subscripts, NULL); return result; } /* * Transform a ColumnRef. * * If you find yourself changing this code, see also ExpandColumnRefStar. */ static Node * transformColumnRef(ParseState *pstate, ColumnRef *cref) { Node *node = NULL; char *nspname = NULL; char *relname = NULL; char *colname = NULL; RangeTblEntry *rte; int levels_up; enum { CRERR_NO_COLUMN, CRERR_NO_RTE, CRERR_WRONG_DB, CRERR_TOO_MANY } crerr = CRERR_NO_COLUMN; /* * Give the PreParseColumnRefHook, if any, first shot. If it returns * non-null then that's all, folks. */ if (pstate->p_pre_columnref_hook != NULL) { node = (*pstate->p_pre_columnref_hook) (pstate, cref); if (node != NULL) return node; } /*---------- * The allowed syntaxes are: * * A First try to resolve as unqualified column name; * if no luck, try to resolve as unqualified table name (A.*). * A.B A is an unqualified table name; B is either a * column or function name (trying column name first). * A.B.C schema A, table B, col or func name C. * A.B.C.D catalog A, schema B, table C, col or func D. * A.* A is an unqualified table name; means whole-row value. * A.B.* whole-row value of table B in schema A. * A.B.C.* whole-row value of table C in schema B in catalog A. * * We do not need to cope with bare "*"; that will only be accepted by * the grammar at the top level of a SELECT list, and transformTargetList * will take care of it before it ever gets here. Also, "A.*" etc will * be expanded by transformTargetList if they appear at SELECT top level, * so here we are only going to see them as function or operator inputs. * * Currently, if a catalog name is given then it must equal the current * database name; we check it here and then discard it. *---------- */ switch (list_length(cref->fields)) { case 1: { Node *field1 = (Node *) linitial(cref->fields); Assert(IsA(field1, String)); colname = strVal(field1); /* Try to identify as an unqualified column */ node = colNameToVar(pstate, colname, false, cref->location); if (node == NULL) { /* * Not known as a column of any range-table entry. * * Consider the possibility that it's VALUE in a domain * check expression. (We handle VALUE as a name, not a * keyword, to avoid breaking a lot of applications that * have used VALUE as a column name in the past.) */ if (pstate->p_value_substitute != NULL && strcmp(colname, "value") == 0) { node = (Node *) copyObject(pstate->p_value_substitute); /* * Try to propagate location knowledge. This should * be extended if p_value_substitute can ever take on * other node types. */ if (IsA(node, CoerceToDomainValue)) ((CoerceToDomainValue *) node)->location = cref->location; break; } /* * Try to find the name as a relation. Note that only * relations already entered into the rangetable will be * recognized. * * This is a hack for backwards compatibility with * PostQUEL-inspired syntax. The preferred form now is * "rel.*". */ rte = refnameRangeTblEntry(pstate, NULL, colname, cref->location, &levels_up); if (rte) node = transformWholeRowRef(pstate, rte, cref->location); } break; } case 2: { Node *field1 = (Node *) linitial(cref->fields); Node *field2 = (Node *) lsecond(cref->fields); Assert(IsA(field1, String)); relname = strVal(field1); /* Locate the referenced RTE */ rte = refnameRangeTblEntry(pstate, nspname, relname, cref->location, &levels_up); if (rte == NULL) { crerr = CRERR_NO_RTE; break; } /* Whole-row reference? */ if (IsA(field2, A_Star)) { node = transformWholeRowRef(pstate, rte, cref->location); break; } Assert(IsA(field2, String)); colname = strVal(field2); /* Try to identify as a column of the RTE */ node = scanRTEForColumn(pstate, rte, colname, cref->location, 0, NULL); if (node == NULL) { /* Try it as a function call on the whole row */ node = transformWholeRowRef(pstate, rte, cref->location); node = ParseFuncOrColumn(pstate, list_make1(makeString(colname)), list_make1(node), NULL, cref->location); } break; } case 3: { Node *field1 = (Node *) linitial(cref->fields); Node *field2 = (Node *) lsecond(cref->fields); Node *field3 = (Node *) lthird(cref->fields); Assert(IsA(field1, String)); nspname = strVal(field1); Assert(IsA(field2, String)); relname = strVal(field2); /* Locate the referenced RTE */ rte = refnameRangeTblEntry(pstate, nspname, relname, cref->location, &levels_up); if (rte == NULL) { crerr = CRERR_NO_RTE; break; } /* Whole-row reference? */ if (IsA(field3, A_Star)) { node = transformWholeRowRef(pstate, rte, cref->location); break; } Assert(IsA(field3, String)); colname = strVal(field3); /* Try to identify as a column of the RTE */ node = scanRTEForColumn(pstate, rte, colname, cref->location, 0, NULL); if (node == NULL) { /* Try it as a function call on the whole row */ node = transformWholeRowRef(pstate, rte, cref->location); node = ParseFuncOrColumn(pstate, list_make1(makeString(colname)), list_make1(node), NULL, cref->location); } break; } case 4: { Node *field1 = (Node *) linitial(cref->fields); Node *field2 = (Node *) lsecond(cref->fields); Node *field3 = (Node *) lthird(cref->fields); Node *field4 = (Node *) lfourth(cref->fields); char *catname; Assert(IsA(field1, String)); catname = strVal(field1); Assert(IsA(field2, String)); nspname = strVal(field2); Assert(IsA(field3, String)); relname = strVal(field3); /* * We check the catalog name and then ignore it. */ if (strcmp(catname, get_database_name(MyDatabaseId)) != 0) { crerr = CRERR_WRONG_DB; break; } /* Locate the referenced RTE */ rte = refnameRangeTblEntry(pstate, nspname, relname, cref->location, &levels_up); if (rte == NULL) { crerr = CRERR_NO_RTE; break; } /* Whole-row reference? */ if (IsA(field4, A_Star)) { node = transformWholeRowRef(pstate, rte, cref->location); break; } Assert(IsA(field4, String)); colname = strVal(field4); /* Try to identify as a column of the RTE */ node = scanRTEForColumn(pstate, rte, colname, cref->location, 0, NULL); if (node == NULL) { /* Try it as a function call on the whole row */ node = transformWholeRowRef(pstate, rte, cref->location); node = ParseFuncOrColumn(pstate, list_make1(makeString(colname)), list_make1(node), NULL, cref->location); } break; } default: crerr = CRERR_TOO_MANY; /* too many dotted names */ break; } /* * Now give the PostParseColumnRefHook, if any, a chance. We pass the * translation-so-far so that it can throw an error if it wishes in the * case that it has a conflicting interpretation of the ColumnRef. (If it * just translates anyway, we'll throw an error, because we can't undo * whatever effects the preceding steps may have had on the pstate.) If it * returns NULL, use the standard translation, or throw a suitable error * if there is none. */ if (pstate->p_post_columnref_hook != NULL) { Node *hookresult; hookresult = (*pstate->p_post_columnref_hook) (pstate, cref, node); if (node == NULL) node = hookresult; else if (hookresult != NULL) ereport(ERROR, (errcode(ERRCODE_AMBIGUOUS_COLUMN), errmsg("column reference \"%s\" is ambiguous", NameListToString(cref->fields)), parser_errposition(pstate, cref->location))); } /* * Throw error if no translation found. */ if (node == NULL) { switch (crerr) { case CRERR_NO_COLUMN: errorMissingColumn(pstate, relname, colname, cref->location); break; case CRERR_NO_RTE: errorMissingRTE(pstate, makeRangeVar(nspname, relname, cref->location)); break; case CRERR_WRONG_DB: ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cross-database references are not implemented: %s", NameListToString(cref->fields)), parser_errposition(pstate, cref->location))); break; case CRERR_TOO_MANY: ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("improper qualified name (too many dotted names): %s", NameListToString(cref->fields)), parser_errposition(pstate, cref->location))); break; } } return node; } static Node * transformParamRef(ParseState *pstate, ParamRef *pref) { Node *result; /* * The core parser knows nothing about Params. If a hook is supplied, * call it. If not, or if the hook returns NULL, throw a generic error. */ if (pstate->p_paramref_hook != NULL) result = (*pstate->p_paramref_hook) (pstate, pref); else result = NULL; if (result == NULL) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_PARAMETER), errmsg("there is no parameter $%d", pref->number), parser_errposition(pstate, pref->location))); return result; } /* Test whether an a_expr is a plain NULL constant or not */ static bool exprIsNullConstant(Node *arg) { if (arg && IsA(arg, A_Const)) { A_Const *con = (A_Const *) arg; if (con->val.type == T_Null) return true; } return false; } static Node * transformAExprOp(ParseState *pstate, A_Expr *a) { Node *lexpr = a->lexpr; Node *rexpr = a->rexpr; Node *result; if (operator_precedence_warning) { int opgroup; const char *opname; opgroup = operator_precedence_group((Node *) a, &opname); if (opgroup > 0) emit_precedence_warnings(pstate, opgroup, opname, lexpr, rexpr, a->location); } /* * Special-case "foo = NULL" and "NULL = foo" for compatibility with * standards-broken products (like Microsoft's). Turn these into IS NULL * exprs. (If either side is a CaseTestExpr, then the expression was * generated internally from a CASE-WHEN expression, and * transform_null_equals does not apply.) */ if (Transform_null_equals && list_length(a->name) == 1 && strcmp(strVal(linitial(a->name)), "=") == 0 && (exprIsNullConstant(lexpr) || exprIsNullConstant(rexpr)) && (!IsA(lexpr, CaseTestExpr) &&!IsA(rexpr, CaseTestExpr))) { NullTest *n = makeNode(NullTest); n->nulltesttype = IS_NULL; n->location = a->location; if (exprIsNullConstant(lexpr)) n->arg = (Expr *) rexpr; else n->arg = (Expr *) lexpr; result = transformExprRecurse(pstate, (Node *) n); } else if (lexpr && IsA(lexpr, RowExpr) && rexpr && IsA(rexpr, SubLink) && ((SubLink *) rexpr)->subLinkType == EXPR_SUBLINK) { /* * Convert "row op subselect" into a ROWCOMPARE sublink. Formerly the * grammar did this, but now that a row construct is allowed anywhere * in expressions, it's easier to do it here. */ SubLink *s = (SubLink *) rexpr; s->subLinkType = ROWCOMPARE_SUBLINK; s->testexpr = lexpr; s->operName = a->name; s->location = a->location; result = transformExprRecurse(pstate, (Node *) s); } else if (lexpr && IsA(lexpr, RowExpr) && rexpr && IsA(rexpr, RowExpr)) { /* ROW() op ROW() is handled specially */ lexpr = transformExprRecurse(pstate, lexpr); rexpr = transformExprRecurse(pstate, rexpr); Assert(IsA(lexpr, RowExpr)); Assert(IsA(rexpr, RowExpr)); result = make_row_comparison_op(pstate, a->name, ((RowExpr *) lexpr)->args, ((RowExpr *) rexpr)->args, a->location); } else { /* Ordinary scalar operator */ lexpr = transformExprRecurse(pstate, lexpr); rexpr = transformExprRecurse(pstate, rexpr); result = (Node *) make_op(pstate, a->name, lexpr, rexpr, a->location); } return result; } static Node * transformAExprOpAny(ParseState *pstate, A_Expr *a) { Node *lexpr = a->lexpr; Node *rexpr = a->rexpr; if (operator_precedence_warning) emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_OP, strVal(llast(a->name)), lexpr, NULL, a->location); lexpr = transformExprRecurse(pstate, lexpr); rexpr = transformExprRecurse(pstate, rexpr); return (Node *) make_scalar_array_op(pstate, a->name, true, lexpr, rexpr, a->location); } static Node * transformAExprOpAll(ParseState *pstate, A_Expr *a) { Node *lexpr = a->lexpr; Node *rexpr = a->rexpr; if (operator_precedence_warning) emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_OP, strVal(llast(a->name)), lexpr, NULL, a->location); lexpr = transformExprRecurse(pstate, lexpr); rexpr = transformExprRecurse(pstate, rexpr); return (Node *) make_scalar_array_op(pstate, a->name, false, lexpr, rexpr, a->location); } static Node * transformAExprDistinct(ParseState *pstate, A_Expr *a) { Node *lexpr = a->lexpr; Node *rexpr = a->rexpr; if (operator_precedence_warning) emit_precedence_warnings(pstate, PREC_GROUP_INFIX_IS, "IS", lexpr, rexpr, a->location); lexpr = transformExprRecurse(pstate, lexpr); rexpr = transformExprRecurse(pstate, rexpr); if (lexpr && IsA(lexpr, RowExpr) && rexpr && IsA(rexpr, RowExpr)) { /* ROW() op ROW() is handled specially */ return make_row_distinct_op(pstate, a->name, (RowExpr *) lexpr, (RowExpr *) rexpr, a->location); } else { /* Ordinary scalar operator */ return (Node *) make_distinct_op(pstate, a->name, lexpr, rexpr, a->location); } } static Node * transformAExprNullIf(ParseState *pstate, A_Expr *a) { Node *lexpr = transformExprRecurse(pstate, a->lexpr); Node *rexpr = transformExprRecurse(pstate, a->rexpr); OpExpr *result; result = (OpExpr *) make_op(pstate, a->name, lexpr, rexpr, a->location); /* * The comparison operator itself should yield boolean ... */ if (result->opresulttype != BOOLOID) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("NULLIF requires = operator to yield boolean"), parser_errposition(pstate, a->location))); /* * ... but the NullIfExpr will yield the first operand's type. */ result->opresulttype = exprType((Node *) linitial(result->args)); /* * We rely on NullIfExpr and OpExpr being the same struct */ NodeSetTag(result, T_NullIfExpr); return (Node *) result; } /* * Checking an expression for match to a list of type names. Will result * in a boolean constant node. */ static Node * transformAExprOf(ParseState *pstate, A_Expr *a) { Node *lexpr = a->lexpr; Const *result; ListCell *telem; Oid ltype, rtype; bool matched = false; if (operator_precedence_warning) emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_IS, "IS", lexpr, NULL, a->location); lexpr = transformExprRecurse(pstate, lexpr); ltype = exprType(lexpr); foreach(telem, (List *) a->rexpr) { rtype = typenameTypeId(pstate, lfirst(telem)); matched = (rtype == ltype); if (matched) break; } /* * We have two forms: equals or not equals. Flip the sense of the result * for not equals. */ if (strcmp(strVal(linitial(a->name)), "<>") == 0) matched = (!matched); result = (Const *) makeBoolConst(matched, false); /* Make the result have the original input's parse location */ result->location = exprLocation((Node *) a); return (Node *) result; } static Node * transformAExprIn(ParseState *pstate, A_Expr *a) { Node *result = NULL; Node *lexpr; List *rexprs; List *rvars; List *rnonvars; bool useOr; ListCell *l; /* * If the operator is <>, combine with AND not OR. */ if (strcmp(strVal(linitial(a->name)), "<>") == 0) useOr = false; else useOr = true; if (operator_precedence_warning) emit_precedence_warnings(pstate, useOr ? PREC_GROUP_IN : PREC_GROUP_NOT_IN, "IN", a->lexpr, NULL, a->location); /* * We try to generate a ScalarArrayOpExpr from IN/NOT IN, but this is only * possible if there is a suitable array type available. If not, we fall * back to a boolean condition tree with multiple copies of the lefthand * expression. Also, any IN-list items that contain Vars are handled as * separate boolean conditions, because that gives the planner more scope * for optimization on such clauses. * * First step: transform all the inputs, and detect whether any contain * Vars. */ lexpr = transformExprRecurse(pstate, a->lexpr); rexprs = rvars = rnonvars = NIL; foreach(l, (List *) a->rexpr) { Node *rexpr = transformExprRecurse(pstate, lfirst(l)); rexprs = lappend(rexprs, rexpr); if (contain_vars_of_level(rexpr, 0)) rvars = lappend(rvars, rexpr); else rnonvars = lappend(rnonvars, rexpr); } /* * ScalarArrayOpExpr is only going to be useful if there's more than one * non-Var righthand item. */ if (list_length(rnonvars) > 1) { List *allexprs; Oid scalar_type; Oid array_type; /* * Try to select a common type for the array elements. Note that * since the LHS' type is first in the list, it will be preferred when * there is doubt (eg, when all the RHS items are unknown literals). * * Note: use list_concat here not lcons, to avoid damaging rnonvars. */ allexprs = list_concat(list_make1(lexpr), rnonvars); scalar_type = select_common_type(pstate, allexprs, NULL, NULL); /* * Do we have an array type to use? Aside from the case where there * isn't one, we don't risk using ScalarArrayOpExpr when the common * type is RECORD, because the RowExpr comparison logic below can cope * with some cases of non-identical row types. */ if (OidIsValid(scalar_type) && scalar_type != RECORDOID) array_type = get_array_type(scalar_type); else array_type = InvalidOid; if (array_type != InvalidOid) { /* * OK: coerce all the right-hand non-Var inputs to the common type * and build an ArrayExpr for them. */ List *aexprs; ArrayExpr *newa; aexprs = NIL; foreach(l, rnonvars) { Node *rexpr = (Node *) lfirst(l); rexpr = coerce_to_common_type(pstate, rexpr, scalar_type, "IN"); aexprs = lappend(aexprs, rexpr); } newa = makeNode(ArrayExpr); newa->array_typeid = array_type; /* array_collid will be set by parse_collate.c */ newa->element_typeid = scalar_type; newa->elements = aexprs; newa->multidims = false; newa->location = -1; result = (Node *) make_scalar_array_op(pstate, a->name, useOr, lexpr, (Node *) newa, a->location); /* Consider only the Vars (if any) in the loop below */ rexprs = rvars; } } /* * Must do it the hard way, ie, with a boolean expression tree. */ foreach(l, rexprs) { Node *rexpr = (Node *) lfirst(l); Node *cmp; if (IsA(lexpr, RowExpr) && IsA(rexpr, RowExpr)) { /* ROW() op ROW() is handled specially */ cmp = make_row_comparison_op(pstate, a->name, (List *) copyObject(((RowExpr *) lexpr)->args), ((RowExpr *) rexpr)->args, a->location); } else { /* Ordinary scalar operator */ cmp = (Node *) make_op(pstate, a->name, copyObject(lexpr), rexpr, a->location); } cmp = coerce_to_boolean(pstate, cmp, "IN"); if (result == NULL) result = cmp; else result = (Node *) makeBoolExpr(useOr ? OR_EXPR : AND_EXPR, list_make2(result, cmp), a->location); } return result; } static Node * transformAExprBetween(ParseState *pstate, A_Expr *a) { Node *aexpr; Node *bexpr; Node *cexpr; Node *result; Node *sub1; Node *sub2; List *args; /* Deconstruct A_Expr into three subexprs */ aexpr = a->lexpr; Assert(IsA(a->rexpr, List)); args = (List *) a->rexpr; Assert(list_length(args) == 2); bexpr = (Node *) linitial(args); cexpr = (Node *) lsecond(args); if (operator_precedence_warning) { int opgroup; const char *opname; opgroup = operator_precedence_group((Node *) a, &opname); emit_precedence_warnings(pstate, opgroup, opname, aexpr, cexpr, a->location); /* We can ignore bexpr thanks to syntactic restrictions */ /* Wrap subexpressions to prevent extra warnings */ aexpr = (Node *) makeA_Expr(AEXPR_PAREN, NIL, aexpr, NULL, -1); bexpr = (Node *) makeA_Expr(AEXPR_PAREN, NIL, bexpr, NULL, -1); cexpr = (Node *) makeA_Expr(AEXPR_PAREN, NIL, cexpr, NULL, -1); } /* * Build the equivalent comparison expression. Make copies of * multiply-referenced subexpressions for safety. (XXX this is really * wrong since it results in multiple runtime evaluations of what may be * volatile expressions ...) * * Ideally we would not use hard-wired operators here but instead use * opclasses. However, mixed data types and other issues make this * difficult: * http://archives.postgresql.org/pgsql-hackers/2008-08/msg01142.php */ switch (a->kind) { case AEXPR_BETWEEN: args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=", aexpr, bexpr, a->location), makeSimpleA_Expr(AEXPR_OP, "<=", copyObject(aexpr), cexpr, a->location)); result = (Node *) makeBoolExpr(AND_EXPR, args, a->location); break; case AEXPR_NOT_BETWEEN: args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<", aexpr, bexpr, a->location), makeSimpleA_Expr(AEXPR_OP, ">", copyObject(aexpr), cexpr, a->location)); result = (Node *) makeBoolExpr(OR_EXPR, args, a->location); break; case AEXPR_BETWEEN_SYM: args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=", aexpr, bexpr, a->location), makeSimpleA_Expr(AEXPR_OP, "<=", copyObject(aexpr), cexpr, a->location)); sub1 = (Node *) makeBoolExpr(AND_EXPR, args, a->location); args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=", copyObject(aexpr), copyObject(cexpr), a->location), makeSimpleA_Expr(AEXPR_OP, "<=", copyObject(aexpr), copyObject(bexpr), a->location)); sub2 = (Node *) makeBoolExpr(AND_EXPR, args, a->location); args = list_make2(sub1, sub2); result = (Node *) makeBoolExpr(OR_EXPR, args, a->location); break; case AEXPR_NOT_BETWEEN_SYM: args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<", aexpr, bexpr, a->location), makeSimpleA_Expr(AEXPR_OP, ">", copyObject(aexpr), cexpr, a->location)); sub1 = (Node *) makeBoolExpr(OR_EXPR, args, a->location); args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<", copyObject(aexpr), copyObject(cexpr), a->location), makeSimpleA_Expr(AEXPR_OP, ">", copyObject(aexpr), copyObject(bexpr), a->location)); sub2 = (Node *) makeBoolExpr(OR_EXPR, args, a->location); args = list_make2(sub1, sub2); result = (Node *) makeBoolExpr(AND_EXPR, args, a->location); break; default: elog(ERROR, "unrecognized A_Expr kind: %d", a->kind); result = NULL; /* keep compiler quiet */ break; } return transformExprRecurse(pstate, result); } static Node * transformBoolExpr(ParseState *pstate, BoolExpr *a) { List *args = NIL; const char *opname; ListCell *lc; switch (a->boolop) { case AND_EXPR: opname = "AND"; break; case OR_EXPR: opname = "OR"; break; case NOT_EXPR: opname = "NOT"; break; default: elog(ERROR, "unrecognized boolop: %d", (int) a->boolop); opname = NULL; /* keep compiler quiet */ break; } foreach(lc, a->args) { Node *arg = (Node *) lfirst(lc); arg = transformExprRecurse(pstate, arg); arg = coerce_to_boolean(pstate, arg, opname); args = lappend(args, arg); } return (Node *) makeBoolExpr(a->boolop, args, a->location); } static Node * transformFuncCall(ParseState *pstate, FuncCall *fn) { List *targs; ListCell *args; /* Transform the list of arguments ... */ targs = NIL; foreach(args, fn->args) { targs = lappend(targs, transformExprRecurse(pstate, (Node *) lfirst(args))); } /* * When WITHIN GROUP is used, we treat its ORDER BY expressions as * additional arguments to the function, for purposes of function lookup * and argument type coercion. So, transform each such expression and add * them to the targs list. We don't explicitly mark where each argument * came from, but ParseFuncOrColumn can tell what's what by reference to * list_length(fn->agg_order). */ if (fn->agg_within_group) { Assert(fn->agg_order != NIL); foreach(args, fn->agg_order) { SortBy *arg = (SortBy *) lfirst(args); targs = lappend(targs, transformExpr(pstate, arg->node, EXPR_KIND_ORDER_BY)); } } /* ... and hand off to ParseFuncOrColumn */ return ParseFuncOrColumn(pstate, fn->funcname, targs, fn, fn->location); } static Node * transformMultiAssignRef(ParseState *pstate, MultiAssignRef *maref) { SubLink *sublink; Query *qtree; TargetEntry *tle; Param *param; /* We should only see this in first-stage processing of UPDATE tlists */ Assert(pstate->p_expr_kind == EXPR_KIND_UPDATE_SOURCE); /* We only need to transform the source if this is the first column */ if (maref->colno == 1) { sublink = (SubLink *) transformExprRecurse(pstate, maref->source); /* Currently, the grammar only allows a SubLink as source */ Assert(IsA(sublink, SubLink)); Assert(sublink->subLinkType == MULTIEXPR_SUBLINK); qtree = (Query *) sublink->subselect; Assert(IsA(qtree, Query)); /* Check subquery returns required number of columns */ if (count_nonjunk_tlist_entries(qtree->targetList) != maref->ncolumns) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("number of columns does not match number of values"), parser_errposition(pstate, sublink->location))); /* * Build a resjunk tlist item containing the MULTIEXPR SubLink, and * add it to pstate->p_multiassign_exprs, whence it will later get * appended to the completed targetlist. We needn't worry about * selecting a resno for it; transformUpdateStmt will do that. */ tle = makeTargetEntry((Expr *) sublink, 0, NULL, true); pstate->p_multiassign_exprs = lappend(pstate->p_multiassign_exprs, tle); /* * Assign a unique-within-this-targetlist ID to the MULTIEXPR SubLink. * We can just use its position in the p_multiassign_exprs list. */ sublink->subLinkId = list_length(pstate->p_multiassign_exprs); } else { /* * Second or later column in a multiassignment. Re-fetch the * transformed query, which we assume is still the last entry in * p_multiassign_exprs. */ Assert(pstate->p_multiassign_exprs != NIL); tle = (TargetEntry *) llast(pstate->p_multiassign_exprs); sublink = (SubLink *) tle->expr; Assert(IsA(sublink, SubLink)); Assert(sublink->subLinkType == MULTIEXPR_SUBLINK); qtree = (Query *) sublink->subselect; Assert(IsA(qtree, Query)); } /* Build a Param representing the appropriate subquery output column */ tle = (TargetEntry *) list_nth(qtree->targetList, maref->colno - 1); Assert(!tle->resjunk); param = makeNode(Param); param->paramkind = PARAM_MULTIEXPR; param->paramid = (sublink->subLinkId << 16) | maref->colno; param->paramtype = exprType((Node *) tle->expr); param->paramtypmod = exprTypmod((Node *) tle->expr); param->paramcollid = exprCollation((Node *) tle->expr); param->location = exprLocation((Node *) tle->expr); return (Node *) param; } static Node * transformCaseExpr(ParseState *pstate, CaseExpr *c) { CaseExpr *newc; Node *arg; CaseTestExpr *placeholder; List *newargs; List *resultexprs; ListCell *l; Node *defresult; Oid ptype; newc = makeNode(CaseExpr); /* transform the test expression, if any */ arg = transformExprRecurse(pstate, (Node *) c->arg); /* generate placeholder for test expression */ if (arg) { /* * If test expression is an untyped literal, force it to text. We have * to do something now because we won't be able to do this coercion on * the placeholder. This is not as flexible as what was done in 7.4 * and before, but it's good enough to handle the sort of silly coding * commonly seen. */ if (exprType(arg) == UNKNOWNOID) arg = coerce_to_common_type(pstate, arg, TEXTOID, "CASE"); /* * Run collation assignment on the test expression so that we know * what collation to mark the placeholder with. In principle we could * leave it to parse_collate.c to do that later, but propagating the * result to the CaseTestExpr would be unnecessarily complicated. */ assign_expr_collations(pstate, arg); placeholder = makeNode(CaseTestExpr); placeholder->typeId = exprType(arg); placeholder->typeMod = exprTypmod(arg); placeholder->collation = exprCollation(arg); } else placeholder = NULL; newc->arg = (Expr *) arg; /* transform the list of arguments */ newargs = NIL; resultexprs = NIL; foreach(l, c->args) { CaseWhen *w = (CaseWhen *) lfirst(l); CaseWhen *neww = makeNode(CaseWhen); Node *warg; Assert(IsA(w, CaseWhen)); warg = (Node *) w->expr; if (placeholder) { /* shorthand form was specified, so expand... */ warg = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (Node *) placeholder, warg, w->location); } neww->expr = (Expr *) transformExprRecurse(pstate, warg); neww->expr = (Expr *) coerce_to_boolean(pstate, (Node *) neww->expr, "CASE/WHEN"); warg = (Node *) w->result; neww->result = (Expr *) transformExprRecurse(pstate, warg); neww->location = w->location; newargs = lappend(newargs, neww); resultexprs = lappend(resultexprs, neww->result); } newc->args = newargs; /* transform the default clause */ defresult = (Node *) c->defresult; if (defresult == NULL) { A_Const *n = makeNode(A_Const); n->val.type = T_Null; n->location = -1; defresult = (Node *) n; } newc->defresult = (Expr *) transformExprRecurse(pstate, defresult); /* * Note: default result is considered the most significant type in * determining preferred type. This is how the code worked before, but it * seems a little bogus to me --- tgl */ resultexprs = lcons(newc->defresult, resultexprs); ptype = select_common_type(pstate, resultexprs, "CASE", NULL); Assert(OidIsValid(ptype)); newc->casetype = ptype; /* casecollid will be set by parse_collate.c */ /* Convert default result clause, if necessary */ newc->defresult = (Expr *) coerce_to_common_type(pstate, (Node *) newc->defresult, ptype, "CASE/ELSE"); /* Convert when-clause results, if necessary */ foreach(l, newc->args) { CaseWhen *w = (CaseWhen *) lfirst(l); w->result = (Expr *) coerce_to_common_type(pstate, (Node *) w->result, ptype, "CASE/WHEN"); } newc->location = c->location; return (Node *) newc; } static Node * transformSubLink(ParseState *pstate, SubLink *sublink) { Node *result = (Node *) sublink; Query *qtree; const char *err; /* * Check to see if the sublink is in an invalid place within the query. We * allow sublinks everywhere in SELECT/INSERT/UPDATE/DELETE, but generally * not in utility statements. */ err = NULL; switch (pstate->p_expr_kind) { case EXPR_KIND_NONE: Assert(false); /* can't happen */ break; case EXPR_KIND_OTHER: /* Accept sublink here; caller must throw error if wanted */ break; case EXPR_KIND_JOIN_ON: case EXPR_KIND_JOIN_USING: case EXPR_KIND_FROM_SUBSELECT: case EXPR_KIND_FROM_FUNCTION: case EXPR_KIND_WHERE: case EXPR_KIND_POLICY: case EXPR_KIND_HAVING: case EXPR_KIND_FILTER: case EXPR_KIND_WINDOW_PARTITION: case EXPR_KIND_WINDOW_ORDER: case EXPR_KIND_WINDOW_FRAME_RANGE: case EXPR_KIND_WINDOW_FRAME_ROWS: case EXPR_KIND_SELECT_TARGET: case EXPR_KIND_INSERT_TARGET: case EXPR_KIND_UPDATE_SOURCE: case EXPR_KIND_UPDATE_TARGET: case EXPR_KIND_GROUP_BY: case EXPR_KIND_ORDER_BY: case EXPR_KIND_DISTINCT_ON: case EXPR_KIND_LIMIT: case EXPR_KIND_OFFSET: case EXPR_KIND_RETURNING: case EXPR_KIND_VALUES: /* okay */ break; case EXPR_KIND_CHECK_CONSTRAINT: case EXPR_KIND_DOMAIN_CHECK: err = _("cannot use subquery in check constraint"); break; case EXPR_KIND_COLUMN_DEFAULT: case EXPR_KIND_FUNCTION_DEFAULT: err = _("cannot use subquery in DEFAULT expression"); break; case EXPR_KIND_INDEX_EXPRESSION: err = _("cannot use subquery in index expression"); break; case EXPR_KIND_INDEX_PREDICATE: err = _("cannot use subquery in index predicate"); break; case EXPR_KIND_ALTER_COL_TRANSFORM: err = _("cannot use subquery in transform expression"); break; case EXPR_KIND_EXECUTE_PARAMETER: err = _("cannot use subquery in EXECUTE parameter"); break; case EXPR_KIND_TRIGGER_WHEN: err = _("cannot use subquery in trigger WHEN condition"); break; /* * There is intentionally no default: case here, so that the * compiler will warn if we add a new ParseExprKind without * extending this switch. If we do see an unrecognized value at * runtime, the behavior will be the same as for EXPR_KIND_OTHER, * which is sane anyway. */ } if (err) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg_internal("%s", err), parser_errposition(pstate, sublink->location))); pstate->p_hasSubLinks = true; /* * OK, let's transform the sub-SELECT. */ qtree = parse_sub_analyze(sublink->subselect, pstate, NULL, false); /* * Check that we got something reasonable. Many of these conditions are * impossible given restrictions of the grammar, but check 'em anyway. */ if (!IsA(qtree, Query) || qtree->commandType != CMD_SELECT || qtree->utilityStmt != NULL) elog(ERROR, "unexpected non-SELECT command in SubLink"); sublink->subselect = (Node *) qtree; if (sublink->subLinkType == EXISTS_SUBLINK) { /* * EXISTS needs no test expression or combining operator. These fields * should be null already, but make sure. */ sublink->testexpr = NULL; sublink->operName = NIL; } else if (sublink->subLinkType == EXPR_SUBLINK || sublink->subLinkType == ARRAY_SUBLINK) { /* * Make sure the subselect delivers a single column (ignoring resjunk * targets). */ if (count_nonjunk_tlist_entries(qtree->targetList) != 1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("subquery must return only one column"), parser_errposition(pstate, sublink->location))); /* * EXPR and ARRAY need no test expression or combining operator. These * fields should be null already, but make sure. */ sublink->testexpr = NULL; sublink->operName = NIL; } else if (sublink->subLinkType == MULTIEXPR_SUBLINK) { /* Same as EXPR case, except no restriction on number of columns */ sublink->testexpr = NULL; sublink->operName = NIL; } else { /* ALL, ANY, or ROWCOMPARE: generate row-comparing expression */ Node *lefthand; List *left_list; List *right_list; ListCell *l; if (operator_precedence_warning) { if (sublink->operName == NIL) emit_precedence_warnings(pstate, PREC_GROUP_IN, "IN", sublink->testexpr, NULL, sublink->location); else emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_OP, strVal(llast(sublink->operName)), sublink->testexpr, NULL, sublink->location); } /* * If the source was "x IN (select)", convert to "x = ANY (select)". */ if (sublink->operName == NIL) sublink->operName = list_make1(makeString("=")); /* * Transform lefthand expression, and convert to a list */ lefthand = transformExprRecurse(pstate, sublink->testexpr); if (lefthand && IsA(lefthand, RowExpr)) left_list = ((RowExpr *) lefthand)->args; else left_list = list_make1(lefthand); /* * Build a list of PARAM_SUBLINK nodes representing the output columns * of the subquery. */ right_list = NIL; foreach(l, qtree->targetList) { TargetEntry *tent = (TargetEntry *) lfirst(l); Param *param; if (tent->resjunk) continue; param = makeNode(Param); param->paramkind = PARAM_SUBLINK; param->paramid = tent->resno; param->paramtype = exprType((Node *) tent->expr); param->paramtypmod = exprTypmod((Node *) tent->expr); param->paramcollid = exprCollation((Node *) tent->expr); param->location = -1; right_list = lappend(right_list, param); } /* * We could rely on make_row_comparison_op to complain if the list * lengths differ, but we prefer to generate a more specific error * message. */ if (list_length(left_list) < list_length(right_list)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("subquery has too many columns"), parser_errposition(pstate, sublink->location))); if (list_length(left_list) > list_length(right_list)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("subquery has too few columns"), parser_errposition(pstate, sublink->location))); /* * Identify the combining operator(s) and generate a suitable * row-comparison expression. */ sublink->testexpr = make_row_comparison_op(pstate, sublink->operName, left_list, right_list, sublink->location); } return result; } /* * transformArrayExpr * * If the caller specifies the target type, the resulting array will * be of exactly that type. Otherwise we try to infer a common type * for the elements using select_common_type(). */ static Node * transformArrayExpr(ParseState *pstate, A_ArrayExpr *a, Oid array_type, Oid element_type, int32 typmod) { ArrayExpr *newa = makeNode(ArrayExpr); List *newelems = NIL; List *newcoercedelems = NIL; ListCell *element; Oid coerce_type; bool coerce_hard; /* * Transform the element expressions * * Assume that the array is one-dimensional unless we find an array-type * element expression. */ newa->multidims = false; foreach(element, a->elements) { Node *e = (Node *) lfirst(element); Node *newe; /* * If an element is itself an A_ArrayExpr, recurse directly so that we * can pass down any target type we were given. */ if (IsA(e, A_ArrayExpr)) { newe = transformArrayExpr(pstate, (A_ArrayExpr *) e, array_type, element_type, typmod); /* we certainly have an array here */ Assert(array_type == InvalidOid || array_type == exprType(newe)); newa->multidims = true; } else { newe = transformExprRecurse(pstate, e); /* * Check for sub-array expressions, if we haven't already found * one. */ if (!newa->multidims && type_is_array(exprType(newe))) newa->multidims = true; } newelems = lappend(newelems, newe); } /* * Select a target type for the elements. * * If we haven't been given a target array type, we must try to deduce a * common type based on the types of the individual elements present. */ if (OidIsValid(array_type)) { /* Caller must ensure array_type matches element_type */ Assert(OidIsValid(element_type)); coerce_type = (newa->multidims ? array_type : element_type); coerce_hard = true; } else { /* Can't handle an empty array without a target type */ if (newelems == NIL) ereport(ERROR, (errcode(ERRCODE_INDETERMINATE_DATATYPE), errmsg("cannot determine type of empty array"), errhint("Explicitly cast to the desired type, " "for example ARRAY[]::integer[]."), parser_errposition(pstate, a->location))); /* Select a common type for the elements */ coerce_type = select_common_type(pstate, newelems, "ARRAY", NULL); if (newa->multidims) { array_type = coerce_type; element_type = get_element_type(array_type); if (!OidIsValid(element_type)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("could not find element type for data type %s", format_type_be(array_type)), parser_errposition(pstate, a->location))); } else { element_type = coerce_type; array_type = get_array_type(element_type); if (!OidIsValid(array_type)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("could not find array type for data type %s", format_type_be(element_type)), parser_errposition(pstate, a->location))); } coerce_hard = false; } /* * Coerce elements to target type * * If the array has been explicitly cast, then the elements are in turn * explicitly coerced. * * If the array's type was merely derived from the common type of its * elements, then the elements are implicitly coerced to the common type. * This is consistent with other uses of select_common_type(). */ foreach(element, newelems) { Node *e = (Node *) lfirst(element); Node *newe; if (coerce_hard) { newe = coerce_to_target_type(pstate, e, exprType(e), coerce_type, typmod, COERCION_EXPLICIT, COERCE_EXPLICIT_CAST, -1); if (newe == NULL) ereport(ERROR, (errcode(ERRCODE_CANNOT_COERCE), errmsg("cannot cast type %s to %s", format_type_be(exprType(e)), format_type_be(coerce_type)), parser_errposition(pstate, exprLocation(e)))); } else newe = coerce_to_common_type(pstate, e, coerce_type, "ARRAY"); newcoercedelems = lappend(newcoercedelems, newe); } newa->array_typeid = array_type; /* array_collid will be set by parse_collate.c */ newa->element_typeid = element_type; newa->elements = newcoercedelems; newa->location = a->location; return (Node *) newa; } static Node * transformRowExpr(ParseState *pstate, RowExpr *r) { RowExpr *newr; char fname[16]; int fnum; ListCell *lc; newr = makeNode(RowExpr); /* Transform the field expressions */ newr->args = transformExpressionList(pstate, r->args, pstate->p_expr_kind); /* Barring later casting, we consider the type RECORD */ newr->row_typeid = RECORDOID; newr->row_format = COERCE_IMPLICIT_CAST; /* ROW() has anonymous columns, so invent some field names */ newr->colnames = NIL; fnum = 1; foreach(lc, newr->args) { snprintf(fname, sizeof(fname), "f%d", fnum++); newr->colnames = lappend(newr->colnames, makeString(pstrdup(fname))); } newr->location = r->location; return (Node *) newr; } static Node * transformCoalesceExpr(ParseState *pstate, CoalesceExpr *c) { CoalesceExpr *newc = makeNode(CoalesceExpr); List *newargs = NIL; List *newcoercedargs = NIL; ListCell *args; foreach(args, c->args) { Node *e = (Node *) lfirst(args); Node *newe; newe = transformExprRecurse(pstate, e); newargs = lappend(newargs, newe); } newc->coalescetype = select_common_type(pstate, newargs, "COALESCE", NULL); /* coalescecollid will be set by parse_collate.c */ /* Convert arguments if necessary */ foreach(args, newargs) { Node *e = (Node *) lfirst(args); Node *newe; newe = coerce_to_common_type(pstate, e, newc->coalescetype, "COALESCE"); newcoercedargs = lappend(newcoercedargs, newe); } newc->args = newcoercedargs; newc->location = c->location; return (Node *) newc; } static Node * transformMinMaxExpr(ParseState *pstate, MinMaxExpr *m) { MinMaxExpr *newm = makeNode(MinMaxExpr); List *newargs = NIL; List *newcoercedargs = NIL; const char *funcname = (m->op == IS_GREATEST) ? "GREATEST" : "LEAST"; ListCell *args; newm->op = m->op; foreach(args, m->args) { Node *e = (Node *) lfirst(args); Node *newe; newe = transformExprRecurse(pstate, e); newargs = lappend(newargs, newe); } newm->minmaxtype = select_common_type(pstate, newargs, funcname, NULL); /* minmaxcollid and inputcollid will be set by parse_collate.c */ /* Convert arguments if necessary */ foreach(args, newargs) { Node *e = (Node *) lfirst(args); Node *newe; newe = coerce_to_common_type(pstate, e, newm->minmaxtype, funcname); newcoercedargs = lappend(newcoercedargs, newe); } newm->args = newcoercedargs; newm->location = m->location; return (Node *) newm; } static Node * transformXmlExpr(ParseState *pstate, XmlExpr *x) { XmlExpr *newx; ListCell *lc; int i; if (operator_precedence_warning && x->op == IS_DOCUMENT) emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_IS, "IS", (Node *) linitial(x->args), NULL, x->location); newx = makeNode(XmlExpr); newx->op = x->op; if (x->name) newx->name = map_sql_identifier_to_xml_name(x->name, false, false); else newx->name = NULL; newx->xmloption = x->xmloption; newx->type = XMLOID; /* this just marks the node as transformed */ newx->typmod = -1; newx->location = x->location; /* * gram.y built the named args as a list of ResTarget. Transform each, * and break the names out as a separate list. */ newx->named_args = NIL; newx->arg_names = NIL; foreach(lc, x->named_args) { ResTarget *r = (ResTarget *) lfirst(lc); Node *expr; char *argname; Assert(IsA(r, ResTarget)); expr = transformExprRecurse(pstate, r->val); if (r->name) argname = map_sql_identifier_to_xml_name(r->name, false, false); else if (IsA(r->val, ColumnRef)) argname = map_sql_identifier_to_xml_name(FigureColname(r->val), true, false); else { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), x->op == IS_XMLELEMENT ? errmsg("unnamed XML attribute value must be a column reference") : errmsg("unnamed XML element value must be a column reference"), parser_errposition(pstate, r->location))); argname = NULL; /* keep compiler quiet */ } /* reject duplicate argnames in XMLELEMENT only */ if (x->op == IS_XMLELEMENT) { ListCell *lc2; foreach(lc2, newx->arg_names) { if (strcmp(argname, strVal(lfirst(lc2))) == 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("XML attribute name \"%s\" appears more than once", argname), parser_errposition(pstate, r->location))); } } newx->named_args = lappend(newx->named_args, expr); newx->arg_names = lappend(newx->arg_names, makeString(argname)); } /* The other arguments are of varying types depending on the function */ newx->args = NIL; i = 0; foreach(lc, x->args) { Node *e = (Node *) lfirst(lc); Node *newe; newe = transformExprRecurse(pstate, e); switch (x->op) { case IS_XMLCONCAT: newe = coerce_to_specific_type(pstate, newe, XMLOID, "XMLCONCAT"); break; case IS_XMLELEMENT: /* no coercion necessary */ break; case IS_XMLFOREST: newe = coerce_to_specific_type(pstate, newe, XMLOID, "XMLFOREST"); break; case IS_XMLPARSE: if (i == 0) newe = coerce_to_specific_type(pstate, newe, TEXTOID, "XMLPARSE"); else newe = coerce_to_boolean(pstate, newe, "XMLPARSE"); break; case IS_XMLPI: newe = coerce_to_specific_type(pstate, newe, TEXTOID, "XMLPI"); break; case IS_XMLROOT: if (i == 0) newe = coerce_to_specific_type(pstate, newe, XMLOID, "XMLROOT"); else if (i == 1) newe = coerce_to_specific_type(pstate, newe, TEXTOID, "XMLROOT"); else newe = coerce_to_specific_type(pstate, newe, INT4OID, "XMLROOT"); break; case IS_XMLSERIALIZE: /* not handled here */ Assert(false); break; case IS_DOCUMENT: newe = coerce_to_specific_type(pstate, newe, XMLOID, "IS DOCUMENT"); break; } newx->args = lappend(newx->args, newe); i++; } return (Node *) newx; } static Node * transformXmlSerialize(ParseState *pstate, XmlSerialize *xs) { Node *result; XmlExpr *xexpr; Oid targetType; int32 targetTypmod; xexpr = makeNode(XmlExpr); xexpr->op = IS_XMLSERIALIZE; xexpr->args = list_make1(coerce_to_specific_type(pstate, transformExprRecurse(pstate, xs->expr), XMLOID, "XMLSERIALIZE")); typenameTypeIdAndMod(pstate, xs->typeName, &targetType, &targetTypmod); xexpr->xmloption = xs->xmloption; xexpr->location = xs->location; /* We actually only need these to be able to parse back the expression. */ xexpr->type = targetType; xexpr->typmod = targetTypmod; /* * The actual target type is determined this way. SQL allows char and * varchar as target types. We allow anything that can be cast implicitly * from text. This way, user-defined text-like data types automatically * fit in. */ result = coerce_to_target_type(pstate, (Node *) xexpr, TEXTOID, targetType, targetTypmod, COERCION_IMPLICIT, COERCE_IMPLICIT_CAST, -1); if (result == NULL) ereport(ERROR, (errcode(ERRCODE_CANNOT_COERCE), errmsg("cannot cast XMLSERIALIZE result to %s", format_type_be(targetType)), parser_errposition(pstate, xexpr->location))); return result; } static Node * transformBooleanTest(ParseState *pstate, BooleanTest *b) { const char *clausename; if (operator_precedence_warning) emit_precedence_warnings(pstate, PREC_GROUP_POSTFIX_IS, "IS", (Node *) b->arg, NULL, b->location); switch (b->booltesttype) { case IS_TRUE: clausename = "IS TRUE"; break; case IS_NOT_TRUE: clausename = "IS NOT TRUE"; break; case IS_FALSE: clausename = "IS FALSE"; break; case IS_NOT_FALSE: clausename = "IS NOT FALSE"; break; case IS_UNKNOWN: clausename = "IS UNKNOWN"; break; case IS_NOT_UNKNOWN: clausename = "IS NOT UNKNOWN"; break; default: elog(ERROR, "unrecognized booltesttype: %d", (int) b->booltesttype); clausename = NULL; /* keep compiler quiet */ } b->arg = (Expr *) transformExprRecurse(pstate, (Node *) b->arg); b->arg = (Expr *) coerce_to_boolean(pstate, (Node *) b->arg, clausename); return (Node *) b; } static Node * transformCurrentOfExpr(ParseState *pstate, CurrentOfExpr *cexpr) { int sublevels_up; /* CURRENT OF can only appear at top level of UPDATE/DELETE */ Assert(pstate->p_target_rangetblentry != NULL); cexpr->cvarno = RTERangeTablePosn(pstate, pstate->p_target_rangetblentry, &sublevels_up); Assert(sublevels_up == 0); /* * Check to see if the cursor name matches a parameter of type REFCURSOR. * If so, replace the raw name reference with a parameter reference. (This * is a hack for the convenience of plpgsql.) */ if (cexpr->cursor_name != NULL) /* in case already transformed */ { ColumnRef *cref = makeNode(ColumnRef); Node *node = NULL; /* Build an unqualified ColumnRef with the given name */ cref->fields = list_make1(makeString(cexpr->cursor_name)); cref->location = -1; /* See if there is a translation available from a parser hook */ if (pstate->p_pre_columnref_hook != NULL) node = (*pstate->p_pre_columnref_hook) (pstate, cref); if (node == NULL && pstate->p_post_columnref_hook != NULL) node = (*pstate->p_post_columnref_hook) (pstate, cref, NULL); /* * XXX Should we throw an error if we get a translation that isn't a * refcursor Param? For now it seems best to silently ignore false * matches. */ if (node != NULL && IsA(node, Param)) { Param *p = (Param *) node; if (p->paramkind == PARAM_EXTERN && p->paramtype == REFCURSOROID) { /* Matches, so convert CURRENT OF to a param reference */ cexpr->cursor_name = NULL; cexpr->cursor_param = p->paramid; } } } return (Node *) cexpr; } /* * Construct a whole-row reference to represent the notation "relation.*". */ static Node * transformWholeRowRef(ParseState *pstate, RangeTblEntry *rte, int location) { Var *result; int vnum; int sublevels_up; /* Find the RTE's rangetable location */ vnum = RTERangeTablePosn(pstate, rte, &sublevels_up); /* * Build the appropriate referencing node. Note that if the RTE is a * function returning scalar, we create just a plain reference to the * function value, not a composite containing a single column. This is * pretty inconsistent at first sight, but it's what we've done * historically. One argument for it is that "rel" and "rel.*" mean the * same thing for composite relations, so why not for scalar functions... */ result = makeWholeRowVar(rte, vnum, sublevels_up, true); /* location is not filled in by makeWholeRowVar */ result->location = location; /* mark relation as requiring whole-row SELECT access */ markVarForSelectPriv(pstate, result, rte); return (Node *) result; } /* * Handle an explicit CAST construct. * * Transform the argument, then look up the type name and apply any necessary * coercion function(s). */ static Node * transformTypeCast(ParseState *pstate, TypeCast *tc) { Node *result; Node *expr; Oid inputType; Oid targetType; int32 targetTypmod; int location; typenameTypeIdAndMod(pstate, tc->typeName, &targetType, &targetTypmod); /* * If the subject of the typecast is an ARRAY[] construct and the target * type is an array type, we invoke transformArrayExpr() directly so that * we can pass down the type information. This avoids some cases where * transformArrayExpr() might not infer the correct type. Otherwise, just * transform the argument normally. */ if (IsA(tc->arg, A_ArrayExpr)) { Oid targetBaseType; int32 targetBaseTypmod; Oid elementType; /* * If target is a domain over array, work with the base array type * here. Below, we'll cast the array type to the domain. In the * usual case that the target is not a domain, the remaining steps * will be a no-op. */ targetBaseTypmod = targetTypmod; targetBaseType = getBaseTypeAndTypmod(targetType, &targetBaseTypmod); elementType = get_element_type(targetBaseType); if (OidIsValid(elementType)) { expr = transformArrayExpr(pstate, (A_ArrayExpr *) tc->arg, targetBaseType, elementType, targetBaseTypmod); } else expr = transformExprRecurse(pstate, tc->arg); } else expr = transformExprRecurse(pstate, tc->arg); inputType = exprType(expr); if (inputType == InvalidOid) return expr; /* do nothing if NULL input */ /* * Location of the coercion is preferentially the location of the :: or * CAST symbol, but if there is none then use the location of the type * name (this can happen in TypeName 'string' syntax, for instance). */ location = tc->location; if (location < 0) location = tc->typeName->location; result = coerce_to_target_type(pstate, expr, inputType, targetType, targetTypmod, COERCION_EXPLICIT, COERCE_EXPLICIT_CAST, location); if (result == NULL) ereport(ERROR, (errcode(ERRCODE_CANNOT_COERCE), errmsg("cannot cast type %s to %s", format_type_be(inputType), format_type_be(targetType)), parser_coercion_errposition(pstate, location, expr))); return result; } /* * Handle an explicit COLLATE clause. * * Transform the argument, and look up the collation name. */ static Node * transformCollateClause(ParseState *pstate, CollateClause *c) { CollateExpr *newc; Oid argtype; newc = makeNode(CollateExpr); newc->arg = (Expr *) transformExprRecurse(pstate, c->arg); argtype = exprType((Node *) newc->arg); /* * The unknown type is not collatable, but coerce_type() takes care of it * separately, so we'll let it go here. */ if (!type_is_collatable(argtype) && argtype != UNKNOWNOID) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("collations are not supported by type %s", format_type_be(argtype)), parser_errposition(pstate, c->location))); newc->collOid = LookupCollation(pstate, c->collname, c->location); newc->location = c->location; return (Node *) newc; } /* * Transform a "row compare-op row" construct * * The inputs are lists of already-transformed expressions. * As with coerce_type, pstate may be NULL if no special unknown-Param * processing is wanted. * * The output may be a single OpExpr, an AND or OR combination of OpExprs, * or a RowCompareExpr. In all cases it is guaranteed to return boolean. * The AND, OR, and RowCompareExpr cases further imply things about the * behavior of the operators (ie, they behave as =, <>, or < <= > >=). */ static Node * make_row_comparison_op(ParseState *pstate, List *opname, List *largs, List *rargs, int location) { RowCompareExpr *rcexpr; RowCompareType rctype; List *opexprs; List *opnos; List *opfamilies; ListCell *l, *r; List **opinfo_lists; Bitmapset *strats; int nopers; int i; nopers = list_length(largs); if (nopers != list_length(rargs)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unequal number of entries in row expressions"), parser_errposition(pstate, location))); /* * We can't compare zero-length rows because there is no principled basis * for figuring out what the operator is. */ if (nopers == 0) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot compare rows of zero length"), parser_errposition(pstate, location))); /* * Identify all the pairwise operators, using make_op so that behavior is * the same as in the simple scalar case. */ opexprs = NIL; forboth(l, largs, r, rargs) { Node *larg = (Node *) lfirst(l); Node *rarg = (Node *) lfirst(r); OpExpr *cmp; cmp = (OpExpr *) make_op(pstate, opname, larg, rarg, location); Assert(IsA(cmp, OpExpr)); /* * We don't use coerce_to_boolean here because we insist on the * operator yielding boolean directly, not via coercion. If it * doesn't yield bool it won't be in any index opfamilies... */ if (cmp->opresulttype != BOOLOID) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("row comparison operator must yield type boolean, " "not type %s", format_type_be(cmp->opresulttype)), parser_errposition(pstate, location))); if (expression_returns_set((Node *) cmp)) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("row comparison operator must not return a set"), parser_errposition(pstate, location))); opexprs = lappend(opexprs, cmp); } /* * If rows are length 1, just return the single operator. In this case we * don't insist on identifying btree semantics for the operator (but we * still require it to return boolean). */ if (nopers == 1) return (Node *) linitial(opexprs); /* * Now we must determine which row comparison semantics (= <> < <= > >=) * apply to this set of operators. We look for btree opfamilies * containing the operators, and see which interpretations (strategy * numbers) exist for each operator. */ opinfo_lists = (List **) palloc(nopers * sizeof(List *)); strats = NULL; i = 0; foreach(l, opexprs) { Oid opno = ((OpExpr *) lfirst(l))->opno; Bitmapset *this_strats; ListCell *j; opinfo_lists[i] = get_op_btree_interpretation(opno); /* * convert strategy numbers into a Bitmapset to make the intersection * calculation easy. */ this_strats = NULL; foreach(j, opinfo_lists[i]) { OpBtreeInterpretation *opinfo = lfirst(j); this_strats = bms_add_member(this_strats, opinfo->strategy); } if (i == 0) strats = this_strats; else strats = bms_int_members(strats, this_strats); i++; } /* * If there are multiple common interpretations, we may use any one of * them ... this coding arbitrarily picks the lowest btree strategy * number. */ i = bms_first_member(strats); if (i < 0) { /* No common interpretation, so fail */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("could not determine interpretation of row comparison operator %s", strVal(llast(opname))), errhint("Row comparison operators must be associated with btree operator families."), parser_errposition(pstate, location))); } rctype = (RowCompareType) i; /* * For = and <> cases, we just combine the pairwise operators with AND or * OR respectively. */ if (rctype == ROWCOMPARE_EQ) return (Node *) makeBoolExpr(AND_EXPR, opexprs, location); if (rctype == ROWCOMPARE_NE) return (Node *) makeBoolExpr(OR_EXPR, opexprs, location); /* * Otherwise we need to choose exactly which opfamily to associate with * each operator. */ opfamilies = NIL; for (i = 0; i < nopers; i++) { Oid opfamily = InvalidOid; ListCell *j; foreach(j, opinfo_lists[i]) { OpBtreeInterpretation *opinfo = lfirst(j); if (opinfo->strategy == rctype) { opfamily = opinfo->opfamily_id; break; } } if (OidIsValid(opfamily)) opfamilies = lappend_oid(opfamilies, opfamily); else /* should not happen */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("could not determine interpretation of row comparison operator %s", strVal(llast(opname))), errdetail("There are multiple equally-plausible candidates."), parser_errposition(pstate, location))); } /* * Now deconstruct the OpExprs and create a RowCompareExpr. * * Note: can't just reuse the passed largs/rargs lists, because of * possibility that make_op inserted coercion operations. */ opnos = NIL; largs = NIL; rargs = NIL; foreach(l, opexprs) { OpExpr *cmp = (OpExpr *) lfirst(l); opnos = lappend_oid(opnos, cmp->opno); largs = lappend(largs, linitial(cmp->args)); rargs = lappend(rargs, lsecond(cmp->args)); } rcexpr = makeNode(RowCompareExpr); rcexpr->rctype = rctype; rcexpr->opnos = opnos; rcexpr->opfamilies = opfamilies; rcexpr->inputcollids = NIL; /* assign_expr_collations will fix this */ rcexpr->largs = largs; rcexpr->rargs = rargs; return (Node *) rcexpr; } /* * Transform a "row IS DISTINCT FROM row" construct * * The input RowExprs are already transformed */ static Node * make_row_distinct_op(ParseState *pstate, List *opname, RowExpr *lrow, RowExpr *rrow, int location) { Node *result = NULL; List *largs = lrow->args; List *rargs = rrow->args; ListCell *l, *r; if (list_length(largs) != list_length(rargs)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unequal number of entries in row expressions"), parser_errposition(pstate, location))); forboth(l, largs, r, rargs) { Node *larg = (Node *) lfirst(l); Node *rarg = (Node *) lfirst(r); Node *cmp; cmp = (Node *) make_distinct_op(pstate, opname, larg, rarg, location); if (result == NULL) result = cmp; else result = (Node *) makeBoolExpr(OR_EXPR, list_make2(result, cmp), location); } if (result == NULL) { /* zero-length rows? Generate constant FALSE */ result = makeBoolConst(false, false); } return result; } /* * make the node for an IS DISTINCT FROM operator */ static Expr * make_distinct_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree, int location) { Expr *result; result = make_op(pstate, opname, ltree, rtree, location); if (((OpExpr *) result)->opresulttype != BOOLOID) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("IS DISTINCT FROM requires = operator to yield boolean"), parser_errposition(pstate, location))); /* * We rely on DistinctExpr and OpExpr being same struct */ NodeSetTag(result, T_DistinctExpr); return result; } /* * Identify node's group for operator precedence warnings * * For items in nonzero groups, also return a suitable node name into *nodename * * Note: group zero is used for nodes that are higher or lower precedence * than everything that changed precedence; we need never issue warnings * related to such nodes. */ static int operator_precedence_group(Node *node, const char **nodename) { int group = 0; *nodename = NULL; if (node == NULL) return 0; if (IsA(node, A_Expr)) { A_Expr *aexpr = (A_Expr *) node; if (aexpr->kind == AEXPR_OP && aexpr->lexpr != NULL && aexpr->rexpr != NULL) { /* binary operator */ if (list_length(aexpr->name) == 1) { *nodename = strVal(linitial(aexpr->name)); /* Ignore if op was always higher priority than IS-tests */ if (strcmp(*nodename, "+") == 0 || strcmp(*nodename, "-") == 0 || strcmp(*nodename, "*") == 0 || strcmp(*nodename, "/") == 0 || strcmp(*nodename, "%") == 0 || strcmp(*nodename, "^") == 0) group = 0; else if (strcmp(*nodename, "<") == 0 || strcmp(*nodename, ">") == 0) group = PREC_GROUP_LESS; else if (strcmp(*nodename, "=") == 0) group = PREC_GROUP_EQUAL; else if (strcmp(*nodename, "<=") == 0 || strcmp(*nodename, ">=") == 0 || strcmp(*nodename, "<>") == 0) group = PREC_GROUP_LESS_EQUAL; else group = PREC_GROUP_INFIX_OP; } else { /* schema-qualified operator syntax */ *nodename = "OPERATOR()"; group = PREC_GROUP_INFIX_OP; } } else if (aexpr->kind == AEXPR_OP && aexpr->lexpr == NULL && aexpr->rexpr != NULL) { /* prefix operator */ if (list_length(aexpr->name) == 1) { *nodename = strVal(linitial(aexpr->name)); /* Ignore if op was always higher priority than IS-tests */ if (strcmp(*nodename, "+") == 0 || strcmp(*nodename, "-")) group = 0; else group = PREC_GROUP_PREFIX_OP; } else { /* schema-qualified operator syntax */ *nodename = "OPERATOR()"; group = PREC_GROUP_PREFIX_OP; } } else if (aexpr->kind == AEXPR_OP && aexpr->lexpr != NULL && aexpr->rexpr == NULL) { /* postfix operator */ if (list_length(aexpr->name) == 1) { *nodename = strVal(linitial(aexpr->name)); group = PREC_GROUP_POSTFIX_OP; } else { /* schema-qualified operator syntax */ *nodename = "OPERATOR()"; group = PREC_GROUP_POSTFIX_OP; } } else if (aexpr->kind == AEXPR_OP_ANY || aexpr->kind == AEXPR_OP_ALL) { *nodename = strVal(llast(aexpr->name)); group = PREC_GROUP_POSTFIX_OP; } else if (aexpr->kind == AEXPR_DISTINCT) { *nodename = "IS"; group = PREC_GROUP_INFIX_IS; } else if (aexpr->kind == AEXPR_OF) { *nodename = "IS"; group = PREC_GROUP_POSTFIX_IS; } else if (aexpr->kind == AEXPR_IN) { *nodename = "IN"; if (strcmp(strVal(linitial(aexpr->name)), "=") == 0) group = PREC_GROUP_IN; else group = PREC_GROUP_NOT_IN; } else if (aexpr->kind == AEXPR_LIKE) { *nodename = "LIKE"; if (strcmp(strVal(linitial(aexpr->name)), "~~") == 0) group = PREC_GROUP_LIKE; else group = PREC_GROUP_NOT_LIKE; } else if (aexpr->kind == AEXPR_ILIKE) { *nodename = "ILIKE"; if (strcmp(strVal(linitial(aexpr->name)), "~~*") == 0) group = PREC_GROUP_LIKE; else group = PREC_GROUP_NOT_LIKE; } else if (aexpr->kind == AEXPR_SIMILAR) { *nodename = "SIMILAR"; if (strcmp(strVal(linitial(aexpr->name)), "~") == 0) group = PREC_GROUP_LIKE; else group = PREC_GROUP_NOT_LIKE; } else if (aexpr->kind == AEXPR_BETWEEN || aexpr->kind == AEXPR_BETWEEN_SYM) { Assert(list_length(aexpr->name) == 1); *nodename = strVal(linitial(aexpr->name)); group = PREC_GROUP_BETWEEN; } else if (aexpr->kind == AEXPR_NOT_BETWEEN || aexpr->kind == AEXPR_NOT_BETWEEN_SYM) { Assert(list_length(aexpr->name) == 1); *nodename = strVal(linitial(aexpr->name)); group = PREC_GROUP_NOT_BETWEEN; } } else if (IsA(node, NullTest) || IsA(node, BooleanTest)) { *nodename = "IS"; group = PREC_GROUP_POSTFIX_IS; } else if (IsA(node, XmlExpr)) { XmlExpr *x = (XmlExpr *) node; if (x->op == IS_DOCUMENT) { *nodename = "IS"; group = PREC_GROUP_POSTFIX_IS; } } else if (IsA(node, SubLink)) { SubLink *s = (SubLink *) node; if (s->subLinkType == ANY_SUBLINK || s->subLinkType == ALL_SUBLINK) { if (s->operName == NIL) { *nodename = "IN"; group = PREC_GROUP_IN; } else { *nodename = strVal(llast(s->operName)); group = PREC_GROUP_POSTFIX_OP; } } } else if (IsA(node, BoolExpr)) { /* * Must dig into NOTs to see if it's IS NOT DOCUMENT or NOT IN. This * opens us to possibly misrecognizing, eg, NOT (x IS DOCUMENT) as a * problematic construct. We can tell the difference by checking * whether the parse locations of the two nodes are identical. * * Note that when we are comparing the child node to its own children, * we will not know that it was a NOT. Fortunately, that doesn't * matter for these cases. */ BoolExpr *b = (BoolExpr *) node; if (b->boolop == NOT_EXPR) { Node *child = (Node *) linitial(b->args); if (IsA(child, XmlExpr)) { XmlExpr *x = (XmlExpr *) child; if (x->op == IS_DOCUMENT && x->location == b->location) { *nodename = "IS"; group = PREC_GROUP_POSTFIX_IS; } } else if (IsA(child, SubLink)) { SubLink *s = (SubLink *) child; if (s->subLinkType == ANY_SUBLINK && s->operName == NIL && s->location == b->location) { *nodename = "IN"; group = PREC_GROUP_NOT_IN; } } } } return group; } /* * helper routine for delivering 9.4-to-9.5 operator precedence warnings * * opgroup/opname/location represent some parent node * lchild, rchild are its left and right children (either could be NULL) * * This should be called before transforming the child nodes, since if a * precedence-driven parsing change has occurred in a query that used to work, * it's quite possible that we'll get a semantic failure while analyzing the * child expression. We want to produce the warning before that happens. * In any case, operator_precedence_group() expects untransformed input. */ static void emit_precedence_warnings(ParseState *pstate, int opgroup, const char *opname, Node *lchild, Node *rchild, int location) { int cgroup; const char *copname; Assert(opgroup > 0); /* * Complain if left child, which should be same or higher precedence * according to current rules, used to be lower precedence. * * Exception to precedence rules: if left child is IN or NOT IN or a * postfix operator, the grouping is syntactically forced regardless of * precedence. */ cgroup = operator_precedence_group(lchild, &copname); if (cgroup > 0) { if (oldprecedence_l[cgroup] < oldprecedence_r[opgroup] && cgroup != PREC_GROUP_IN && cgroup != PREC_GROUP_NOT_IN && cgroup != PREC_GROUP_POSTFIX_OP && cgroup != PREC_GROUP_POSTFIX_IS) ereport(WARNING, (errmsg("operator precedence change: %s is now lower precedence than %s", opname, copname), parser_errposition(pstate, location))); } /* * Complain if right child, which should be higher precedence according to * current rules, used to be same or lower precedence. * * Exception to precedence rules: if right child is a prefix operator, the * grouping is syntactically forced regardless of precedence. */ cgroup = operator_precedence_group(rchild, &copname); if (cgroup > 0) { if (oldprecedence_r[cgroup] <= oldprecedence_l[opgroup] && cgroup != PREC_GROUP_PREFIX_OP) ereport(WARNING, (errmsg("operator precedence change: %s is now lower precedence than %s", opname, copname), parser_errposition(pstate, location))); } } /* * Produce a string identifying an expression by kind. * * Note: when practical, use a simple SQL keyword for the result. If that * doesn't work well, check call sites to see whether custom error message * strings are required. */ const char * ParseExprKindName(ParseExprKind exprKind) { switch (exprKind) { case EXPR_KIND_NONE: return "invalid expression context"; case EXPR_KIND_OTHER: return "extension expression"; case EXPR_KIND_JOIN_ON: return "JOIN/ON"; case EXPR_KIND_JOIN_USING: return "JOIN/USING"; case EXPR_KIND_FROM_SUBSELECT: return "sub-SELECT in FROM"; case EXPR_KIND_FROM_FUNCTION: return "function in FROM"; case EXPR_KIND_WHERE: return "WHERE"; case EXPR_KIND_POLICY: return "POLICY"; case EXPR_KIND_HAVING: return "HAVING"; case EXPR_KIND_FILTER: return "FILTER"; case EXPR_KIND_WINDOW_PARTITION: return "window PARTITION BY"; case EXPR_KIND_WINDOW_ORDER: return "window ORDER BY"; case EXPR_KIND_WINDOW_FRAME_RANGE: return "window RANGE"; case EXPR_KIND_WINDOW_FRAME_ROWS: return "window ROWS"; case EXPR_KIND_SELECT_TARGET: return "SELECT"; case EXPR_KIND_INSERT_TARGET: return "INSERT"; case EXPR_KIND_UPDATE_SOURCE: case EXPR_KIND_UPDATE_TARGET: return "UPDATE"; case EXPR_KIND_GROUP_BY: return "GROUP BY"; case EXPR_KIND_ORDER_BY: return "ORDER BY"; case EXPR_KIND_DISTINCT_ON: return "DISTINCT ON"; case EXPR_KIND_LIMIT: return "LIMIT"; case EXPR_KIND_OFFSET: return "OFFSET"; case EXPR_KIND_RETURNING: return "RETURNING"; case EXPR_KIND_VALUES: return "VALUES"; case EXPR_KIND_CHECK_CONSTRAINT: case EXPR_KIND_DOMAIN_CHECK: return "CHECK"; case EXPR_KIND_COLUMN_DEFAULT: case EXPR_KIND_FUNCTION_DEFAULT: return "DEFAULT"; case EXPR_KIND_INDEX_EXPRESSION: return "index expression"; case EXPR_KIND_INDEX_PREDICATE: return "index predicate"; case EXPR_KIND_ALTER_COL_TRANSFORM: return "USING"; case EXPR_KIND_EXECUTE_PARAMETER: return "EXECUTE"; case EXPR_KIND_TRIGGER_WHEN: return "WHEN"; /* * There is intentionally no default: case here, so that the * compiler will warn if we add a new ParseExprKind without * extending this switch. If we do see an unrecognized value at * runtime, we'll fall through to the "unrecognized" return. */ } return "unrecognized expression kind"; }