blob: 3a3f205a05a7f9bf675c82d51da5d403ab610c9f [file] [log] [blame]
From Aaditya.Kumar@ap.sony.com Fri Nov 23 03:46:32 2012
From: Aaditya Kumar <aaditya.kumar@ap.sony.com>
Date: Fri, 23 Nov 2012 17:10:49 +0530
Subject: [PATCH v2 RESEND 10/15] AXFS: axfs_uml.c
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "ltsi-dev@lists.linuxfoundation.org" <ltsi-dev@lists.linuxfoundation.org>, tim.bird@am.sony.com, frank.rowand@am.sony.com, takuzo.ohara@ap.sony.com, amit.agarwal@ap.sony.com, kan.iibuchi@jp.sony.com, aaditya.kumar.30@gmail.com
Message-ID: <50AF60C1.5050301@ap.sony.com>
From: Jared Hulbert <jaredeh@gmail.com>
Allows axfs in a UML kernel to use find_iomem() interface for the XIP device
or dummy functions if this is not a UML build.
Signed-off-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: Aaditya Kumar <aaditya.kumar@ap.sony.com>
---
fs/axfs/axfs_uml.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 fs/axfs/axfs_uml.c
--- /dev/null
+++ b/fs/axfs/axfs_uml.c
@@ -0,0 +1,47 @@
+/*
+ * Advanced XIP File System for Linux - AXFS
+ * Readonly, compressed, and XIP filesystem for Linux systems big and small
+ *
+ * Copyright(c) 2008 Numonyx
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * Authors:
+ * Jared Hulbert <jaredeh@gmail.com>
+ *
+ * Project url: http://axfs.sourceforge.net
+ *
+ * axfs_uml.c -
+ * Allows axfs to a UML kernels find_iomem() interface as an XIP device or
+ * dummy functions if this is not a UML build.
+ */
+#include "axfs.h"
+
+#ifdef CONFIG_UML
+#include <mem_user.h>
+int axfs_get_uml_address(char *iomem, unsigned long *address,
+ unsigned long *length)
+{
+ *address = find_iomem(iomem, length);
+ if (!(*address)) {
+ printk(KERN_DEBUG "axfs: find_iomem() failed\n");
+ return -EINVAL;
+ }
+
+ if (*length < PAGE_SIZE) {
+ printk(KERN_DEBUG
+ "axfs: iomem() too small, must be at least %li Bytes\n",
+ PAGE_SIZE);
+ return -EINVAL;
+ }
+ return 0;
+}
+#else
+int axfs_get_uml_address(char *iomem, unsigned long *address,
+ unsigned long *length)
+{
+ return 0;
+}
+#endif /* CONFIG_UML */