Changeset a8afce3 in rtems


Ignore:
Timestamp:
Feb 17, 2011, 4:25:43 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
d18d5890
Parents:
c637946
Message:

2011-02-17 Sebastian Huber <sebastian.huber@…>

  • libblock/include/rtems/bdpart.h (rtems_bdpart_format): Preserve previous API.
  • libblock/src/bdpart-create.c, libblock/src/bdpart-read.c, libblock/src/bdpart-write.c: Reflect changes above.
  • libmisc/shell/fdisk.c: Reflect changes above.
Location:
cpukit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rc637946 ra8afce3  
     12011-02-17      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * libblock/include/rtems/bdpart.h (rtems_bdpart_format):
     4        Preserve previous API.
     5        * libblock/src/bdpart-create.c, libblock/src/bdpart-read.c,
     6        libblock/src/bdpart-write.c: Reflect changes above.
     7        * libmisc/shell/fdisk.c: Reflect changes above.
     8
    192011-02-17      Sebastian Huber <sebastian.huber@embedded-brains.de>
    210
  • cpukit/libblock/include/rtems/bdpart.h

    rc637946 ra8afce3  
    164164 * Disk format description.
    165165 */
    166 typedef struct {
     166typedef union {
    167167  /**
    168168   * Format type.
    169169   */
    170170  rtems_bdpart_format_type type;
    171   union {
     171
     172  /**
     173   * MBR format fields.
     174   */
     175  struct {
     176    rtems_bdpart_format_type type;
     177
    172178    /**
    173      * MBR format fields.
     179     * Disk ID in MBR at offset 440.
    174180     */
    175     struct {
    176       /**
    177        * Disk ID in MBR at offset 440.
    178        */
    179       uint32_t disk_id;
    180 
    181       /**
    182        * This option is used for partition table creation and validation checks
    183        * before a write to the disk.  It ensures that the first primary
    184        * partition and the logical partitions start at head one and sector one
    185        * under the virtual one head and 63 sectors geometry.  Each begin and
    186        * end of a partition will be aligned to the virtual cylinder boundary.
    187        */
    188       bool dos_compatibility;
    189     } mbr;
     181    uint32_t disk_id;
    190182
    191183    /**
    192      * GPT format fields.
     184     * This option is used for partition table creation and validation checks
     185     * before a write to the disk.  It ensures that the first primary
     186     * partition and the logical partitions start at head one and sector one
     187     * under the virtual one head and 63 sectors geometry.  Each begin and
     188     * end of a partition will be aligned to the virtual cylinder boundary.
    193189     */
    194     struct {
    195       /**
    196        * Disk ID in GPT header.
    197        */
    198       uuid_t disk_id;
    199     } gpt;
    200   } u;
     190    bool dos_compatibility;
     191  } mbr;
     192
     193  /**
     194   * GPT format fields.
     195   */
     196  struct {
     197    rtems_bdpart_format_type type;
     198
     199    /**
     200     * Disk ID in GPT header.
     201     */
     202    uuid_t disk_id;
     203  } gpt;
    201204} rtems_bdpart_format;
    202205
  • cpukit/libblock/src/bdpart-create.c

    rc637946 ra8afce3  
    3838  bool dos_compatibility = format != NULL
    3939    && format->type == RTEMS_BDPART_FORMAT_MBR
    40     && format->u.mbr.dos_compatibility;
     40    && format->mbr.dos_compatibility;
    4141  rtems_blkdev_bnum disk_end = 0;
    4242  rtems_blkdev_bnum pos = 0;
  • cpukit/libblock/src/bdpart-read.c

    rc637946 ra8afce3  
    262262  /* Set format */
    263263  format->type = RTEMS_BDPART_FORMAT_MBR;
    264   format->u.mbr.disk_id = rtems_uint32_from_little_endian(
     264  format->mbr.disk_id = rtems_uint32_from_little_endian(
    265265    block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
    266266  );
    267   format->u.mbr.dos_compatibility = true;
     267  format->mbr.dos_compatibility = true;
    268268
    269269  /* Iterate through the rest of the primary partition table */
  • cpukit/libblock/src/bdpart-write.c

    rc637946 ra8afce3  
    9595  bool dos_compatibility = format != NULL
    9696    && format->type == RTEMS_BDPART_FORMAT_MBR
    97     && format->u.mbr.dos_compatibility;
     97    && format->mbr.dos_compatibility;
    9898  rtems_bdbuf_buffer *block = NULL;
    9999  rtems_blkdev_bnum disk_end = 0;
     
    220220  /* Write disk ID */
    221221  rtems_uint32_to_little_endian(
    222     format->u.mbr.disk_id,
     222    format->mbr.disk_id,
    223223    block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
    224224  );
  • cpukit/libmisc/shell/fdisk.c

    rc637946 ra8afce3  
    133133    /* Default format */
    134134    format.type = RTEMS_BDPART_FORMAT_MBR;
    135     format.u.mbr.disk_id = 0;
    136     format.u.mbr.dos_compatibility = true;
     135    format.mbr.disk_id = 0;
     136    format.mbr.dos_compatibility = true;
    137137
    138138    for (ai = 2; ai < argc; ++ai) {
     
    195195        case RTEMS_BDPART_SHELL_MBR:
    196196          if (strcmp( s, "dos") == 0) {
    197             format.u.mbr.dos_compatibility = true;
     197            format.mbr.dos_compatibility = true;
    198198          } else if (strcmp( s, "nodos") == 0) {
    199             format.u.mbr.dos_compatibility = false;
     199            format.mbr.dos_compatibility = false;
    200200          } else {
    201201            RTEMS_BDPART_SHELL_ERROR( "unexpected option: %s", argv [ai]);
Note: See TracChangeset for help on using the changeset viewer.