Lines Matching defs:slot
49 HILOG_INFO(LOG_CORE, "current slot is %{public}d, numOfSlots is %{public}d", currentSlot, numOfSlots);
53 int32_t PartitionSlotManager::GetSlotSuffix(int32_t slot, std::string& suffix)
56 if (slot == UPDATE_PARTITION_B) {
65 int32_t PartitionSlotManager::SetActiveSlot(int32_t slot)
67 HILOG_DEBUG(LOG_CORE, "%{public}s called!, slot is %{public}d", __func__, slot);
68 return WriteSlotToMisc(slot, MISC_PARTITION_ACTIVE_SLOT_OFFSET, MISC_PARTITION_ACTIVE_SLOT_SIZE);
71 int32_t PartitionSlotManager::SetSlotUnbootable(int32_t slot)
73 HILOG_DEBUG(LOG_CORE, "%{public}s called!, slot is %{public}d", __func__, slot);
74 return WriteSlotToMisc(slot, MISC_PARTITION_UNBOOT_SLOT_OFFSET, MISC_PARTITION_UNBOOT_SLOT_SIZE);
77 int32_t PartitionSlotManager::WriteSlot(int fd, int32_t slot, off_t offset, off_t size)
80 HILOG_ERROR(LOG_CORE, "Failed lseek slot %{public}d errno %{public}d", slot, errno);
84 if (write(fd, &slot, size) != size) {
85 HILOG_ERROR(LOG_CORE, "Write slot failed ");
102 int32_t slot = 0;
103 if (read(fd, &slot, size) != size) {
108 HILOG_INFO(LOG_CORE, "Read slot %{public}d", slot);
110 return slot;
113 int PartitionSlotManager::WriteSlotToMisc(int32_t slot, off_t offset, off_t size)
115 if (slot < 0) {
116 HILOG_ERROR(LOG_CORE, "Invalid slot : %{public}d", slot);
125 if (WriteSlot(fd, slot, offset, size) < 0) {
126 HILOG_ERROR(LOG_CORE, "Failed to WriteSlot miscDevice %{public}d errno %{public}d ", slot, errno);