1 |
786 |
skrzyp |
#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, 2004, 2006 Free Software Foundation, Inc.
|
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
|
18 |
|
|
// version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
21 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License
|
26 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use
|
30 |
|
|
// macros or inline functions from this file, or you compile this file
|
31 |
|
|
// and link it with other works to produce a work based on this file,
|
32 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
33 |
|
|
// the GNU General Public License. However the source code for this file
|
34 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
35 |
|
|
// General Public License v2.
|
36 |
|
|
//
|
37 |
|
|
// This exception does not invalidate any other reasons why a work based
|
38 |
|
|
// on this file might be covered by the GNU General Public License.
|
39 |
|
|
// -------------------------------------------
|
40 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
// ====================================================================
|
42 |
|
|
//#####DESCRIPTIONBEGIN####
|
43 |
|
|
//
|
44 |
|
|
// Author(s): savin
|
45 |
|
|
// Date: 2003-06-09
|
46 |
|
|
// Purpose: Special support for disk I/O devices
|
47 |
|
|
// Description:
|
48 |
|
|
//
|
49 |
|
|
//####DESCRIPTIONEND####
|
50 |
|
|
//
|
51 |
|
|
// ====================================================================
|
52 |
|
|
|
53 |
|
|
// This file contains the user-level visible I/O interfaces
|
54 |
|
|
|
55 |
|
|
#include <pkgconf/hal.h>
|
56 |
|
|
#include <cyg/infra/cyg_type.h>
|
57 |
|
|
#include <cyg/io/config_keys.h>
|
58 |
|
|
|
59 |
|
|
#include <cyg/io/devtab.h>
|
60 |
|
|
|
61 |
|
|
#ifdef __cplusplus
|
62 |
|
|
extern "C" {
|
63 |
|
|
#endif
|
64 |
|
|
|
65 |
|
|
struct cyg_disk_identify_t
|
66 |
|
|
{
|
67 |
|
|
char serial[20+1]; // serial number
|
68 |
|
|
char firmware_rev[8+1]; // firmware revision
|
69 |
|
|
char model_num[40+1]; // model number
|
70 |
|
|
cyg_uint32 cylinders_num; // number of cylinders (CHS)
|
71 |
|
|
cyg_uint32 heads_num; // number of heads (CHS)
|
72 |
|
|
cyg_uint32 sectors_num; // number of sectors per track (CHS)
|
73 |
|
|
cyg_uint32 lba_sectors_num; // total number of sectors in LBA mode
|
74 |
|
|
cyg_uint32 phys_block_size; // physical block size in sectors
|
75 |
|
|
cyg_uint32 max_transfer; // Maximum transfer size in bytes
|
76 |
|
|
};
|
77 |
|
|
|
78 |
|
|
struct cyg_disk_partition_t
|
79 |
|
|
{
|
80 |
|
|
cyg_uint8 type; // partition type
|
81 |
|
|
cyg_uint8 state; // state 0x00 - inactive, 0x80 - active
|
82 |
|
|
cyg_uint32 start; // first sector number
|
83 |
|
|
cyg_uint32 end; // last sector number
|
84 |
|
|
cyg_uint32 size; // size in sectors
|
85 |
|
|
};
|
86 |
|
|
|
87 |
|
|
struct cyg_disk_info_t
|
88 |
|
|
{
|
89 |
|
|
cyg_disk_partition_t *partitions; // partition table
|
90 |
|
|
int partitions_num;// partition table size
|
91 |
|
|
cyg_disk_identify_t ident; // identify data
|
92 |
|
|
cyg_uint32 block_size; // logical block size
|
93 |
|
|
cyg_uint32 blocks_num; // number of blocks on disk
|
94 |
|
|
cyg_uint32 phys_block_size; // physical block size
|
95 |
|
|
cyg_bool connected; // true if device connected
|
96 |
|
|
cyg_ucount16 mounts; // total number of mounts for all partitions
|
97 |
|
|
};
|
98 |
|
|
|
99 |
|
|
#ifdef __cplusplus
|
100 |
|
|
}
|
101 |
|
|
#endif
|
102 |
|
|
|
103 |
|
|
#endif /* CYGONCE_DISKIO_H */
|
104 |
|
|
/* EOF diskio.h */
|