Ejemplo n.º 1
0
int
main(void)
{
  cpu_init();
  /* Initialize UART connected to Galileo Gen2 FTDI header */
  quarkX1000_uart_init(QUARK_X1000_UART_1);
  clock_init();
  rtimer_init();

  printf("Starting Contiki\n");

  ENABLE_IRQ();

  process_init();
  procinit_init();
  ctimer_init();
  autostart_start(autostart_processes);

  eth_init();

  while(1) {
    process_run();
  }

  return 0;
}
Ejemplo n.º 2
0
/* Kernel entrypoint */
int
main(void)
{
  uintptr_t *func_ptr;

#ifdef X86_CONF_RESTRICT_DMA
  quarkX1000_imr_conf();
#endif
  irq_init();
  quarkX1000_uart_init();
  /* Initialize UART connected to Galileo Gen1 3.5mm audio-style jack or
   * Galileo Gen2 FTDI header
   */
  quarkX1000_uart_init_port(QUARK_X1000_UART_1, 115200);
  SET_EXCEPTION_HANDLER(13, 1, gp_fault_handler);
  clock_init();
  rtimer_init();

  pci_root_complex_init();
  quarkX1000_eth_init();
  quarkX1000_i2c_init();
  quarkX1000_i2c_configure(QUARKX1000_I2C_SPEED_STANDARD,
                           QUARKX1000_I2C_ADDR_MODE_7BIT);
  /* The GPIO subsystem must be initialized prior to configuring pinmux, because
   * the pinmux configuration automatically performs GPIO configuration for the
   * relevant pins.
   */
  quarkX1000_gpio_init();
  /* use default pinmux configuration */
  if(galileo_pinmux_initialize() < 0) {
    fprintf(stderr, "Failed to initialize pinmux\n");
  }
  shared_isr_init();

  /* The ability to remap interrupts is not needed after this point and should
   * thus be disabled according to the principle of least privilege.
   */
  pci_root_complex_lock();

  func_ptr = (uintptr_t *)&_sdata_kern_startup_func;
  while(func_ptr != (uintptr_t *)&_edata_kern_startup_func) {
    ((void (*)(void))*func_ptr)();

    func_ptr++;
  }

  prot_domains_leave_main();

  return 0;
}