Ignore:
File:
1 edited

Legend:

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

    rdc76f4a rc3cbbb2  
    3434 */
    3535
    36 #ifndef LIBGPT_LIBGPT_H_
    37 #define LIBGPT_LIBGPT_H_
     36#ifndef __GPT_H__
     37#define __GPT_H__
    3838
    3939#define LIBGPT_NAME     "libgpt"
     
    4141#include <loc.h>
    4242#include <sys/types.h>
    43 
    44 #include "gpt.h"
    4543
    4644/** Block address of GPT header. */
     
    6159extern const uint8_t efi_signature[8];
    6260
     61typedef 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 */
     72typedef 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
    6389typedef struct {
    6490        /** Raw header. Has more bytes alloced than sizeof(gpt_header_t)!
     
    6793} gpt_t;
    6894
     95/** GPT partition entry */
     96typedef 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;
    69116typedef gpt_entry_t gpt_part_t;
     117
    70118
    71119typedef struct gpt_parts {
     
    120168
    121169extern void            gpt_set_random_uuid(uint8_t *);
    122 extern uint64_t        gpt_get_next_aligned(uint64_t, unsigned int);
    123170
    124171
Note: See TracChangeset for help on using the changeset viewer.