static av_cold int vdadec_init(AVCodecContext *avctx) { VDADecoderContext *ctx = avctx->priv_data; struct vda_context *vda_ctx = &ctx->vda_ctx; OSStatus status; int ret; ctx->h264_initialized = 0; /* init pix_fmts of codec */ if (!ff_h264_vda_decoder.pix_fmts) { if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber10_7) ff_h264_vda_decoder.pix_fmts = vda_pixfmts_prior_10_7; else ff_h264_vda_decoder.pix_fmts = vda_pixfmts; } /* init vda */ memset(vda_ctx, 0, sizeof(struct vda_context)); vda_ctx->width = avctx->width; vda_ctx->height = avctx->height; vda_ctx->format = 'avc1'; vda_ctx->use_sync_decoding = 1; vda_ctx->use_ref_buffer = 1; ctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); switch (ctx->pix_fmt) { case AV_PIX_FMT_UYVY422: vda_ctx->cv_pix_fmt_type = '2vuy'; break; case AV_PIX_FMT_YUYV422: vda_ctx->cv_pix_fmt_type = 'yuvs'; break; case AV_PIX_FMT_NV12: vda_ctx->cv_pix_fmt_type = '420v'; break; case AV_PIX_FMT_YUV420P: vda_ctx->cv_pix_fmt_type = 'y420'; break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format: %d\n", avctx->pix_fmt); goto failed; } status = ff_vda_create_decoder(vda_ctx, avctx->extradata, avctx->extradata_size); if (status != kVDADecoderNoErr) { av_log(avctx, AV_LOG_ERROR, "Failed to init VDA decoder: %d.\n", status); goto failed; } avctx->hwaccel_context = vda_ctx; /* changes callback functions */ avctx->get_format = get_format; avctx->get_buffer2 = get_buffer2; #if FF_API_GET_BUFFER // force the old get_buffer to be empty avctx->get_buffer = NULL; #endif /* init H.264 decoder */ ret = ff_h264_decoder.init(avctx); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to open H.264 decoder.\n"); goto failed; } ctx->h264_initialized = 1; return 0; failed: vdadec_close(avctx); return -1; }


int _gnutls_ciphertext2compressed(gnutls_session_t session,
				  opaque * compress_data,
				  int compress_size,
				  gnutls_datum_t ciphertext, uint8 type)
{
    uint8 MAC[MAX_HASH_SIZE];
    uint16 c_length;
    uint8 pad;
    int length;
    mac_hd_t td;
    uint16 blocksize;
    int ret, i, pad_failed = 0;
    uint8 major, minor;
    gnutls_protocol_t ver;
    int hash_size =
	_gnutls_hash_get_algo_len(session->security_parameters.
				  read_mac_algorithm);

    ver = gnutls_protocol_get_version(session);
    minor = _gnutls_version_get_minor(ver);
    major = _gnutls_version_get_major(ver);

    blocksize = _gnutls_cipher_get_block_size(session->security_parameters.
					      read_bulk_cipher_algorithm);

    /* initialize MAC
     */
    td = mac_init(session->security_parameters.read_mac_algorithm,
		  session->connection_state.read_mac_secret.data,
		  session->connection_state.read_mac_secret.size, ver);

    if (td == GNUTLS_MAC_FAILED
	&& session->security_parameters.read_mac_algorithm !=
	GNUTLS_MAC_NULL) {
	gnutls_assert();
	return GNUTLS_E_INTERNAL_ERROR;
    }

    /* actual decryption (inplace)
     */
    switch (_gnutls_cipher_is_block
	    (session->security_parameters.read_bulk_cipher_algorithm)) {
    case CIPHER_STREAM:
	if ((ret = _gnutls_cipher_decrypt(session->connection_state.
					  read_cipher_state,
					  ciphertext.data,
					  ciphertext.size)) < 0) {
	    gnutls_assert();
	    return ret;
	}

	length = ciphertext.size - hash_size;

	break;
    case CIPHER_BLOCK:
	if ((ciphertext.size < blocksize)
	    || (ciphertext.size % blocksize != 0)) {
	    gnutls_assert();
	    return GNUTLS_E_DECRYPTION_FAILED;
	}

	if ((ret = _gnutls_cipher_decrypt(session->connection_state.
					  read_cipher_state,
					  ciphertext.data,
					  ciphertext.size)) < 0) {
	    gnutls_assert();
	    return ret;
	}

	/* ignore the IV in TLS 1.1.
	 */
	if (session->security_parameters.version >= GNUTLS_TLS1_1) {
	    ciphertext.size -= blocksize;
	    ciphertext.data += blocksize;

	    if (ciphertext.size == 0) {
		gnutls_assert();
		return GNUTLS_E_DECRYPTION_FAILED;
	    }
	}

	pad = ciphertext.data[ciphertext.size - 1] + 1;	/* pad */

	length = ciphertext.size - hash_size - pad;

	if (pad > ciphertext.size - hash_size) {
	    gnutls_assert();
	    /* We do not fail here. We check below for the
	     * the pad_failed. If zero means success.
	     */
	    pad_failed = GNUTLS_E_DECRYPTION_FAILED;
	}

	/* Check the pading bytes (TLS 1.x)
	 */
	if (ver >= GNUTLS_TLS1)
	    for (i = 2; i < pad; i++) {
		if (ciphertext.data[ciphertext.size - i] !=
		    ciphertext.data[ciphertext.size - 1])
		    pad_failed = GNUTLS_E_DECRYPTION_FAILED;
	    }

	break;
    default:
	gnutls_assert();
	return GNUTLS_E_INTERNAL_ERROR;
    }

    if (length < 0)
	length = 0;
    c_length = _gnutls_conv_uint16((uint16) length);

    /* Pass the type, version, length and compressed through
     * MAC.
     */
    if (td != GNUTLS_MAC_FAILED) {
	_gnutls_hmac(td,
		     UINT64DATA(session->connection_state.
				read_sequence_number), 8);

	_gnutls_hmac(td, &type, 1);
	if (ver >= GNUTLS_TLS1) {	/* TLS 1.x */
	    _gnutls_hmac(td, &major, 1);
	    _gnutls_hmac(td, &minor, 1);
	}
	_gnutls_hmac(td, &c_length, 2);

	if (length > 0)
	    _gnutls_hmac(td, ciphertext.data, length);

	mac_deinit(td, MAC, ver);
    }

    /* This one was introduced to avoid a timing attack against the TLS
     * 1.0 protocol.
     */
    if (pad_failed != 0)
	return pad_failed;

    /* HMAC was not the same.
     */
    if (memcmp(MAC, &ciphertext.data[length], hash_size) != 0) {
	gnutls_assert();
	return GNUTLS_E_DECRYPTION_FAILED;
    }

    /* copy the decrypted stuff to compress_data.
     */
    if (compress_size < length) {
	gnutls_assert();
	return GNUTLS_E_INTERNAL_ERROR;
    }
    memcpy(compress_data, ciphertext.data, length);

    return length;
}


glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
                             uint8_t *dst,const uint8_t *src,
                             int dstpitch,int srcpitch,
                             int bltwidth,int bltheight)
{
    int x,y;
    dstpitch -= bltwidth;
    srcpitch -= bltwidth;
    for (y = 0; y < bltheight; y++) {
        for (x = 0; x < bltwidth; x++) {
            ROP_OP(*dst, *src);
            dst++;
            src++;
        }
        dst += dstpitch;
        src += srcpitch;
    }
}


static int intel_pmu_handle_irq(struct pt_regs *regs)
{
	struct perf_sample_data data;
	struct cpu_hw_events *cpuc;
	int bit, loops;
	u64 status;
	int handled;

	perf_sample_data_init(&data, 0);

	cpuc = &__get_cpu_var(cpu_hw_events);

	/*
	 * Some chipsets need to unmask the LVTPC in a particular spot
	 * inside the nmi handler.  As a result, the unmasking was pushed
	 * into all the nmi handlers.
	 *
	 * This handler doesn't seem to have any issues with the unmasking
	 * so it was left at the top.
	 */
	apic_write(APIC_LVTPC, APIC_DM_NMI);

	intel_pmu_disable_all();
	handled = intel_pmu_drain_bts_buffer();
	status = intel_pmu_get_status();
	if (!status) {
		intel_pmu_enable_all(0);
		return handled;
	}

	loops = 0;
again:
	intel_pmu_ack_status(status);
	if (++loops > 100) {
		WARN_ONCE(1, "perfevents: irq loop stuck!\n");
		perf_event_print_debug();
		intel_pmu_reset();
		goto done;
	}

	inc_irq_stat(apic_perf_irqs);

	intel_pmu_lbr_read();

	/*
	 * PEBS overflow sets bit 62 in the global status register
	 */
	if (__test_and_clear_bit(62, (unsigned long *)&status)) {
		handled++;
		x86_pmu.drain_pebs(regs);
	}

	for_each_set_bit(bit, (unsigned long *)&status, X86_PMC_IDX_MAX) {
		struct perf_event *event = cpuc->events[bit];

		handled++;

		if (!test_bit(bit, cpuc->active_mask))
			continue;

		if (!intel_pmu_save_and_restart(event))
			continue;

		data.period = event->hw.last_period;

		if (perf_event_overflow(event, 1, &data, regs))
			x86_pmu_stop(event, 0);
	}

	/*
	 * Repeat if there is more work to be done:
	 */
	status = intel_pmu_get_status();
	if (status)
		goto again;

done:
	intel_pmu_enable_all(0);
	return handled;
}


void tb_invalidate_phys_page_fast ( tb_page_addr_t start , int len ) {
 PageDesc * p ;
 int offset , b ;
 # if 0 if ( 1 ) {
 qemu_log ( "modifying code at 0x%x size=%d EIP=%x PC=%08x\n" , cpu_single_env -> mem_io_vaddr , len , cpu_single_env -> eip , cpu_single_env -> eip + ( intptr_t ) cpu_single_env -> segs [ R_CS ] . base ) ;
 }
 # endif p = page_find ( start >> TARGET_PAGE_BITS ) ;
 if ( ! p ) {
 return ;
 }
 if ( p -> code_bitmap ) {
 offset = start & ~ TARGET_PAGE_MASK ;
 b = p -> code_bitmap [ offset >> 3 ] >> ( offset & 7 ) ;
 if ( b & ( ( 1 << len ) - 1 ) ) {
 goto do_invalidate ;
 }
 }
 else {
 do_invalidate : tb_invalidate_phys_page_range ( start , start + len , 1 ) ;
 }
 }


static bool em_syscall_is_enabled(struct x86_emulate_ctxt *ctxt)
{
	struct x86_emulate_ops *ops = ctxt->ops;
	u32 eax, ebx, ecx, edx;

	/*
	 * syscall should always be enabled in longmode - so only become
	 * vendor specific (cpuid) if other modes are active...
	 */
	if (ctxt->mode == X86EMUL_MODE_PROT64)
		return true;

	eax = 0x00000000;
	ecx = 0x00000000;
	if (ops->get_cpuid(ctxt, &eax, &ebx, &ecx, &edx)) {
		/*
		 * Intel ("GenuineIntel")
		 * remark: Intel CPUs only support "syscall" in 64bit
		 * longmode. Also an 64bit guest with a
		 * 32bit compat-app running will #UD !! While this
		 * behaviour can be fixed (by emulating) into AMD
		 * response - CPUs of AMD can't behave like Intel.
		 */
		if (ebx == X86EMUL_CPUID_VENDOR_GenuineIntel_ebx &&
		    ecx == X86EMUL_CPUID_VENDOR_GenuineIntel_ecx &&
		    edx == X86EMUL_CPUID_VENDOR_GenuineIntel_edx)
			return false;

		/* AMD ("AuthenticAMD") */
		if (ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx &&
		    ecx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx &&
		    edx == X86EMUL_CPUID_VENDOR_AuthenticAMD_edx)
			return true;

		/* AMD ("AMDisbetter!") */
		if (ebx == X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx &&
		    ecx == X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx &&
		    edx == X86EMUL_CPUID_VENDOR_AMDisbetterI_edx)
			return true;
	}

	/* default: (not Intel, not AMD), apply Intel's stricter rules... */
	return false;
}


static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{
    return cirrus_bitblt_common_patterncopy(s,
					    s->vram_ptr +
                                            (s->cirrus_blt_srcaddr & ~7));
}


print_insn (bfd_vma pc, disassemble_info *info) { const struct dis386 *dp; int i; char *op_txt[MAX_OPERANDS]; int needcomma; unsigned char uses_DATA_prefix, uses_LOCK_prefix; unsigned char uses_REPNZ_prefix, uses_REPZ_prefix; int sizeflag; const char *p; struct dis_private priv; unsigned char op; unsigned char threebyte; if (info->mach == bfd_mach_x86_64_intel_syntax || info->mach == bfd_mach_x86_64) address_mode = mode_64bit; else address_mode = mode_32bit; if (intel_syntax == (char) -1) intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax || info->mach == bfd_mach_x86_64_intel_syntax); if (info->mach == bfd_mach_i386_i386 || info->mach == bfd_mach_x86_64 || info->mach == bfd_mach_i386_i386_intel_syntax || info->mach == bfd_mach_x86_64_intel_syntax) priv.orig_sizeflag = AFLAG | DFLAG; else if (info->mach == bfd_mach_i386_i8086) priv.orig_sizeflag = 0; else abort (); for (p = info->disassembler_options; p != NULL; ) { if (strncmp (p, "x86-64", 6) == 0) { address_mode = mode_64bit; priv.orig_sizeflag = AFLAG | DFLAG; } else if (strncmp (p, "i386", 4) == 0) { address_mode = mode_32bit; priv.orig_sizeflag = AFLAG | DFLAG; } else if (strncmp (p, "i8086", 5) == 0) { address_mode = mode_16bit; priv.orig_sizeflag = 0; } else if (strncmp (p, "intel", 5) == 0) { intel_syntax = 1; } else if (strncmp (p, "att", 3) == 0) { intel_syntax = 0; } else if (strncmp (p, "addr", 4) == 0) { if (address_mode == mode_64bit) { if (p[4] == '3' && p[5] == '2') priv.orig_sizeflag &= ~AFLAG; else if (p[4] == '6' && p[5] == '4') priv.orig_sizeflag |= AFLAG; } else { if (p[4] == '1' && p[5] == '6') priv.orig_sizeflag &= ~AFLAG; else if (p[4] == '3' && p[5] == '2') priv.orig_sizeflag |= AFLAG; } } else if (strncmp (p, "data", 4) == 0) { if (p[4] == '1' && p[5] == '6') priv.orig_sizeflag &= ~DFLAG; else if (p[4] == '3' && p[5] == '2') priv.orig_sizeflag |= DFLAG; } else if (strncmp (p, "suffix", 6) == 0) priv.orig_sizeflag |= SUFFIX_ALWAYS; p = strchr (p, ','); if (p != NULL) p++; } if (intel_syntax) { names64 = intel_names64; names32 = intel_names32; names16 = intel_names16; names8 = intel_names8; names8rex = intel_names8rex; names_seg = intel_names_seg; index16 = intel_index16; open_char = '['; close_char = ']'; separator_char = '+'; scale_char = '*'; } else { names64 = att_names64; names32 = att_names32; names16 = att_names16; names8 = att_names8; names8rex = att_names8rex; names_seg = att_names_seg; index16 = att_index16; open_char = '('; close_char = ')'; separator_char = ','; scale_char = ','; } /* The output looks better if we put 7 bytes on a line, since that puts most long word instructions on a single line. */ info->bytes_per_line = 7; info->private_data = &priv; priv.max_fetched = priv.the_buffer; priv.insn_start = pc; obuf[0] = 0; for (i = 0; i < MAX_OPERANDS; ++i) { op_out[i][0] = 0; op_index[i] = -1; } the_info = info; start_pc = pc; start_codep = priv.the_buffer; codep = priv.the_buffer; if (sigsetjmp(priv.bailout, 0) != 0) { const char *name; /* Getting here means we tried for data but didn't get it. That means we have an incomplete instruction of some sort. Just print the first byte as a prefix or a .byte pseudo-op. */ if (codep > priv.the_buffer) { name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag); if (name != NULL) (*info->fprintf_func) (info->stream, "%s", name); else { /* Just print the first byte as a .byte instruction. */ (*info->fprintf_func) (info->stream, ".byte 0x%x", (unsigned int) priv.the_buffer[0]); } return 1; } return -1; } obufp = obuf; ckprefix (); ckvexprefix (); insn_codep = codep; sizeflag = priv.orig_sizeflag; fetch_data(info, codep + 1); two_source_ops = (*codep == 0x62) || (*codep == 0xc8); if (((prefixes & PREFIX_FWAIT) && ((*codep < 0xd8) || (*codep > 0xdf))) || (rex && rex_used)) { const char *name; /* fwait not followed by floating point instruction, or rex followed by other prefixes. Print the first prefix. */ name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag); if (name == NULL) name = INTERNAL_DISASSEMBLER_ERROR; (*info->fprintf_func) (info->stream, "%s", name); return 1; } op = 0; if (prefixes & PREFIX_VEX_0F) { used_prefixes |= PREFIX_VEX_0F | PREFIX_VEX_0F38 | PREFIX_VEX_0F3A; if (prefixes & PREFIX_VEX_0F38) threebyte = 0x38; else if (prefixes & PREFIX_VEX_0F3A) threebyte = 0x3a; else threebyte = *codep++; goto vex_opcode; } if (*codep == 0x0f) { fetch_data(info, codep + 2); threebyte = codep[1]; codep += 2; vex_opcode: dp = &dis386_twobyte[threebyte]; need_modrm = twobyte_has_modrm[threebyte]; uses_DATA_prefix = twobyte_uses_DATA_prefix[threebyte]; uses_REPNZ_prefix = twobyte_uses_REPNZ_prefix[threebyte]; uses_REPZ_prefix = twobyte_uses_REPZ_prefix[threebyte]; uses_LOCK_prefix = (threebyte & ~0x02) == 0x20; if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE) { fetch_data(info, codep + 2); op = *codep++; switch (threebyte) { case 0x38: uses_DATA_prefix = threebyte_0x38_uses_DATA_prefix[op]; uses_REPNZ_prefix = threebyte_0x38_uses_REPNZ_prefix[op]; uses_REPZ_prefix = threebyte_0x38_uses_REPZ_prefix[op]; break; case 0x3a: uses_DATA_prefix = threebyte_0x3a_uses_DATA_prefix[op]; uses_REPNZ_prefix = threebyte_0x3a_uses_REPNZ_prefix[op]; uses_REPZ_prefix = threebyte_0x3a_uses_REPZ_prefix[op]; break; default: break; } } } else { dp = &dis386[*codep]; need_modrm = onebyte_has_modrm[*codep]; uses_DATA_prefix = 0; uses_REPNZ_prefix = 0; /* pause is 0xf3 0x90. */ uses_REPZ_prefix = *codep == 0x90; uses_LOCK_prefix = 0; codep++; } if (!uses_REPZ_prefix && (prefixes & PREFIX_REPZ)) { oappend ("repz "); used_prefixes |= PREFIX_REPZ; } if (!uses_REPNZ_prefix && (prefixes & PREFIX_REPNZ)) { oappend ("repnz "); used_prefixes |= PREFIX_REPNZ; } if (!uses_LOCK_prefix && (prefixes & PREFIX_LOCK)) { oappend ("lock "); used_prefixes |= PREFIX_LOCK; } if (prefixes & PREFIX_ADDR) { sizeflag ^= AFLAG; if (dp->op[2].bytemode != loop_jcxz_mode || intel_syntax) { if ((sizeflag & AFLAG) || address_mode == mode_64bit) oappend ("addr32 "); else oappend ("addr16 "); used_prefixes |= PREFIX_ADDR; } } if (!uses_DATA_prefix && (prefixes & PREFIX_DATA)) { sizeflag ^= DFLAG; if (dp->op[2].bytemode == cond_jump_mode && dp->op[0].bytemode == v_mode && !intel_syntax) { if (sizeflag & DFLAG) oappend ("data32 "); else oappend ("data16 "); used_prefixes |= PREFIX_DATA; } } if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE) { dp = &three_byte_table[dp->op[1].bytemode][op]; modrm.mod = (*codep >> 6) & 3; modrm.reg = (*codep >> 3) & 7; modrm.rm = *codep & 7; } else if (need_modrm) { fetch_data(info, codep + 1); modrm.mod = (*codep >> 6) & 3; modrm.reg = (*codep >> 3) & 7; modrm.rm = *codep & 7; } if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE) { dofloat (sizeflag); } else { int index; if (dp->name == NULL) { switch (dp->op[0].bytemode) { case USE_GROUPS: dp = &grps[dp->op[1].bytemode][modrm.reg]; break; case USE_PREFIX_USER_TABLE: index = 0; used_prefixes |= (prefixes & PREFIX_REPZ); if (prefixes & PREFIX_REPZ) index = 1; else { /* We should check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA. */ used_prefixes |= (prefixes & PREFIX_REPNZ); if (prefixes & PREFIX_REPNZ) index = 3; else { used_prefixes |= (prefixes & PREFIX_DATA); if (prefixes & PREFIX_DATA) index = 2; } } dp = &prefix_user_table[dp->op[1].bytemode][index]; break; case X86_64_SPECIAL: index = address_mode == mode_64bit ? 1 : 0; dp = &x86_64_table[dp->op[1].bytemode][index]; break; default: oappend (INTERNAL_DISASSEMBLER_ERROR); break; } } if (putop (dp->name, sizeflag) == 0) { for (i = 0; i < MAX_OPERANDS; ++i) { obufp = op_out[i]; op_ad = MAX_OPERANDS - 1 - i; if (dp->op[i].rtn) (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag); } } } /* See if any prefixes were not used. If so, print the first one separately. If we don't do this, we'll wind up printing an instruction stream which does not precisely correspond to the bytes we are disassembling. */ if ((prefixes & ~used_prefixes) != 0) { const char *name; name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag); if (name == NULL) name = INTERNAL_DISASSEMBLER_ERROR; (*info->fprintf_func) (info->stream, "%s", name); return 1; } if (rex & ~rex_used) { const char *name; name = prefix_name (rex | 0x40, priv.orig_sizeflag); if (name == NULL) name = INTERNAL_DISASSEMBLER_ERROR; (*info->fprintf_func) (info->stream, "%s ", name); } obufp = obuf + strlen (obuf); for (i = strlen (obuf); i < 6; i++) oappend (" "); oappend (" "); (*info->fprintf_func) (info->stream, "%s", obuf); /* The enter and bound instructions are printed with operands in the same order as the intel book; everything else is printed in reverse order. */ if (intel_syntax || two_source_ops) { bfd_vma riprel; for (i = 0; i < MAX_OPERANDS; ++i) op_txt[i] = op_out[i]; for (i = 0; i < (MAX_OPERANDS >> 1); ++i) { op_ad = op_index[i]; op_index[i] = op_index[MAX_OPERANDS - 1 - i]; op_index[MAX_OPERANDS - 1 - i] = op_ad; riprel = op_riprel[i]; op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i]; op_riprel[MAX_OPERANDS - 1 - i] = riprel; } } else { for (i = 0; i < MAX_OPERANDS; ++i) op_txt[MAX_OPERANDS - 1 - i] = op_out[i]; } needcomma = 0; for (i = 0; i < MAX_OPERANDS; ++i) if (*op_txt[i]) { if (needcomma) (*info->fprintf_func) (info->stream, ","); if (op_index[i] != -1 && !op_riprel[i]) (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info); else (*info->fprintf_func) (info->stream, "%s", op_txt[i]); needcomma = 1; } for (i = 0; i < MAX_OPERANDS; i++) if (op_index[i] != -1 && op_riprel[i]) { (*info->fprintf_func) (info->stream, " # "); (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep + op_address[op_index[i]]), info); break; } return codep - priv.the_buffer; }


static int em_ret_far(struct x86_emulate_ctxt *ctxt)
{
	int rc;
	unsigned long eip, cs;
	u16 old_cs;
	int cpl = ctxt->ops->cpl(ctxt);
	struct desc_struct old_desc, new_desc;
	const struct x86_emulate_ops *ops = ctxt->ops;

	if (ctxt->mode == X86EMUL_MODE_PROT64)
		ops->get_segment(ctxt, &old_cs, &old_desc, NULL,
				 VCPU_SREG_CS);

	rc = emulate_pop(ctxt, &eip, ctxt->op_bytes);
	if (rc != X86EMUL_CONTINUE)
		return rc;
	rc = emulate_pop(ctxt, &cs, ctxt->op_bytes);
	if (rc != X86EMUL_CONTINUE)
		return rc;
	/* Outer-privilege level return is not implemented */
	if (ctxt->mode >= X86EMUL_MODE_PROT16 && (cs & 3) > cpl)
		return X86EMUL_UNHANDLEABLE;
	rc = __load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS, cpl,
				       X86_TRANSFER_RET,
				       &new_desc);
	if (rc != X86EMUL_CONTINUE)
		return rc;
	rc = assign_eip_far(ctxt, eip, &new_desc);
	if (rc != X86EMUL_CONTINUE) {
		WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64);
		ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS);
	}
	return rc;
}


av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq) { afq->avctx = avctx; afq->next_pts = AV_NOPTS_VALUE; afq->remaining_delay = avctx->delay; afq->remaining_samples = avctx->delay; afq->frame_queue = NULL; }


static int dissect_h245_H261VideoMode ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
 offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_H261VideoMode , H261VideoMode_sequence ) ;
 return offset ;
 }


IN_PROC_BROWSER_TEST_F ( UnloadTest , BrowserCloseInfiniteBeforeUnload ) {
 LoadUrlAndQuitBrowser ( INFINITE_BEFORE_UNLOAD_HTML , "infinitebeforeunload" ) ;
 }


put_dirent32 (struct dirent *d, struct compat_dirent __user *d32)
{
        if (!access_ok(VERIFY_WRITE, d32, sizeof(struct compat_dirent)))
                return -EFAULT;

        __put_user(d->d_ino, &d32->d_ino);
        __put_user(d->d_off, &d32->d_off);
        __put_user(d->d_reclen, &d32->d_reclen);
        if (__copy_to_user(d32->d_name, d->d_name, d->d_reclen))
		return -EFAULT;

        return 0;
}


unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs)
{
	unsigned long addr, seg;

	addr = regs->rip;
	seg = regs->cs & 0xffff;

	/*
	 * We'll assume that the code segments in the GDT
	 * are all zero-based. That is largely true: the
	 * TLS segments are used for data, and the PNPBIOS
	 * and APM bios ones we just ignore here.
	 */
	if (seg & LDT_SEGMENT) {
		u32 *desc;
		unsigned long base;

		down(&child->mm->context.sem);
		desc = child->mm->context.ldt + (seg & ~7);
		base = (desc[0] >> 16) | ((desc[1] & 0xff) << 16) | (desc[1] & 0xff000000);

		/* 16-bit code segment? */
		if (!((desc[1] >> 22) & 1))
			addr &= 0xffff;
		addr += base;
		up(&child->mm->context.sem);
	}
	return addr;
}


static void d3d11va_device_uninit(AVHWDeviceContext *hwdev) { AVD3D11VADeviceContext *device_hwctx = hwdev->hwctx; if (device_hwctx->device) ID3D11Device_Release(device_hwctx->device); if (device_hwctx->device_context) ID3D11DeviceContext_Release(device_hwctx->device_context); if (device_hwctx->video_device) ID3D11VideoDevice_Release(device_hwctx->video_device); if (device_hwctx->video_context) ID3D11VideoContext_Release(device_hwctx->video_context); if (device_hwctx->lock == d3d11va_default_lock) CloseHandle(device_hwctx->lock_ctx); }


static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf, int size, int type, uint32_t **lace_buf, int *laces) { int res = 0, n; uint8_t *data = *buf; uint32_t *lace_size; if (!type) { *laces = 1; *lace_buf = av_mallocz(sizeof(int)); if (!*lace_buf) return AVERROR(ENOMEM); *lace_buf[0] = size; return 0; } assert(size > 0); *laces = *data + 1; data += 1; size -= 1; lace_size = av_mallocz(*laces * sizeof(int)); if (!lace_size) return AVERROR(ENOMEM); switch (type) { case 0x1: /* Xiph lacing */ { uint8_t temp; uint32_t total = 0; for (n = 0; res == 0 && n < *laces - 1; n++) { while (1) { if (size == 0) { res = AVERROR_EOF; break; } temp = *data; lace_size[n] += temp; data += 1; size -= 1; if (temp != 0xff) break; } total += lace_size[n]; } if (size <= total) { res = AVERROR_INVALIDDATA; break; } lace_size[n] = size - total; break; } case 0x2: /* fixed-size lacing */ if (size != (size / *laces) * size) { res = AVERROR_INVALIDDATA; break; } for (n = 0; n < *laces; n++) lace_size[n] = size / *laces; break; case 0x3: /* EBML lacing */ { uint64_t num; uint32_t total; n = matroska_ebmlnum_uint(matroska, data, size, &num); if (n < 0) { av_log(matroska->ctx, AV_LOG_INFO, "EBML block data error\n"); res = n; break; } data += n; size -= n; total = lace_size[0] = num; for (n = 1; res == 0 && n < *laces - 1; n++) { int64_t snum; int r; r = matroska_ebmlnum_sint(matroska, data, size, &snum); if (r < 0) { av_log(matroska->ctx, AV_LOG_INFO, "EBML block data error\n"); res = r; break; } data += r; size -= r; lace_size[n] = lace_size[n - 1] + snum; total += lace_size[n]; } if (size <= total) { res = AVERROR_INVALIDDATA; break; } lace_size[*laces - 1] = size - total; break; } } *buf = data; *lace_buf = lace_size; return res; }


static int best_effort_strncat_from_utf16 ( struct archive_string * as , const void * _p , size_t bytes , struct archive_string_conv * sc , int be ) {
 const char * utf16 = ( const char * ) _p ;
 char * mbs ;
 uint32_t uc ;
 int n , ret ;
 ( void ) sc ;
 ret = 0 ;
 if ( archive_string_ensure ( as , as -> length + bytes + 1 ) == NULL ) return ( - 1 ) ;
 mbs = as -> s + as -> length ;
 while ( ( n = utf16_to_unicode ( & uc , utf16 , bytes , be ) ) != 0 ) {
 if ( n < 0 ) {
 n *= - 1 ;
 ret = - 1 ;
 }
 bytes -= n ;
 utf16 += n ;
 if ( uc > 127 ) {
 * mbs ++ = '?' ;
 ret = - 1 ;
 }
 else * mbs ++ = ( char ) uc ;
 }
 as -> length = mbs - as -> s ;
 as -> s [ as -> length ] = '\0' ;
 return ( ret ) ;
 }


krb5_gss_inquire_context(minor_status, context_handle, initiator_name,
                         acceptor_name, lifetime_rec, mech_type, ret_flags,
                         locally_initiated, opened)
    OM_uint32 *minor_status;
    gss_ctx_id_t context_handle;
    gss_name_t *initiator_name;
    gss_name_t *acceptor_name;
    OM_uint32 *lifetime_rec;
    gss_OID *mech_type;
    OM_uint32 *ret_flags;
    int *locally_initiated;
    int *opened;
{
    krb5_context context;
    krb5_error_code code;
    krb5_gss_ctx_id_rec *ctx;
    krb5_gss_name_t initiator, acceptor;
    krb5_timestamp now;
    krb5_deltat lifetime;

    if (initiator_name)
        *initiator_name = (gss_name_t) NULL;
    if (acceptor_name)
        *acceptor_name = (gss_name_t) NULL;

    ctx = (krb5_gss_ctx_id_rec *) context_handle;

    if (! ctx->established) {
        *minor_status = KG_CTX_INCOMPLETE;
        return(GSS_S_NO_CONTEXT);
    }

    initiator = NULL;
    acceptor = NULL;
    context = ctx->k5_context;

    if ((code = krb5_timeofday(context, &now))) {
        *minor_status = code;
        save_error_info(*minor_status, context);
        return(GSS_S_FAILURE);
    }

    if ((lifetime = ctx->krb_times.endtime - now) < 0)
        lifetime = 0;

    if (initiator_name) {
        if ((code = kg_duplicate_name(context,
                                      ctx->initiate ? ctx->here : ctx->there,
                                      &initiator))) {
            *minor_status = code;
            save_error_info(*minor_status, context);
            return(GSS_S_FAILURE);
        }
    }

    if (acceptor_name) {
        if ((code = kg_duplicate_name(context,
                                      ctx->initiate ? ctx->there : ctx->here,
                                      &acceptor))) {
            if (initiator)
                kg_release_name(context, &initiator);
            *minor_status = code;
            save_error_info(*minor_status, context);
            return(GSS_S_FAILURE);
        }
    }

    if (initiator_name)
        *initiator_name = (gss_name_t) initiator;

    if (acceptor_name)
        *acceptor_name = (gss_name_t) acceptor;

    if (lifetime_rec)
        *lifetime_rec = lifetime;

    if (mech_type)
        *mech_type = (gss_OID) ctx->mech_used;

    if (ret_flags)
        *ret_flags = ctx->gss_flags;

    if (locally_initiated)
        *locally_initiated = ctx->initiate;

    if (opened)
        *opened = ctx->established;

    *minor_status = 0;
    return((lifetime == 0)?GSS_S_CONTEXT_EXPIRED:GSS_S_COMPLETE);
}


static void dissect_zcl_ota_imagepagereq ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
 guint8 field_ctrl ;
 field_ctrl = dissect_zcl_ota_field_ctrl_field ( tvb , tree , offset ) ;
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_manufacturer_code , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
 * offset += 2 ;
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_image_type , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
 * offset += 2 ;
 dissect_zcl_ota_file_version_field ( tvb , tree , offset ) ;
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_file_offset , tvb , * offset , 4 , ENC_LITTLE_ENDIAN ) ;
 * offset += 4 ;
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_max_data_size , tvb , * offset , 1 , ENC_NA ) ;
 * offset += 1 ;
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_page_size , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
 * offset += 2 ;
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_rsp_spacing , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
 * offset += 2 ;
 if ( field_ctrl & ZBEE_ZCL_OTA_FIELD_CTRL_IEEE_ADDR_PRESENT ) {
 proto_tree_add_item ( tree , hf_zbee_zcl_ota_req_node_addr , tvb , * offset , 8 , ENC_LITTLE_ENDIAN ) ;
 * offset += 8 ;
 }
 }


int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
{
	void *pgdir;
	unsigned long vsid;
	struct mm_struct *mm;
	pte_t *ptep;
	cpumask_t tmp;
	int rc, user_region = 0, local = 0;
	int psize;

	DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
		ea, access, trap);

	if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) {
		DBG_LOW(" out of pgtable range !\n");
 		return 1;
	}

	/* Get region & vsid */
 	switch (REGION_ID(ea)) {
	case USER_REGION_ID:
		user_region = 1;
		mm = current->mm;
		if (! mm) {
			DBG_LOW(" user region with no mm !\n");
			return 1;
		}
		vsid = get_vsid(mm->context.id, ea);
		psize = mm->context.user_psize;
		break;
	case VMALLOC_REGION_ID:
		mm = &init_mm;
		vsid = get_kernel_vsid(ea);
		if (ea < VMALLOC_END)
			psize = mmu_vmalloc_psize;
		else
			psize = mmu_io_psize;
		break;
	default:
		/* Not a valid range
		 * Send the problem up to do_page_fault
		 */
		return 1;
	}
	DBG_LOW(" mm=%p, mm->pgdir=%p, vsid=%016lx\n", mm, mm->pgd, vsid);

	/* Get pgdir */
	pgdir = mm->pgd;
	if (pgdir == NULL)
		return 1;

	/* Check CPU locality */
	tmp = cpumask_of_cpu(smp_processor_id());
	if (user_region && cpus_equal(mm->cpu_vm_mask, tmp))
		local = 1;

	/* Handle hugepage regions */
	if (unlikely(in_hugepage_area(mm->context, ea))) {
		DBG_LOW(" -> huge page !\n");
		return hash_huge_page(mm, access, ea, vsid, local, trap);
	}

	/* Get PTE and page size from page tables */
	ptep = find_linux_pte(pgdir, ea);
	if (ptep == NULL || !pte_present(*ptep)) {
		DBG_LOW(" no PTE !\n");
		return 1;
	}

#ifndef CONFIG_PPC_64K_PAGES
	DBG_LOW(" i-pte: %016lx\n", pte_val(*ptep));
#else
	DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep),
		pte_val(*(ptep + PTRS_PER_PTE)));
#endif
	/* Pre-check access permissions (will be re-checked atomically
	 * in __hash_page_XX but this pre-check is a fast path
	 */
	if (access & ~pte_val(*ptep)) {
		DBG_LOW(" no access !\n");
		return 1;
	}

	/* Do actual hashing */
#ifndef CONFIG_PPC_64K_PAGES
	rc = __hash_page_4K(ea, access, vsid, ptep, trap, local);
#else
	if (mmu_ci_restrictions) {
		/* If this PTE is non-cacheable, switch to 4k */
		if (psize == MMU_PAGE_64K &&
		    (pte_val(*ptep) & _PAGE_NO_CACHE)) {
			if (user_region) {
				psize = MMU_PAGE_4K;
				mm->context.user_psize = MMU_PAGE_4K;
				mm->context.sllp = SLB_VSID_USER |
					mmu_psize_defs[MMU_PAGE_4K].sllp;
			} else if (ea < VMALLOC_END) {
				/*
				 * some driver did a non-cacheable mapping
				 * in vmalloc space, so switch vmalloc
				 * to 4k pages
				 */
				printk(KERN_ALERT "Reducing vmalloc segment "
				       "to 4kB pages because of "
				       "non-cacheable mapping\n");
				psize = mmu_vmalloc_psize = MMU_PAGE_4K;
			}
#ifdef CONFIG_SPE_BASE
			spu_flush_all_slbs(mm);
#endif
		}
		if (user_region) {
			if (psize != get_paca()->context.user_psize) {
				get_paca()->context = mm->context;
				slb_flush_and_rebolt();
			}
		} else if (get_paca()->vmalloc_sllp !=
			   mmu_psize_defs[mmu_vmalloc_psize].sllp) {
			get_paca()->vmalloc_sllp =
				mmu_psize_defs[mmu_vmalloc_psize].sllp;
			slb_flush_and_rebolt();
		}
	}
	if (psize == MMU_PAGE_64K)
		rc = __hash_page_64K(ea, access, vsid, ptep, trap, local);
	else
		rc = __hash_page_4K(ea, access, vsid, ptep, trap, local);
#endif /* CONFIG_PPC_64K_PAGES */

#ifndef CONFIG_PPC_64K_PAGES
	DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
#else
	DBG_LOW(" o-pte: %016lx %016lx\n", pte_val(*ptep),
		pte_val(*(ptep + PTRS_PER_PTE)));
#endif
	DBG_LOW(" -> rc=%d\n", rc);
	return rc;
}


static ossl_inline LHASH_OF ( type ) * lh_ ## type ## _new ( unsigned long ( * hfn ) ( const type * ) , int ( * cfn ) ( const type * , const type * ) ) {
 return ( LHASH_OF ( type ) * ) OPENSSL_LH_new ( ( OPENSSL_LH_HASHFUNC ) hfn , ( OPENSSL_LH_COMPFUNC ) cfn ) ;
 }
 static ossl_inline void lh_ ## type ## _free ( LHASH_OF ( type ) * lh ) {
 OPENSSL_LH_free ( ( OPENSSL_LHASH * ) lh ) ;
 }
 static ossl_inline type * lh_ ## type ## _insert ( LHASH_OF ( type ) * lh , type * d ) {
 return ( type * ) OPENSSL_LH_insert ( ( OPENSSL_LHASH * ) lh , d ) ;
 }
 static ossl_inline type * lh_ ## type ## _delete ( LHASH_OF ( type ) * lh , const type * d ) {
 return ( type * ) OPENSSL_LH_delete ( ( OPENSSL_LHASH * ) lh , d ) ;
 }
 static ossl_inline type * lh_ ## type ## _retrieve ( LHASH_OF ( type ) * lh , const type * d ) {
 return ( type * ) OPENSSL_LH_retrieve ( ( OPENSSL_LHASH * ) lh , d ) ;
 }
 static ossl_inline int lh_ ## type ## _error ( LHASH_OF ( type ) * lh ) {
 return OPENSSL_LH_error ( ( OPENSSL_LHASH * ) lh ) ;
 }
 static ossl_inline unsigned long lh_ ## type ## _num_items ( LHASH_OF ( type ) * lh ) {
 return OPENSSL_LH_num_items ( ( OPENSSL_LHASH * ) lh ) ;
 }
 static ossl_inline void lh_ ## type ## _node_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
 OPENSSL_LH_node_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
 }
 static ossl_inline void lh_ ## type ## _node_usage_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
 OPENSSL_LH_node_usage_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
 }
 static ossl_inline void lh_ ## type ## _stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
 OPENSSL_LH_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
 }
 static ossl_inline unsigned long lh_ ## type ## _get_down_load ( LHASH_OF ( type ) * lh ) {
 return OPENSSL_LH_get_down_load ( ( OPENSSL_LHASH * ) lh ) ;
 }
 static ossl_inline void lh_ ## type ## _set_down_load ( LHASH_OF ( type ) * lh , unsigned long dl ) {
 OPENSSL_LH_set_down_load ( ( OPENSSL_LHASH * ) lh , dl ) ;
 }
 static ossl_inline void lh_ ## type ## _doall ( LHASH_OF ( type ) * lh , void ( * doall ) ( type * ) ) {
 OPENSSL_LH_doall ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNC ) doall ) ;
 }
 LHASH_OF ( type ) # define IMPLEMENT_LHASH_DOALL_ARG_CONST ( type , argtype ) int_implement_lhash_doall ( type , argtype , const type ) # define IMPLEMENT_LHASH_DOALL_ARG ( type , argtype ) int_implement_lhash_doall ( type , argtype , type ) # define int_implement_lhash_doall ( type , argtype , cbargtype ) static ossl_inline void lh_ ## type ## _doall_ ## argtype ( LHASH_OF ( type ) * lh , void ( * fn ) ( cbargtype * , argtype * ) , argtype * arg ) {
 OPENSSL_LH_doall_arg ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNCARG ) fn , ( void * ) arg ) ;
 }
 LHASH_OF ( type ) DEFINE_LHASH_OF ( OPENSSL_STRING ) ;
 # ifdef _MSC_VER # pragma warning ( push ) # pragma warning ( disable : 4090 ) # endif DEFINE_LHASH_OF ( OPENSSL_CSTRING )


shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx)
{
	return alloc_page(gfp | __GFP_ZERO);
}


static int shmem_getpage(struct inode *inode, unsigned long idx,
			struct page **pagep, enum sgp_type sgp, int *type)
{
	struct address_space *mapping = inode->i_mapping;
	struct shmem_inode_info *info = SHMEM_I(inode);
	struct shmem_sb_info *sbinfo;
	struct page *filepage = *pagep;
	struct page *swappage;
	swp_entry_t *entry;
	swp_entry_t swap;
	int error;

	if (idx >= SHMEM_MAX_INDEX)
		return -EFBIG;

	if (type)
		*type = 0;

	/*
	 * Normally, filepage is NULL on entry, and either found
	 * uptodate immediately, or allocated and zeroed, or read
	 * in under swappage, which is then assigned to filepage.
	 * But shmem_readpage and shmem_write_begin pass in a locked
	 * filepage, which may be found not uptodate by other callers
	 * too, and may need to be copied from the swappage read in.
	 */
repeat:
	if (!filepage)
		filepage = find_lock_page(mapping, idx);
	if (filepage && PageUptodate(filepage))
		goto done;
	error = 0;
	if (sgp == SGP_QUICK)
		goto failed;

	spin_lock(&info->lock);
	shmem_recalc_inode(inode);
	entry = shmem_swp_alloc(info, idx, sgp);
	if (IS_ERR(entry)) {
		spin_unlock(&info->lock);
		error = PTR_ERR(entry);
		goto failed;
	}
	swap = *entry;

	if (swap.val) {
		/* Look it up and read it in.. */
		swappage = lookup_swap_cache(swap);
		if (!swappage) {
			shmem_swp_unmap(entry);
			/* here we actually do the io */
			if (type && !(*type & VM_FAULT_MAJOR)) {
				__count_vm_event(PGMAJFAULT);
				*type |= VM_FAULT_MAJOR;
			}
			spin_unlock(&info->lock);
			swappage = shmem_swapin(info, swap, idx);
			if (!swappage) {
				spin_lock(&info->lock);
				entry = shmem_swp_alloc(info, idx, sgp);
				if (IS_ERR(entry))
					error = PTR_ERR(entry);
				else {
					if (entry->val == swap.val)
						error = -ENOMEM;
					shmem_swp_unmap(entry);
				}
				spin_unlock(&info->lock);
				if (error)
					goto failed;
				goto repeat;
			}
			wait_on_page_locked(swappage);
			page_cache_release(swappage);
			goto repeat;
		}

		/* We have to do this with page locked to prevent races */
		if (TestSetPageLocked(swappage)) {
			shmem_swp_unmap(entry);
			spin_unlock(&info->lock);
			wait_on_page_locked(swappage);
			page_cache_release(swappage);
			goto repeat;
		}
		if (PageWriteback(swappage)) {
			shmem_swp_unmap(entry);
			spin_unlock(&info->lock);
			wait_on_page_writeback(swappage);
			unlock_page(swappage);
			page_cache_release(swappage);
			goto repeat;
		}
		if (!PageUptodate(swappage)) {
			shmem_swp_unmap(entry);
			spin_unlock(&info->lock);
			unlock_page(swappage);
			page_cache_release(swappage);
			error = -EIO;
			goto failed;
		}

		if (filepage) {
			shmem_swp_set(info, entry, 0);
			shmem_swp_unmap(entry);
			delete_from_swap_cache(swappage);
			spin_unlock(&info->lock);
			copy_highpage(filepage, swappage);
			unlock_page(swappage);
			page_cache_release(swappage);
			flush_dcache_page(filepage);
			SetPageUptodate(filepage);
			set_page_dirty(filepage);
			swap_free(swap);
		} else if (!(error = move_from_swap_cache(
				swappage, idx, mapping))) {
			info->flags |= SHMEM_PAGEIN;
			shmem_swp_set(info, entry, 0);
			shmem_swp_unmap(entry);
			spin_unlock(&info->lock);
			filepage = swappage;
			swap_free(swap);
		} else {
			shmem_swp_unmap(entry);
			spin_unlock(&info->lock);
			unlock_page(swappage);
			page_cache_release(swappage);
			if (error == -ENOMEM) {
				/* let kswapd refresh zone for GFP_ATOMICs */
				congestion_wait(WRITE, HZ/50);
			}
			goto repeat;
		}
	} else if (sgp == SGP_READ && !filepage) {
		shmem_swp_unmap(entry);
		filepage = find_get_page(mapping, idx);
		if (filepage &&
		    (!PageUptodate(filepage) || TestSetPageLocked(filepage))) {
			spin_unlock(&info->lock);
			wait_on_page_locked(filepage);
			page_cache_release(filepage);
			filepage = NULL;
			goto repeat;
		}
		spin_unlock(&info->lock);
	} else {
		shmem_swp_unmap(entry);
		sbinfo = SHMEM_SB(inode->i_sb);
		if (sbinfo->max_blocks) {
			spin_lock(&sbinfo->stat_lock);
			if (sbinfo->free_blocks == 0 ||
			    shmem_acct_block(info->flags)) {
				spin_unlock(&sbinfo->stat_lock);
				spin_unlock(&info->lock);
				error = -ENOSPC;
				goto failed;
			}
			sbinfo->free_blocks--;
			inode->i_blocks += BLOCKS_PER_PAGE;
			spin_unlock(&sbinfo->stat_lock);
		} else if (shmem_acct_block(info->flags)) {
			spin_unlock(&info->lock);
			error = -ENOSPC;
			goto failed;
		}

		if (!filepage) {
			spin_unlock(&info->lock);
			filepage = shmem_alloc_page(mapping_gfp_mask(mapping),
						    info,
						    idx);
			if (!filepage) {
				shmem_unacct_blocks(info->flags, 1);
				shmem_free_blocks(inode, 1);
				error = -ENOMEM;
				goto failed;
			}

			spin_lock(&info->lock);
			entry = shmem_swp_alloc(info, idx, sgp);
			if (IS_ERR(entry))
				error = PTR_ERR(entry);
			else {
				swap = *entry;
				shmem_swp_unmap(entry);
			}
			if (error || swap.val || 0 != add_to_page_cache_lru(
					filepage, mapping, idx, GFP_ATOMIC)) {
				spin_unlock(&info->lock);
				page_cache_release(filepage);
				shmem_unacct_blocks(info->flags, 1);
				shmem_free_blocks(inode, 1);
				filepage = NULL;
				if (error)
					goto failed;
				goto repeat;
			}
			info->flags |= SHMEM_PAGEIN;
		}

		info->alloced++;
		spin_unlock(&info->lock);
		flush_dcache_page(filepage);
		SetPageUptodate(filepage);
	}
done:
	if (*pagep != filepage) {
		*pagep = filepage;
		if (sgp != SGP_FAULT)
			unlock_page(filepage);

	}
	return 0;

failed:
	if (*pagep != filepage) {
		unlock_page(filepage);
		page_cache_release(filepage);
	}
	return error;
}


static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s, const uint8_t * src) { uint8_t *dst; dst = s->vga.vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask); if (blit_is_unsafe(s, false)) return 0; (*s->cirrus_rop) (s, dst, src, s->cirrus_blt_dstpitch, 0, s->cirrus_blt_width, s->cirrus_blt_height); cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, s->cirrus_blt_dstpitch, s->cirrus_blt_width, s->cirrus_blt_height); return 1; }


static int load_state_from_tss16(struct x86_emulate_ctxt *ctxt,
				 struct tss_segment_16 *tss)
{
	int ret;
	u8 cpl;

	ctxt->_eip = tss->ip;
	ctxt->eflags = tss->flag | 2;
	*reg_write(ctxt, VCPU_REGS_RAX) = tss->ax;
	*reg_write(ctxt, VCPU_REGS_RCX) = tss->cx;
	*reg_write(ctxt, VCPU_REGS_RDX) = tss->dx;
	*reg_write(ctxt, VCPU_REGS_RBX) = tss->bx;
	*reg_write(ctxt, VCPU_REGS_RSP) = tss->sp;
	*reg_write(ctxt, VCPU_REGS_RBP) = tss->bp;
	*reg_write(ctxt, VCPU_REGS_RSI) = tss->si;
	*reg_write(ctxt, VCPU_REGS_RDI) = tss->di;

	/*
	 * SDM says that segment selectors are loaded before segment
	 * descriptors
	 */
	set_segment_selector(ctxt, tss->ldt, VCPU_SREG_LDTR);
	set_segment_selector(ctxt, tss->es, VCPU_SREG_ES);
	set_segment_selector(ctxt, tss->cs, VCPU_SREG_CS);
	set_segment_selector(ctxt, tss->ss, VCPU_SREG_SS);
	set_segment_selector(ctxt, tss->ds, VCPU_SREG_DS);

	cpl = tss->cs & 3;

	/*
	 * Now load segment descriptors. If fault happens at this stage
	 * it is handled in a context of new task
	 */
	ret = __load_segment_descriptor(ctxt, tss->ldt, VCPU_SREG_LDTR, cpl, true);
	if (ret != X86EMUL_CONTINUE)
		return ret;
	ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, true);
	if (ret != X86EMUL_CONTINUE)
		return ret;
	ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, true);
	if (ret != X86EMUL_CONTINUE)
		return ret;
	ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, true);
	if (ret != X86EMUL_CONTINUE)
		return ret;
	ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, true);
	if (ret != X86EMUL_CONTINUE)
		return ret;

	return X86EMUL_CONTINUE;
}


gssrpc__svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg,
	bool_t *no_dispatch)
{
	enum auth_stat		 retstat;
	XDR	 		 xdrs;
	SVCAUTH			*auth;
	struct svc_rpc_gss_data	*gd;
	struct rpc_gss_cred	*gc;
	struct rpc_gss_init_res	 gr;
	int			 call_stat, offset;
	OM_uint32		 min_stat;

	log_debug("in svcauth_gss()");

	/* Initialize reply. */
	rqst->rq_xprt->xp_verf = gssrpc__null_auth;

	/* Allocate and set up server auth handle. */
	if (rqst->rq_xprt->xp_auth == NULL ||
	    rqst->rq_xprt->xp_auth == &svc_auth_none) {
		if ((auth = calloc(sizeof(*auth), 1)) == NULL) {
			fprintf(stderr, "svcauth_gss: out_of_memory\n");
			return (AUTH_FAILED);
		}
		if ((gd = calloc(sizeof(*gd), 1)) == NULL) {
			fprintf(stderr, "svcauth_gss: out_of_memory\n");
			return (AUTH_FAILED);
		}
		auth->svc_ah_ops = &svc_auth_gss_ops;
		SVCAUTH_PRIVATE(auth) = gd;
		rqst->rq_xprt->xp_auth = auth;
	}
	else gd = SVCAUTH_PRIVATE(rqst->rq_xprt->xp_auth);

	log_debug("xp_auth=%p, gd=%p", rqst->rq_xprt->xp_auth, gd);

	/* Deserialize client credentials. */
	if (rqst->rq_cred.oa_length <= 0)
		return (AUTH_BADCRED);

	gc = (struct rpc_gss_cred *)rqst->rq_clntcred;
	memset(gc, 0, sizeof(*gc));

	log_debug("calling xdrmem_create()");
	log_debug("oa_base=%p, oa_length=%u", rqst->rq_cred.oa_base,
		  rqst->rq_cred.oa_length);
	xdrmem_create(&xdrs, rqst->rq_cred.oa_base,
		      rqst->rq_cred.oa_length, XDR_DECODE);
	log_debug("xdrmem_create() returned");

	if (!xdr_rpc_gss_cred(&xdrs, gc)) {
		log_debug("xdr_rpc_gss_cred() failed");
		XDR_DESTROY(&xdrs);
		return (AUTH_BADCRED);
	}
	XDR_DESTROY(&xdrs);

	retstat = AUTH_FAILED;

#define ret_freegc(code) do { retstat = code; goto freegc; } while (0)

	/* Check version. */
	if (gc->gc_v != RPCSEC_GSS_VERSION)
		ret_freegc (AUTH_BADCRED);

	/* Check RPCSEC_GSS service. */
	if (gc->gc_svc != RPCSEC_GSS_SVC_NONE &&
	    gc->gc_svc != RPCSEC_GSS_SVC_INTEGRITY &&
	    gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY)
		ret_freegc (AUTH_BADCRED);

	/* Check sequence number. */
	if (gd->established) {
		if (gc->gc_seq > MAXSEQ)
			ret_freegc (RPCSEC_GSS_CTXPROBLEM);

		if ((offset = gd->seqlast - gc->gc_seq) < 0) {
			gd->seqlast = gc->gc_seq;
			offset = 0 - offset;
			gd->seqmask <<= offset;
			offset = 0;
		} else if ((u_int)offset >= gd->win ||
			   (gd->seqmask & (1 << offset))) {
			*no_dispatch = 1;
			ret_freegc (RPCSEC_GSS_CTXPROBLEM);
		}
		gd->seq = gc->gc_seq;
		gd->seqmask |= (1 << offset);
	}

	if (gd->established) {
		rqst->rq_clntname = (char *)gd->client_name;
		rqst->rq_svccred = (char *)gd->ctx;
	}

	/* Handle RPCSEC_GSS control procedure. */
	switch (gc->gc_proc) {

	case RPCSEC_GSS_INIT:
	case RPCSEC_GSS_CONTINUE_INIT:
		if (rqst->rq_proc != NULLPROC)
			ret_freegc (AUTH_FAILED);		/* XXX ? */

		if (!svcauth_gss_acquire_cred())
			ret_freegc (AUTH_FAILED);

		if (!svcauth_gss_accept_sec_context(rqst, &gr))
			ret_freegc (AUTH_REJECTEDCRED);

		if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win))) {
			gss_release_buffer(&min_stat, &gr.gr_token);
			mem_free(gr.gr_ctx.value,
				 sizeof(gss_union_ctx_id_desc));
			ret_freegc (AUTH_FAILED);
		}
		*no_dispatch = TRUE;

		call_stat = svc_sendreply(rqst->rq_xprt, xdr_rpc_gss_init_res,
					  (caddr_t)&gr);

		gss_release_buffer(&min_stat, &gr.gr_token);
		gss_release_buffer(&min_stat, &gd->checksum);
		mem_free(gr.gr_ctx.value, sizeof(gss_union_ctx_id_desc));
		if (!call_stat)
			ret_freegc (AUTH_FAILED);

		if (gr.gr_major == GSS_S_COMPLETE)
			gd->established = TRUE;

		break;

	case RPCSEC_GSS_DATA:
		if (!svcauth_gss_validate(rqst, gd, msg))
			ret_freegc (RPCSEC_GSS_CREDPROBLEM);

		if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
 			ret_freegc (AUTH_FAILED);
		break;

	case RPCSEC_GSS_DESTROY:
		if (rqst->rq_proc != NULLPROC)
			ret_freegc (AUTH_FAILED);		/* XXX ? */

		if (!svcauth_gss_validate(rqst, gd, msg))
			ret_freegc (RPCSEC_GSS_CREDPROBLEM);

		if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
			ret_freegc (AUTH_FAILED);

		*no_dispatch = TRUE;

		call_stat = svc_sendreply(rqst->rq_xprt,
					  xdr_void, (caddr_t)NULL);

		log_debug("sendreply in destroy: %d", call_stat);

		if (!svcauth_gss_release_cred())
			ret_freegc (AUTH_FAILED);

		SVCAUTH_DESTROY(rqst->rq_xprt->xp_auth);
		rqst->rq_xprt->xp_auth = &svc_auth_none;

		break;

	default:
		ret_freegc (AUTH_REJECTEDCRED);
		break;
	}
	retstat = AUTH_OK;
freegc:
	xdr_free(xdr_rpc_gss_cred, gc);
	log_debug("returning %d from svcauth_gss()", retstat);
	return (retstat);
}


static int get_iovec_page_array(const struct iovec __user *iov,
				unsigned int nr_vecs, struct page **pages,
				struct partial_page *partial, int aligned)
{
	int buffers = 0, error = 0;

	down_read(&current->mm->mmap_sem);

	while (nr_vecs) {
		unsigned long off, npages;
		struct iovec entry;
		void __user *base;
		size_t len;
		int i;

		error = -EFAULT;
		if (copy_from_user_mmap_sem(&entry, iov, sizeof(entry)))
			break;

		base = entry.iov_base;
		len = entry.iov_len;

		/*
		 * Sanity check this iovec. 0 read succeeds.
		 */
		error = 0;
		if (unlikely(!len))
			break;
		error = -EFAULT;
		if (unlikely(!base))
			break;

		/*
		 * Get this base offset and number of pages, then map
		 * in the user pages.
		 */
		off = (unsigned long) base & ~PAGE_MASK;

		/*
		 * If asked for alignment, the offset must be zero and the
		 * length a multiple of the PAGE_SIZE.
		 */
		error = -EINVAL;
		if (aligned && (off || len & ~PAGE_MASK))
			break;

		npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
		if (npages > PIPE_BUFFERS - buffers)
			npages = PIPE_BUFFERS - buffers;

		error = get_user_pages(current, current->mm,
				       (unsigned long) base, npages, 0, 0,
				       &pages[buffers], NULL);

		if (unlikely(error <= 0))
			break;

		/*
		 * Fill this contiguous range into the partial page map.
		 */
		for (i = 0; i < error; i++) {
			const int plen = min_t(size_t, len, PAGE_SIZE - off);

			partial[buffers].offset = off;
			partial[buffers].len = plen;

			off = 0;
			len -= plen;
			buffers++;
		}

		/*
		 * We didn't complete this iov, stop here since it probably
		 * means we have to move some of this into a pipe to
		 * be able to continue.
		 */
		if (len)
			break;

		/*
		 * Don't continue if we mapped fewer pages than we asked for,
		 * or if we mapped the max number of pages that we have
		 * room for.
		 */
		if (error < npages || buffers == PIPE_BUFFERS)
			break;

		nr_vecs--;
		iov++;
	}

	up_read(&current->mm->mmap_sem);

	if (buffers)
		return buffers;

	return error;
}


static void dissect_udvm_bytecode ( tvbuff_t * udvm_tvb , packet_info * pinfo , proto_tree * sigcomp_udvm_tree , guint start_address ) {
 guint instruction ;
 gint offset = 0 ;
 gint start_offset = 0 ;
 gint len ;
 gint n ;
 guint instruction_no = 0 ;
 guint16 value = 0 ;
 proto_item * item , * item2 ;
 guint UDVM_address = start_address ;
 gboolean is_memory_address ;
 guint16 msg_length = tvb_reported_length_remaining ( udvm_tvb , offset ) ;
 while ( msg_length > offset ) {
 instruction = tvb_get_guint8 ( udvm_tvb , offset ) ;
 instruction_no ++ ;
 UDVM_address = start_address + offset ;
 item = proto_tree_add_uint_format ( sigcomp_udvm_tree , hf_sigcomp_udvm_instruction , udvm_tvb , offset , 1 , instruction_no , "######### UDVM instruction %u at UDVM-address %u (0x%x) #########" , instruction_no , UDVM_address , UDVM_address ) ;
 PROTO_ITEM_SET_GENERATED ( item ) ;
 proto_tree_add_item ( sigcomp_udvm_tree , hf_sigcomp_udvm_instr , udvm_tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
 offset ++ ;
 switch ( instruction ) {
 case SIGCOMP_INSTR_AND : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_OR : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_NOT : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_LSHIFT : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_RSHIFT : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_ADD : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_SUBTRACT : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_MULTIPLY : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_DIVIDE : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_REMAINDER : offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_1 , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_operand_2 , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_SORT_ASCENDING : offset = offset + tvb_reported_length_remaining ( udvm_tvb , offset ) ;
 break ;
 case SIGCOMP_INSTR_SORT_DESCENDING : offset = offset + tvb_reported_length_remaining ( udvm_tvb , offset ) ;
 break ;
 case SIGCOMP_INSTR_SHA_1 : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_position , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_ref_dest , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_LOAD : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_address , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_value , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_value , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_MULTILOAD : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_address , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_literal_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_literal_num , udvm_tvb , start_offset , len , value ) ;
 n = value ;
 while ( n > 0 ) {
 n = n - 1 ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_value , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_value , udvm_tvb , start_offset , len , value ) ;
 }
 }
 break ;
 case SIGCOMP_INSTR_PUSH : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_value , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_value , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_POP : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_COPY : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_position , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_ref_dest , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_COPY_LITERAL : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_position , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_ref_dest , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_COPY_OFFSET : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_offset , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_offset , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_reference_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_ref_dest , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_MEMSET : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_address , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_start_value , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_offset , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_JUMP : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_COMPARE : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_value , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_value , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_value , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_value , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_CALL : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_RETURN : break ;
 case SIGCOMP_INSTR_SWITCH : offset = dissect_udvm_literal_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_literal_num , udvm_tvb , start_offset , len , value ) ;
 n = value ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_j , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_j , udvm_tvb , start_offset , len , value ) ;
 }
 while ( n > 0 ) {
 n = n - 1 ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_CRC : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_value , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_value , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_position , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_INPUT_BYTES : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_destination , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_destination , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_INPUT_BITS : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_length , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_destination , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_destination , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_INPUT_HUFFMAN : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_destination , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_destination , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 value = ( value + UDVM_address ) & 0xffff ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_at_address , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_literal_operand ( udvm_tvb , sigcomp_udvm_tree , offset , & start_offset , & value ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_literal_num , udvm_tvb , start_offset , len , value ) ;
 n = value ;
 while ( n > 0 ) {
 n = n - 1 ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_bits , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_lower_bound , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_upper_bound , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , FALSE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_uncompressed , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_STATE_ACCESS : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_partial_identifier_start , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_partial_identifier_length , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_state_begin , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_length_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_address_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_address , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_instr , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_STATE_CREATE : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_length_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_address_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_address , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_instr , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_min_acc_len , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_ret_pri , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_STATE_FREE : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_partial_identifier_start , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_partial_identifier_length , udvm_tvb , start_offset , len , value ) ;
 break ;
 case SIGCOMP_INSTR_OUTPUT : offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_addr_output_start , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_output_start , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_output_length_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_output_length , udvm_tvb , start_offset , len , value ) ;
 }
 break ;
 case SIGCOMP_INSTR_END_MESSAGE : if ( ( msg_length - 1 ) < offset ) {
 proto_tree_add_expert ( sigcomp_udvm_tree , pinfo , & ei_sigcomp_all_remaining_parameters_zero , udvm_tvb , 0 , - 1 ) ;
 return ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_req_feedback_loc , udvm_tvb , start_offset , len , value ) ;
 if ( ( msg_length - 1 ) < offset ) {
 proto_tree_add_expert ( sigcomp_udvm_tree , pinfo , & ei_sigcomp_all_remaining_parameters_zero , udvm_tvb , offset - 1 , - 1 ) ;
 return ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_ret_param_loc , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_length_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_length , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 if ( is_memory_address ) {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_address_addr , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_address , udvm_tvb , start_offset , len , value ) ;
 }
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_instr , udvm_tvb , start_offset , len , value ) ;
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_min_acc_len , udvm_tvb , start_offset , len , value ) ;
 if ( tvb_reported_length_remaining ( udvm_tvb , offset ) != 0 ) {
 offset = dissect_udvm_multitype_operand ( udvm_tvb , sigcomp_udvm_tree , offset , TRUE , & start_offset , & value , & is_memory_address ) ;
 len = offset - start_offset ;
 proto_tree_add_uint ( sigcomp_udvm_tree , hf_udvm_state_ret_pri , udvm_tvb , start_offset , len , value ) ;
 }
 else {
 item2 = proto_tree_add_uint_format_value ( sigcomp_udvm_tree , hf_udvm_state_ret_pri , udvm_tvb , offset , 1 , 0 , "0 (Not in the uploaded code as UDVM buffer initialized to Zero" ) ;
 PROTO_ITEM_SET_GENERATED ( item2 ) ;
 }
 if ( tvb_reported_length_remaining ( udvm_tvb , offset ) != 0 ) {
 len = tvb_reported_length_remaining ( udvm_tvb , offset ) ;
 UDVM_address = start_address + offset ;
 proto_tree_add_bytes_format ( sigcomp_udvm_tree , hf_sigcomp_remaining_bytes , udvm_tvb , offset , len , NULL , "Remaining %u bytes starting at UDVM addr %u (0x%x)- State information ?" , len , UDVM_address , UDVM_address ) ;
 }
 offset = offset + tvb_reported_length_remaining ( udvm_tvb , offset ) ;
 break ;
 default : offset = offset + tvb_reported_length_remaining ( udvm_tvb , offset ) ;
 break ;
 }
 }
 return ;
 }


asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim)
{
	struct rlimit new_rlim, *old_rlim;
	unsigned long it_prof_secs;
	int retval;

	if (resource >= RLIM_NLIMITS)
		return -EINVAL;
	if (copy_from_user(&new_rlim, rlim, sizeof(*rlim)))
		return -EFAULT;
	if (new_rlim.rlim_cur > new_rlim.rlim_max)
		return -EINVAL;
	old_rlim = current->signal->rlim + resource;
	if ((new_rlim.rlim_max > old_rlim->rlim_max) &&
	    !capable(CAP_SYS_RESOURCE))
		return -EPERM;
	if (resource == RLIMIT_NOFILE && new_rlim.rlim_max > NR_OPEN)
		return -EPERM;

	retval = security_task_setrlimit(resource, &new_rlim);
	if (retval)
		return retval;

	task_lock(current->group_leader);
	*old_rlim = new_rlim;
	task_unlock(current->group_leader);

	if (resource != RLIMIT_CPU)
		goto out;

	/*
	 * RLIMIT_CPU handling.   Note that the kernel fails to return an error
	 * code if it rejected the user's attempt to set RLIMIT_CPU.  This is a
	 * very long-standing error, and fixing it now risks breakage of
	 * applications, so we live with it
	 */
	if (new_rlim.rlim_cur == RLIM_INFINITY)
		goto out;

	it_prof_secs = cputime_to_secs(current->signal->it_prof_expires);
	if (it_prof_secs == 0 || new_rlim.rlim_cur <= it_prof_secs) {
		unsigned long rlim_cur = new_rlim.rlim_cur;
		cputime_t cputime;

		if (rlim_cur == 0) {
			/*
			 * The caller is asking for an immediate RLIMIT_CPU
			 * expiry.  But we use the zero value to mean "it was
			 * never set".  So let's cheat and make it one second
			 * instead
			 */
			rlim_cur = 1;
		}
		cputime = secs_to_cputime(rlim_cur);
		read_lock(&tasklist_lock);
		spin_lock_irq(&current->sighand->siglock);
		set_process_cpu_timer(current, CPUCLOCK_PROF, &cputime, NULL);
		spin_unlock_irq(&current->sighand->siglock);
		read_unlock(&tasklist_lock);
	}
out:
	return 0;
}


static void steamdiscover_dissect_body_proofresponse ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , gint offset , gint bytes_left ) {
 gint len ;
 gint64 value ;
 protobuf_desc_t pb = {
 tvb , offset , bytes_left }
 ;
 protobuf_tag_t tag = {
 0 , 0 , 0 }
 ;
 while ( protobuf_iter_next ( & pb , & tag ) ) {
 switch ( tag . field_number ) {
 case STEAMDISCOVER_FN_PROOFRESPONSE_RESPONSE : STEAMDISCOVER_ENSURE_WIRETYPE ( PROTOBUF_WIRETYPE_LENGTHDELIMITED ) ;
 value = get_varint64 ( pb . tvb , pb . offset , pb . bytes_left , & len ) ;
 proto_tree_add_item ( tree , hf_steam_ihs_discovery_body_proofresponse_response , pb . tvb , pb . offset + len , ( gint ) value , ENC_NA ) ;
 len += ( gint ) value ;
 break ;
 default : len = protobuf_dissect_unknown_field ( & pb , & tag , pinfo , tree , NULL ) ;
 break ;
 }
 protobuf_seek_forward ( & pb , len ) ;
 }
 }


recvauth_common(krb5_context context,
                krb5_auth_context * auth_context,
                /* IN */
                krb5_pointer fd,
                char *appl_version,
                krb5_principal server,
                krb5_int32 flags,
                krb5_keytab keytab,
                /* OUT */
                krb5_ticket ** ticket,
                krb5_data *version)
{
    krb5_auth_context     new_auth_context;
    krb5_flags            ap_option = 0;
    krb5_error_code       retval, problem;
    krb5_data             inbuf;
    krb5_data             outbuf;
    krb5_rcache           rcache = 0;
    krb5_octet            response;
    krb5_data             null_server;
    int                   need_error_free = 0;
    int                   local_rcache = 0, local_authcon = 0;

    /*
     * Zero out problem variable.  If problem is set at the end of
     * the intial version negotiation section, it means that we
     * need to send an error code back to the client application
     * and exit.
     */
    problem = 0;
    response = 0;

    if (!(flags & KRB5_RECVAUTH_SKIP_VERSION)) {
        /*
         * First read the sendauth version string and check it.
         */
        if ((retval = krb5_read_message(context, fd, &inbuf)))
            return(retval);
        if (strcmp(inbuf.data, sendauth_version)) {
            problem = KRB5_SENDAUTH_BADAUTHVERS;
            response = 1;
        }
        free(inbuf.data);
    }
    if (flags & KRB5_RECVAUTH_BADAUTHVERS) {
        problem = KRB5_SENDAUTH_BADAUTHVERS;
        response = 1;
    }

    /*
     * Do the same thing for the application version string.
     */
    if ((retval = krb5_read_message(context, fd, &inbuf)))
        return(retval);
    if (appl_version && strcmp(inbuf.data, appl_version)) {
        if (!problem) {
            problem = KRB5_SENDAUTH_BADAPPLVERS;
            response = 2;
        }
    }
    if (version && !problem)
        *version = inbuf;
    else
        free(inbuf.data);

    /*
     * Now we actually write the response.  If the response is non-zero,
     * exit with a return value of problem
     */
    if ((krb5_net_write(context, *((int *)fd), (char *)&response, 1)) < 0) {
        return(problem); /* We'll return the top-level problem */
    }
    if (problem)
        return(problem);

    /* We are clear of errors here */

    /*
     * Now, let's read the AP_REQ message and decode it
     */
    if ((retval = krb5_read_message(context, fd, &inbuf)))
        return retval;

    if (*auth_context == NULL) {
        problem = krb5_auth_con_init(context, &new_auth_context);
        *auth_context = new_auth_context;
        local_authcon = 1;
    }
    krb5_auth_con_getrcache(context, *auth_context, &rcache);
    if ((!problem) && rcache == NULL) {
        /*
         * Setup the replay cache.
         */
        if (server != NULL && server->length > 0) {
            problem = krb5_get_server_rcache(context, &server->data[0],
                                             &rcache);
        } else {
            null_server.length = 7;
            null_server.data = "default";
            problem = krb5_get_server_rcache(context, &null_server, &rcache);
        }
        if (!problem)
            problem = krb5_auth_con_setrcache(context, *auth_context, rcache);
        local_rcache = 1;
    }
    if (!problem) {
        problem = krb5_rd_req(context, auth_context, &inbuf, server,
                              keytab, &ap_option, ticket);
        free(inbuf.data);
    }

    /*
     * If there was a problem, send back a krb5_error message,
     * preceeded by the length of the krb5_error message.  If
     * everything's ok, send back 0 for the length.
     */
    if (problem) {
        krb5_error      error;
        const   char *message;

        memset(&error, 0, sizeof(error));
        krb5_us_timeofday(context, &error.stime, &error.susec);
        if(server)
            error.server = server;
        else {
            /* If this fails - ie. ENOMEM we are hosed
               we cannot even send the error if we wanted to... */
            (void) krb5_parse_name(context, "????", &error.server);
            need_error_free = 1;
        }

        error.error = problem - ERROR_TABLE_BASE_krb5;
        if (error.error > 127)
            error.error = KRB_ERR_GENERIC;
        message = error_message(problem);
        error.text.length  = strlen(message) + 1;
        error.text.data = strdup(message);
        if (!error.text.data) {
            retval = ENOMEM;
            goto cleanup;
        }
        if ((retval = krb5_mk_error(context, &error, &outbuf))) {
            free(error.text.data);
            goto cleanup;
        }
        free(error.text.data);
        if(need_error_free)
            krb5_free_principal(context, error.server);

    } else {
        outbuf.length = 0;
        outbuf.data = 0;
    }

    retval = krb5_write_message(context, fd, &outbuf);
    if (outbuf.data) {
        free(outbuf.data);
        /* We sent back an error, we need cleanup then return */
        retval = problem;
        goto cleanup;
    }
    if (retval)
        goto cleanup;

    /* Here lies the mutual authentication stuff... */
    if ((ap_option & AP_OPTS_MUTUAL_REQUIRED)) {
        if ((retval = krb5_mk_rep(context, *auth_context, &outbuf))) {
            return(retval);
        }
        retval = krb5_write_message(context, fd, &outbuf);
        free(outbuf.data);
    }

cleanup:;
    if (retval) {
        if (local_authcon) {
            krb5_auth_con_free(context, *auth_context);
        } else if (local_rcache && rcache != NULL) {
            krb5_rc_close(context, rcache);
            krb5_auth_con_setrcache(context, *auth_context, NULL);
        }
    }
    return retval;
}


static int setup_frame(int sig, struct k_sigaction *ka,
		       sigset_t *set, struct pt_regs * regs)
{
	void __user *restorer;
	struct sigframe __user *frame;
	int err = 0;
	int usig;

	frame = get_sigframe(ka, regs, sizeof(*frame));

	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
		goto give_sigsegv;

	usig = current_thread_info()->exec_domain
		&& current_thread_info()->exec_domain->signal_invmap
		&& sig < 32
		? current_thread_info()->exec_domain->signal_invmap[sig]
		: sig;

	err = __put_user(usig, &frame->sig);
	if (err)
		goto give_sigsegv;

	err = setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]);
	if (err)
		goto give_sigsegv;

	if (_NSIG_WORDS > 1) {
		err = __copy_to_user(&frame->extramask, &set->sig[1],
				      sizeof(frame->extramask));
		if (err)
			goto give_sigsegv;
	}

	if (current->binfmt->hasvdso)
		restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
	else
		restorer = &frame->retcode;
	if (ka->sa.sa_flags & SA_RESTORER)
		restorer = ka->sa.sa_restorer;

	/* Set up to return from userspace.  */
	err |= __put_user(restorer, &frame->pretcode);

	/*
	 * This is popl %eax ; movl $,%eax ; int $0x80
	 *
	 * WE DO NOT USE IT ANY MORE! It's only left here for historical
	 * reasons and because gdb uses it as a signature to notice
	 * signal handler stack frames.
	 */
	err |= __put_user(0xb858, (short __user *)(frame->retcode+0));
	err |= __put_user(__NR_sigreturn, (int __user *)(frame->retcode+2));
	err |= __put_user(0x80cd, (short __user *)(frame->retcode+6));

	if (err)
		goto give_sigsegv;

	/* Set up registers for signal handler */
	regs->sp = (unsigned long) frame;
	regs->ip = (unsigned long) ka->sa.sa_handler;
	regs->ax = (unsigned long) sig;
	regs->dx = (unsigned long) 0;
	regs->cx = (unsigned long) 0;

	regs->ds = __USER_DS;
	regs->es = __USER_DS;
	regs->ss = __USER_DS;
	regs->cs = __USER_CS;

	/*
	 * Clear TF when entering the signal handler, but
	 * notify any tracer that was single-stepping it.
	 * The tracer may want to single-step inside the
	 * handler too.
	 */
	regs->flags &= ~TF_MASK;
	if (test_thread_flag(TIF_SINGLESTEP))
		ptrace_notify(SIGTRAP);

#if DEBUG_SIG
	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
		current->comm, current->pid, frame, regs->ip, frame->pretcode);
#endif

	return 0;

give_sigsegv:
	force_sigsegv(sig, current);
	return -EFAULT;
}


void hb_set_add_range ( hb_set_t * set , hb_codepoint_t first , hb_codepoint_t last ) {
 set -> add_range ( first , last ) ;
 }


init_ctx_new(OM_uint32 *minor_status,
	     spnego_gss_cred_id_t spcred,
	     gss_ctx_id_t *ctx,
	     send_token_flag *tokflag)
{
	OM_uint32 ret;
	spnego_gss_ctx_id_t sc = NULL;

	sc = create_spnego_ctx();
	if (sc == NULL)
		return GSS_S_FAILURE;

	/* determine negotiation mech set */
	ret = get_negotiable_mechs(minor_status, spcred, GSS_C_INITIATE,
				   &sc->mech_set);
	if (ret != GSS_S_COMPLETE)
		goto cleanup;

	/* Set an initial internal mech to make the first context token. */
	sc->internal_mech = &sc->mech_set->elements[0];

	if (put_mech_set(sc->mech_set, &sc->DER_mechTypes) < 0) {
		ret = GSS_S_FAILURE;
		goto cleanup;
	}
	/*
	 * The actual context is not yet determined, set the output
	 * context handle to refer to the spnego context itself.
	 */
	sc->ctx_handle = GSS_C_NO_CONTEXT;
	*ctx = (gss_ctx_id_t)sc;
	sc = NULL;
	*tokflag = INIT_TOKEN_SEND;
	ret = GSS_S_CONTINUE_NEEDED;

cleanup:
	release_spnego_ctx(&sc);
	return ret;
}


produce_frozen_state (const char *name)
{
  FILE *file;
  int h;
  symbol *sym;
  const builtin *bp;

  if (file = fopen (name, O_BINARY ? "wb" : "w"), !file)
    {
      M4ERROR ((warning_status, errno, name));
      return;
    }

  /* Write a recognizable header.  */

  xfprintf (file, "# This is a frozen state file generated by %s\n",
	   PACKAGE_STRING);
  xfprintf (file, "V1\n");

  /* Dump quote delimiters.  */

  if (strcmp (lquote.string, DEF_LQUOTE) || strcmp (rquote.string, DEF_RQUOTE))
    {
      xfprintf (file, "Q%d,%d\n", (int) lquote.length, (int) rquote.length);
      fputs (lquote.string, file);
      fputs (rquote.string, file);
      fputc ('\n', file);
    }

  /* Dump comment delimiters.  */

  if (strcmp (bcomm.string, DEF_BCOMM) || strcmp (ecomm.string, DEF_ECOMM))
    {
      xfprintf (file, "C%d,%d\n", (int) bcomm.length, (int) ecomm.length);
      fputs (bcomm.string, file);
      fputs (ecomm.string, file);
      fputc ('\n', file);
    }

  /* Dump all symbols.  */

  for (h = 0; h < hash_table_size; h++)
    {

      /* Process all entries in one bucket, from the last to the first.
	 This order ensures that, at reload time, pushdef's will be
	 executed with the oldest definitions first.  */

      symtab[h] = reverse_symbol_list (symtab[h]);
      for (sym = symtab[h]; sym; sym = SYMBOL_NEXT (sym))
	{
	  switch (SYMBOL_TYPE (sym))
	    {
	    case TOKEN_TEXT:
	      xfprintf (file, "T%d,%d\n",
			(int) strlen (SYMBOL_NAME (sym)),
			(int) strlen (SYMBOL_TEXT (sym)));
	      fputs (SYMBOL_NAME (sym), file);
	      fputs (SYMBOL_TEXT (sym), file);
	      fputc ('\n', file);
	      break;

	    case TOKEN_FUNC:
	      bp = find_builtin_by_addr (SYMBOL_FUNC (sym));
	      if (bp == NULL)
		{
		  M4ERROR ((warning_status, 0, "\
INTERNAL ERROR: builtin not found in builtin table!"));
		  abort ();
		}
	      xfprintf (file, "F%d,%d\n",
			(int) strlen (SYMBOL_NAME (sym)),
			(int) strlen (bp->name));
	      fputs (SYMBOL_NAME (sym), file);
	      fputs (bp->name, file);
	      fputc ('\n', file);
	      break;

	    case TOKEN_VOID:
	      /* Ignore placeholder tokens that exist due to traceon.  */
	      break;

	    default:
	      M4ERROR ((warning_status, 0, "\
INTERNAL ERROR: bad token data type in freeze_one_symbol ()"));
	      abort ();
	      break;
	    }
	}

      /* Reverse the bucket once more, putting it back as it was.  */

      symtab[h] = reverse_symbol_list (symtab[h]);
    }

  /* Let diversions be issued from output.c module, its cleaner to have this
     piece of code there.  */

  freeze_diversions (file);

  /* All done.  */

  fputs ("# End of frozen state file\n", file);
  if (close_stream (file) != 0)
    M4ERROR ((EXIT_FAILURE, errno, "unable to create frozen state"));
}