Re: [Yaffs] Compiling error with yaffs direct

Top Page
Attachments:
Message as email
+ (text/plain)
+ yaffs_direct.patch (text/x-patch)
Delete this message
Reply to this message
Author: Claudio Lanconelli
Date:  
To: yaffs mail list
Subject: Re: [Yaffs] Compiling error with yaffs direct
Hi Aubrey,
try this patch in the yaffs/direct dir

Cheers,
Claudio

Li, Aubrey wrote:

>Hi yaffsers,
>
>I download today's tarball of yaffs package.
>When I enter folder direct under yaffs, I got an error if I build the
>direct branch.
>- - - -
>make: *** No rule to make target `nand_ecc.c', needed by `nand_ecc.o'.
>Stop.
>- - - -
>
>If I removed "nand_ecc.o" from the Makefile, some error messages showed
>to me:
>- - - -
>/home/aubrey/temp/Development/yaffs/direct/yboot.c:269: undefined
>reference to `nand_calculate_ecc'
>yboot.o(.text+0x4f7):/home/aubrey/temp/Development/yaffs/direct/yboot.c:
>270: undefined reference to `nand_correct_data'
>yboot.o(.text+0x50b):/home/aubrey/temp/Development/yaffs/direct/yboot.c:
>271: undefined reference to `nand_calculate_ecc'
>yboot.o(.text+0x526):/home/aubrey/temp/Development/yaffs/direct/yboot.c:
>272: undefined reference to `nand_correct_data'
>- - - -
>
>Thanks for anyone to help me out.
>-Aubrey
>
>_______________________________________________
>yaffs mailing list
>
>http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
>
>
>


Index: Makefile
===================================================================
RCS file: /home/aleph1/cvs/yaffs/direct/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile    20 May 2003 22:30:36 -0000    1.2
+++ Makefile    10 Nov 2005 10:01:03 -0000
@@ -19,7 +19,7 @@


DIRECTTESTOBJS = dtest.o yaffs_ecc.o yaffscfg.o yaffs_fileem.o yaffsfs.o yaffs_ramdisk.o yaffs_guts.o

-BOOTTESTOBJS = bootldtst.o yboot.o yaffs_fileem.o nand_ecc.o
+BOOTTESTOBJS = bootldtst.o yboot.o yaffs_fileem.o yaffs_ecc.o

ALLOBJS = dtest.o nand_ecc.o yaffscfg.o yaffs_fileem.o yaffsfs.o yaffs_ramdisk.o bootldtst.o yboot.o

@@ -42,4 +42,4 @@


 clean:
-    rm -f $(ALLOBJS) core
+    rm -f $(ALLOBJS) core $(SYMLINKS)
Index: bootldtst.c
===================================================================
RCS file: /home/aleph1/cvs/yaffs/direct/bootldtst.c,v
retrieving revision 1.1
diff -u -r1.1 bootldtst.c
--- bootldtst.c    21 Jan 2003 03:32:17 -0000    1.1
+++ bootldtst.c    10 Nov 2005 10:01:03 -0000
@@ -30,7 +30,7 @@
 }



-int main()
+int main(void)
 {
     int oId;

    
@@ -66,8 +66,6 @@
        
         printf("\n\n%d bytes read\n",nBytes);
     }
-    
-    
-    
-    
+
+    return 0;
 }
Index: dtest.c
===================================================================
RCS file: /home/aleph1/cvs/yaffs/direct/dtest.c,v
retrieving revision 1.7
diff -u -r1.7 dtest.c
--- dtest.c    31 Aug 2005 09:21:12 -0000    1.7
+++ dtest.c    10 Nov 2005 10:01:03 -0000
@@ -2,9 +2,10 @@
 * Test code for the "direct" interface. 
 */


-
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>

#include "yaffsfs.h"

@@ -292,6 +293,8 @@
    
}

+extern int yaffs_DumpDevStruct(const char *path);
+
int long_test(int argc, char *argv[])
{

@@ -618,7 +621,7 @@
     // This test reporoduces a bug whereby YAFFS caching is buypassed
     // resulting in erroneous reads after writes.
     int a;
-    int i;
+//    int i;
     char buffer1[1000];
     char buffer2[1000];

    
Index: yboot.c
===================================================================
RCS file: /home/aleph1/cvs/yaffs/direct/yboot.c,v
retrieving revision 1.2
diff -u -r1.2 yboot.c
--- yboot.c    19 Jul 2005 19:51:57 -0000    1.2
+++ yboot.c    10 Nov 2005 10:01:03 -0000
@@ -19,6 +19,7 @@
 #include <string.h>
 #include <stdio.h>
 #include "yaffs_guts.h"
+#include "yaffs_ecc.h"


const char *yboot_c_version="$Id: yboot.c,v 1.2 2005/07/19 19:51:57 charles Exp $";

@@ -30,8 +31,10 @@


 // External functions for ECC on data
-void nand_calculate_ecc (const unsigned char*dat, unsigned char*ecc_code);
-int nand_correct_data (unsigned char*dat, unsigned char*read_ecc, unsigned char*calc_ecc);
+//void nand_calculate_ecc (const unsigned char*dat, unsigned char*ecc_code);
+//int nand_correct_data (unsigned char*dat, unsigned char*read_ecc, unsigned char*calc_ecc);
+#define nand_calculate_ecc    yaffs_ECCCalculate
+#define nand_correct_data    yaffs_ECCCorrect


static const char yaffs_countBits[256] =
{