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


C++ rtems_io_register_name函数代码示例

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


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

示例1: console_initialize

rtems_device_driver console_initialize(
    rtems_device_major_number  major,
    rtems_device_minor_number  minor,
    void                      *arg
)
{
    rtems_status_code status;
    int i;

    for (i = 0; i < NUM_DEVS; i++) {
        imx_uart_init(i);
    }

    rtems_termios_initialize();

    /* /dev/console and /dev/tty0 are the same */
    status = rtems_io_register_name("/dev/console", major, 0);
    if (status != RTEMS_SUCCESSFUL) {
        rtems_panic("%s:%d Error registering /dev/console :: %d\n",
                    __FUNCTION__, __LINE__, status);
    }

    status = rtems_io_register_name("/dev/tty0", major, 0);
    if (status != RTEMS_SUCCESSFUL) {
        rtems_panic("%s:%d Error registering /dev/tty0 :: %d\n",
                    __FUNCTION__, __LINE__, status);
    }

    status = rtems_io_register_name("/dev/tty1", major, 1);
    if (status != RTEMS_SUCCESSFUL) {
        rtems_panic("%s:%d Error registering /dev/tty1 :: %d\n",
                    __FUNCTION__, __LINE__, status);
    }
    return RTEMS_SUCCESSFUL;
}
开发者ID:0871087123,项目名称:rtems,代码行数:35,代码来源:uart.c

示例2: console_initialize

rtems_device_driver console_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
)
{
  rtems_status_code sc = RTEMS_SUCCESSFUL;
  const console_generic_info *info_table = console_generic_info_table;
  rtems_device_minor_number count = console_generic_info_count;
  rtems_device_minor_number console = console_generic_minor;

  if (count <= 0) {
    mpc55xx_fatal(MPC55XX_FATAL_CONSOLE_GENERIC_COUNT);
  }

  rtems_termios_initialize();

  for (minor = 0; minor < count; ++minor) {
    const console_generic_info *info = info_table + minor;

    sc = rtems_io_register_name(info->device_path, major, minor);
    if (sc != RTEMS_SUCCESSFUL) {
      mpc55xx_fatal(MPC55XX_FATAL_CONSOLE_GENERIC_REGISTER);
    }
  }

  sc = rtems_io_register_name(CONSOLE_DEVICE_NAME, major, console);
  if (sc != RTEMS_SUCCESSFUL) {
    mpc55xx_fatal(MPC55XX_FATAL_CONSOLE_GENERIC_REGISTER_CONSOLE);
  }

  console_generic_char_out_do_init();

  return sc;
}
开发者ID:AndroidMarv,项目名称:rtems,代码行数:35,代码来源:console-generic.c

示例3: console_initialize

/* console_initialize --
 *     This routine initializes the console IO drivers and register devices
 *     in RTEMS I/O system.
 *
 * PARAMETERS:
 *     major - major console device number
 *     minor - minor console device number (not used)
 *     arg - device initialize argument
 *
 * RETURNS:
 *     RTEMS error code (RTEMS_SUCCESSFUL if device initialized successfuly)
 */
rtems_device_driver
console_initialize(rtems_device_major_number major,
        rtems_device_minor_number minor,
        void *arg)
{
    rtems_status_code status;

#ifdef SH4_WITH_IPL
    /* booting from flash we cannot have IPL console */
    if (boot_mode != SH4_BOOT_MODE_IPL && console_mode == CONSOLE_MODE_IPL)
        console_mode = CONSOLE_MODE_INT;

    /* break out from gdb if neccessary */
    if (boot_mode == SH4_BOOT_MODE_IPL && console_mode != CONSOLE_MODE_IPL)
        ipl_finish();
#endif

    /*
     * Set up TERMIOS
     */
    if ((console_mode != CONSOLE_MODE_RAW) &&
                    (console_mode != CONSOLE_MODE_IPL))
        rtems_termios_initialize ();

    /*
     * Register the devices
     */
    status = rtems_io_register_name ("/dev/console", major, 0);
    if (status != RTEMS_SUCCESSFUL)
        rtems_fatal_error_occurred (status);

    status = rtems_io_register_name ("/dev/aux", major, 1);
    if (status != RTEMS_SUCCESSFUL)
        rtems_fatal_error_occurred (status);

    if (console_mode == CONSOLE_MODE_RAW)
    {
        rtems_status_code sc;
        sc = sh4uart_init(&sh4_uarts[0],              /* uart */
                NULL,                  /* tty */
                1,                     /* UART channel number */
                0);                    /* Poll-mode */

        if (sc == RTEMS_SUCCESSFUL)
            sc = sh4uart_reset(&sh4_uarts[0]);

        sc = sh4uart_init(&sh4_uarts[1],              /* uart */
                NULL,                  /* tty */
                2,                     /* UART channel number */
                0);                    /* Poll-mode */

        if (sc == RTEMS_SUCCESSFUL)
            sc = sh4uart_reset(&sh4_uarts[1]);

        return sc;
    }

    return RTEMS_SUCCESSFUL;
}
开发者ID:AoLaD,项目名称:rtems,代码行数:71,代码来源:console.c

示例4: console

/*-------------------------------------------------------------------------+
| Console device driver INITIALIZE entry point.
+--------------------------------------------------------------------------+
| Initilizes the I/O console (keyboard + VGA display) driver.
+--------------------------------------------------------------------------*/
rtems_device_driver
console_initialize(rtems_device_major_number major,
                   rtems_device_minor_number minor,
                   void                      *arg)
{
  rtems_status_code status;

  /*
   *  The video was initialized in the start.s code and does not need
   *  to be reinitialized.
   */

  /*
   * Set up TERMIOS
   */
  rtems_termios_initialize ();

  /*
   * Do device-specific initialization
   */

  /* RTEMS calls this routine once with 'minor'==0; loop through
   * all known instances...
   */

  for (minor=0; minor < sizeof(ttyS)/sizeof(ttyS[0]); minor++) {
	char *nm;
	  /*
	   * Skip ports (possibly not supported by BSP...) we have no ISR for
	   */
	  if ( ! ttyS[minor].isr )
		continue;
	  /*
	   * Register the device
	   */
	  status = rtems_io_register_name ((nm=ttyS[minor].name), major, minor);
	  if ( RTEMS_SUCCESSFUL==status && BSPConsolePort == minor)
		{
		  printk("Registering /dev/console as minor %d (==%s)\n",
							minor,
							ttyS[minor].name);
		  /* also register an alias */
		  status = rtems_io_register_name (
							(nm="/dev/console"),
							major,
							minor);
		}
	  if (status != RTEMS_SUCCESSFUL)
		{
		  printk("Error registering %s!\n",nm);
		  rtems_fatal_error_occurred (status);
		}
  }

  return RTEMS_SUCCESSFUL;
} /* console_initialize */
开发者ID:jfpmonteiro,项目名称:rtems-4.8-rhealstone,代码行数:61,代码来源:console.c

示例5: console_initialize

rtems_device_driver console_initialize(
  rtems_device_major_number  major,
  rtems_device_minor_number  minor,
  void                      *arg
)
{
  rtems_status_code status;
  int i;
  char console_name[16];

  rtems_termios_initialize();

  /* Find UARTs */
  leon3_console_scan_uarts();

  /* Update syscon_uart_index to index used as /dev/console
   * Let user select System console by setting syscon_uart_index. If the
   * BSP is to provide the default UART (syscon_uart_index==0):
   *   non-MP: APBUART[0] is system console
   *   MP: LEON CPU index select UART
   */
  if (syscon_uart_index == 0) {
#if defined(RTEMS_MULTIPROCESSING)
    syscon_uart_index = LEON3_Cpu_Index;
#else
    syscon_uart_index = 0;
#endif
  } else {
    syscon_uart_index = syscon_uart_index - 1; /* User selected sys-console */
  }

  /*  Register Device Names
   *
   *  0 /dev/console   - APBUART[USER-SELECTED, DEFAULT=APBUART[0]]
   *  1 /dev/console_a - APBUART[0] (by default not present because is console)
   *  2 /dev/console_b - APBUART[1]
   *  ...
   *
   * On a MP system one should not open UARTs that other OS instances use.
   */
  if (syscon_uart_index < uarts) {
    status = rtems_io_register_name("/dev/console", major, 0);
    if (status != RTEMS_SUCCESSFUL)
      bsp_fatal(LEON3_FATAL_CONSOLE_REGISTER_DEV);
  }
  strcpy(console_name,"/dev/console_a");
  for (i = 0; i < uarts; i++) {
    if (i == syscon_uart_index)
      continue; /* skip UART that is registered as /dev/console */
    console_name[13] = 'a' + i;
    rtems_io_register_name( console_name, major, i+1);
  }

  return RTEMS_SUCCESSFUL;
}
开发者ID:Fyleo,项目名称:rtems,代码行数:55,代码来源:console.c

示例6: console_initialize

rtems_device_driver console_initialize(
  rtems_device_major_number  major,
  rtems_device_minor_number  minor,
  void                      *arg
)
{
  rtems_status_code status;
  int i, uart0;
  char console_name[16];
  extern rtems_configuration_table Configuration;

  rtems_termios_initialize();

  /* Find UARTs */
  scan_uarts();
	
  if (Configuration.User_multiprocessing_table != NULL)
    uart0 =  LEON3_Cpu_Index;
  else
    uart0 = 0;  

  /*  Register Device Names */
  
  if (uarts && (uart0 < uarts)) 
  {  
    status = rtems_io_register_name( "/dev/console", major, 0 );
    if (status != RTEMS_SUCCESSFUL)
      rtems_fatal_error_occurred(status);

    strcpy(console_name,"/dev/console_a");
    for (i = uart0+1; i < uarts; i++)
    {
      console_name[13]++;
      status = rtems_io_register_name( console_name, major, i);
    }
  }


  /*
   *  Initialize Hardware
   */
  if ((Configuration.User_multiprocessing_table == NULL) ||
      ((Configuration.User_multiprocessing_table)->node == 1))
  {
    for (i = uart0; i < uarts; i++)
    {
      LEON3_Console_Uart[i]->ctrl |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
      LEON3_Console_Uart[i]->status = 0;  
    }
  }

  return RTEMS_SUCCESSFUL;
}
开发者ID:jfpmonteiro,项目名称:rtems-4.8-rhealstone,代码行数:53,代码来源:console.c

示例7: console

/*-------------------------------------------------------------------------+
| Console device driver INITIALIZE entry point.
+--------------------------------------------------------------------------+
| Initilizes the I/O console (keyboard + VGA display) driver.
+--------------------------------------------------------------------------*/
rtems_device_driver
console_initialize(rtems_device_major_number major,
                   rtems_device_minor_number minor,
                   void                      *arg)
{
  rtems_status_code status;

  /*
   * Set up TERMIOS
   */
  rtems_termios_initialize ();

  /*
   * Do device-specific initialization
   */

  /* 115200-8-N-1, without hardware flow control */
  BSP_uart_init(BSPConsolePort, 115200, CHR_8_BITS, 0, 0, 0);

  /* Set interrupt handler */
  if(BSPConsolePort == BSP_UART_COM1)
    {
      console_isr_data.name = BSP_UART_COM1_IRQ;
      console_isr_data.hdl  = BSP_uart_termios_isr_com1;

    }
  else
    {
      assert(BSPConsolePort == BSP_UART_COM2);
      console_isr_data.name = BSP_UART_COM2_IRQ;
      console_isr_data.hdl  = BSP_uart_termios_isr_com2;
    }

  status = BSP_install_rtems_irq_handler(&console_isr_data);

  if (!status){
    printk("Error installing serial console interrupt handler!\n");
    rtems_fatal_error_occurred(status);
  }
  /*
   * Register the device
   */
  status = rtems_io_register_name ("/dev/console", major, 0);
  if (status != RTEMS_SUCCESSFUL)
    {
      printk("Error registering console device!\n");
      rtems_fatal_error_occurred (status);
    }

  if(BSPConsolePort == BSP_UART_COM1)
    {
      printk("Initialized console on port COM1 115200-8-N-1\n\n");
    }
  else
    {
      printk("Initialized console on port COM2 115200-8-N-1\n\n");
    }

  return RTEMS_SUCCESSFUL;
} /* console_initialize */
开发者ID:FullMentalPanic,项目名称:RTEMS_NEW_TOOL_CHAIN,代码行数:65,代码来源:console.c

示例8: sh_sci_initialize

rtems_device_driver sh_sci_initialize(
    rtems_device_major_number  major,
    rtems_device_minor_number  minor,
    void                      *arg )
{
    rtems_device_driver status ;
    rtems_device_minor_number     i;

    /*
     * register all possible devices.
     * the initialization of the hardware is done by sci_open
     */

    for ( i = 0 ; i < SCI_MINOR_DEVICES ; i++ )
    {
        status = rtems_io_register_name(
                     sci_device[i].name,
                     major,
                     sci_device[i].minor );
        if (status != RTEMS_SUCCESSFUL)
            rtems_fatal_error_occurred(status);
    }

    /* default hardware setup */

    return RTEMS_SUCCESSFUL;
}
开发者ID:kptran,项目名称:rtems,代码行数:27,代码来源:sci.c

示例9: paux_initialize

/*
 * paux device driver INITIALIZE entry point.
 */
rtems_device_driver paux_initialize(  
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void                      *arg)
{
  rtems_status_code status;

  /*
   * Set up TERMIOS
   */
  rtems_termios_initialize();

  printk( "PS/2 mouse probe.\n" );
  if( psaux_init() < 0 ) {
    printk("Error detecting PS/2 mouse --\n");
    /* we might want to finish the application here !!! */
  }
  open_aux();

  /*
   * Register the device
   */
  status = rtems_io_register_name ("/dev/mouse", major, 0);
  if (status != RTEMS_SUCCESSFUL) {
    printk("Error registering paux device!\n");
    rtems_fatal_error_occurred (status);
  }
  return RTEMS_SUCCESSFUL;
} /* tty_initialize */
开发者ID:aniwang2013,项目名称:leon-rtems,代码行数:32,代码来源:ps2_mouse.c

示例10: flash_initialize

rtems_device_driver flash_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
)
{
  rtems_status_code sc;
  int i;
  char devname[16];

  for (i=0;i<FLASH_PARTITION_COUNT;i++) {
    sprintf(devname, "/dev/flash%d", i+1);
    sc = rtems_io_register_name(devname, major, i);
    RTEMS_CHECK_SC(sc, "Create flash device");
  }

  sc = rtems_semaphore_create(
    rtems_build_name('F', 'L', 'S', 'H'),
    1,
    RTEMS_SIMPLE_BINARY_SEMAPHORE,
    0,
    &flash_lock
  );
  RTEMS_CHECK_SC(sc, "create semaphore");

  return RTEMS_SUCCESSFUL;
}
开发者ID:0871087123,项目名称:rtems,代码行数:27,代码来源:flash.c

示例11: ir_initialize

rtems_device_driver ir_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
)
{
  rtems_status_code sc;
  rtems_isr_entry dummy;

  sc = rtems_io_register_name(DEVICE_NAME, major, 0);
  RTEMS_CHECK_SC(sc, "create IR input device");

 sc = rtems_message_queue_create(
    rtems_build_name('R', 'C', '5', 'Q'),
    64,
    2,
    0,
    &ir_q
  );
  RTEMS_CHECK_SC(sc, "create IR queue");

  rtems_interrupt_catch(interrupt_handler, MM_IRQ_IR, &dummy);
  bsp_interrupt_vector_enable(MM_IRQ_IR);

  return RTEMS_SUCCESSFUL;
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:26,代码来源:ir.c

示例12: pfpu_initialize

rtems_device_driver pfpu_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
)
{
  rtems_status_code sc;
  rtems_isr_entry dummy;

  sc = rtems_io_register_name(DEVICE_NAME, major, 0);
  RTEMS_CHECK_SC(sc, "create PFPU device");

  sc = rtems_semaphore_create(
    rtems_build_name('P', 'F', 'P', 'U'),
    0,
    RTEMS_SIMPLE_BINARY_SEMAPHORE,
    0,
    &done_sem
  );
  RTEMS_CHECK_SC(sc, "create PFPU done semaphore");

  rtems_interrupt_catch(done_handler, MM_IRQ_PFPU, &dummy);
  bsp_interrupt_vector_enable(MM_IRQ_PFPU);

  return RTEMS_SUCCESSFUL;
}
开发者ID:aniwang2013,项目名称:leon-rtems,代码行数:26,代码来源:pfpu.c

示例13: console_initialize

rtems_device_driver console_initialize(
  rtems_device_major_number  major,
  rtems_device_minor_number  minor,
  void                      *arg
)
{
  rtems_status_code status;

  rtems_termios_initialize();

  /*
   *  Make sure the hardware is initialized.
   */

  console_initialize_hardware();

  /*
   *  Register Device Names
   */

  status = rtems_io_register_name( "/dev/console", major, 0 );
  if (status != RTEMS_SUCCESSFUL)
    rtems_fatal_error_occurred(status);

  return RTEMS_SUCCESSFUL;
}
开发者ID:jfpmonteiro,项目名称:rtems-4.8-rhealstone,代码行数:26,代码来源:console-polled.c

示例14: console_initialize

/******************************************************
  Name: console_initialize
  Input parameters: MAJOR # of console_driver,
		    minor is always 0,
		    args are always NULL
  Output parameters: -
  Description: Reserve resources consumed by this driver
  TODO: We should pass m340_uart_config table in arg
 *****************************************************/
rtems_device_driver console_initialize(
  rtems_device_major_number  major,
  rtems_device_minor_number  minor,
  void                      *arg
)
{
	rtems_status_code status;
	int i;

	/*
	 * Set up TERMIOS
	 */
	rtems_termios_initialize ();

	/*
	 * Do device-specific initialization
	 */
        Init_UART_Table();
	dbugInitialise ();
	Fifo_Full_benchmark_timer_initialize();

	/*
	 * Register the devices
	 */
	for (i=0; i<UART_NUMBER_OF_CHANNELS; i++) {
	    if (m340_uart_config[i].enable) {
		status = rtems_io_register_name (m340_uart_config[i].name, major, i);
		if (status != RTEMS_SUCCESSFUL)
			rtems_fatal_error_occurred (status);
	    }
	}

	return RTEMS_SUCCESSFUL;
}
开发者ID:atixing,项目名称:rtems,代码行数:43,代码来源:console.c

示例15: usbinput_initialize

rtems_device_driver usbinput_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
)
{
  rtems_status_code sc;
  rtems_isr_entry dummy;

  MM_WRITE(MM_SOFTUSB_CONTROL, SOFTUSB_CONTROL_RESET);

  mouse_consume = 0;
  keyboard_consume = 0;
  midi_consume = 0;

  sc = rtems_io_register_name(DEVICE_NAME, major, 0);
  RTEMS_CHECK_SC(sc, "create USB input device");

  sc = rtems_message_queue_create(
    rtems_build_name('U', 'S', 'B', 'I'),
    64,
    8,
    0,
    &event_q
  );
  RTEMS_CHECK_SC(sc, "create USB event queue");

  rtems_interrupt_catch(interrupt_handler, MM_IRQ_USB, &dummy);
  bsp_interrupt_vector_enable(MM_IRQ_USB);

  return RTEMS_SUCCESSFUL;
}
开发者ID:RTEMS,项目名称:rtems,代码行数:32,代码来源:usbinput.c


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