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


C++ dump_registers函数代码示例

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


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

示例1: do_vm86

static int
do_vm86(xf86Int10InfoPtr pInt)
{
    int retval, signo;

    xf86InterceptSignals(&signo);
    retval = vm86_rep(VM86S);
    xf86InterceptSignals(NULL);

    if (signo >= 0) {
	xf86DrvMsg(pInt->scrnIndex, X_ERROR,
	    "vm86() syscall generated signal %d.\n", signo);
	dump_registers(pInt);
	dump_code(pInt);
	stack_trace(pInt);
	return 0;
    }

    switch (VM86_TYPE(retval)) {
    case VM86_UNKNOWN:
	if (!vm86_GP_fault(pInt)) return 0;
	break;
    case VM86_STI:
	xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n");
	dump_registers(pInt);
	dump_code(pInt);
	stack_trace(pInt);
	return 0;
    case VM86_INTx:
	pInt->num = VM86_ARG(retval);
	if (!int_handler(pInt)) {
	    xf86DrvMsg(pInt->scrnIndex, X_ERROR,
		"Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval));
	    dump_registers(pInt);
	    dump_code(pInt);
	    stack_trace(pInt);
	    return 0;
	}
	/* I'm not sure yet what to do if we can handle ints */
	break;
    case VM86_SIGNAL:
	return 1;
	/*
	 * we used to warn here and bail out - but now the sigio stuff
	 * always fires signals at us. So we just ignore them for now.
	 */
	xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n");
	return 0;
    default:
	xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n",
		VM86_ARG(retval), VM86_TYPE(retval));
	dump_registers(pInt);
	dump_code(pInt);
	stack_trace(pInt);
	return 0;
    }

    return 1;
}
开发者ID:aosm,项目名称:X11,代码行数:59,代码来源:linux_vm86.c

示例2: debug_opcode

void debug_opcode(cpu* local_cpu, char *opcode, u16 n) {
#ifdef DEBUGOPCODE
    // Get the n arguments.
    u16 *args = get_args(local_cpu, n);
    
    printf("%s\n\n\tInstruction/OpCode\n\n%s", COLORS_BG_BLACK, COLORS_RESET_BG);

    printf(
           "\t%s%s%s [%s%c%s] %s%s0x0%x%s, 0x0%x\n", // String & Replacement Flags
           COLORS_BG_BLACK,
           opcode,
           COLORS_RESET_BG,
           COLORS_LIGHT_BLUE,
           get_register_value(local_cpu, args[0], 2),
           COLORS_RESET,
           COLORS_BLACK,
           COLORS_BG_WHITE,
           get_register_value(local_cpu, args[0], 0),
           COLORS_RESET,
           get_register_value(local_cpu, args[0], 3)
    );
    
    dump_registers(local_cpu, n);
    
    printf("%s\n\n\tEND\n\n%s", COLORS_BG_BLACK, COLORS_RESET_BG);
    
    free(args);
#endif
}
开发者ID:thehydroimpulse,项目名称:snowbird,代码行数:29,代码来源:main.c

示例3: ncp6335d_get_mode

static unsigned int ncp6335d_get_mode(struct regulator_dev *rdev)
{
	unsigned int val;
	int rc;
	struct ncp6335d_info *dd = rdev_get_drvdata(rdev);
	struct i2c_client *client = to_i2c_client(dd->dev);

	rc = regmap_read(dd->regmap, REG_NCP6335D_COMMAND, &val);
	if (rc) {
		dev_err(dd->dev, "Unable to get regulator mode rc(%d), %x\n", rc, client->addr);
		getAddr(client);
		rc = regmap_read(dd->regmap, REG_NCP6335D_COMMAND, &val);
		if (rc) {
			dev_err(dd->dev, "Unable to get regulator mode rc1(%d), %x\n", rc, client->addr);
			return rc;
		}
	}

	dump_registers(dd, REG_NCP6335D_COMMAND, __func__);

	if (val & dd->mode_bit)
		return REGULATOR_MODE_FAST;

	return REGULATOR_MODE_NORMAL;
}
开发者ID:SiddheshK15,项目名称:kernel_htc_820,代码行数:25,代码来源:onsemi-ncp6335d.c

示例4: ncp6335d_get_voltage

static int ncp6335d_get_voltage(struct regulator_dev *rdev)
{
	unsigned int val;
	int rc;
	struct ncp6335d_info *dd = rdev_get_drvdata(rdev);

	mutex_lock(&dd->ncp_mutex);
	if (dd->is_suspend) {
		rc = dd->curr_voltage;
		dev_dbg(dd->dev, "Get voltage after suspend, (%d)\n", rc);
		goto out;
	}

	rc = ncp6335x_read(dd, dd->vsel_reg, &val);
	if (rc) {
		dev_err(dd->dev, "Unable to get volatge rc(%d)", rc);
		return rc;
	}
	dd->curr_voltage = ((val & NCP6335D_VOUT_SEL_MASK) * dd->step_size) +
				dd->min_voltage;

	rc = dd->curr_voltage;

	dump_registers(dd, dd->vsel_reg, __func__);

out:
	mutex_unlock(&dd->ncp_mutex);
	return rc;
}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:29,代码来源:onsemi-ncp6335d.c

示例5: ncp6335d_set_voltage

static int ncp6335d_set_voltage(struct regulator_dev *rdev,
			int min_uV, int max_uV, unsigned *selector)
{
	unsigned int temp = 0;
	int rc, set_val, new_uV;
	struct ncp6335d_info *dd = rdev_get_drvdata(rdev);

	set_val = DIV_ROUND_UP(min_uV - NCP6335D_MIN_VOLTAGE_UV,
					NCP6335D_STEP_VOLTAGE_UV);
	new_uV = (set_val * NCP6335D_STEP_VOLTAGE_UV) +
					NCP6335D_MIN_VOLTAGE_UV;
	if (new_uV > (max_uV + NCP6335D_MIN_VOLTAGE_UV)) {
		dev_err(dd->dev, "Unable to set volatge (%d %d)\n",
							min_uV, max_uV);
		return -EINVAL;
	}

	temp = dd->vsel_ctrl_val & ~NCP6335D_VOUT_SEL_MASK;
	temp |= (set_val & NCP6335D_VOUT_SEL_MASK);

	rc = regmap_write(dd->regmap, dd->vsel_reg, temp);
	if (rc) {
		dev_err(dd->dev, "Unable to set volatge (%d %d)\n",
							min_uV, max_uV);
	} else {
		ncp633d_slew_delay(dd, dd->curr_voltage, new_uV);
		dd->curr_voltage = new_uV;
		dd->vsel_ctrl_val = temp;
	}

	dump_registers(dd, dd->vsel_reg, __func__);

	return rc;
}
开发者ID:NovaFusion,项目名称:android_kernel_samsung_arubaslim,代码行数:34,代码来源:onsemi-ncp6335d.c

示例6: ncp6335d_set_mode

static int ncp6335d_set_mode(struct regulator_dev *rdev,
					unsigned int mode)
{
	int rc;
	struct ncp6335d_info *dd = rdev_get_drvdata(rdev);

	/* only FAST and NORMAL mode types are supported */
	if (mode != REGULATOR_MODE_FAST && mode != REGULATOR_MODE_NORMAL) {
		dev_err(dd->dev, "Mode %d not supported\n", mode);
		return -EINVAL;
	}

	rc = regmap_update_bits(dd->regmap, REG_NCP6335D_COMMAND, dd->mode_bit,
			(mode == REGULATOR_MODE_FAST) ? dd->mode_bit : 0);
	if (rc) {
		dev_err(dd->dev, "Unable to set operating mode rc(%d)", rc);
		return rc;
	}

	rc = regmap_update_bits(dd->regmap, REG_NCP6335D_COMMAND,
					NCP6335D_DVS_PWM_MODE,
					(mode == REGULATOR_MODE_FAST) ?
					NCP6335D_DVS_PWM_MODE : 0);
	if (rc)
		dev_err(dd->dev, "Unable to set DVS trans. mode rc(%d)", rc);

	dump_registers(dd, REG_NCP6335D_COMMAND, __func__);

	return rc;
}
开发者ID:NovaFusion,项目名称:android_kernel_samsung_arubaslim,代码行数:30,代码来源:onsemi-ncp6335d.c

示例7: ncp6335d_set_voltage

static int ncp6335d_set_voltage(struct regulator_dev *rdev,
                                int min_uV, int max_uV, unsigned *selector)
{
    int rc, set_val, new_uV;
    struct ncp6335d_info *dd = rdev_get_drvdata(rdev);

    set_val = DIV_ROUND_UP(min_uV - dd->min_voltage, dd->step_size);
    new_uV = (set_val * dd->step_size) + dd->min_voltage;
    if (new_uV > max_uV) {
        dev_err(dd->dev, "Unable to set volatge (%d %d)\n",
                min_uV, max_uV);
        return -EINVAL;
    }
#if 0
    rc = ncp6335x_update_bits(dd, dd->vsel_reg,
                              NCP6335D_VOUT_SEL_MASK, (set_val & NCP6335D_VOUT_SEL_MASK));
#else
    rc = ncp6335x_update_bits(dd, dd->vsel_reg,
                              0xFF, ((set_val & NCP6335D_VOUT_SEL_MASK)|0x80));

#endif

    if (rc) {
        dev_err(dd->dev, "Unable to set volatge (%d %d)\n",
                min_uV, max_uV);
    } else {
        ncp633d_slew_delay(dd, dd->curr_voltage, new_uV);
        dd->curr_voltage = new_uV;
    }

    dump_registers(dd, dd->vsel_reg, __func__);

    return rc;
}
开发者ID:dtsd,项目名称:zte_blade_s6_lollipop_kernel,代码行数:34,代码来源:onsemi-ncp6335d.c

示例8: handle_usr1

void handle_usr1(int sig) {
	dump_registers();
	if (halt) { 
		halt = 0; 
	} else {
		halt = 1;
	}
}
开发者ID:tismith,项目名称:dcpu16,代码行数:8,代码来源:dcpu16.c

示例9: main

int main() {
  registers regs; /* Registers */
  memory mem; /* Main memory */
  int i; /* Instruction count */

  /* 
   * 'Boot up'??
   */

  /* Initialize memory/registers to zero */
  memset(mem.data, 0, MEMSIZE);
  memset(&regs, 0, sizeof(registers));

  /* 'Load' sample program into memory */
  memcpy(mem.data + OS_SIZE, test_program, sizeof(test_program));

  /* Initialize some register and memory values 
   * (hard-coded for the purposes of testing)
   */
  const uint32_t sample_value_addr = OS_SIZE + sizeof(test_program);

  regs.general[0] = 0xDEADBEEF;
  regs.general[1] = sample_value_addr; 
  regs.general[3] = 0xCAFEBABE;

  printf("Initial state:\n");
  dump_registers(&regs);
  dump_memory(&mem);

  /* Execute program */
  regs.prog_counter = OS_SIZE;

  for (i = 0; i < sizeof(test_program)/sizeof(uint32_t); i++) {
    printf("Executing instruction %u in test_program\n", i);

    /* Execute instruction */
    execute(&regs, &mem);

    /* Dump */
    dump_registers(&regs);
    dump_memory(&mem);
  }

  return EXIT_SUCCESS;
}
开发者ID:darcykimball,项目名称:best_cpu,代码行数:45,代码来源:test_fetch_store.c

示例10: dump_crash_report

void dump_crash_report(int tfd, unsigned pid, unsigned tid, bool at_fault)
{
    char data[1024];
    FILE *fp;
    mapinfo *milist = 0;
    unsigned int sp_list[STACK_CONTENT_DEPTH];
    int stack_depth;
    int frame0_pc_sane = 1;
    
    if (!at_fault) {
        _LOG(tfd, true,
         "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n");
        _LOG(tfd, true, "pid: %d, tid: %d\n", pid, tid);
    }

    dump_registers(tfd, tid, at_fault);
    
    /* Clear stack pointer records */
    memset(sp_list, 0, sizeof(sp_list));

    sprintf(data, "/proc/%d/maps", pid);
    fp = fopen(data, "r");
    if(fp) {
        while(fgets(data, 1024, fp)) {
            mapinfo *mi = parse_maps_line(data);
            if(mi) {
                mi->next = milist;
                milist = mi;
            }
        }
        fclose(fp);
    }

    parse_exidx_info(milist, tid);

    /* If stack unwinder fails, use the default solution to dump the stack
     * content.
     */
    stack_depth = unwind_backtrace_with_ptrace(tfd, tid, milist, sp_list,
                                               &frame0_pc_sane, at_fault);

    /* The stack unwinder should at least unwind two levels of stack. If less
     * level is seen we make sure at lease pc and lr are dumped.
     */
    if (stack_depth < 2) {
        dump_pc_and_lr(tfd, tid, milist, stack_depth, at_fault);
    }

    dump_stack_and_code(tfd, tid, milist, stack_depth, sp_list, frame0_pc_sane,
                        at_fault);

    while(milist) {
        mapinfo *next = milist->next;
        free(milist);
        milist = next;
    }
}
开发者ID:SuperTeam,项目名称:android_system_core,代码行数:57,代码来源:debuggerd.c

示例11: ubc_break_work

void ubc_break_work(register_stack *stack)
{
    ubc_serial_init(57600);

    ubc_serial_flush();

    dump_registers(&(stack->r0), "R", 14);

    ubc_serial_flush();
}
开发者ID:quad,项目名称:voot,代码行数:10,代码来源:ubc-serial-receive-menu.c

示例12: ncp6335d_set_voltage

static int ncp6335d_set_voltage(struct regulator_dev *rdev,
			int min_uV, int max_uV, unsigned *selector)
{
	int rc, set_val, new_uV;
	struct ncp6335d_info *dd = rdev_get_drvdata(rdev);
	//<oliver 20150716>++ modify ncp output voltage for stability
	static enum msm_cpu cur_cpu; //static variable constraint to this file
	static char* buf = "0.0";

	cur_cpu = socinfo_get_msm_cpu();
	buf = OLIVER_socinfo_get_msm_cpu_revision();
	set_val = DIV_ROUND_UP(min_uV - dd->min_voltage, dd->step_size);
	if (!strncmp("3.0",buf,3)) {
		//printk("OLIVER 3.0 found\n");
	} else if ((MSM_CPU_8939 == cur_cpu)&&(asus_PRJ_ID == ASUS_ZE550KL)){
		if (!strncmp("3",asus_project_stage,2)||!strncmp("1",asus_project_stage,2)) {
			if (set_val < 80)
				set_val = set_val + 5;
			else if (set_val < 120) {
				set_val = set_val + 4;
				if (set_val > 120)
					set_val = 120;
			}

		}else {
			if (set_val < 80) {
				set_val = set_val + 4;
				if (set_val > 80)
					set_val = 80;
			}
		}
	}
	//<oliver 20150716>--
	new_uV = (set_val * dd->step_size) + dd->min_voltage;
	if (new_uV > max_uV) {
		dev_err(dd->dev, "Unable to set volatge (%d %d)\n",
							min_uV, max_uV);
		return -EINVAL;
	}

	rc = ncp6335x_update_bits(dd, dd->vsel_reg,
		NCP6335D_VOUT_SEL_MASK, (set_val & NCP6335D_VOUT_SEL_MASK));
	if (rc) {
		dev_err(dd->dev, "Unable to set volatge (%d %d)\n",
							min_uV, max_uV);
	} else {
		ncp633d_slew_delay(dd, dd->curr_voltage, new_uV);
		dd->curr_voltage = new_uV;
	}

	dump_registers(dd, dd->vsel_reg, __func__);

	return rc;
}
开发者ID:shakalaca,项目名称:ASUS_ZenFone_ZE601KL,代码行数:54,代码来源:onsemi-ncp6335d.c

示例13: dump_context

static void dump_context(struct ucontext *cx)
{
	kprintf("iret_eip    = 0x%lx\n", cx->iret_eip);
	kprintf("iret_cs     = 0x%lx\n", cx->iret_cs);
	kprintf("iret_elfags = 0x%lx\n", cx->eflags);
	if (!is_kernel_context(cx)) {
		kprintf("iret_esp    = 0x%lx\n", cx->iret_esp);
		kprintf("iret_ss     = 0x%lx\n", cx->iret_ss);
	}
	dump_registers(&cx->reg);
}
开发者ID:drewt,项目名称:Telos,代码行数:11,代码来源:interrupt.c

示例14: process_command

void process_command ()
{ char action;
  char fname[100];
  int pid, time, ret;

  printf ("command> ");
  scanf ("%c", &action);
  while (action != 'T')
  { switch (action)
    { case 's':   // submit
        scanf ("%s", &fname);
        if (Debug) printf ("File name: %s is submitted\n", fname);
        submit_process (fname);
        break;
      case 'x':  // execute
        execute_process ();
        break;
      case 'r':  // dump register
        dump_registers ();
        break;
      case 'q':  // dump ready queue and list of processes completed IO
        dump_ready_queue ();
        dump_doneWait_list ();
        break;
      case 'p':   // dump PCB
        printf ("PCB Dump Starts: Checks from 0 to %d\n", currentPid);
        for (pid=1; pid<currentPid; pid++)
          if (PCB[pid] != NULL) dump_PCB (pid);
        break;
      case 'e':   // dump events in timer
        dump_events ();
        break;
      case 'm':   // dump Memory
        for (pid=1; pid<currentPid; pid++)
          if (PCB[pid] != NULL) dump_memory (pid);
        break;
      case 'w':   // dump Swap Space
         for (pid=1; pid<currentPid; pid++)
            if (PCB[pid] != NULL) dump_swap_memory (pid);
        break;
      case 'l':   // dump Spool
        for (pid=1; pid<currentPid; pid++)
          if (PCB[pid] != NULL) dump_spool (pid);
        break;
      case 'T':  // Terminate, do nothing, terminate in while loop
        break;
      default: 
        printf ("Incorrect command!!!\n");
    }
    printf ("\ncommand> ");
    scanf ("\n%c", &action);
    if (Debug) printf ("Next command is %c\n", action);
  }
}
开发者ID:mourya92,项目名称:Simulated_Operating_System,代码行数:54,代码来源:command.c

示例15: ncp6335d_disable

static int ncp6335d_disable(struct regulator_dev *rdev)
{
	int rc;
	struct ncp6335d_info *dd = rdev_get_drvdata(rdev);

	rc = regmap_update_bits(dd->regmap, dd->vsel_reg,
					NCP6335D_ENABLE, 0);
	if (rc)
		dev_err(dd->dev, "Unable to disable regualtor rc(%d)", rc);

	dump_registers(dd, dd->vsel_reg, __func__);

	return rc;
}
开发者ID:AbdulrahmanAmir,项目名称:Dorimanx-LG-G2-D802-Kernel,代码行数:14,代码来源:onsemi-ncp6335d.c


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