Commit 42d8af43992ba3bb3e6e3c9e41908b420070de72

  • avatar
  • The Android Open Source Project <initial-contribution @and…id.com>
  • Wed Feb 11 00:43:56 CET 2009
auto import from //branches/cupcake/...@130745
  
3131cfg_pentry(struct pc_partition *pentry, uint8_t status, uint8_t type,
3232 uint32_t start, uint32_t len)
3333{
34 /* zero out the c/h/s entries.. they are not used */
35 memset(&pentry->start, 0, sizeof(struct chs));
36 memset(&pentry->end, 0, sizeof(struct chs));
34 if (len > 0) {
35 /* seems that somes BIOSens can get wedged on boot while verifying
36 * the mbr if these are 0 */
37 memset(&pentry->start, 0xff, sizeof(struct chs));
38 memset(&pentry->end, 0xff, sizeof(struct chs));
39 } else {
40 /* zero out the c/h/s entries.. they are not used */
41 memset(&pentry->start, 0, sizeof(struct chs));
42 memset(&pentry->end, 0, sizeof(struct chs));
43 }
3744
3845 pentry->status = status;
3946 pentry->type = type;
  
4848#define PART_ACTIVE_FLAG 0x1
4949
5050struct chs {
51 uint8_t cylinder;
5251 uint8_t head;
5352 uint8_t sector;
54};
53 uint8_t cylinder;
54} __attribute__((__packed__));
5555
5656/* 16 byte pc partition descriptor that sits in MBR and EPBR.
5757 * Note: multi-byte entities have little-endian layout on disk */