From: Jared Hulbert <jaredeh@gmail.com>
To: Linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org,
linux-mtd <linux-mtd@lists.infradead.org>,
"Jörn Engel" <joern@logfs.org>,
tim.bird@AM.SONY.COM, cotte@d
Subject: [PATCH 09/10] AXFS: axfs_uml.c
Date: Wed, 20 Aug 2008 22:46:02 -0700 [thread overview]
Message-ID: <48AD011A.30505@gmail.com> (raw)
UML specific code for working with iomem 'devices'. UML is handy for testing.
Signed-off-by: Jared Hulbert <jaredeh@gmail.com>
---
diff --git a/fs/axfs/axfs_uml.c b/fs/axfs/axfs_uml.c
new file mode 100644
index 0000000..7d479a0
--- /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 <linux/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 */
reply other threads:[~2008-08-21 5:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48AD011A.30505@gmail.com \
--to=jaredeh@gmail.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=cotte@d \
--cc=joern@logfs.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=tim.bird@AM.SONY.COM \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).