荒野的狮子
荒野的狮子
这家伙很懒,什么也没写!

注册于 2年前

回答
5
文章
0
关注者
0

发布于8月前

好的

发布于1年前

screenshot_image.png
百度是通的 http没问题 主要是https不通

发布于1年前

需要在什么地方增加内存吗?

发布于1年前

  1. static int find_valid_gpt(struct rt_mmcsd_card *card, gpt_header **gpt,
  2. gpt_entry **ptes)
  3. {
  4. int good_pgpt = 0, good_agpt = 0, good_pmbr = 0;
  5. gpt_header *pgpt = RT_NULL, *agpt = RT_NULL;
  6. gpt_entry *pptes = RT_NULL, *aptes = RT_NULL;
  7. legacy_mbr *legacymbr;
  8. size_t total_sectors = last_lba(card) + 1;
  9. size_t lastlba;
  10. int status = 0;
  11. if (!ptes)
  12. {
  13. return 0;
  14. }
  15. lastlba = last_lba(card);
  16. if (!force_gpt)
  17. {
  18. /* This will be added to the EFI Spec. per Intel after v1.02. */
  19. legacymbr = rt_malloc(512);
  20. if (!legacymbr)
  21. {
  22. goto fail;
  23. }
  24. status = read_lba(card, 0, (uint8_t *)legacymbr, 1);
  25. if (status)
  26. {
  27. LOG_I("status:%d", status);
  28. goto fail;
  29. }
  30. good_pmbr = is_pmbr_valid(legacymbr, total_sectors);
  31. rt_free(legacymbr);
  32. if (!good_pmbr)
  33. {
  34. goto fail;
  35. }
  36. rt_kprintf("Device has a %s MBR\n",
  37. good_pmbr == GPT_MBR_PROTECTIVE ?
  38. "protective" : "hybrid");
  39. }
  40. good_pgpt = is_gpt_valid(card, GPT_PRIMARY_PARTITION_TABLE_LBA,
  41. &pgpt, &pptes);
  42. if (good_pgpt)
  43. {
  44. good_agpt = is_gpt_valid(card, (pgpt->alternate_lba), &agpt, &aptes);
  45. if (!good_agpt && force_gpt)
  46. {
  47. good_agpt = is_gpt_valid(card, lastlba, &agpt, &aptes);
  48. }
  49. /* The obviously unsuccessful case */
  50. if (!good_pgpt && !good_agpt)
  51. {
  52. goto fail;
  53. }
  54. compare_gpts(pgpt, agpt, lastlba);
  55. /* The good cases */
  56. if (good_pgpt)
  57. {
  58. *gpt = pgpt;
  59. *ptes = pptes;
  60. rt_free(agpt);
  61. rt_free(aptes);
  62. if (!good_agpt)
  63. {
  64. LOG_D("Alternate GPT is invalid, using primary GPT.");
  65. }
  66. return 1;
  67. }
  68. else if (good_agpt)
  69. {
  70. *gpt = agpt;
  71. *ptes = aptes;
  72. rt_free(pgpt);
  73. rt_free(pptes);
  74. LOG_D("Primary GPT is invalid, using alternate GPT.");
  75. return 1;
  76. }
  77. }
  78. fail:
  79. rt_free(pgpt);
  80. rt_free(agpt);
  81. rt_free(pptes);
  82. rt_free(aptes);
  83. *gpt = RT_NULL;
  84. *ptes = RT_NULL;
  85. return 0;
  86. }

在gpt.c下面

发布于1年前

rt_err_t set_date(rt_uint32_t year, rt_uint32_t month, rt_uint32_t day);
rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second);

int rt_soft_rtc_init(void);
int rt_rtc_ntp_sync_init(void);

就定义了这些东西

回到
顶部

发布
问题

投诉
建议