Ignore:
Timestamp:
Mar 25, 2003, 5:01:52 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ebe5abc
Parents:
c151cfc
Message:

2003-03-25 Thomas Doerfler <Thomas.Doerfler@…>

PR 367/filesystem

  • Makefile.am, include/rtems/ide_part_table.h, src/ata.c, src/ide_part_table.c: Some bugs were still present in the DOSFS implementation:
    • FAT12 did not work properly on Big-Endian machines
    • Some synchronization and error handling problems were present
    • Some legal codings for EOC were not recognized
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/ide_part_table.c

    rc151cfc rdbe06865  
    2020
    2121#include <rtems/ide_part_table.h>
    22 
     22#include <string.h>
    2323
    2424/*
     
    113113}
    114114
     115/*
     116 * is_fat_partition --
     117 *      checks if the partition type is defined for FAT
     118 *
     119 * PARAMETERS:
     120 *      type - type of partition to check
     121 *
     122 * RETURNS:
     123 *      TRUE if partition type is extended, FALSE otherwise
     124 */
     125static rtems_boolean
     126is_fat_partition(unsigned8 type)
     127{
     128  static const unsigned8 fat_part_types[] = {
     129    DOS_FAT12_PARTITION,DOS_FAT16_PARTITION,
     130    DOS_P32MB_PARTITION,
     131    FAT32_PARTITION    ,FAT32_LBA_PARTITION,
     132    FAT16_LBA_PARTITION
     133  };
     134
     135  return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types)));
     136}
     137
    115138
    116139/*
     
    158181    part_desc->size = LE_TO_CPU_U32(temp);
    159182
    160     if ((part_desc->sys_type == EMPTY_PARTITION) ||
    161         ((part_desc->size == 0) && (!is_extended(part_desc->sys_type))))
    162     {
    163         /* empty partition */
    164         free(part_desc);
    165         return RTEMS_SUCCESSFUL;
    166     }
    167    
    168     *new_part_desc = part_desc;
    169 
     183    /*
     184     * use partitions that are
     185     * - extended
     186     * or
     187     * - FAT type and non-zero
     188     */
     189    if (is_extended(part_desc->sys_type) ||
     190        (is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0)) {
     191      *new_part_desc = part_desc;
     192    }
     193    else { 
     194      /* empty partition */
     195      free(part_desc);
     196    }
    170197    return RTEMS_SUCCESSFUL;
    171198}
Note: See TracChangeset for help on using the changeset viewer.