FreeBSD/sys/i386/i386/bpf_jit_machdep.c
/*
 * Emit routine to output the actual binary code.
 */
Emit routine to output the actual binary code.
Emit routine to output the actual binary code .
static void
emit_code(bpf_bin_stream *stream, u_int value, u_int len)
{
	switch (len) {
	case 1:
		stream->ibuf[stream->cur_ip] = (u_char)value;
		stream->cur_ip++;
		break;
	case 2:
		*((u_short *)(stream->ibuf + stream->cur_ip)) = (u_short)value;
		stream->cur_ip += 2;
		break;
	case 4:
		*((u_int *)(stream->ibuf + stream->cur_ip)) = value;
		stream->cur_ip += 4;
		break;
	}
	return;
}
static void emit_code ( bpf_bin_stream * stream , u_int value , u_int len ) { switch ( len ) { case 1 : stream -> ibuf [ stream -> cur_ip ] = ( u_char ) value ; stream -> cur_ip ++ ; break ; case 2 : * ( ( u_short * ) ( stream -> ibuf + stream -> cur_ip ) ) = ( u_short ) value ; stream -> cur_ip += 2 ; break ; case 4 : * ( ( u_int * ) ( stream -> ibuf + stream -> cur_ip ) ) = value ; stream -> cur_ip += 4 ; break ; } return ; }
Emit routine to output the actual binary code.
Emit routine to output the actual binary code .