Merge branch 'time_upgrade'
authorCharles Manning <cdhmanning@gmail.com>
Wed, 7 Jul 2021 04:00:35 +0000 (16:00 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Wed, 7 Jul 2021 04:00:35 +0000 (16:00 +1200)
direct/test-framework/tests/launch_tests.sh
direct/test-framework/yaffs_osglue.c
rtems/Makefile.rtems
rtems/RTEMS_NOTES
yaffs_guts.c
yaffs_tagsmarshall.c

index b2041d3f1b62767aaa98d075b9b00503afe4bd8c..9b7c38d26820f287185a99fb3f02a6773ab2be32 100755 (executable)
@@ -11,8 +11,10 @@ LAUNCHDIR=`pwd`
 RUNDIR=`pwd`/tmp
 mkdir $RUNDIR
 
+# Check if RUNDIR is mounted, if not, mount as tmpfs
+# because we don't want to hammer the disk.
 if [ -z "$(mount | grep $RUNDIR)" ]; then
-sudo mount -t tmpfs -osize=2G none $RUNDIR
+sudo mount -t tmpfs -osize=7G none $RUNDIR
 sudo chmod a+wr $RUNDIR
 fi
 
@@ -30,3 +32,4 @@ xterm  -e "$LAUNCHDIR/manage_m18_test.sh  2 $iterations"&
 xterm  -e "$LAUNCHDIR/manage_nand_test.sh  0 $iterations"&
 xterm  -e "$LAUNCHDIR/manage_nand_test.sh  1 $iterations"&
 xterm  -e "$LAUNCHDIR/manage_nand_test.sh  2 $iterations"&
+xterm  -e "$LAUNCHDIR/manage_nand_test.sh  3 $iterations"&
index 2cc18bbdcb6bdec25eafef419df5caac894ed42a..94ca24dfd225a73bde9924f6c51a73672ed1c89b 100644 (file)
@@ -106,7 +106,13 @@ static void *bg_gc_func(void *dummy)
 
                while ((dev = yaffs_next_dev()) != NULL) {
                        result = yaffs_do_background_gc_reldev(dev, urgent);
-                       if (result > 0)
+
+                       /* result is 1 if more than half the free space is
+                        * erased.
+                        * If less than half the free space is erased then it is
+                        * worth doing another background_gc operation sooner.
+                        */
+                       if (result == 0)
                                next_urgent = 1;
                }
 
index 4803a9fb21b5319b3e071f0c5691276f5025784b..0741179a7dd2ee36524218d511da71a792cfa903 100644 (file)
@@ -24,6 +24,7 @@ CFLAGS += $(DEPFLAGS) $(GCCFLAGS)
 # Files to be made into local symlinks
 YCORE_SYMLINKS = \
        yaffs_ecc.c \
+       yaffs_cache.c \
        yaffs_endian.c \
        yaffs_guts.c \
        yaffs_packedtags1.c \
@@ -39,6 +40,7 @@ YCORE_SYMLINKS = \
        yaffs_verify.c \
        yaffs_summary.c \
        yaffs_tagsmarshall.c\
+       yaffs_cache.h \
        yaffs_ecc.h \
        yaffs_guts.h \
        yaffs_packedtags1.h \
@@ -93,6 +95,7 @@ LIB = $(BUILDDIR)/libyaffs2.a
 LIB_PIECES = yaffs_ecc \
        yaffs_endian \
        yaffs_guts \
+       yaffs_cache \
        yaffs_packedtags1 \
        yaffs_tagscompat \
        yaffs_tagsmarshall\
index 0366b0533879592ee5bedf194b881fbfe2c9762d..5e89b1394d56037b6d3965c74ecc69717fb74176 100644 (file)
@@ -28,38 +28,23 @@ $make -f Makefile.rtems install
 Building test application
 
 
-$ cd rtems-y-test/
+$ cd rtems-y-test/basic-test
+$ make
 
-
-
-Running 
-
-$  sparc-rtems5-sis hello_world_c/o-optimize/hello.exe
+$ sparc-rtems5-sis o-optimize/yaffs-rtems-test.exe 
 
  SIS - SPARC/RISCV instruction simulator 2.20,  copyright Jiri Gaisler 2019
  Bug-reports to jiri@gaisler.se
 
  ERC32 emulation enabled
 
- Loaded hello_world_c/o-optimize/hello.exe, entry 0x02000000
+ Loaded o-optimize/yaffs-rtems-test.exe, entry 0x02000000
 sis> go
 resuming at 0x02000000
-
-
-*** HELLO WORLD TEST ***
-Hello World 123
-*** END OF HELLO WORLD TEST ***
-
-*** FATAL ***
-fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT)
-fatal code: 0 (0x00000000)
-RTEMS version: 5.0.0.e22554535796fc29a7ed7c5e2338128e324a621d-modified
-RTEMS tools: 7.5.0 20191114 (RTEMS 5, RSB 5 (599c4d7c87fa), Newlib d14714c69)
-executing thread ID: 0x08a010001
-executing thread name: UI1 
-cpu 0 in error mode (tt = 0x101)
-   125619  0200c0e0:  91d02000   ta  0x0
-sis> 
+Starting
+Created simulated flash device 0x2d203c8
+yaffs: 0 blocks to be sorted...
+....
 
 
 Running with GDB
index a2b4cdf696114a2d89ab639c1ab0f35ee126221b..c05aee0c8bf8340c751c525c3944242edd0df804 100644 (file)
@@ -3017,8 +3017,10 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
 
        result = yaffs_rd_chunk_tags_nand(dev, in->hdr_chunk, buf, &tags);
 
-       if (result == YAFFS_FAIL)
+       if (result == YAFFS_FAIL) {
+               yaffs_release_temp_buffer(dev, buf);
                return;
+       }
 
        oh = (struct yaffs_obj_hdr *)buf;
 
@@ -3201,7 +3203,6 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR *name, int force,
                bi->has_shrink_hdr = 1;
        }
 
-
        return new_chunk_id;
 }
 
@@ -4826,6 +4827,7 @@ void yaffs_deinitialise(struct yaffs_dev *dev)
                kfree(dev->checkpt_block_list);
                dev->checkpt_block_list = NULL;
 
+               dev->ll_init = 0;
                dev->is_mounted = 0;
 
                yaffs_deinit_nand(dev);
index d568208e91bd53ece6b685707ecca481c693c183..397715dbc9eb00f27a79afbd3a5910352e2768bc 100644 (file)
@@ -100,8 +100,12 @@ static int yaffs_tags_marshall_read(struct yaffs_dev *dev,
                BUG();
 
 
-       if (retval == YAFFS_FAIL)
+       if (retval == YAFFS_FAIL) {
+               if (local_data)
+                       yaffs_release_temp_buffer(dev, data);
+
                return YAFFS_FAIL;
+       }
 
        if (dev->param.inband_tags) {
                if (tags) {