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

C++ set_reg函数代码示例

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

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



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

示例1: fixup_store

static void fixup_store(struct disasm_state *state, struct pt_regs *regs,
			struct callee_regs *cregs)
{
	/* register write back */
	if ((state->aa == 1) || (state->aa == 2)) {
		set_reg(state->wb_reg, state->src2 + state->src3, regs, cregs);

		if (state->aa == 3)
			state->src3 = 0;
	} else if (state->aa == 3) {
		if (state->zz == 2) {
			set_reg(state->wb_reg, state->src2 + (state->src3 << 1),
				regs, cregs);
		} else if (!state->zz) {
			set_reg(state->wb_reg, state->src2 + (state->src3 << 2),
				regs, cregs);
		} else {
			goto fault;
		}
	}

	/* write fix-up */
	if (!state->zz)
		put32_unaligned_check(state->src1, state->src2 + state->src3);
	else
		put16_unaligned_check(state->src1, state->src2 + state->src3);

	return;

fault:	state->fault = 1;
}
开发者ID:endocode,项目名称:linux,代码行数:31,代码来源:unaligned.c


示例2: single_frame_update

void single_frame_update(struct hisi_fb_data_type *hisifd)
{
	char __iomem *dss_base = NULL;

	BUG_ON(hisifd == NULL);

	dss_base = hisifd->dss_base;

	if (hisifd->index == PRIMARY_PANEL_IDX) {
		if (is_mipi_cmd_panel(hisifd)) {
			set_reg(dss_base + PDP_LDI_FRM_MSK, 1, 1, 24);
		}
		set_reg(dss_base + PDP_LDI_CTRL, 1, 1, 0);
	} else if (hisifd->index == EXTERNAL_PANEL_IDX) {
		if (is_mipi_cmd_panel(hisifd)) {
			set_reg(dss_base + SDP_LDI_FRM_MSK, 1, 1, 24);
		}
		set_reg(dss_base + SDP_LDI_CTRL, 1, 1, 0);
	} else {
		;
	}

	if (hisifd->vsync_ctrl.vsync_report_fnc) {
		atomic_inc(&(hisifd->vsync_ctrl.buffer_updated));
	}
}
开发者ID:mildrock,项目名称:overlay_plane_display,代码行数:26,代码来源:hisi_dpe_utils.c


示例3: hisi_offlinecompser_panel_off

static int hisi_offlinecompser_panel_off(struct platform_device *pdev)
{
	int ret = 0;
	struct hisi_fb_data_type *hisifd = NULL;
	int i = 0;

	BUG_ON(pdev == NULL);
	hisifd = platform_get_drvdata(pdev);
	BUG_ON(hisifd == NULL);

	HISI_FB_DEBUG("index=%d, enter!\n", hisifd->index);

	for (i = 0; i < HISI_DSS_OFFLINE_MAX_NUM; i++) {
		char __iomem *ctl_base = hisifd->dss_base + DSS_GLB_WBE1_CH0_CTL +
				i * (DSS_GLB_WBE1_CH1_CTL - DSS_GLB_WBE1_CH0_CTL);

		cmdlist_config_stop(hisifd, i);
		hisifd->offline_wb_status[i] = e_status_idle;
		set_reg(ctl_base, 0x1, 1, 8);
		set_reg(ctl_base, 0x0, 1, 8);
	}

	HISI_FB_DEBUG("index=%d, exit!\n", hisifd->index);

	return ret;
}
开发者ID:HuaweiHonor4C,项目名称:kernel_hi6210sft_mm,代码行数:26,代码来源:hisi_offlinecomposer_panel.c


示例4: emu_step

int emu_step() {
    instruction in;
    int i;
	char *state;
	int result;

	in.instr = read_insrtuction(memory.R[7]);
	memset(disas, '0', LEN);
	memset(reg, '0', LEN);
	
	for (i = 0; i < COUNT; i++) {
        if (check_instr(i, in)) {
			sprintf(disas, "%06o %s", in.instr, table[i].assembler(in));

			result = handle_callback(i, in);
			switch(result) {
			case EX:
				state = "Execution";
				break;
			case HLT:
				state = "Completed";
				break;
			default:
				state = "Unknown error";
			}
			
			set_reg(state);

			return in.instr;
        }
    }
	sprintf(disas, "%s", "UNKNOWN COMMAND");
	set_reg("ERROR UNKNOWN OPCODE");
    return UNKNOWN_COMMAND;
}
开发者ID:pdp-11-top-team,项目名称:PDP-11-emulator,代码行数:35,代码来源:emulator.c


示例5: fixup_load

static void fixup_load(struct disasm_state *state, struct pt_regs *regs,
			struct callee_regs *cregs)
{
	int val;

	/* register write back */
	if ((state->aa == 1) || (state->aa == 2)) {
		set_reg(state->wb_reg, state->src1 + state->src2, regs, cregs);

		if (state->aa == 2)
			state->src2 = 0;
	}

	if (state->zz == 0) {
		get32_unaligned_check(val, state->src1 + state->src2);
	} else {
		get16_unaligned_check(val, state->src1 + state->src2);

		if (state->x)
			val = (val << 16) >> 16;
	}

	if (state->pref == 0)
		set_reg(state->dest, val, regs, cregs);

	return;

fault:	state->fault = 1;
}
开发者ID:endocode,项目名称:linux,代码行数:29,代码来源:unaligned.c


示例6: mipi_dsi_frc_handle

static int mipi_dsi_frc_handle(struct platform_device *pdev, int fps)
{
	int ret = 0;

#if 0
	struct hisi_fb_data_type *hisifd = NULL;
	struct hisi_panel_info *pinfo = NULL;
	uint32_t hline_time = 0;
	uint32_t pixel_clk = 0;
	uint32_t vertical_timing = 0;
	uint32_t horizontal_timing = 0;
	uint32_t h_front_porch = 0;

	BUG_ON(pdev == NULL);
	hisifd = platform_get_drvdata(pdev);
	BUG_ON(hisifd == NULL);

	if (hisifd->index != PRIMARY_PANEL_IDX) {
		HISI_FB_ERR("fb%d, not support!", hisifd->index);
		return 0;
	}

	HISI_FB_DEBUG("fb%d, +.\n", hisifd->index);

	pinfo = &(hisifd->panel_info);

	/* calculate new HFP based on target_fps */
	vertical_timing = pinfo->yres + pinfo->ldi.v_back_porch
		+ pinfo->ldi.v_front_porch + pinfo->ldi.v_pulse_width;
	horizontal_timing = pinfo->pxl_clk_rate / (vertical_timing * fps);

	/* new HFP*/
	/*
	pinfo->ldi.h_front_porch = horizontal_timing - pinfo->xres
		-pinfo->ldi.h_back_porch - pinfo->ldi.h_pulse_width;
	*/
	h_front_porch = horizontal_timing - pinfo->xres
		-pinfo->ldi.h_back_porch - pinfo->ldi.h_pulse_width;

	pixel_clk = pinfo->pxl_clk_rate / 1000000;
	/* update hline_time */
	hline_time = (pinfo->ldi.h_pulse_width + pinfo->ldi.h_back_porch +
		pinfo->xres + h_front_porch) *
		(pinfo->mipi.dsi_bit_clk / 4) / pixel_clk;

	/* reset dsi core */
	set_reg(hisifd->mipi_dsi0_base + MIPIDSI_PWR_UP_OFFSET, 0x0, 1, 0);
	set_reg(hisifd->mipi_dsi0_base + MIPIDSI_VID_HLINE_TIME_OFFSET, hline_time, 15, 0);
	outp32(hisifd->dss_base + PDP_LDI_DPI0_HRZ_CTRL0,
		h_front_porch | (pinfo->ldi.h_back_porch << 16));

	/* power on dsi core */
	set_reg(hisifd->mipi_dsi0_base + MIPIDSI_PWR_UP_OFFSET, 0x1, 1, 0);

	HISI_FB_DEBUG("fb%d, -.\n", hisifd->index);
#endif

	return ret;
}
开发者ID:mildrock,项目名称:overlay_plane_display,代码行数:59,代码来源:hisi_mipi_dsi.c


示例7: set_bit

 virtual void set_bit(sys_bus_addr addr, int pos, bool enable) {
   uint32_t reg = get_reg(addr);
   if (enable) {
     set_reg(addr, (reg | (1 << pos)));
   } else {
     set_reg(addr, (reg & ~(1 << pos)));
   }
 }
开发者ID:cbm-fles,项目名称:flesnet,代码行数:8,代码来源:register_file.hpp


示例8: disable_clk_adp

void disable_clk_adp(struct hisi_fb_data_type *hisifd)
{
	disable_clk_axi(hisifd);
	disable_clk_rot1(hisifd);
	disable_clk_dpe2(hisifd);

	set_reg(hisifd->dss_base + DSS_GLB_DPE2_CLK_SW, 0x0, 1, 0);
	set_reg(hisifd->dss_base + DSS_GLB_ROT1_CLK_SW, 0x0, 1, 0);
}
开发者ID:mildrock,项目名称:overlay_plane_display,代码行数:9,代码来源:hisi_dpe_utils.c


示例9: hh2serial_disable

static int hh2serial_disable(struct connman_device *device)
{
	DBG("");

	set_reg("/sys/class/gpio/expo_rt", "85");
	set_reg("/sys/class/gpio/gpio85/direction", "out");
	set_reg("/sys/class/gpio/gpio85/value", "0");

	return 0;
}
开发者ID:aldebaran,项目名称:connman-stable,代码行数:10,代码来源:hh2serial-gps.c


示例10: init_new_thread

int init_new_thread(SysStruct *ss, int (*f)())
{
    int pid;
    if(ss == NULL)
        return -1;
    pid = get_next_avail_pid(ss);
    if(pid < 0 || pid >= NUM_PROCS)
        return -1;
    set_reg(ss, pid, SP_REG, (int)(ss->proc[pid].stack + STACK_SIZE));
    set_reg(ss, pid, LR_REG, (int)end_process);
    set_reg(ss, pid, PC_REG, (int)f);
    set_spsr(ss, pid, 0x10);
    return pid;
}
开发者ID:jlamothe,项目名称:kernel,代码行数:14,代码来源:supervisor.c


示例11: ldi_init

static int ldi_init(struct k3_fb_data_type *k3fd)
{
	u32 edc_base = 0;
	struct k3_panel_info *pinfo = NULL;

	BUG_ON(k3fd == NULL);

	pinfo = &(k3fd->panel_info);
	edc_base = k3fd->edc_base;

	set_LDI_HRZ_CTRL0_hfp(edc_base, pinfo->ldi.h_front_porch);
	set_LDI_HRZ_CTRL0_hbp(edc_base, pinfo->ldi.h_back_porch);
	set_LDI_HRZ_CTRL1_hsw(edc_base, pinfo->ldi.h_pulse_width);
	set_LDI_VRT_CTRL0_vfp(edc_base, pinfo->ldi.v_front_porch);
	set_LDI_VRT_CTRL0_vbp(edc_base, pinfo->ldi.v_back_porch);
	if (pinfo->ldi.v_pulse_width > 15)
		pinfo->ldi.v_pulse_width = 15;
	set_LDI_VRT_CTRL1_vsw(edc_base, pinfo->ldi.v_pulse_width);
	set_LDI_PLR_CTRL_hsync(edc_base, pinfo->ldi.hsync_plr);
	set_LDI_PLR_CTRL_vsync(edc_base, pinfo->ldi.vsync_plr);
	set_LDI_PLR_CTRL_pixel_clk(edc_base, pinfo->ldi.pixelclk_plr);
	set_LDI_PLR_CTRL_data_en(edc_base, pinfo->ldi.data_en_plr);

	set_LDI_DSP_SIZE_hsize(edc_base, pinfo->xres);
	set_LDI_DSP_SIZE_vsize(edc_base, pinfo->yres);

	set_LDI_WORK_MODE_work_mode(edc_base, LDI_WORK);
	set_LDI_WORK_MODE_colorbar_en(edc_base, K3_DISABLE);
	set_LDI_CTRL_bgr(edc_base, pinfo->bgr_fmt);
	set_LDI_CTRL_bpp(edc_base, pinfo->bpp);
	set_LDI_CTRL_disp_mode(edc_base, pinfo->ldi.disp_mode);
	set_LDI_CTRL_corlorbar_width(edc_base, 0x3C);
	if (pinfo->type == PANEL_MIPI_CMD) {
		set_LDI_CTRL_ldi_en(edc_base, K3_DISABLE);
	} else {
		set_LDI_CTRL_ldi_en(edc_base, K3_ENABLE);
	}
	set_LDI_INT_CLR(edc_base, 0xFFFFFFFF);

	if (pinfo->type == PANEL_HDMI) {
		/* dsi pixel off */
		set_reg(edc_base + LDI_HDMI_DSI_GT, 0x1, 1, 0);
	}

	if (!(pinfo->bl_set_type & BL_SET_BY_PWM)) {
		set_reg(edc_base + LDI_DE_SPACE_LOW, 0x1, 1, 1);
	}

	return 0;
}
开发者ID:joestone,项目名称:Huawei-MATE-CM10.1,代码行数:50,代码来源:ldi.c


示例12: prealloc_reg

static void prealloc_reg(struct brw_wm_compile *c)
{
    int i, j;
    struct brw_reg reg;
    int nr_interp_regs = 0;
    GLuint inputs = FRAG_BIT_WPOS | c->fp_interp_emitted | c->fp_deriv_emitted;

    for (i = 0; i < 4; i++) {
	reg = (i < c->key.nr_depth_regs) 
	    ? brw_vec8_grf(i*2, 0) : brw_vec8_grf(0, 0);
	set_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, reg);
    }
    c->reg_index += 2*c->key.nr_depth_regs;
    {
	int nr_params = c->fp->program.Base.Parameters->NumParameters;
	struct gl_program_parameter_list *plist = 
	    c->fp->program.Base.Parameters;
	int index = 0;
	c->prog_data.nr_params = 4*nr_params;
	for (i = 0; i < nr_params; i++) {
	    for (j = 0; j < 4; j++, index++) {
		reg = brw_vec1_grf(c->reg_index + index/8, 
			index%8);
		c->prog_data.param[index] = 
		    &plist->ParameterValues[i][j];
		set_reg(c, PROGRAM_STATE_VAR, i, j, reg);
	    }
	}
	c->nr_creg = 2*((4*nr_params+15)/16);
	c->reg_index += c->nr_creg;
    }
    for (i = 0; i < FRAG_ATTRIB_MAX; i++) {
	if (inputs & (1<<i)) {
	    nr_interp_regs++;
	    reg = brw_vec8_grf(c->reg_index, 0);
	    for (j = 0; j < 4; j++)
		set_reg(c, PROGRAM_PAYLOAD, i, j, reg);
	    c->reg_index += 2;

	}
    }
    c->prog_data.first_curbe_grf = c->key.nr_depth_regs * 2;
    c->prog_data.urb_read_length = nr_interp_regs * 2;
    c->prog_data.curb_read_length = c->nr_creg;
    c->emit_mask_reg = brw_uw1_reg(BRW_GENERAL_REGISTER_FILE, c->reg_index, 0);
    c->reg_index++;
    c->stack =  brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, c->reg_index, 0);
    c->reg_index += 2;
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:49,代码来源:brw_wm_glsl.c


示例13: _tk_set_reg

/*
 * Set task register contents
 */
SYSCALL ER _tk_set_reg( ID tskid,
		T_REGS *pk_regs, T_EIT *pk_eit, T_CREGS *pk_cregs )
{
	TCB		*tcb;
	ER		ercd = E_OK;

	CHECK_INTSK();
	CHECK_TSKID(tskid);
	CHECK_NONSELF(tskid);

	tcb = get_tcb(tskid);

	BEGIN_CRITICAL_SECTION;
	if ( tcb->state == TS_NONEXIST ) {
		ercd = E_NOEXS;
	} else {
		ercd = mp_check_domain_and_protection(tskid, tcb->tskid, tcb->tskatr);
		if ( ercd == E_OK ) {
			if ( is_ctxtsk(tcb) ) {
				ercd = E_OBJ;
			} else {
				set_reg(tcb, pk_regs, pk_eit, pk_cregs);
			}
		}
	}
	END_CRITICAL_NO_DISPATCH;

	return ercd;
}
开发者ID:kidasan,项目名称:tkernel,代码行数:32,代码来源:cpu_calls.c


示例14: hisi_dss_mctl_ov_set_ctl_dbg_reg

void hisi_dss_mctl_ov_set_ctl_dbg_reg(struct hisi_fb_data_type *hisifd, char __iomem *mctl_dgb)
{
	if (hisifd == NULL) {
		HISI_FB_ERR("hisifd is null");
		return;
	}

	if (is_mipi_cmd_panel(hisifd) && (hisifd->ldi_data_gate_en == 1)) {
		//open underflow clear
		set_reg(mctl_dgb, 0x782620, 32, 0);
	} else {
		//open underflow clear
		set_reg(mctl_dgb, 0x70A620, 32, 0);
		//set_reg(mctl_dgb, 0xB02620, 32, 0);
	}
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:16,代码来源:hisi_overlay_utils_hi6250.c


示例15: create_state_record_for

static int
create_state_record_for (struct dwarf_cursor *c, dwarf_state_record_t *sr,
                         unw_word_t ip)
{
    int i, ret;

    assert (c->pi_valid);

    memset (sr, 0, sizeof (*sr));
    for (i = 0; i < DWARF_NUM_PRESERVED_REGS + 2; ++i)
        set_reg (sr, i, DWARF_WHERE_SAME, 0);

    switch (c->pi.format)
    {
    case UNW_INFO_FORMAT_TABLE:
    case UNW_INFO_FORMAT_REMOTE_TABLE:
        ret = parse_fde (c, ip, sr);
        break;

    case UNW_INFO_FORMAT_DYNAMIC:
        ret = parse_dynamic (c, ip, sr);
        break;

    default:
        Debug (1, "Unexpected unwind-info format %d\n", c->pi.format);
        ret = -UNW_EINVAL;
    }
    return ret;
}
开发者ID:jessicah,项目名称:haiku-private,代码行数:29,代码来源:Gparser.c


示例16: _td_set_reg

/*
 * Set task register
 */
SYSCALL ER _td_set_reg( ID tskid, T_REGS *regs, T_EIT *eit, T_CREGS *cregs )
{
	TCB	*tcb;
	ER	ercd = E_OK;

	CHECK_TSKID(tskid);
	CHECK_NONSELF(tskid);
#if 0 /* (030206) This is not an error. Please ignore. */
	if ( eit != NULL ) {
		if ( (eit->sr & (SR_BL|SR_I(15))) != 0 ) {
			return E_PAR;
		}
	}
#endif

	tcb = get_tcb(tskid);

	BEGIN_CRITICAL_SECTION;
	if ( tcb->state == TS_NONEXIST ) {
		ercd = E_NOEXS;
	} else if ( !MP_CMP_DOMIDPART(tskid, tcb->tskid) ) {
		ercd = E_NOEXS;
	} else if ( is_ctxtsk(tcb) ) {
		ercd = E_OBJ;
	} else {
		set_reg(tcb, regs, eit, cregs);
	}
	END_CRITICAL_NO_DISPATCH;

	return ercd;
}
开发者ID:kidasan,项目名称:tkernel,代码行数:34,代码来源:cpu_calls.c


示例17: slv6_X_set_reg

 extern "C" void slv6_X_set_reg(SLv6_Processor *proc,
                                const SLv6_Condition cond,
                                const uint8_t d,
                                const uint32_t data) {
   if (!ConditionPassed(&proc->cpsr,cond)) return;
   set_reg(proc,d,data);
 }
开发者ID:kinhoa122345,项目名称:virtualsoc-wcdma,代码行数:7,代码来源:arm_v6_llvm_lib.cpp


示例18: set_reg_mask

static void set_reg_mask(struct asill_s *A, int r, int mask, int v)
{
  int nv = get_reg(A, r) & ~mask;

  nv |= v;
  set_reg(A, r, nv);
}
开发者ID:chripell,项目名称:yaaca,代码行数:7,代码来源:asill.c


示例19: disable_ldi

void disable_ldi(struct hisi_fb_data_type *hisifd)
{
	char __iomem *dss_base = 0;

	BUG_ON(hisifd == NULL);

	dss_base = hisifd->dss_base;

	if (hisifd->index == PRIMARY_PANEL_IDX) {
		set_reg(dss_base + PDP_LDI_CTRL, 0, 1, 0);
	} else  if (hisifd->index == EXTERNAL_PANEL_IDX) {
		set_reg(dss_base + SDP_LDI_CTRL, 0, 1, 0);
	} else {
		;
	}
}
开发者ID:mildrock,项目名称:overlay_plane_display,代码行数:16,代码来源:hisi_dpe_utils.c


示例20: get_reg

static struct brw_reg 
get_reg(struct brw_wm_compile *c, int file, int index, int component, int nr, GLuint neg, GLuint abs)
{
    struct brw_reg reg;
    switch (file) {
	case PROGRAM_STATE_VAR:
	case PROGRAM_CONSTANT:
	case PROGRAM_UNIFORM:
	    file = PROGRAM_STATE_VAR;
	    break;
	case PROGRAM_UNDEFINED:
	    return brw_null_reg();	
	default:
	    break;
    }

    if(c->wm_regs[file][index][component].inited)
	reg = c->wm_regs[file][index][component].reg;
    else 
	reg = brw_vec8_grf(c->reg_index, 0);

    if(!c->wm_regs[file][index][component].inited) {
	set_reg(c, file, index, component, reg);
	c->reg_index++;
    }

    if (neg & (1<< component)) {
	reg = negate(reg);
    }
    if (abs)
	reg = brw_abs(reg);
    return reg;
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:33,代码来源:brw_wm_glsl.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ set_reg_field_value函数代码示例发布时间:2022-05-30
下一篇:
C++ set_range函数代码示例发布时间: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