comparison packages/io/disk/current/include/diskio.h @ 1476:f2453fae08d4

Added support for FAT filesystem. Several packages, see the individual ChangeLogs for details.
author nickg
date Mon, 19 Jan 2004 14:35:01 +0000
parents
children b1d2762b2eec
comparison
equal deleted inserted replaced
1475:c9e09b1c18cb 1476:f2453fae08d4
1 #ifndef CYGONCE_DISKIO_H
2 #define CYGONCE_DISKIO_H
3 // ====================================================================
4 //
5 // diskio.h
6 //
7 // Device I/O
8 //
9 // ====================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 2003 Savin Zlobec
14 //
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
18 //
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 // for more details.
23 //
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 //
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
34 //
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
37 //
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 // ====================================================================
41 //#####DESCRIPTIONBEGIN####
42 //
43 // Author(s): savin
44 // Date: 2003-06-09
45 // Purpose: Special support for disk I/O devices
46 // Description:
47 //
48 //####DESCRIPTIONEND####
49 //
50 // ====================================================================
51
52 // This file contains the user-level visible I/O interfaces
53
54 #include <pkgconf/hal.h>
55 #include <cyg/infra/cyg_type.h>
56 #include <cyg/io/config_keys.h>
57
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61
62 typedef struct {
63 char serial[20+1]; // serial number
64 char firmware_rev[8+1]; // firmware revision
65 char model_num[40+1]; // model number
66 cyg_uint32 cylinders_num; // number of cylinders (CHS)
67 cyg_uint32 heads_num; // number of heads (CHS)
68 cyg_uint32 sectors_num; // number of sectors per track (CHS)
69 cyg_uint32 lba_sectors_num; // total number of sectors in LBA mode
70 } cyg_disk_identify_t;
71
72 typedef struct {
73 cyg_uint8 type; // partition type
74 cyg_uint8 state; // state 0x00 - inactive, 0x80 - active
75 cyg_uint32 start; // first sector number
76 cyg_uint32 end; // last sector number
77 cyg_uint32 size; // size in sectors
78 } cyg_disk_partition_t;
79
80 typedef struct {
81 cyg_disk_identify_t ident; // identify data
82 cyg_disk_partition_t partitions[4]; // partitions
83 cyg_addrword_t devs[4]; // device instances
84 cyg_uint32 block_size; // block size
85 cyg_uint32 blocks_num; // number of blocks on disk
86 cyg_bool connected; // true if device connected
87 } cyg_disk_info_t;
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* CYGONCE_DISKIO_H */
94 /* EOF diskio.h */