當前位置: 首頁>>代碼示例>>C++>>正文


C++ ADDR函數代碼示例

本文整理匯總了C++中ADDR函數的典型用法代碼示例。如果您正苦於以下問題:C++ ADDR函數的具體用法?C++ ADDR怎麽用?C++ ADDR使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ADDR函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: hwt_stop

/************************
 *
 *	hwt_stop
 *
 *	Stop hardware timer.
 *
 *	void hwt_stop(
 *		struct s_smc *smc) ;
 * In
 *	smc - A pointer to the SMT Context structure.
 * Out
 *	Nothing.
 *
 ************************/
void hwt_stop(struct s_smc *smc)
{
	outpw(ADDR(B2_TI_CRTL), TIM_STOP) ;
	outpw(ADDR(B2_TI_CRTL), TIM_CL_IRQ) ;

	smc->hw.timer_activ = FALSE ;
}
開發者ID:Core2idiot,項目名稱:Kernel-Samsung-3.0...-,代碼行數:21,代碼來源:hwt.c

示例2: read_address

void read_address(struct s_smc *smc, u_char *mac_addr)
{
	char ConnectorType ;
	char PmdType ;
	int	i ;

#ifdef	PCI
	for (i = 0; i < 6; i++) {	/* read mac address from board */
		smc->hw.fddi_phys_addr.a[i] =
			bitrev8(inp(ADDR(B2_MAC_0+i)));
	}
#endif

	ConnectorType = inp(ADDR(B2_CONN_TYP)) ;
	PmdType = inp(ADDR(B2_PMD_TYP)) ;

	smc->y[PA].pmd_type[PMD_SK_CONN] =
	smc->y[PB].pmd_type[PMD_SK_CONN] = ConnectorType ;
	smc->y[PA].pmd_type[PMD_SK_PMD ] =
	smc->y[PB].pmd_type[PMD_SK_PMD ] = PmdType ;

	if (mac_addr) {
		for (i = 0; i < 6 ;i++) {
			smc->hw.fddi_canon_addr.a[i] = mac_addr[i] ;
			smc->hw.fddi_home_addr.a[i] = bitrev8(mac_addr[i]);
		}
		return ;
	}
	smc->hw.fddi_home_addr = smc->hw.fddi_phys_addr ;

	for (i = 0; i < 6 ;i++) {
		smc->hw.fddi_canon_addr.a[i] =
			bitrev8(smc->hw.fddi_phys_addr.a[i]);
	}
}
開發者ID:adis1313,項目名稱:android_kernel_samsung_msm8974,代碼行數:35,代碼來源:drvfbi.c

示例3: i_igspill

/* i_igspill: spill node i, removing it from index j in interference graph g */
static void i_igspill (i_local_t i, i_local_t j, ig_t g) {
     SCLASS(i) = STACK;		/* Update storage location */
     if (TYPE(i) == I_B)
	  ADDR(i) = v_localb(ADDR(i));
     else ADDR(i) = v_local(TYPE(i));
     i_igremove(j, g);		/* Remove node i from integer IG */
}
開發者ID:berkus,項目名稱:lang-e,代碼行數:8,代碼來源:reg-gc.c

示例4: ADDR

JNIEXPORT jint JNICALL Java_au_notzed_jjmpeg_SwsContextNative_scaleByteArray
(JNIEnv *env, jclass jc, jobject jptr, jobject jsrc, jint srcSliceY, jint srcSliceH, jintArray jdst, jint fmt, jint width, jint height) {
	struct SwsContext *sws = ADDR(jptr);
	struct AVFrame *src = ADDR(jsrc);

	return scaleArray(env, sws, src, srcSliceY, srcSliceH, jdst, 1, fmt, width, height);
}
開發者ID:ideastorm,項目名稱:jjmpeg,代碼行數:7,代碼來源:jjmpeg.c

示例5: chkmem

/**
 * @brief Checks access permissions to a memory area.
 * 
 * @param addr Address to be checked.
 * @param size Size of memory area.
 * @param mask Access permissions mask.
 * 
 * @returns Non-zero if access is authorized, and zero otherwise.
 */
PUBLIC int chkmem(const void *addr, size_t size, mode_t mask)
{
	int ret;              /* Return value.           */
	struct region *reg;   /* Working memory region.  */
	struct pregion *preg; /* Working process region. */
	
	/* Get associated process memory region. */
	if ((preg = findreg(curr_proc, ADDR(addr))) == NULL)
		return (-1);
	
	lockreg(reg = preg->reg);
	
	/* Not allowed. */
	if (!(accessreg(curr_proc, reg) & mask))
	{
		unlockreg(reg);
		return (-1);
	}
		
	ret = withinreg(preg, ADDR(addr));
	ret &= withinreg(preg, ADDR(addr) + size);

	unlockreg(reg);
	
	return (ret);
}
開發者ID:ppenna,項目名稱:nanvix,代碼行數:35,代碼來源:mm.c

示例6: insa_icon

VOID insa_icon(LONG tree, WORD obj, WORD nicon, ICONBLK *pic, BYTE *ptext)
{
	memcpy(pic, &G.g_iblist[nicon], sizeof(ICONBLK));
	pic->ib_ptext = ADDR( ptext );
	LWSET(OB_TYPE(obj), G_ICON);
	LLSET(OB_SPEC(obj), ADDR(pic));
}
開發者ID:daemqn,項目名稱:Atari_ST_Sources,代碼行數:7,代碼來源:DESKINS.C

示例7: ted_set

VOID ted_set(LONG taddr, BYTE *tmplt, BYTE *valid, BYTE *text)
{
	WORD	imap, itmp;

	if (!tmplt[0])
	{
		tmplt[0] = '@';
		LLSTRCPY(LLGET(TE_PVALID(taddr)), (LONG)ADDR(valid));
		LLSTRCPY(LLGET(TE_PTEXT(taddr)), (LONG)ADDR(text));
		if (!valid[0])
			valid[0] = '@';
		if (!text[0])
			text[0] = '@';
	}
	else
	{
		for (imap = itmp = 0; tmplt[itmp]; itmp++)
			if (tmplt[itmp] == '_')
			{
				tmplt[itmp] = '~';
				valid[itmp] = LBGET(imap + LLGET(TE_PVALID(taddr)));
				text[itmp] = LBGET(imap + LLGET(TE_PTEXT(taddr)));
				imap++;
			}
			else
				valid[itmp] = text[itmp] = '~';
		valid[itmp] = text[itmp] = '\0';
	}
}
開發者ID:daemqn,項目名稱:Atari_ST_Sources,代碼行數:29,代碼來源:RCSEDIT.C

示例8: update_if

VOID update_if(LONG taddr, BYTE *naddr)
{
	if (!LLSTRCMP(LLGET(taddr), (LONG)ADDR(naddr)))
	{
		LLSET(taddr, get_mem( (UWORD) strlen(naddr)+1));
		LLSTRCPY((LONG)ADDR(naddr), LLGET(taddr));
	}
}
開發者ID:daemqn,項目名稱:Atari_ST_Sources,代碼行數:8,代碼來源:RCSDATA.C

示例9: forker

void forker(void)
{
        register FPD    *f;
        register PD     *oldrl;
        register LONG   amt;
        FPD             g;
        
        oldrl = rlr;
        rlr = (PD *) -1;
        while(fpcnt)
        {
/* critical area        */
          cli();
          fpcnt--;
          f = &D.g_fpdx[fph++];
                                        /* copy FPD so an interrupt     */
                                        /*  doesn't overwrite it.       */
          LBCOPY(ADDR(&g), ADDR(f), sizeof(FPD) );
          if (fph == NFORKS) 
            fph = 0;
          sti();
/* */
                                                /* see if recording     */
          if (gl_recd)
          {
                                                  /* check for stop key */
            if ( ((void *)g.f_code == (void *)kchange) &&
                 ((g.f_data & 0x0000ffffL) == KEYSTOP) )
              gl_recd = FALSE;
                                                /* if still recording   */
                                                /*   then handle event  */
            if (gl_recd)
            {
                                                /* if its a time event &*/
                                                /*   previously recorded*/
                                                /*   was a time event   */
                                                /*   then coalesce them */ 
                                                /*   else record the    */
                                                /*   event              */
              if ( ((void *)g.f_code == (void *)tchange) &&
                   (LLGET(gl_rbuf - sizeof(FPD)) == (LONG)tchange) )
              {
                amt = g.f_data + LLGET(gl_rbuf-sizeof(LONG));
                LLSET(gl_rbuf - sizeof(LONG), amt);           
              }
              else
              {
                LBCOPY(gl_rbuf, ADDR(f), sizeof(FPD));
                gl_rbuf += sizeof(FPD);
                gl_rlen--;
                gl_recd = gl_rlen;
              }
            }
          }
          (*g.f_code)(g.f_data);
        }
        rlr = oldrl;
}
開發者ID:ragnar76,項目名稱:emutos,代碼行數:58,代碼來源:gemdisp.c

示例10: tx_scl_en

/*
** 函數功能:SCL_EN引腳輸出電平
** 輸入參數:a=HIGH 輸出高電平, a=LOW 輸出低電平
** 輸出參數:無
** 返回值:無
** 備注:
*/
void tx_scl_en(unsigned char a)
{
	gpio_data = SCL_EN;
	if(a == HIGH){
		iowrite32(gpio_data, ADDR(gpio_reg, gpio_t, set_data23));
	}else{
		iowrite32(gpio_data, ADDR(gpio_reg, gpio_t, clr_data23));
	}
}
開發者ID:DavionKnight,項目名稱:omc_aeu_60m,代碼行數:16,代碼來源:main.c

示例11: pumpOn

static void pumpOn(UArm *uarm)
{
	if(FALSE == uarm->status.pump)
	{
    	Xil_Out32(ADDR(PUMP_EN),LOW);
    	Xil_Out32(ADDR(VALVE_EN),HIGH);
    	uarm->status.pump = TRUE;
    }
}
開發者ID:chhx001,項目名稱:fs-zrobot-zed,代碼行數:9,代碼來源:uarm.c

示例12: set_dir_sda

/*
** 函數功能:設置SDA引腳方向,輸入/輸出
** 輸入參數:dir=IN 輸入, dir=OUT 輸出
** 輸出參數:無
** 返回值:無
** 備注:
*/
void set_dir_sda(int dir)
{
	gpio_data = ioread32(ADDR(gpio_reg, gpio_t, dir01));
	if(dir == OUT){
		gpio_data &= ~SDA;
	}else{
		gpio_data |= SDA;
	}
	iowrite32(gpio_data, ADDR(gpio_reg, gpio_t,dir01));
}
開發者ID:DavionKnight,項目名稱:omc_aeu_60m,代碼行數:17,代碼來源:main.c

示例13: set_dir_scl_en

/*
** 函數功能:設置SCL_EN引腳方向,輸入/輸出
** 輸入參數:dir=IN 輸入, dir=OUT 輸出
** 輸出參數:無
** 返回值:無
** 備注:
*/
void set_dir_scl_en(int dir)
{
	gpio_data = ioread32(ADDR(gpio_reg, gpio_t, dir23));
	if(dir == OUT){
		gpio_data &= ~SCL_EN;
	}else{
		gpio_data |= SCL_EN;
	}
	iowrite32(gpio_data, ADDR(gpio_reg, gpio_t,dir23));
}
開發者ID:DavionKnight,項目名稱:omc_aeu_60m,代碼行數:17,代碼來源:main.c

示例14: sqlite3DropTriggerPtr

/*
** Drop a trigger given a pointer to that trigger. 
*/
void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
  Table   *pTable;
  Vdbe *v;
  sqlite3 *db = pParse->db;
  int iDb;

  iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
  assert( iDb>=0 && iDb<db->nDb );
  pTable = tableOfTrigger(pTrigger);
  assert( pTable );
  assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
#ifndef SQLITE_OMIT_AUTHORIZATION
  {
    int code = SQLITE_DROP_TRIGGER;
    const char *zDb = db->aDb[iDb].zName;
    const char *zTab = SCHEMA_TABLE(iDb);
    if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER;
    if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
      sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
      return;
    }
  }
#endif

  /* Generate code to destroy the database record of the trigger.
  */
  assert( pTable!=0 );
  if( (v = sqlite3GetVdbe(pParse))!=0 ){
    int base;
    static const int iLn = VDBE_OFFSET_LINENO(2);
    static const VdbeOpList dropTrigger[] = {
      { OP_Rewind,     0, ADDR(9),  0},
      { OP_String8,    0, 1,        0}, /* 1 */
      { OP_Column,     0, 1,        2},
      { OP_Ne,         2, ADDR(8),  1},
      { OP_String8,    0, 1,        0}, /* 4: "trigger" */
      { OP_Column,     0, 0,        2},
      { OP_Ne,         2, ADDR(8),  1},
      { OP_Delete,     0, 0,        0},
      { OP_Next,       0, ADDR(1),  0}, /* 8 */
    };

    sqlite3BeginWriteOperation(pParse, 0, iDb);
    sqlite3OpenMasterTable(pParse, iDb);
    base = sqlite3VdbeAddOpList(v,  ArraySize(dropTrigger), dropTrigger, iLn);
    sqlite3VdbeChangeP4(v, base+1, pTrigger->zName, P4_TRANSIENT);
    sqlite3VdbeChangeP4(v, base+4, "trigger", P4_STATIC);
    sqlite3ChangeCookie(pParse, iDb);
    sqlite3VdbeAddOp2(v, OP_Close, 0, 0);
    sqlite3VdbeAddOp4(v, OP_DropTrigger, iDb, 0, 0, pTrigger->zName, 0);
    if( pParse->nMem<3 ){
      pParse->nMem = 3;
    }
  }
}
開發者ID:AchironOS,項目名稱:chromium-2,代碼行數:58,代碼來源:trigger.c

示例15: tx_scl

/*
** 函數功能:SCL引腳輸出電平
** 輸入參數:a=HIGH 輸出高電平, a=LOW 輸出低電平
** 輸出參數:無
** 返回值:無
** 備注:
*/
void tx_scl(unsigned char a)
{
	tx_scl_en(HIGH);// 使能CPLD中SCL的方向,ARM->LASER
	set_dir_scl(OUT);
	gpio_data = SCL;
	if(a == HIGH){
		iowrite32(gpio_data, ADDR(gpio_reg, gpio_t, set_data01));
	}else{
		iowrite32(gpio_data, ADDR(gpio_reg, gpio_t, clr_data01));
	}
}
開發者ID:DavionKnight,項目名稱:omc_aeu_60m,代碼行數:18,代碼來源:main.c


注:本文中的ADDR函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。