예제 #1
0
파일: agp.c 프로젝트: Xeffyr/KolibriOS-Mod
u32_t __stdcall drvEntry(int action)
{
    u32_t retval;

    int i;

    if(action != 1)
        return 0;

    if(!dbg_open("/rd/1/drivers/agp.log"))
    {
        printf("Can't open /rd/1/drivers/agp.log\nExit\n");
        return 0;
    }

    if( FindPciDevice() == 0)
    {
        dbgprintf("Device not found\n");
        return 0;
    };

    return 0;

//    retval = RegService("AGP", srv_2d);
//    dbgprintf("reg service %s as: %x\n", "HDRAW", retval);

//    return retval;
};
예제 #2
0
ACPI_STATUS
AcpiOsInitialize (void)
{
    if(!dbg_open("/rd/1/drivers/acpi.log"))
    {
        dbgprintf("Can't open /rd/1/drivers/acpi.log\nExit\n");
        return AE_ERROR;
    }

    return (AE_OK);
}
예제 #3
0
u32_t __stdcall drvEntry(int action)
{
    RHDPtr rhdPtr;
    u32_t retval;

    int i;

    if(action != 1)
        return 0;

    if(!dbg_open("/bd0/2/ati2d.log"))
    {
        printf("Can't open /rd/1/drivers/ati2d.log\nExit\n");
        return 0;
    }
    if( GetScreenBpp() != 32)
    {
        dbgprintf("32 bpp dispaly mode required !\nExit\t");
        return 0;
    }

    if((rhdPtr=FindPciDevice())==NULL)
    {
        dbgprintf("Device not found\n");
        return 0;
    };

    dbgprintf("detect %s GART\n",
               rhd.gart_type == RADEON_IS_PCIE ? "PCIE":"PCI");

    for(i=0;i<6;i++)
    {
        if(rhd.memBase[i])
            dbgprintf("Memory base_%d 0x%x size 0x%x\n",
                      i,rhd.memBase[i],(1<<rhd.memsize[i]));
    };
    for(i=0;i<6;i++)
    {
        if(rhd.ioBase[i])
            dbgprintf("Io base_%d 0x%x size 0x%x\n",
                      i,rhd.ioBase[i],(1<<rhd.memsize[i]));
    };
    if(!RHDPreInit())
        return 0;

    R5xx2DInit();

    Init3DEngine(&rhd);

    retval = RegService("HDRAW", srv_2d);
    dbgprintf("reg service %s as: %x\n", "HDRAW", retval);

    return retval;
};
예제 #4
0
파일: edbg.c 프로젝트: arv3/edbg
//-----------------------------------------------------------------------------
int main(int argc, char **argv)
{
  debugger_t debuggers[MAX_DEBUGGERS];
  int n_debuggers = 0;
  int debugger = -1;
  target_t *target;

  parse_command_line(argc, argv);

  if (!(g_erase || g_program || g_verify || g_lock || g_read || g_list || g_target))
    error_exit("no actions specified");

  if (g_read && (g_erase || g_program || g_verify || g_lock))
    error_exit("mutually exclusive actions specified");

  n_debuggers = dbg_enumerate(debuggers, MAX_DEBUGGERS);

  if (g_list)
  {
    printf("Attached debuggers:\n");
    for (int i = 0; i < n_debuggers; i++)
      printf("  %s - %s %s\n", debuggers[i].serial, debuggers[i].manufacturer, debuggers[i].product);
    return 0;
  }

  if (NULL == g_target)
    error_exit("no target type specified (use '-t' option)");

  if (0 == strcmp("list", g_target))
  {
    target_list();
    return 0;
  }

  target = target_get_ops(g_target);

  if (g_serial)
  {
    for (int i = 0; i < n_debuggers; i++)
    {
      if (0 == strcmp(debuggers[i].serial, g_serial))
      {
        debugger = i;
        break;
      }
    }

    if (-1 == debugger)
      error_exit("unable to find a debugger with a specified serial number");
  }

  if (0 == n_debuggers)
    error_exit("no debuggers found");
  else if (1 == n_debuggers)
    debugger = 0;
  else if (n_debuggers > 1 && -1 == debugger)
    error_exit("more than one debugger found, please specify a serial number");

  dbg_open(&debuggers[debugger]);

  dap_disconnect();
  dap_get_debugger_info();
  dap_connect();
  dap_transfer_configure(0, 128, 128);
  dap_swd_configure(0);
  dap_led(0, 1);
  dap_reset_link();
  dap_swj_clock(DAP_FREQ);
  dap_target_prepare();

  target->ops->select();

  if (g_erase)
    target->ops->erase();

  if (g_program)
    target->ops->program(g_file);

  if (g_verify)
    target->ops->verify(g_file);

  if (g_lock)
    target->ops->lock();

  if (g_read)
    target->ops->read(g_file);

  target->ops->deselect();

  dap_disconnect();
  dap_led(0, 0);

  dbg_close();

  return 0;
}