From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [RFC v2 3/8] resource: add create_resource() helper function
Date: Mon, 5 Dec 2016 12:40:28 +0300 [thread overview]
Message-ID: <20161205094033.31569-4-antonynpavlov@gmail.com> (raw)
In-Reply-To: <20161205094033.31569-1-antonynpavlov@gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
common/resource.c | 15 +++++++++++++++
include/linux/ioport.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/common/resource.c b/common/resource.c
index e4bbe15..fa9ffd0 100644
--- a/common/resource.c
+++ b/common/resource.c
@@ -150,3 +150,18 @@ struct resource *request_ioport_region(const char *name,
return res;
}
+
+struct resource *create_resource(const char *name,
+ resource_size_t start, resource_size_t end)
+{
+ struct resource *t;
+
+ t = xzalloc(sizeof *t);
+ INIT_LIST_HEAD(&t->children);
+ t->parent = NULL;
+ t->name = xstrdup(name);
+ t->start = start;
+ t->end = end;
+
+ return t;
+}
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 3d375a8..2a944cc 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -140,6 +140,8 @@ struct resource *__request_region(struct resource *parent,
resource_size_t size);
int release_region(struct resource *res);
+struct resource *create_resource(const char *name,
+ resource_size_t start, resource_size_t end);
extern struct resource iomem_resource;
extern struct resource ioport_resource;
--
2.10.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-12-05 9:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 9:40 [RFC v2 0/8] MIPS: use kexec to load ELF linux images Antony Pavlov
2016-12-05 9:40 ` [RFC v2 1/8] MIPS: add virt_to_phys() and phys_to_virt() Antony Pavlov
2016-12-05 9:40 ` [RFC v2 2/8] MIPS: c-r4k: add support for secondary cache Antony Pavlov
2016-12-05 9:40 ` Antony Pavlov [this message]
2016-12-05 9:40 ` [RFC v2 4/8] import initial kexec stuff Antony Pavlov
2016-12-07 19:47 ` Sascha Hauer
2016-12-08 7:24 ` Antony Pavlov
2016-12-05 9:40 ` [RFC v2 5/8] filetype: add ELF type Antony Pavlov
2016-12-05 9:40 ` [RFC v2 6/8] bootm: add kexec ELF support Antony Pavlov
2016-12-07 19:59 ` Sascha Hauer
2016-12-08 7:29 ` Antony Pavlov
2016-12-05 9:40 ` [RFC v2 7/8] MIPS: add kexec ELF loading support Antony Pavlov
2016-12-05 9:40 ` [RFC v2 8/8] MIPS: malta: enable kexec Antony Pavlov
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=20161205094033.31569-4-antonynpavlov@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
/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