当前位置: 首页>>代码示例>>C++>>正文


C++ set_register函数代码示例

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


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

示例1: timer2_enable

void timer2_enable()
{
	int i;

	map_mem(TIMER2_BASE, TIMER2_BASE, MMU_SECTION, USER_NO_ACCESS);

	for(i = 0; i < NUM_CALLBACKS; i++)
	{
		callback_vectors[i] = 0x00000000;
	}

        set_register_bit_value(TIMER2_BASE + TIOCP_CFG, 0, 1);

        while(get_register_bit(TIMER2_BASE + TIOCP_CFG, 0));

        set_register_bit_value(TIMER2_BASE + IRQENABLE_SET, 1, 1); // Enable overflow interrupt

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TCLR));

        set_register_bit_value(TIMER2_BASE + TCLR, 1, 1); // Auto reload

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TLDR));

        set_register(TIMER2_BASE + TLDR, 0xff000000); // Load value on reload

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TTGR));
        set_register(TIMER2_BASE + TTGR, 0x00000000);

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TCLR));
        set_register_bit_value(TIMER2_BASE + TCLR, 0, 1); // Start!
}
开发者ID:dankar,项目名称:boneos,代码行数:31,代码来源:timer.c

示例2: exADD

void exADD(enum addr_mode mode, char src,char dst)
{
    char val;
    switch( mode )
    {
        case VAL_REG :
            if(set_register(src, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        case REG_REG:
            if(get_register(&val, src)) {
                printf("Bad register access\n");
                exit(-1);
            }
            if(set_register(val, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        default :
            printf("Bad addressing mode\n");
    }
}
开发者ID:dinesh121991,项目名称:M2R-PDES-MOSIG,代码行数:25,代码来源:Emulate-Processor.c

示例3: first_stage

void first_stage(int r2_missing){
  inputs_vector_state[7] = 1; //r7 pending
  inputs_vector_values[7] = 11;
  inputs_vector_refs[7] = 0;

  // Beginning of payload building //

  add_node_to_payload(key_instructions.svc->addr, 0, key_instructions.svc->string, 0, 0, 0);

  // If writer r0 doesn't write into r1 ... //
  if(!gadget_writes_r(key_instructions.write_r0, 1)){
    set_register(1);
  }

  if(!state[0]){
    set_register(0);
  }

  if(!state[2] && !r2_missing){
    set_register(2);
  }

  if(!state[3] && !store_writes_r(7)){
    set_register(7);
  }
}
开发者ID:fervagar,项目名称:frop,代码行数:26,代码来源:p_sh.c

示例4: preSetAbortStates

preSetAbortStates()
{
   SafeGateVal = 0;
   set_register(DDR,SoftwareGates,0);
   set_register(DDR,SoftwareGain,0);
   set_register(DDR,SoftwareAUX,0);
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:7,代码来源:ddrFifo.c

示例5: set_register

void Value::assign_register() {
  if (in_register()) {
    return;
  }

#if ENABLE_ARM_VFP
  if (stack_type() == T_FLOAT) {
    set_register(RegisterAllocator::allocate_float_register());
  } else if (stack_type() == T_DOUBLE) {
    set_vfp_double_register(RegisterAllocator::allocate_double_register());
  } else
#endif
  {
    if (!is_two_word()) {
      set_register(RegisterAllocator::allocate());
    } else {
      // NOTE: avoid doing this: set_registers(allocate(), allocate());
      // The order of parameter list evaluation is undefined in C, and
      // on linux/i386 and solaris/sparc the orders are opposite. The following
      // code forces the same order, so AOT generator will generate exact
      // same code on both Linux and Solaris hosts.
      Assembler::Register hi  = RegisterAllocator::allocate();
      Assembler::Register low = RegisterAllocator::allocate();
      set_registers(low, hi);
    }
  }
}
开发者ID:jiangxilong,项目名称:yari,代码行数:27,代码来源:Value.cpp

示例6: setup_pegasus_II

static inline void setup_pegasus_II(pegasus_t * pegasus)
{
	u16 data = 0xa5;
	
	set_register(pegasus, Reg1d, 0);
	set_register(pegasus, Reg7b, 1);
	mdelay(100);
	if ((pegasus->features & HAS_HOME_PNA) && mii_mode)
		set_register(pegasus, Reg7b, 0);
	else
		set_register(pegasus, Reg7b, 2);

	set_register(pegasus, 0x83, data);
	get_registers(pegasus, 0x83, 1, &data);

	if (data == 0xa5) {
		pegasus->chip = 0x8513;
	} else {
		pegasus->chip = 0;
	}

	set_register(pegasus, 0x80, 0xc0);
	set_register(pegasus, 0x83, 0xff);
	set_register(pegasus, 0x84, 0x01);
	
	if (pegasus->features & HAS_HOME_PNA && mii_mode)
		set_register(pegasus, Reg81, 6);
	else
		set_register(pegasus, Reg81, 2);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:30,代码来源:pegasus.c

示例7: execute

void execute(ARCH arch, uint32_t word)
{
    uint rs, rt, rd, sa;
	uint q, reste;
	uint val_rs, val_rt;
	uint bit_sign;

    parser_typeR(word, &rs, &rt, &rd, &sa);
	val_rs = (arch->registers)[rs];
	val_rt = (arch->registers)[rt];
	
	if (val_rt == 0) {
		set_register(arch, SR, 4096);
		print_error("can't divide by zero");
	}
	else {
		q = val_rs / val_rt;
		reste = val_rs % val_rt;
		set_register(arch, HI, q);
		set_register(arch, LO, reste);
		
		bit_sign = parser_instr(q, 31, 31);
		if (bit_sign == 1)
			set_register_bit(arch, SR, 7);	

		if (q == 0 && reste == 0) 
			set_register_bit(arch, SR, 6);	
	}
}
开发者ID:jeanbroid,项目名称:mips,代码行数:29,代码来源:div.c

示例8: disable_eprom_write

static inline void disable_eprom_write(pegasus_t * pegasus)
{
	__u8 tmp;

	get_registers(pegasus, EthCtrl2, 1, &tmp);
	set_register(pegasus, EpromCtrl, 0);
	set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:8,代码来源:pegasus.c

示例9: setXY

static int setXY(int address,unsigned char row,unsigned char col)
{
	if(set_register(address,COMMAND_MODE,0xb0+row))
		return -1;
	if(set_register(address,COMMAND_MODE,0x00+(8*col&0x0f)))
		return -1;
	return set_register(address,COMMAND_MODE,0x10+((8*col>>4)&0x0f));
}
开发者ID:Ourobooros,项目名称:grove-nest,代码行数:8,代码来源:oled.c

示例10: preSetAbortStates

preSetAbortStates()
{
   SafeGateVal = 0;		
   set_register(MASTER,SoftwareGates,0);
   set_register(MASTER,SoftwareSpi0,0);
   set_register(MASTER,SoftwareSpi1,0);
   set_register(MASTER,SoftwareSpi2,0);
   set_register(MASTER,SoftwareAUX,0);
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:9,代码来源:masterFifo.c

示例11: test_registers

// Read a bunch of registers to see what happens, for initial debugging
void test_registers()
{
    u_long id;

    id = idcode(id);
    id = get_cpsr();
    id = 0x87654321;
    ice_set(watchpoint0_adr, id);
    id = idcode();
    id = ice_get(watchpoint0_adr);
    set_register(5, 0xaa5533cc);
    set_register(12, 0x1234fedc);
    id = get_register(5);
    id = get_register(12);
}
开发者ID:MitchBradley,项目名称:cforth,代码行数:16,代码来源:at91sam7jtag.c

示例12: exMOV

void exMOV(enum addr_mode mode, char src, char dst)
{
    char val;
    switch( mode )
    {
        case VAL_REG :
            if(set_register(src, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        case REG_REG:
            if(get_register(&val, src)) {
                printf("Bad register access\n");
                exit(-1);
            }
            if(set_register(val, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        case ADDR_REG :
            if( get_address( &val,src ))
            {
                printf("Bad Address Location -RO\n");
                exit(-1);
            }
            if( set_register( val, dst ))
            {
                printf("Bad Register access \n");
                exit(-1);
            }
            break;
        case REG_ADDR :
            if( get_register( &val,src ))
            {
                printf("Bad Register Access \n");
                exit(-1);
            }
            if( set_address( val,dst))
            {
                printf("Bad Address Location -RO \n");
            }
            break;
        default :
            printf("Bad addressing mode\n");
    }
}
开发者ID:dinesh121991,项目名称:M2R-PDES-MOSIG,代码行数:48,代码来源:Emulate-Processor.c

示例13: Radio_Transmit

uint8_t Radio_Transmit(radiopacket_t* payload, RADIO_TX_WAIT wait)
{
	//if (block && transmit_lock) while (transmit_lock);
	//if (!block && transmit_lock) return 0;
	uint8_t len = 32;

	// indicate that the driver is transmitting.
    transmit_lock = 1;

	// disable the radio while writing to the Tx FIFO.
    ioport_set_pin_low (CE);

	set_tx_mode();

    // for auto-ack to work, the pipe0 address must be set to the Tx address while the radio is transmitting.
    // The register will be set back to the original pipe 0 address when the TX_DS or MAX_RT interrupt is asserted.
    set_register(RX_ADDR_P0, (uint8_t*)tx_address, ADDRESS_LENGTH);

    // transfer the packet to the radio's Tx FIFO for transmission
    send_instruction(W_TX_PAYLOAD, payload, NULL, len);

    // start the transmission.
    ioport_set_pin_high (CE);

    if (wait == RADIO_WAIT_FOR_TX)
    {
    	while (transmit_lock);
    	return tx_last_status;
    }

    return RADIO_TX_SUCCESS;
}
开发者ID:magnealvnor,项目名称:TTK4155_Gruppe2_TermProject,代码行数:32,代码来源:radio.c

示例14: reset_pipe0_address

/**
 * Reset the pipe 0 address if pipe 0 is enabled.  This is necessary when the radio is using Enhanced Shockburst, because
 * the pipe 0 address is set to the transmit address while the radio is transmitting (this is how the radio receives
 * auto-ack packets).
 */
static void reset_pipe0_address(void)
{
	if (rx_pipe_widths[RADIO_PIPE_0] != 0)
	{
		// reset the pipe 0 address if pipe 0 is enabled.
		set_register(RX_ADDR_P0, (uint8_t*)rx_pipe0_address, ADDRESS_LENGTH);
	}
}
开发者ID:magnealvnor,项目名称:TTK4155_Gruppe2_TermProject,代码行数:13,代码来源:radio.c

示例15: GUARANTEE

void Value::force_to_byte_register() {
  GUARANTEE(in_register(), "must be in register");
  if (!Assembler::is_valid_byte_register(lo_register())) {
    Assembler::Register byte_register = RegisterAllocator::allocate_byte_register();
    Compiler::code_generator()->movl(byte_register, lo_register());
    set_register(byte_register);
  }
}
开发者ID:jiangxilong,项目名称:yari,代码行数:8,代码来源:Value.cpp


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