Changeset f57ccb5 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2015-08-11T16:03:59Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0bde8523
Parents:
1b23e33
Message:

Set partition type based on selected filesystem type.

Location:
uspace/lib/c/include
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/vbd.h

    r1b23e33 rf57ccb5  
    4646        VBD_PART_CREATE,
    4747        VBD_PART_DELETE,
     48        VBD_SUGGEST_PTYPE
    4849} vbd_request_t;
    4950
  • uspace/lib/c/include/types/label.h

    r1b23e33 rf57ccb5  
    3636#define LIBC_TYPES_LABEL_H_
    3737
     38#include <types/uuid.h>
     39
    3840/** Disk contents */
    3941typedef enum {
     
    7274        /** Label supports extended (and logical) partitions */
    7375        lf_ext_supp = 0x1,
     76        /** Partition type is in UUID format (otherwise in small number format) */
     77        lf_ptype_uuid = 0x2,
    7478        /** Currently it is possible to create a primary partition */
    75         lf_can_create_pri = 0x2,
     79        lf_can_create_pri = 0x4,
    7680        /** Currently it is possible to create an extended partition */
    77         lf_can_create_ext = 0x4,
     81        lf_can_create_ext = 0x8,
    7882        /** Currrently it is possible to create a logical partition */
    79         lf_can_create_log = 0x8
     83        lf_can_create_log = 0x10
    8084} label_flags_t;
     85
     86/** Partition type format */
     87typedef enum {
     88        /** Small number */
     89        lptf_num,
     90        /** UUID */
     91        lptf_uuid
     92} label_pt_fmt;
     93
     94/** Partition type */
     95typedef struct {
     96        /** Type format */
     97        label_pt_fmt fmt;
     98        /** Depending on @c fmt */
     99        union {
     100                /* Small number */
     101                uint8_t num;
     102                /** UUID */
     103                uuid_t uuid;
     104        } t;
     105} label_ptype_t;
     106
     107/** Partition content (used to get partition type suggestion) */
     108typedef enum {
     109        /** ExFAT */
     110        lpc_exfat,
     111        /** Ext4 */
     112        lpc_ext4,
     113        /** FAT12 or FAT16 */
     114        lpc_fat12_16,
     115        /** FAT32 */
     116        lpc_fat32,
     117        /** Minix file system */
     118        lpc_minix
     119} label_pcnt_t;
    81120
    82121#endif
  • uspace/lib/c/include/uuid.h

    r1b23e33 rf57ccb5  
    3737
    3838#include <stdint.h>
    39 
    40 enum {
    41         uuid_bytes = 16
    42 };
    43 
    44 /** Universally Unique Identifier */
    45 typedef struct {
    46         uint8_t b[uuid_bytes];
    47 } uuid_t;
     39#include <types/uuid.h>
    4840
    4941extern int uuid_generate(uuid_t *);
    5042extern void uuid_encode(uuid_t *, uint8_t *);
    5143extern void uuid_decode(uint8_t *, uuid_t *);
     44extern int uuid_parse(const char *, uuid_t *, const char **);
     45extern int uuid_format(uuid_t *, char **);
    5246
    5347#endif
  • uspace/lib/c/include/vbd.h

    r1b23e33 rf57ccb5  
    7474        label_pkind_t pkind;
    7575        /** Partition type */
    76         uint64_t ptype;
     76        label_ptype_t ptype;
    7777} vbd_part_spec_t;
    7878
     
    105105extern int vbd_part_delete(vbd_t *, vbd_part_id_t);
    106106extern void vbd_pspec_init(vbd_part_spec_t *);
     107extern int vbd_suggest_ptype(vbd_t *, service_id_t, label_pcnt_t,
     108    label_ptype_t *);
    107109
    108110#endif
Note: See TracChangeset for help on using the changeset viewer.