This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fatfs and io disk misc patches


Andrew Lunn wrote:

Index: devs/disk/synth/current/src/synthdisk.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/disk/synth/current/src/synthdisk.c,v
retrieving revision 1.1
diff -u -5 -r1.1 synthdisk.c
--- devs/disk/synth/current/src/synthdisk.c 19 Jan 2004 14:35:01 -0000 1.1
+++ devs/disk/synth/current/src/synthdisk.c 1 Jul 2004 10:47:38 -0000
@@ -121,14 +121,15 @@
sectors_num: _spt_, \
size: CYGNUM_IO_DISK_ECOSYNTH_DISK##_number_##_SIZE, \
filefd: -1, \
filename: CYGDAT_IO_DISK_ECOSYNTH_DISK##_number_##_FILENAME \
}; \
-static DISK_CHANNEL(synth_disk_channel##_number_, \
- synth_disk_funs, \
- synth_disk_info##_number_, \
- _mbr_supp_ \
+DISK_CHANNEL(synth_disk_channel##_number_, \
+ synth_disk_funs, \
+ synth_disk_info##_number_, \
+ _mbr_supp_, \
+ 4 \
); \
BLOCK_DEVTAB_ENTRY(synth_disk_io##_number_, \
CYGDAT_IO_DISK_ECOSYNTH_DISK##_number_##_NAME, \
0, \
&cyg_io_disk_devio, \



The same needs applying to packages/dev/disk/v85x. Could you provide a
patch please?


Here it is.
Index: devs/disk/v85x/edb_v850/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/disk/v85x/edb_v850/current/ChangeLog,v
retrieving revision 1.1
diff -u -5 -r1.1 ChangeLog
--- devs/disk/v85x/edb_v850/current/ChangeLog	19 Jan 2004 14:35:01 -0000	1.1
+++ devs/disk/v85x/edb_v850/current/ChangeLog	2 Jul 2004 08:31:35 -0000
@@ -1,5 +1,11 @@
+2004-07-02  Savin Zlobec  <savin@elatec.si> 
+
+        * src/v85x_edb_v850_disk.c:
+        Updated to work with the new DISK_CHANNEL macro definition
+        and fixed read and write calls to honor the len parameter.
+
 2004-01-15  Nick Garnett  <nickg@calivar.com>
 
 	* src/v85x_edb_v850_disk.c: Removed block_pos arguments from read
 	and write calls: it is not necessary.
 
Index: devs/disk/v85x/edb_v850/current/src/v85x_edb_v850_disk.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/disk/v85x/edb_v850/current/src/v85x_edb_v850_disk.c,v
retrieving revision 1.1
diff -u -5 -r1.1 v85x_edb_v850_disk.c
--- devs/disk/v85x/edb_v850/current/src/v85x_edb_v850_disk.c	19 Jan 2004 14:35:02 -0000	1.1
+++ devs/disk/v85x/edb_v850/current/src/v85x_edb_v850_disk.c	2 Jul 2004 08:31:37 -0000
@@ -147,14 +147,15 @@
 
 #define CF_DISK_INSTANCE(_number_,_base_,_mbr_supp_,_name_)           \
 static cf_disk_info_t cf_disk_info##_number_ = {                      \
     base: (volatile cyg_uint16 *)_base_,                              \
 };                                                                    \
-static DISK_CHANNEL(cf_disk_channel##_number_,                        \
-                    cf_disk_funs,                                     \
-                    cf_disk_info##_number_,                           \
-                    _mbr_supp_                                        \
+DISK_CHANNEL(cf_disk_channel##_number_,                               \
+             cf_disk_funs,                                            \
+             cf_disk_info##_number_,                                  \
+             _mbr_supp_,                                              \
+             4                                                        \
 );                                                                    \
 BLOCK_DEVTAB_ENTRY(cf_disk_io##_number_,                              \
                    _name_,                                            \
                    0,                                                 \
                    &cyg_io_disk_devio,                                \
@@ -237,11 +238,11 @@
 
     for (i = 0; i < 512; i += 2)
     {
         cyg_uint16 data;
         HAL_READ_UINT16(base + 4, data);
-        *bufp++ = data;
+        if (i < len) *bufp++ = data;
     }
 
     CF_HW_BUSY_WAIT();
 }
 
@@ -257,11 +258,12 @@
 
     for (i = 0; i < 512; i += 2)
     {
         cyg_uint16 data;
 
-        data = *bufp++;
+        if (i < len) data = *bufp++;
+        else         data = 0x0000;
 
         HAL_WRITE_UINT16(base + 4, data);
     }
     
     CF_HW_BUSY_WAIT();
@@ -305,11 +307,11 @@
     if (!exe_cmd(info->base, CF_ATA_IDENTIFY_DRIVE_CMD, 0, 0, 0))
     {
         D(("CF(%p) error (%x)\n", info->base, get_error(info->base)));
         return false; 
     }
-    read_data(info->base, id_buf, sizeof(cf_ata_identify_data_t), 0);
+    read_data(info->base, id_buf, sizeof(cf_ata_identify_data_t));
    
     ata_id = (cf_ata_identify_data_t *)id_buf;
 
     D(("CF(%p) general conf = %x\n", info->base, ata_id->general_conf));
             

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]