Changeset dc76f4a in mainline for uspace/lib/gpt/libgpt.h


Ignore:
Timestamp:
2013-07-29T00:48:51Z (11 years ago)
Author:
Dominik Taborsky (AT DOT) <brembyseznamcz>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
675de6d
Parents:
c3cbbb2
Message:

libmbr, libgpt polishing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gpt/libgpt.h

    rc3cbbb2 rdc76f4a  
    3434 */
    3535
    36 #ifndef __GPT_H__
    37 #define __GPT_H__
     36#ifndef LIBGPT_LIBGPT_H_
     37#define LIBGPT_LIBGPT_H_
    3838
    3939#define LIBGPT_NAME     "libgpt"
     
    4141#include <loc.h>
    4242#include <sys/types.h>
     43
     44#include "gpt.h"
    4345
    4446/** Block address of GPT header. */
     
    5961extern const uint8_t efi_signature[8];
    6062
    61 typedef enum {
    62         AT_REQ_PART = 0,
    63         AT_NO_BLOCK_IO,
    64         AT_LEGACY_BOOT,
    65         AT_UNDEFINED,
    66         AT_SPECIFIC = 48
    67 } GPT_ATTR;
    68 
    69 /** GPT header
    70  * - all in little endian.
    71  */
    72 typedef struct {
    73         uint8_t  efi_signature[8];
    74         uint32_t revision;
    75         uint32_t header_size;
    76         uint32_t header_crc32;
    77         uint32_t reserved;
    78         uint64_t my_lba;
    79         uint64_t alternate_lba;
    80         uint64_t first_usable_lba;
    81         uint64_t last_usable_lba;
    82         uint8_t  disk_guid[16];
    83         uint64_t entry_lba;
    84         uint32_t fillries;
    85         uint32_t entry_size;
    86         uint32_t pe_array_crc32;
    87 } __attribute__((packed)) gpt_header_t;
    88 
    8963typedef struct {
    9064        /** Raw header. Has more bytes alloced than sizeof(gpt_header_t)!
     
    9367} gpt_t;
    9468
    95 /** GPT partition entry */
    96 typedef struct {
    97         uint8_t part_type[16];
    98         uint8_t part_id[16];
    99         uint64_t start_lba;
    100         uint64_t end_lba;
    101         uint64_t attributes;
    102         uint8_t part_name[72];
    103 } __attribute__((packed)) gpt_entry_t;
    104 
    105 
    106 //typedef struct g_part {
    107         ///** Partition entry is in use **/
    108         //bool present;
    109         ///** Address of first block */
    110         //aoff64_t start_addr;
    111         ///** Number of blocks */
    112         //aoff64_t length;
    113         ///** Raw data access */
    114         //gpt_entry_t raw_data; //TODO: a pointer or just a member?
    115 //}gpt_part_t;
    11669typedef gpt_entry_t gpt_part_t;
    117 
    11870
    11971typedef struct gpt_parts {
     
    168120
    169121extern void            gpt_set_random_uuid(uint8_t *);
     122extern uint64_t        gpt_get_next_aligned(uint64_t, unsigned int);
    170123
    171124
Note: See TracChangeset for help on using the changeset viewer.