Makefile uses symlinks to files outside yaffs2/rtems aso that rtems can be built without
modifying the directory structure and deleting files.
Various tweaks needed to support changes in function prototypes.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
+++ /dev/null
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_MAKEFILE_PATH)/make/target.cfg
-
-INSTALL_BASE = $(RTEMS_MAKEFILE_PATH)/lib
-
-BUILDDIR = build-$(RTEMS_BSP)
-
-CPPFLAGS += -I. -Idirect -Idirect/rtems
-
-DEPFLAGS = -MT $@ -MD -MP -MF $(basename $@).d
-
-GCCFLAGS = -g -I . -B $(INSTALL_BASE) -specs bsp_specs -qrtems
-
-CFLAGS += $(DEPFLAGS) $(GCCFLAGS)
-
-INCLUDES = rtems/rtems_yaffs.h \
- direct/yportenv.h \
- direct/ydirectenv.h \
- direct/yaffs_osglue.h \
- direct/yaffs_hweight.h \
- direct/yaffscfg.h \
- direct/yaffs_list.h \
- direct/yaffsfs.h \
- yaffs_guts.h \
- yaffs_packedtags2.h \
- yaffs_ecc.h
-
-LIB = $(BUILDDIR)/libyaffs2.a
-LIB_PIECES = yaffs_ecc \
- yaffs_guts \
- yaffs_packedtags1 \
- yaffs_tagscompat \
- yaffs_packedtags2 \
- yaffs_nand \
- yaffs_checkptrw \
- direct/yaffs_qsort \
- yaffs_nameval \
- yaffs_attribs \
- yaffs_allocator \
- yaffs_bitmap \
- yaffs_yaffs1 \
- yaffs_yaffs2 \
- yaffs_verify \
- yaffs_summary \
- direct/yaffs_hweight \
- rtems/rtems_yaffs \
- rtems/rtems_yaffs_os_context \
- rtems/rtems_yaffs_os_glue
-LIB_OBJS = $(LIB_PIECES:%=$(BUILDDIR)/%.o)
-LIB_DEPS = $(LIB_PIECES:%=$(BUILDDIR)/%.d)
-
-all: $(BUILDDIR) $(LIB)
-
-$(BUILDDIR):
- mkdir $(BUILDDIR)
- mkdir $(BUILDDIR)/direct
- mkdir $(BUILDDIR)/rtems
-
-$(LIB): $(LIB_OBJS)
- $(AR) rcu $@ $^
- $(RANLIB) $@
-
-$(BUILDDIR)/%.o: %.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
-
-clean:
- rm -rf $(BUILDDIR)
-
-install: all
- mkdir -p $(INSTALL_BASE)/include/yaffs
- install -m 644 $(LIB) $(INSTALL_BASE)
- install -m 644 $(INCLUDES) $(INSTALL_BASE)/include/yaffs
-
-.PHONY: clean install
-
--include $(LIB_DEPS)
vecswap(pb, pn - r, r);
r = pb - pa;
if (r > es)
- yaffs_qsort(a, r / es, es, cmp);
+ qsort(a, r / es, es, cmp);
r = pd - pc;
if (r > es) {
/* Iterate rather than recurse to save stack space */
n = r / es;
goto loop;
}
-/* yaffs_qsort(pn - r, r / es, es, cmp);*/
+/* qsort(pn - r, r / es, es, cmp);*/
}
#define __YPORTENV_H__
+#ifdef __rtems__
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <errno.h>
+
+#define CONFIG_YAFFS_DIRECT 1
+#define CONFIG_YAFFS_SHORT_NAMES_IN_RAM 1
+#define CONFIG_YAFFS_YAFFS2 1
+#define CONFIG_YAFFS_PROVIDE_DEFS 1
+#define CONFIG_YAFFSFS_PROVIDE_VALUES 1
+#define CONFIG_YAFFS_DEFINES_TYPES 1
+#define NO_Y_INLINE 1
+#define loff_t off_t
+
+#endif /* __rtems__ */
+
/* Definition of types */
#ifdef CONFIG_YAFFS_DEFINES_TYPES
typedef unsigned char u8;
typedef signed int s32;
#endif
-
#ifdef CONFIG_YAFFS_PROVIDE_DEFS
/* File types */
--- /dev/null
+#
+# This file was originally written to work from the yaffs2 base directory
+# which required deleting some of the Linux files.
+#
+# This is now modified to run from the yaffs2/rtems directory and copies in
+# all files as symbolic links.
+#
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_MAKEFILE_PATH)/make/target.cfg
+
+INSTALL_BASE = $(RTEMS_MAKEFILE_PATH)/lib
+
+BUILDDIR = build-$(RTEMS_BSP)
+
+CPPFLAGS += -I.
+
+DEPFLAGS = -MT $@ -MD -MP -MF $(basename $@).d
+
+GCCFLAGS = -g -I . -B $(INSTALL_BASE) -specs bsp_specs -qrtems
+
+CFLAGS += $(DEPFLAGS) $(GCCFLAGS)
+
+# Files to be made into local symlinks
+YCORE_SYMLINKS = \
+ yaffs_ecc.c \
+ yaffs_guts.c \
+ yaffs_packedtags1.c \
+ yaffs_tagscompat.c \
+ yaffs_packedtags2.c \
+ yaffs_nand.c \
+ yaffs_checkptrw.c \
+ yaffs_nameval.c \
+ yaffs_allocator.c \
+ yaffs_bitmap.c \
+ yaffs_yaffs1.c \
+ yaffs_yaffs2.c \
+ yaffs_verify.c \
+ yaffs_summary.c \
+ yaffs_ecc.h \
+ yaffs_guts.h \
+ yaffs_packedtags1.h \
+ yaffs_tagscompat.h \
+ yaffs_packedtags2.h \
+ yaffs_nand.h \
+ yaffs_checkptrw.h \
+ yaffs_nameval.h \
+ yaffs_attribs.h \
+ yaffs_allocator.h \
+ yaffs_bitmap.h \
+ yaffs_yaffs1.h \
+ yaffs_yaffs2.h \
+ yaffs_verify.h \
+ yaffs_summary.h \
+ yaffs_trace.h \
+ yaffs_endian.h \
+ yaffs_getblockinfo.h \
+ yaffs_tagsmarshall.h
+
+
+DIRECT_SYMLINKS = \
+ yaffs_attribs.c \
+ yaffs_hweight.c \
+ yaffs_hweight.h \
+ yportenv.h \
+ ydirectenv.h \
+ yaffscfg.h \
+ yaffs_osglue.h \
+ yaffs_list.h \
+ yaffsfs.h
+
+DIRECT_QSORT_SYMLINKS = \
+ qsort.c
+
+ALL_SYMLINKS = $(YCORE_SYMLINKS) $(DIRECT_SYMLINKS) $(DIRECT_QSORT_SYMLINKS)
+
+
+INCLUDES = rtems_yaffs.h \
+ yportenv.h \
+ ydirectenv.h \
+ yaffs_osglue.h \
+ yaffs_hweight.h \
+ yaffscfg.h \
+ yaffs_list.h \
+ yaffsfs.h \
+ yaffs_guts.h \
+ yaffs_packedtags2.h \
+ yaffs_ecc.h
+
+LIB = $(BUILDDIR)/libyaffs2.a
+LIB_PIECES = yaffs_ecc \
+ yaffs_guts \
+ yaffs_packedtags1 \
+ yaffs_tagscompat \
+ yaffs_packedtags2 \
+ yaffs_nand \
+ yaffs_checkptrw \
+ qsort \
+ yaffs_nameval \
+ yaffs_attribs \
+ yaffs_allocator \
+ yaffs_bitmap \
+ yaffs_yaffs1 \
+ yaffs_yaffs2 \
+ yaffs_verify \
+ yaffs_summary \
+ yaffs_hweight \
+ rtems_yaffs \
+ rtems_yaffs_os_context \
+ rtems_yaffs_os_glue
+LIB_OBJS = $(LIB_PIECES:%=$(BUILDDIR)/%.o)
+LIB_DEPS = $(LIB_PIECES:%=$(BUILDDIR)/%.d)
+
+all: $(BUILDDIR) $(ALL_SYMLINKS) $(LIB)
+
+symlinks:$(ALL_SYMLINKS)
+
+$(YCORE_SYMLINKS):
+ ln -s ../$@ $@
+
+$(DIRECT_SYMLINKS):
+ ln -s ../direct/$@ $@
+
+$(DIRECT_QSORT_SYMLINKS):
+ ln -s ../direct/optional_sort/$@ $@
+
+$(BUILDDIR):
+ mkdir $(BUILDDIR)
+
+$(LIB): $(LIB_OBJS)
+ $(AR) rcu $@ $^
+ $(RANLIB) $@
+
+$(BUILDDIR)/%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -rf $(BUILDDIR) $(ALL_SYMLINKS)
+
+install: all
+ mkdir -p $(INSTALL_BASE)/include/yaffs
+ install -m 644 $(LIB) $(INSTALL_BASE)
+ install -m 644 $(INCLUDES) $(INSTALL_BASE)/include/yaffs
+
+.PHONY: clean install
+
+-include $(LIB_DEPS)
if (obj != NULL) {
obj->yst_mode = mode;
obj->dirty = 1;
- yc = yaffs_flush_file(obj, 0, 0);
+ yc = yaffs_flush_file(obj, 0, 0,0);
} else {
yc = YAFFS_FAIL;
}
obj->yst_uid = owner;
obj->yst_gid = group;
obj->dirty = 1;
- yc = yaffs_flush_file(obj, 0, 0);
+ yc = yaffs_flush_file(obj, 0, 0, 0);
} else {
yc = YAFFS_FAIL;
}
int yc;
ylock(dev);
- yc = yaffs_flush_file(obj, 0, 1);
+ yc = yaffs_flush_file(obj, 0, 1, 0);
if (rtems_filesystem_location_is_instance_root(&iop->pathinfo)) {
- yaffs_flush_whole_cache(dev);
+ yaffs_flush_whole_cache(dev, 0);
}
yunlock(dev);
struct yaffs_dev *dev = obj->my_dev;
ylock(dev);
- yaffs_flush_file(obj, 1, 0);
+ yaffs_flush_file(obj, 1, 0, 1);
yunlock(dev);
return 0;
mt_entry->mt_fs_root->location.node_access = dev->root_dir;
mt_entry->mt_fs_root->location.handlers = &yaffs_directory_handlers;
- yaffs_flush_whole_cache(dev);
+ yaffs_flush_whole_cache(dev, 0);
yunlock(dev);
return 0;
struct yaffs_dev *dev = ryfs_get_device_by_mt_entry(mt_entry);
ylock(dev);
- yaffs_flush_whole_cache(dev);
+ yaffs_flush_whole_cache(dev, 1);
yaffs_deinitialise(dev);
yunlock(dev);
rtems_yaffs_os_unmount(dev);