• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ R4函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中R4函数的典型用法代码示例。如果您正苦于以下问题:C++ R4函数的具体用法?C++ R4怎么用?C++ R4使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了R4函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Transform

static void Transform(Sha* sha)
{
    word32 W[80], i;

    /* Copy context->state[] to working vars */ 
    word32 a = sha->digest[0];
    word32 b = sha->digest[1];
    word32 c = sha->digest[2];
    word32 d = sha->digest[3];
    word32 e = sha->digest[4];

    for (i = 0; i < 16; i++)
        W[i] = sha->buffer[i];

    for (i = 16; i < 80; i++)
        W[i] = rotlFixed(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);
    
    /* 4 rounds of 20 operations each.  */
    for (i = 0; i < 20; ) { 
        R0(a,b,c,d,e,i); i++;
        R0(e,a,b,c,d,i); i++;
        R0(d,e,a,b,c,i); i++;
        R0(c,d,e,a,b,i); i++;
        R0(b,c,d,e,a,i); i++;
    }

    for (i = 20; i < 40; ) {
        R2(a,b,c,d,e,i); i++;
        R2(e,a,b,c,d,i); i++;
        R2(d,e,a,b,c,i); i++;
        R2(c,d,e,a,b,i); i++;
        R2(b,c,d,e,a,i); i++;
    }

    for (i = 40; i < 60; ) {
        R3(a,b,c,d,e,i); i++;
        R3(e,a,b,c,d,i); i++;
        R3(d,e,a,b,c,i); i++;
        R3(c,d,e,a,b,i); i++;
        R3(b,c,d,e,a,i); i++;
    }

    for (i = 60; i < 80; ) {
        R4(a,b,c,d,e,i); i++;
        R4(e,a,b,c,d,i); i++;
        R4(d,e,a,b,c,i); i++;
        R4(c,d,e,a,b,i); i++;
        R4(b,c,d,e,a,i); i++;
    }

    /* Add the working vars back into digest state[] */
    sha->digest[0] += a;
    sha->digest[1] += b;
    sha->digest[2] += c;
    sha->digest[3] += d;
    sha->digest[4] += e;
}
开发者ID:GreenLunar,项目名称:smaFS,代码行数:57,代码来源:sha.c


示例2: transform

static void transform(uint32_t state[5], uint8_t buffer[64]){
    uint32_t block[80];
    unsigned int i, a, b, c, d, e;

    a = state[0];
    b = state[1];
    c = state[2];
    d = state[3];
    e = state[4];
#ifdef CONFIG_SMALL
    for(i=0; i<80; i++){
        int t;
        if(i<16) t= be2me_32(((uint32_t*)buffer)[i]);
        else     t= rol(block[i-3]^block[i-8]^block[i-14]^block[i-16],1);
        block[i]= t;
        t+= e+rol(a,5);
        if(i<40){
            if(i<20)    t+= ((b&(c^d))^d)    +0x5A827999;
            else        t+= ( b^c     ^d)    +0x6ED9EBA1;
        }else{
            if(i<60)    t+= (((b|c)&d)|(b&c))+0x8F1BBCDC;
            else        t+= ( b^c     ^d)    +0xCA62C1D6;
        }
        e= d;
        d= c;
        c= rol(b,30);
        b= a;
        a= t;
    }
#else
    for(i=0; i<15; i+=5){
        R0(a,b,c,d,e,0+i); R0(e,a,b,c,d,1+i); R0(d,e,a,b,c,2+i); R0(c,d,e,a,b,3+i); R0(b,c,d,e,a,4+i);
    }
    R0(a,b,c,d,e,15); R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
    for(i=20; i<40; i+=5){
        R2(a,b,c,d,e,0+i); R2(e,a,b,c,d,1+i); R2(d,e,a,b,c,2+i); R2(c,d,e,a,b,3+i); R2(b,c,d,e,a,4+i);
    }
    for(; i<60; i+=5){
        R3(a,b,c,d,e,0+i); R3(e,a,b,c,d,1+i); R3(d,e,a,b,c,2+i); R3(c,d,e,a,b,3+i); R3(b,c,d,e,a,4+i);
    }
    for(; i<80; i+=5){
        R4(a,b,c,d,e,0+i); R4(e,a,b,c,d,1+i); R4(d,e,a,b,c,2+i); R4(c,d,e,a,b,3+i); R4(b,c,d,e,a,4+i);
    }
#endif
    state[0] += a;
    state[1] += b;
    state[2] += c;
    state[3] += d;
    state[4] += e;
}
开发者ID:joshdekock,项目名称:jim-ps3ware,代码行数:50,代码来源:sha1.c


示例3: k8_mc2_mce

static bool k8_mc2_mce(u16 ec, u8 xec)
{
	bool ret = true;

	if (xec == 0x1)
		pr_cont(" in the write data buffers.\n");
	else if (xec == 0x3)
		pr_cont(" in the victim data buffers.\n");
	else if (xec == 0x2 && MEM_ERROR(ec))
		pr_cont(": %s error in the L2 cache tags.\n", R4_MSG(ec));
	else if (xec == 0x0) {
		if (TLB_ERROR(ec))
			pr_cont(": %s error in a Page Descriptor Cache or "
				"Guest TLB.\n", TT_MSG(ec));
		else if (BUS_ERROR(ec))
			pr_cont(": %s/ECC error in data read from NB: %s.\n",
				R4_MSG(ec), PP_MSG(ec));
		else if (MEM_ERROR(ec)) {
			u8 r4 = R4(ec);

			if (r4 >= 0x7)
				pr_cont(": %s error during data copyback.\n",
					R4_MSG(ec));
			else if (r4 <= 0x1)
				pr_cont(": %s parity/ECC error during data "
					"access from L2.\n", R4_MSG(ec));
			else
				ret = false;
		} else
			ret = false;
	} else
		ret = false;

	return ret;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:35,代码来源:mce_amd.c


示例4: R4

void Homography::estimate(int *noi, int *nof, double threshold)
{
	if(_n < 20) {
		_hom.setIdentity();
		return;
	}

	RX::mat3 H3, H4;

	Ransac R4(_ux2, _ux1, _nused);
	R4.normalize();
	R4.mainLoop(4, 0.01, H4);
	R4.fitHomography(H4);
	R4.denormalize(H4);

	_hom = H4;
	if(noi) *noi = R4.noi();
	if(nof) *nof = R4.nof();
	_inliers = R4.inliers();
	
 	for(int i = 0; i < 3; ++i) {
		for(int j = 0; j < 3; ++j) {
			_hom.set(i, j, _hom.at(i, j)/_hom.at(2, 2));
		}
	}
}
开发者ID:rosaliaschneider,项目名称:Project2011b,代码行数:26,代码来源:Homography.cpp


示例5: sha1_core

static void sha1_core(struct sha1_ctx * ctx)
{
	__m128i a, b, c, d, e;
	__m128i k0, k1, k2, k3;
	__m128i v1, w;
	SVAL buf[16];

	a = SET1(AA);
	b = SET1(BB);
	c = SET1(CC);
	d = SET1(DD);
	e = SET1(EE);

	k0 = SET1(K0);
	R20(SHA1R0, 0);

	k1 = SET1(K1);
	R20(SHA1R1, 20);

	k2 = SET1(K2);
	R20(SHA1R2, 40);

	k3 = SET1(K3);
	R16(SHA1R3, 60);
	if (!ssresult_check(ctx->sres, a)) return;
	R4(SHA1R3, 76);

	FINAL(0, a, AA);
	FINAL(1, b, BB);
	FINAL(2, c, CC);
	FINAL(3, d, DD);
	FINAL(4, e, EE);
	check_result(ctx);
}
开发者ID:clcarwin,项目名称:mdrotor,代码行数:34,代码来源:sha1.c


示例6: k8_mc1_mce

static bool k8_mc1_mce(u16 ec, u8 xec)
{
	u8 ll	 = LL(ec);
	bool ret = true;

	if (!MEM_ERROR(ec))
		return false;

	if (ll == 0x2)
		pr_cont("during a linefill from L2.\n");
	else if (ll == 0x1) {
		switch (R4(ec)) {
		case R4_IRD:
			pr_cont("Parity error during data load.\n");
			break;

		case R4_EVICT:
			pr_cont("Copyback Parity/Victim error.\n");
			break;

		case R4_SNOOP:
			pr_cont("Tag Snoop error.\n");
			break;

		default:
			ret = false;
			break;
		}
	} else
		ret = false;

	return ret;
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:33,代码来源:mce_amd.c


示例7: decode_mc3_mce

static void decode_mc3_mce(struct mce *m)
{
	u16 ec = EC(m->status);
	u8 xec = XEC(m->status, xec_mask);

	if (boot_cpu_data.x86 >= 0x14) {
		pr_emerg("You shouldn't be seeing MC3 MCE on this cpu family,"
			 " please report on LKML.\n");
		return;
	}

	pr_emerg(HW_ERR "MC3 Error");

	if (xec == 0x0) {
		u8 r4 = R4(ec);

		if (!BUS_ERROR(ec) || (r4 != R4_DRD && r4 != R4_DWR))
			goto wrong_mc3_mce;

		pr_cont(" during %s.\n", R4_MSG(ec));
	} else
		goto wrong_mc3_mce;

	return;

 wrong_mc3_mce:
	pr_emerg(HW_ERR "Corrupted MC3 MCE info?\n");
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:28,代码来源:mce_amd.c


示例8: f10h_mc0_mce

static bool f10h_mc0_mce(u16 ec, u8 xec)
{
	if (R4(ec) == R4_GEN && LL(ec) == LL_L1) {
		pr_cont("during data scrub.\n");
		return true;
	}
	return f12h_mc0_mce(ec, xec);
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:8,代码来源:mce_amd.c


示例9: a

void
EulerAngleUpdaterCheck::initialize()
{
  const auto grain_num = _grain_tracker.getTotalFeatureCount();
  _angles.resize(grain_num);
  _angles_old.resize(grain_num);
  _diff.assign(3 * grain_num, 0.0);

  for (unsigned int i = 0; i < grain_num; ++i)
  {
    _angles[i] = _euler.getEulerAngles(i);
    _angles_old[i] = _euler.getEulerAnglesOld(i);
    RealGradient torque = _grain_torque.getTorqueValues()[i];

    RealVectorValue a(1, 1, 1);
    RotationTensor R(_angles[i]);  // Final rotation tensor
    RealVectorValue a_rot = R * a; // final rotated vector

    RotationTensor R0(_angles_old[i]);        // RotationTensor as per old euler angles
    RealVectorValue torque_rot = R0 * torque; // Rotated torque
    RealVectorValue a_rot0 = R0 * a;          // Rotated unit vector as per old euler angles

    /**
     * Change in euler angles are obtained from the torque & angular velocities about the material
     * axes.
     * Change in phi1, Phi and phi2 are caused by rotation about z axis, x' axis & z'' axis,
     * respectively.
     * Components of the angular velocities across z, x' and z'' axes are obtained from the torque
     * values.
     * This yields change in euler angles due to grain rotation.
     */
    RealVectorValue torque_rot1;
    RealVectorValue angle_rot;
    torque_rot1(0) =
        torque_rot(2); // Tourque about z changed to torque responsible for chaneg in angle phi1
    angle_rot(0) = _mr / _grain_volumes[i] * torque_rot1(0) * _dt; // change in phi1
    // Tourque about x' changed to torque responsible for chaneg in angle Phi
    torque_rot1(1) =
        (torque_rot(0) * std::cos(angle_rot(0)) + torque_rot(1) * std::sin(angle_rot(0)));
    angle_rot(1) = _mr / _grain_volumes[i] * torque_rot1(1) * _dt; // change in Phi
    // Tourque about z'' changed to torque responsible for chaneg in angle phi2
    torque_rot1(2) = (torque_rot(0) * std::sin(angle_rot(0)) * std::sin(angle_rot(1)) -
                      torque_rot(1) * std::cos(angle_rot(0)) * std::sin(angle_rot(1)) +
                      torque_rot(2) * std::cos(angle_rot(1)));
    angle_rot(2) = _mr / _grain_volumes[i] * torque_rot1(2) * _dt; // change in phi2
    angle_rot *= (180.0 / libMesh::pi);

    RotationTensor R4(angle_rot);         // RotationTensor due to grain rotation
    RealVectorValue a_rot1 = R4 * a_rot0; // Final rotated vector obtained in two step rotation

    // Difference between the final positions of the rotated vector obtained in two different ways,
    // should be 0.0
    _diff[3 * i + 0] = a_rot(0) - a_rot1(0);
    _diff[3 * i + 1] = a_rot(1) - a_rot1(1);
    _diff[3 * i + 2] = a_rot(2) - a_rot1(2);
  }
}
开发者ID:aeslaughter,项目名称:moose,代码行数:57,代码来源:EulerAngleUpdaterCheck.C


示例10: main

int main(int argc, char** argv) {
	Giornale G1(12.50, "Titolo1", false);
	Giornale G2(1.50, "Titolo2", true);
	Giornale G3(2.00, "Titolo3", false);
	Rivista R4(22.70, "Titolo4", false, "Editore4", "Periodo4");
	Rivista R5(11.50, "Titolo5", true, "Editore5", "Periodo5");
	Rivista R6(6.00, "Titolo6", false,  "Editore6", "Periodo6");
	Quotidiano Q7(6.35, "Titolo7", false, "Direttore7", true);
	Quotidiano Q8(9.99, "Titolo8", true, "Direttore8", false);
	Quotidiano Q9(5, "Titolo9", false, "Direttore9", true);
	
	cout<<"Polimorfismo:\n";
	Giornale * vett[9];
	vett[0] = &G1;
	vett[1] = &G2;
	vett[2] = &G3;
	vett[3] = &R4;
	vett[4] = &R5;
	vett[5] = &R6;
	vett[6] = &Q7;
	vett[7] = &Q8;
	vett[8] = &Q9;
	
	for(int i=0; i<9; i++) {
		cout << *vett[i] << "\n\n";
	}
	
	cout<<"\n\nPila:\n";
	Pila P;
	for(int i=0; i<9; i++) {
		P.push(vett[i]);
	}
	cout<<P;
	
	ofstream file;
	file.open("./test.txt", ios::out);
	if(!file) {
		cout<<"Errore apertura file.";
	} else {
		file << P;
	}
	file.close();
	
	Rivista R10(1.00, "Titolo10", false,  "Editore10", "Periodo10");
	Quotidiano Q11(1.35, "Titolo11", false, "Direttore11", true);
	
	P.push(&R10);
	
	cout<<"\n\nEccezione:\n";
	try {
		P.push(&Q11);
	} catch(SpaceOverflow e) {
		cout<<e.errorLog();
	}
	return 0;
}
开发者ID:alessandrocar,项目名称:prog1,代码行数:56,代码来源:main.cpp


示例11: f14h_mc0_mce

static bool f14h_mc0_mce(u16 ec, u8 xec)
{
	u8 r4	 = R4(ec);
	bool ret = true;

	if (MEM_ERROR(ec)) {

		if (TT(ec) != TT_DATA || LL(ec) != LL_L1)
			return false;

		switch (r4) {
		case R4_DRD:
		case R4_DWR:
			pr_cont("Data/Tag parity error due to %s.\n",
				(r4 == R4_DRD ? "load/hw prf" : "store"));
			break;
		case R4_EVICT:
			pr_cont("Copyback parity error on a tag miss.\n");
			break;
		case R4_SNOOP:
			pr_cont("Tag parity error during snoop.\n");
			break;
		default:
			ret = false;
		}
	} else if (BUS_ERROR(ec)) {

		if ((II(ec) != II_MEM && II(ec) != II_IO) || LL(ec) != LL_LG)
			return false;

		pr_cont("System read data error on a ");

		switch (r4) {
		case R4_RD:
			pr_cont("TLB reload.\n");
			break;
		case R4_DWR:
			pr_cont("store.\n");
			break;
		case R4_DRD:
			pr_cont("load.\n");
			break;
		default:
			ret = false;
		}
	} else {
		ret = false;
	}

	return ret;
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:51,代码来源:mce_amd.c


示例12: decode_stqraw

/* decode skytraq raw channel mesurement -------------------------------------*/
static int decode_stqraw(raw_t *raw)
{
    int i,j,iod,prn,sat,n=0,nsat;
    unsigned char *p=raw->buff+4,ind;
    
    trace(4,"decode_stqraw: len=%d\n",raw->len);
    
    iod=U1(p+1);
    if (iod!=raw->iod) {
        trace(2,"stq raw iod error: iod=%d %d\n",iod,raw->iod);
        return -1;
    }
    nsat=U1(p+2);
    if (raw->len<8+23*nsat) {
        trace(2,"stq raw length error: len=%d nsat=%d\n",raw->len,nsat);
        return -1;
    }
    for (i=0,p+=3;i<nsat&&i<MAXOBS;i++,p+=23) {
        ind                    =U1(p+22);
        prn                    =U1(p);
        raw->obs.data[n].SNR[0]=(unsigned char)(U1(p+1)*4.0+0.5);
        raw->obs.data[n].P[0]  =(ind&0x1)?R8(p+ 2):0.0;
        raw->obs.data[n].L[0]  =(ind&0x4)?R8(p+10):0.0;
        raw->obs.data[n].D[0]  =(ind&0x2)?R4(p+18):0.0f;
        raw->obs.data[n].LLI[0]=(ind&0x8)?1:0; /* slip */
        raw->obs.data[n].code[0]=CODE_L1C;
        
        /* receiver dependent options */
        if (strstr(raw->opt,"-invcp")) {
            raw->obs.data[n].L[0]=-raw->obs.data[n].L[0];
        }
        if (prn>MAXPRNGPS) prn+=MINPRNSBS-38;
        if (!(sat=satno(MINPRNSBS<=prn?SYS_SBS:SYS_GPS,prn))) {
            trace(2,"stq raw satellite number error: prn=%d\n",prn);
            continue;
        }
        raw->obs.data[n].time=raw->time;
        raw->obs.data[n].sat =sat;
        
        for (j=1;j<NFREQ;j++) {
            raw->obs.data[n].L[j]=raw->obs.data[n].P[j]=0.0;
            raw->obs.data[n].D[j]=0.0;
            raw->obs.data[n].SNR[j]=raw->obs.data[n].LLI[j]=0;
            raw->obs.data[n].code[j]=CODE_NONE;
        }
        n++;
    }
    raw->obs.n=n;
    return n>0?1:0;
}
开发者ID:brNX,项目名称:rtklibros,代码行数:51,代码来源:skytraq.c


示例13: decode_x4aiono

/* decode NVS x4aiono --------------------------------------------------------*/
static int decode_x4aiono(raw_t *raw)
{
    unsigned char *p=raw->buff+2;
    
    trace(4,"decode_x4aiono: len=%d\n", raw->len);
    
    raw->nav.ion_gps[0] = R4(p   );
    raw->nav.ion_gps[1] = R4(p+ 4);
    raw->nav.ion_gps[2] = R4(p+ 8);
    raw->nav.ion_gps[3] = R4(p+12);
    raw->nav.ion_gps[4] = R4(p+16);
    raw->nav.ion_gps[5] = R4(p+20);
    raw->nav.ion_gps[6] = R4(p+24);
    raw->nav.ion_gps[7] = R4(p+28);
    
    return 9;
}
开发者ID:hfu,项目名称:gsilib102,代码行数:18,代码来源:nvs.c


示例14: decode_bnx_01_03

/* decode binex mesaage 0x01-03: decoded sbas ephmemeris ---------------------*/
static int decode_bnx_01_03(raw_t *raw, unsigned char *buff, int len)
{
    seph_t seph={0};
    unsigned char *p=buff;
    double tow,tod,tof;
    int prn,week,iodn;
    
    trace(4,"binex 0x01-03: len=%d\n",len);
    
    if (len>=98) {
        prn        =U1(p);     p+=1;
        week       =U2(p);     p+=2;
        tow        =U4(p);     p+=4;
        seph.af0   =R8(p);     p+=8;
        tod        =R4(p);     p+=4;
        tof        =U4(p);     p+=4;
        seph.pos[0]=R8(p)*1E3; p+=8;
        seph.vel[0]=R8(p)*1E3; p+=8;
        seph.acc[0]=R8(p)*1E3; p+=8;
        seph.pos[1]=R8(p)*1E3; p+=8;
        seph.vel[1]=R8(p)*1E3; p+=8;
        seph.acc[1]=R8(p)*1E3; p+=8;
        seph.pos[2]=R8(p)*1E3; p+=8;
        seph.vel[2]=R8(p)*1E3; p+=8;
        seph.acc[2]=R8(p)*1E3; p+=8;
        seph.svh   =U1(p);     p+=1;
        seph.sva   =U1(p);     p+=1;
        iodn       =U1(p);
    }
    else {
        trace(2,"binex 0x01-03 length error: len=%d\n",len);
        return -1;
    }
    if (!(seph.sat=satno(SYS_SBS,prn))) {
        trace(2,"binex 0x01-03 satellite error: prn=%d\n",prn);
        return -1;
    }
    seph.t0=gpst2time(week,tow);
    seph.tof=adjweek(seph.t0,tof);
    
    if (!strstr(raw->opt,"-EPHALL")) {
        if (fabs(timediff(seph.t0,raw->nav.seph[prn-MINPRNSBS].t0))<1.0&&
            seph.sva==raw->nav.seph[prn-MINPRNSBS].sva) return 0; /* unchanged */
    }
    raw->nav.seph[prn-MINPRNSBS]=seph;
    raw->ephsat=seph.sat;
    return 2;
}
开发者ID:alexis93,项目名称:zhiyu_xihe,代码行数:49,代码来源:binex.c


示例15: f14h_mc1_mce

static bool f14h_mc1_mce(u16 ec, u8 xec)
{
	u8 r4    = R4(ec);
	bool ret = true;

	if (MEM_ERROR(ec)) {
		if (TT(ec) != 0 || LL(ec) != 1)
			ret = false;

		if (r4 == R4_IRD)
			pr_cont("Data/tag array parity error for a tag hit.\n");
		else if (r4 == R4_SNOOP)
			pr_cont("Tag error during snoop/victimization.\n");
		else
			ret = false;
	}
	return ret;
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:18,代码来源:mce_amd.c


示例16: decode_mc2_mce

static void decode_mc2_mce(struct mce *m)
{
	u16 ec = EC(m->status);
	u8 xec = XEC(m->status, xec_mask);

	pr_emerg(HW_ERR "MC2 Error");

	if (xec == 0x1)
		pr_cont(" in the write data buffers.\n");
	else if (xec == 0x3)
		pr_cont(" in the victim data buffers.\n");
	else if (xec == 0x2 && MEM_ERROR(ec))
		pr_cont(": %s error in the L2 cache tags.\n", R4_MSG(ec));
	else if (xec == 0x0) {
		if (TLB_ERROR(ec))
			pr_cont(": %s error in a Page Descriptor Cache or "
				"Guest TLB.\n", TT_MSG(ec));
		else if (BUS_ERROR(ec))
			pr_cont(": %s/ECC error in data read from NB: %s.\n",
				R4_MSG(ec), PP_MSG(ec));
		else if (MEM_ERROR(ec)) {
			u8 r4 = R4(ec);

			if (r4 >= 0x7)
				pr_cont(": %s error during data copyback.\n",
					R4_MSG(ec));
			else if (r4 <= 0x1)
				pr_cont(": %s parity/ECC error during data "
					"access from L2.\n", R4_MSG(ec));
			else
				goto wrong_mc2_mce;
		} else
			goto wrong_mc2_mce;
	} else
		goto wrong_mc2_mce;

	return;

 wrong_mc2_mce:
	pr_emerg(HW_ERR "Corrupted MC2 MCE info?\n");
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:41,代码来源:mce_amd.c


示例17: f16h_mc2_mce

static bool f16h_mc2_mce(u16 ec, u8 xec)
{
	u8 r4 = R4(ec);

	if (!MEM_ERROR(ec))
		return false;

	switch (xec) {
	case 0x04 ... 0x05:
		pr_cont("%cBUFF parity error.\n", (r4 == R4_RD) ? 'I' : 'O');
		break;

	case 0x09 ... 0x0b:
	case 0x0d ... 0x0f:
		pr_cont("ECC error in L2 tag (%s).\n",
			((r4 == R4_GEN)   ? "BankReq" :
			((r4 == R4_SNOOP) ? "Prb"     : "Fill")));
		break;

	case 0x10 ... 0x19:
	case 0x1b:
		pr_cont("ECC error in L2 data array (%s).\n",
			(((r4 == R4_RD) && !(xec & 0x3)) ? "Hit"  :
			((r4 == R4_GEN)   ? "Attr" :
			((r4 == R4_EVICT) ? "Vict" : "Fill"))));
		break;

	case 0x1c ... 0x1d:
	case 0x1f:
		pr_cont("Parity error in L2 attribute bits (%s).\n",
			((r4 == R4_RD)  ? "Hit"  :
			((r4 == R4_GEN) ? "Attr" : "Fill")));
		break;

	default:
		return false;
	}

	return true;
}
开发者ID:03199618,项目名称:linux,代码行数:40,代码来源:mce_amd.c


示例18: cat_mc1_mce

static bool cat_mc1_mce(u16 ec, u8 xec)
{
	u8 r4    = R4(ec);
	bool ret = true;

	if (!MEM_ERROR(ec))
		return false;

	if (TT(ec) != TT_INSTR)
		return false;

	if (r4 == R4_IRD)
		pr_cont("Data/tag array parity error for a tag hit.\n");
	else if (r4 == R4_SNOOP)
		pr_cont("Tag error during snoop/victimization.\n");
	else if (xec == 0x0)
		pr_cont("Tag parity error from victim castout.\n");
	else if (xec == 0x2)
		pr_cont("Microcode patch RAM parity error.\n");
	else
		ret = false;

	return ret;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:24,代码来源:mce_amd.c


示例19: sha1_update

void sha1_update(sha1_ctx_t *ctx, void *data, size_t dlen) {
  uint16_t avail; /* space available in the context message block */
  uint16_t pos;   /* position to write data into the message block */
  uint32_t t;
  uint32_t x[80];
  
  while (dlen) {
    pos = CTX_POS(ctx);
    avail = CTX_AVAIL(ctx);
    if (avail > dlen)
      avail = dlen;
      
    /* Copy input data into the context's message block. */
    memcpy(ctx->block + pos, data, avail);
    data += avail;
    dlen -= avail;
    ctx->len += avail;
    
    if ((ctx->len % 64) == 0) {
      uint32_t a = ctx->hash[0];
      uint32_t b = ctx->hash[1];
      uint32_t c = ctx->hash[2];
      uint32_t d = ctx->hash[3];
      uint32_t e = ctx->hash[4];
      
      R1a(t, a, b, c, d, e, x,  0);
      R1a(t, a, b, c, d, e, x,  1);
      R1a(t, a, b, c, d, e, x,  2);
      R1a(t, a, b, c, d, e, x,  3);
      R1a(t, a, b, c, d, e, x,  4);
      R1a(t, a, b, c, d, e, x,  5);
      R1a(t, a, b, c, d, e, x,  6);
      R1a(t, a, b, c, d, e, x,  7);
      R1a(t, a, b, c, d, e, x,  8);
      R1a(t, a, b, c, d, e, x,  9);
      R1a(t, a, b, c, d, e, x, 10);
      R1a(t, a, b, c, d, e, x, 11);
      R1a(t, a, b, c, d, e, x, 12);
      R1a(t, a, b, c, d, e, x, 13);
      R1a(t, a, b, c, d, e, x, 14);
      R1a(t, a, b, c, d, e, x, 15);
      R1b(t, a, b, c, d, e, x, 16);
      R1b(t, a, b, c, d, e, x, 17);
      R1b(t, a, b, c, d, e, x, 18);
      R1b(t, a, b, c, d, e, x, 19);
      R2(t, a, b, c, d, e, x, 20);
      R2(t, a, b, c, d, e, x, 21);
      R2(t, a, b, c, d, e, x, 22);
      R2(t, a, b, c, d, e, x, 23);
      R2(t, a, b, c, d, e, x, 24);
      R2(t, a, b, c, d, e, x, 25);
      R2(t, a, b, c, d, e, x, 26);
      R2(t, a, b, c, d, e, x, 27);
      R2(t, a, b, c, d, e, x, 28);
      R2(t, a, b, c, d, e, x, 29);
      R2(t, a, b, c, d, e, x, 30);
      R2(t, a, b, c, d, e, x, 31);
      R2(t, a, b, c, d, e, x, 32);
      R2(t, a, b, c, d, e, x, 33);
      R2(t, a, b, c, d, e, x, 34);
      R2(t, a, b, c, d, e, x, 35);
      R2(t, a, b, c, d, e, x, 36);
      R2(t, a, b, c, d, e, x, 37);
      R2(t, a, b, c, d, e, x, 38);
      R2(t, a, b, c, d, e, x, 39);
      R3(t, a, b, c, d, e, x, 40);
      R3(t, a, b, c, d, e, x, 41);
      R3(t, a, b, c, d, e, x, 42);
      R3(t, a, b, c, d, e, x, 43);
      R3(t, a, b, c, d, e, x, 44);
      R3(t, a, b, c, d, e, x, 45);
      R3(t, a, b, c, d, e, x, 46);
      R3(t, a, b, c, d, e, x, 47);
      R3(t, a, b, c, d, e, x, 48);
      R3(t, a, b, c, d, e, x, 49);
      R3(t, a, b, c, d, e, x, 50);
      R3(t, a, b, c, d, e, x, 51);
      R3(t, a, b, c, d, e, x, 52);
      R3(t, a, b, c, d, e, x, 53);
      R3(t, a, b, c, d, e, x, 54);
      R3(t, a, b, c, d, e, x, 55);
      R3(t, a, b, c, d, e, x, 56);
      R3(t, a, b, c, d, e, x, 57);
      R3(t, a, b, c, d, e, x, 58);
      R3(t, a, b, c, d, e, x, 59);
      R4(t, a, b, c, d, e, x, 60);
      R4(t, a, b, c, d, e, x, 61);
      R4(t, a, b, c, d, e, x, 62);
      R4(t, a, b, c, d, e, x, 63);
      R4(t, a, b, c, d, e, x, 64);
      R4(t, a, b, c, d, e, x, 65);
      R4(t, a, b, c, d, e, x, 66);
      R4(t, a, b, c, d, e, x, 67);
      R4(t, a, b, c, d, e, x, 68);
      R4(t, a, b, c, d, e, x, 69);
      R4(t, a, b, c, d, e, x, 70);
      R4(t, a, b, c, d, e, x, 71);
      R4(t, a, b, c, d, e, x, 72);
      R4(t, a, b, c, d, e, x, 73);
      R4(t, a, b, c, d, e, x, 74);
//.........这里部分代码省略.........
开发者ID:dpejesh,项目名称:libsv-crypt,代码行数:101,代码来源:sha1_update.c


示例20: decode_bnx_01_05

/* decode binex mesaage 0x01-05: decoded beidou-2/compass ephmemeris ---------*/
static int decode_bnx_01_05(raw_t *raw, unsigned char *buff, int len)
{
    eph_t eph={0};
    unsigned char *p=buff;
    double tow,toc,sqrtA;
    int prn,flag1,flag2;
    
    trace(4,"binex 0x01-05: len=%d\n",len);
    
    if (len>=117) {
        prn       =U1(p);        p+=1;
        eph.week  =U2(p);        p+=2;
        tow       =I4(p);        p+=4;
        toc       =I4(p);        p+=4;
        eph.toes  =I4(p);        p+=4;
        eph.f2    =R4(p);        p+=4;
        eph.f1    =R4(p);        p+=4;
        eph.f0    =R4(p);        p+=4;
        eph.deln  =R4(p)*SC2RAD; p+=4;
        eph.M0    =R8(p);        p+=8;
        eph.e     =R8(p);        p+=8;
        sqrtA     =R8(p);        p+=8;
        eph.cic   =R4(p);        p+=4;
        eph.crc   =R4(p);        p+=4;
        eph.cis   =R4(p);        p+=4;
        eph.crs   =R4(p);        p+=4;
        eph.cuc   =R4(p);        p+=4;
        eph.cus   =R4(p);        p+=4;
        eph.OMG0  =R8(p);        p+=8;
        eph.omg   =R8(p);        p+=8;
        eph.i0    =R8(p);        p+=8;
        eph.OMGd  =R4(p)*SC2RAD; p+=4;
        eph.idot  =R4(p)*SC2RAD; p+=4;
        flag1     =U2(p);        p+=2;
        flag2     =U4(p);
    }
    else {
        trace(2,"binex 0x01-05: length error len=%d\n",len);
        return -1;
    }
    if (!(eph.sat=satno(SYS_CMP,prn))) {
        trace(2,"binex 0x01-05: satellite error prn=%d\n",prn);
        return 0;
    }
    eph.A=sqrtA*sqrtA;
    eph.toe=gpst2time(eph.week+1356,eph.toes+14.0); /* bdt -> gpst */
    eph.toc=gpst2time(eph.week+1356,eph.toes+14.0); /* bdt -> gpst */
    eph.ttr=adjweek(eph.toe,tow+14.0); /* bdt -> gpst */
    eph.iodc=(flag1>>1)&0x1F;
    eph.iode=(flag1>>6)&0x1F;
    eph.svh=flag1&0x01;
    eph.sva=flag2&0x0F; /* ura index */
    eph.tgd[0]=bds_tgd(flag2>> 4); /* TGD1 (s) */
    eph.tgd[1]=bds_tgd(flag2>>14); /* TGD2 (s) */
    eph.flag=(flag1>>11)&0x07; /* nav type (0:unknown,1:IGSO/MEO,2:GEO) */
    eph.code=(flag2>>25)&0x7F;
        /* message source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)*/
    
    if (!strstr(raw->opt,"-EPHALL")) {
        if (raw->nav.eph[eph.sat-1].iode==eph.iode&&
            raw->nav.eph[eph.sat-1].iodc==eph.iodc) return 0; /* unchanged */
    }
    raw->nav.eph[eph.sat-1]=eph;
    raw->ephsat=eph.sat;
    return 2;
}
开发者ID:alexis93,项目名称:zhiyu_xihe,代码行数:67,代码来源:binex.c



注:本文中的R4函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RAD函数代码示例发布时间:2022-05-30
下一篇:
C++ R2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap