SWAP32
#define SWAP64(x) (SWAP32((x) >> 32) & 0xffffffff | SWAP32(x) << 32)
otp->tag_loc = SWAP32(itp->tag_loc);
tloc = SWAP32(tp->tag_loc);
p->ext_len = SWAP32(p->ext_len);
p->ext_loc = SWAP32(p->ext_loc);
p->itag_prnde = SWAP32(p->itag_prnde);
p->itag_lb_loc = SWAP32(p->itag_lb_loc);
p->sad_ext_len = SWAP32(p->sad_ext_len);
p->sad_ext_loc = SWAP32(p->sad_ext_loc);
p->lad_ext_len = SWAP32(p->lad_ext_len);
p->lad_ext_loc = SWAP32(p->lad_ext_loc);
p->pvd_vdsn = SWAP32(p->pvd_vdsn);
p->pvd_pvdn = SWAP32(p->pvd_pvdn);
p->pvd_csl = SWAP32(p->pvd_csl);
p->pvd_mcsl = SWAP32(p->pvd_mcsl);
p->pvd_pvdsl = SWAP32(p->pvd_pvdsl);
p->iuvd_vdsn = SWAP32(p->iuvd_vdsn);
p->vdp_vdsn = SWAP32(p->vdp_vdsn);
p->pd_vdsn = SWAP32(p->pd_vdsn);
p->pd_acc_type = SWAP32(p->pd_acc_type);
p->pd_part_start = SWAP32(p->pd_part_start);
p->pd_part_length = SWAP32(p->pd_part_length);
p->lvd_vdsn = SWAP32(p->lvd_vdsn);
p->lvd_log_bsize = SWAP32(p->lvd_log_bsize);
p->lvd_mtbl_len = SWAP32(p->lvd_mtbl_len);
p->lvd_num_pmaps = SWAP32(p->lvd_num_pmaps);
p->ua_vdsn = SWAP32(p->ua_vdsn);
p->ua_nad = SWAP32(p->ua_nad);
p->lvid_int_type = SWAP32(p->lvid_int_type);
p->lvid_npart = SWAP32(p->lvid_npart);
p->lvid_liu = SWAP32(p->lvid_liu);
p->lvid_fst[0] = SWAP32(p->lvid_fst[0]);
p->lvid_fst[1] = SWAP32(p->lvid_fst[1]);
lvup->lvidiu_nfiles = SWAP32(lvup->lvidiu_nfiles);
lvup->lvidiu_ndirs = SWAP32(lvup->lvidiu_ndirs);
p->fsd_cs_list = SWAP32(p->fsd_cs_list);
p->fsd_mcs_list = SWAP32(p->fsd_mcs_list);
p->fsd_fs_no = SWAP32(p->fsd_fs_no);
p->fsd_fsd_no = SWAP32(p->fsd_fsd_no);
p->aed_rev_ael = SWAP32(p->aed_rev_ael);
p->aed_len_aed = SWAP32(p->aed_len_aed);
p->sbd_nbits = SWAP32(p->sbd_nbits);
p->sbd_nbytes = SWAP32(p->sbd_nbytes);
p->fe_len_adesc = SWAP32(p->fe_len_adesc);
p->fe_len_ear = SWAP32(p->fe_len_ear);
p->fe_uid = SWAP32(p->fe_uid);
p->fe_gid = SWAP32(p->fe_gid);
p->fe_perms = SWAP32(p->fe_perms);
p->fe_rec_len = SWAP32(p->fe_rec_len);
p->fe_ckpoint = SWAP32(p->fe_ckpoint);
p->fe_len_adesc = SWAP32(p->fe_len_adesc);
p->fe_len_ear = SWAP32(p->fe_len_ear);
#define SWAP64(x) (SWAP32((x) >> 32) & 0xffffffff | SWAP32(x) << 32)
SWAP32(p); /* lsn.file */
SWAP32(p); /* lsn.offset */
SWAP32(p); /* pgno */
SWAP32(p); /* magic */
SWAP32(p); /* version */
SWAP32(p); /* pagesize */
SWAP32(p); /* maxkey */
SWAP32(p); /* minkey */
SWAP32(p); /* free */
SWAP32(p); /* flags */
SWAP32(p); /* pgno */
SWAP32(p); /* pgno */
SWAP32(p); /* tlen */
SWAP32(p); /* magic */
SWAP32(p); /* version */
SWAP32(p); /* pagesize */
SWAP32(p); /* ovfl_point */
SWAP32(p); /* last_freed */
SWAP32(p); /* max_bucket */
SWAP32(p); /* high_mask */
SWAP32(p); /* low_mask */
SWAP32(p); /* ffactor */
SWAP32(p); /* nelem */
SWAP32(p); /* h_charkey */
SWAP32(p); /* flags */
SWAP32(p); /* spares */
SWAP32(p); /* lsn part 1 */
SWAP32(p); /* lsn part 2 */
SWAP32(p); /* pgno */
dest [i] = SWAP32(src[i]);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32)
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32)
hdr.num_attrs = SWAP32(num_attrs);
for (i = 0; i < SWAP32(hdr->num_attrs); i++) {
(((uint64_t)SWAP32((uint32_t)((value) & 0xffffffff)) \
(uint64_t)SWAP32((uint32_t)((value) >> 32)))
*version = SWAP32(buf);
*version = SWAP32(tmp);
version = SWAP32(version);
version = SWAP32(version);
version = SWAP32(version);
version = SWAP32(version);
obj->obj_version = SWAP32(obj->obj_version);
version = SWAP32(version);
version = SWAP32(version);
counter = SWAP32(counter);
version = SWAP32(1);
counter = SWAP32(counter);
version = SWAP32(version);
version = SWAP32(version);
buf = SWAP32(0);
buf = SWAP32(1);
version = SWAP32(version);
version = SWAP32(version);
SWAP32(flash_dir->entry[i].offset);
SWAP32(flash_dir->entry[i].pad_size);
SWAP32(flash_dir->entry[i].image_size);
SWAP32(flash_dir->entry[i].checksum);
SWAP32(flash_dir->entry[i].entry_point);
SWAP32(flash_dir->entry[i].resv0);
SWAP32(flash_dir->entry[i].resv1);
SWAP32(ufi_hdr->ufi_version);
SWAP32(ufi_hdr->file_length);
SWAP32(ufi_hdr->checksum);
SWAP32(ufi_hdr->antidote);
SWAP32(ufi_hdr->image_cnt);
image_hdr->id = SWAP32(image_hdr->id);
image_hdr->offset = SWAP32(image_hdr->offset);
image_hdr->length = SWAP32(image_hdr->length);
image_hdr->checksum = SWAP32(image_hdr->checksum);
SWAP32(flash_dir->header.format_rev);
SWAP32(flash_dir->header.checksum);
SWAP32(flash_dir->header.antidote);
SWAP32(flash_dir->header.entry_count);
flash_dir->header.resv0 = SWAP32(flash_dir->header.resv0);
flash_dir->header.resv1 = SWAP32(flash_dir->header.resv1);
flash_dir->header.resv2 = SWAP32(flash_dir->header.resv2);
flash_dir->header.resv3 = SWAP32(flash_dir->header.resv3);
SWAP32(flash_dir->header.controller[i].vendor_id);
SWAP32(flash_dir->header.controller[i].device_id);
SWAP32(flash_dir->header.controller[i].sub_vendor_id);
SWAP32(flash_dir->header.controller[i].sub_device_id);
SWAP32(flash_dir->entry[i].type);
SWAP32(flash_dir->entry[i].offset);
SWAP32(flash_dir->entry[i].block_size);
SWAP32(flash_dir->entry[i].image_size);
SWAP32(flash_dir->entry[i].checksum);
SWAP32(flash_dir->entry[i].entry_point);
SWAP32(flash_dir->entry[i].resv0);
SWAP32(flash_dir->entry[i].resv1);
*bptr1 = SWAP32(*bptr2);
SWAP32(ufi_hdr->checksum);
SWAP32(ufi_hdr->antidote);
SWAP32(ufi_hdr->controller.vendor_id);
SWAP32(ufi_hdr->controller.device_id);
SWAP32(ufi_hdr->controller.sub_vendor_id);
SWAP32(ufi_hdr->controller.sub_device_id);
SWAP32(ufi_hdr->file_length);
SWAP32(ufi_hdr->chunk_num);
SWAP32(ufi_hdr->chunk_cnt);
SWAP32(ufi_hdr->image_cnt);
SWAP32(flash_dir->header.format_rev);
SWAP32(flash_dir->header.checksum);
SWAP32(flash_dir->header.antidote);
SWAP32(flash_dir->header.build_num);
SWAP32(flash_dir->header.active_entry_mask);
SWAP32(flash_dir->header.valid_entry_mask);
SWAP32(flash_dir->header.orig_content_mask);
flash_dir->header.resv0 = SWAP32(flash_dir->header.resv0);
flash_dir->header.resv1 = SWAP32(flash_dir->header.resv1);
flash_dir->header.resv2 = SWAP32(flash_dir->header.resv2);
flash_dir->header.resv3 = SWAP32(flash_dir->header.resv3);
flash_dir->header.resv4 = SWAP32(flash_dir->header.resv4);
SWAP32(flash_dir->header.controller[i].vendor_id);
SWAP32(flash_dir->header.controller[i].device_id);
SWAP32(flash_dir->header.controller[i].sub_vendor_id);
SWAP32(flash_dir->header.controller[i].sub_device_id);
SWAP32(flash_dir->entry[i].type);
*iptr = SWAP32(i);
*wptr++ = SWAP32(word);
*dptr++ = SWAP32(word);
#define LE_SWAP32(_x) SWAP32(_x)
#define BE_SWAP32(_x) SWAP32(_x)