Beispiel #1
0
HRESULT CTDSThrough7ParameterPositionVector::SetModelParameters2 (double ha, double f) 
{
	m_DstSys.m_HA	= ha;
	m_DstSys.m_f	= f;
	m_DstSys.m_HB	= HB(ha, f);
	m_DstSys.m_e2	= E2(f);
	m_DstSys.m_e12	= E12(f);
	m_DstSys.m_e22	= E22(ha, HB(ha, f));
	return S_OK;
}
Beispiel #2
0
static int skb_to_mamac(const struct sk_buff *skb, struct mbo *mbo)
{
	u8 *buff = mbo->virt_address;
	static const u8 broadcast[] = { 0x03, 0xFF };
	const u8 *dest_addr = skb->data + 4;
	const u8 *eth_type = skb->data + 12;
	unsigned int payload_len = skb->len - ETH_HLEN;
	unsigned int mdp_len = payload_len + MDP_HDR_LEN;

	if (mbo->buffer_length < mdp_len) {
		pr_err("drop: too small buffer! (%d for %d)\n",
		       mbo->buffer_length, mdp_len);
		return -EINVAL;
	}

	if (skb->len < ETH_HLEN) {
		pr_err("drop: too small packet! (%d)\n", skb->len);
		return -EINVAL;
	}

	if (dest_addr[0] == 0xFF && dest_addr[1] == 0xFF)
		dest_addr = broadcast;

	*buff++ = HB(mdp_len - 2);
	*buff++ = LB(mdp_len - 2);

	*buff++ = PMHL;
	*buff++ = (PMS_FIFONO_MDP << PMS_FIFONO_SHIFT) | PMS_MSGTYPE_DATA;
	*buff++ = PMS_DEF_PRIO;
	*buff++ = dest_addr[0];
	*buff++ = dest_addr[1];
	*buff++ = 0x00;

	*buff++ = HB(payload_len + 6);
	*buff++ = LB(payload_len + 6);

	/* end of FPH here */

	*buff++ = eth_type[0];
	*buff++ = eth_type[1];
	*buff++ = 0;
	*buff++ = 0;

	*buff++ = PMS_TELID_UNSEGM_MAMAC << 4 | HB(payload_len);
	*buff++ = LB(payload_len);

	memcpy(buff, skb->data + ETH_HLEN, payload_len);
	mbo->buffer_length = mdp_len;
	return 0;
}
Beispiel #3
0
static int skb_to_mep(const struct sk_buff *skb, struct mbo *mbo)
{
	u8 *buff = mbo->virt_address;
	unsigned int mep_len = skb->len + MEP_HDR_LEN;

	if (mbo->buffer_length < mep_len) {
		pr_err("drop: too small buffer! (%d for %d)\n",
		       mbo->buffer_length, mep_len);
		return -EINVAL;
	}

	*buff++ = HB(mep_len - 2);
	*buff++ = LB(mep_len - 2);

	*buff++ = PMHL;
	*buff++ = (PMS_FIFONO_MEP << PMS_FIFONO_SHIFT) | PMS_MSGTYPE_DATA;
	*buff++ = (MEP_DEF_RETRY << PMS_RETRY_SHIFT) | PMS_DEF_PRIO;
	*buff++ = 0;
	*buff++ = 0;
	*buff++ = 0;

	memcpy(buff, skb->data, skb->len);
	mbo->buffer_length = mep_len;
	return 0;
}
Beispiel #4
0
static void
tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode)
{
	u8 buf[PB(HDMI_AVI_INFOFRAME_SIZE) + 1];

	memset(buf, 0, sizeof(buf));
	buf[HB(0)] = HDMI_INFOFRAME_TYPE_AVI;
	buf[HB(1)] = 0x02;
	buf[HB(2)] = HDMI_AVI_INFOFRAME_SIZE;
	buf[PB(1)] = HDMI_SCAN_MODE_UNDERSCAN;
	buf[PB(2)] = HDMI_ACTIVE_ASPECT_PICTURE;
	buf[PB(3)] = HDMI_QUANTIZATION_RANGE_FULL << 2;
	buf[PB(4)] = drm_match_cea_mode(mode);

	tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf,
			 sizeof(buf));
}
Beispiel #5
0
static void
tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p)
{
	u8 buf[PB(HDMI_AUDIO_INFOFRAME_SIZE) + 1];

	memset(buf, 0, sizeof(buf));
	buf[HB(0)] = HDMI_INFOFRAME_TYPE_AUDIO;
	buf[HB(1)] = 0x01;
	buf[HB(2)] = HDMI_AUDIO_INFOFRAME_SIZE;
	buf[PB(1)] = p->audio_frame[1] & 0x07; /* CC */
	buf[PB(2)] = p->audio_frame[2] & 0x1c; /* SF */
	buf[PB(4)] = p->audio_frame[4];
	buf[PB(5)] = p->audio_frame[5] & 0xf8; /* DM_INH + LSV */

	tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf,
			 sizeof(buf));
}
Beispiel #6
0
bool TpsOrderParameter::hBorHB(TpsTrajectory& traj)
{
	if(_use_HB) {
		return HB(traj);
	}
	else {
		return hB(traj);
	}

}
Beispiel #7
0
void cpu_reset(void)
{
	union reg acc;
#ifdef DYNAREC
        int i;
        dynapointer=0;
#endif
	cpu.speed = 0;
	cpu.halt = 0;
	cpu.div = 0;
	cpu.tim = 0;
	cpu.lcdc = 40;

	IME = 0;
	IMA = 0;
	
	PC = 0x0100;
	SP = 0xFFFE;
	W(acc) = 0x01B0;
	A=HB(acc);
	F=LB(acc);
	W(acc) = 0x0013;
	B=HB(acc);
	C=LB(acc);
	W(acc) = 0x00D8;
	D=HB(acc);
	E=LB(acc);
	HL = 0x014D;

        if (hw.cgb) A = 0x11;
        if (hw.gba) B = 0x01;
#ifdef DYNAREC
        for(i=0;i<(1<<HASH_SIGNIFICANT_LOWER_BITS);i++)
           address_map[i]=0;
#endif
}
Beispiel #8
0
extern void serial_init () 
{
  /* disable interrupts */
  OUTB(0x0,COM1+1); 
  /* enable dlab (baud rate divisor) */
  OUTB(0x80,COM1+3);
  /* set divisor */
  u16 div = get_divisor ();
  OUTB(LB(div),COM1+0); 
  OUTB(HB(div),COM1+1);
  /* 8 bits, no parity, one stop byte */
  OUTB(0x03,COM1+3); 
  /* fifo 14-byte threshold */
  OUTB(0xc7,COM1+2);
  /* irqs enabled */
  OUTB(0x0b,COM1+4);
}