From: Nikita Danilov <Nikita@Namesys.COM>
To: Jeff Dike <JDike@Karaya.COM>
Cc: user-mode-linux-devel@lists.sourceforge.net,
Andrew Morton <AKPM@Osdl.ORG>
Subject: [uml-devel] [PATCH]: fix UML compilation breakage in fs/proc/task_mmu.c
Date: Thu, 8 Jan 2004 23:02:50 +0300 [thread overview]
Message-ID: <16381.46954.397526.967308@laputa.namesys.com> (raw)
Hello,
recent change that adds fixmaps to the /proc/<pid>/maps broke
compilation on the UML, because there FIXADDR_USER_{START,END} are not
constant.
This patch adds a function to initialize &gate_vmarea.
Nikita.
diff -puN fs/proc/task_mmu.c~uml-FIXADDR_USER_START-not-const fs/proc/task_mmu.c
--- lobby/fs/proc/task_mmu.c~uml-FIXADDR_USER_START-not-const Thu Jan 8 20:56:36 2004
+++ lobby-nikita/fs/proc/task_mmu.c Thu Jan 8 20:56:36 2004
@@ -79,17 +79,27 @@ int task_statm(struct mm_struct *mm, int
#ifdef AT_SYSINFO_EHDR
static struct vm_area_struct gate_vmarea = {
- /* Do _not_ mark this area as readable, cuz not the entire range may be readable
- (e.g., due to execute-only pages or holes) and the tools that read
- /proc/PID/maps should read the interesting bits from the gate-DSO file
- instead. */
- .vm_start = FIXADDR_USER_START,
- .vm_end = FIXADDR_USER_END
+ /*
+ * we cannot initialize fields right here, because on some
+ * architectures (on UML to be precise), FIXADDR_USER_* are not
+ * constant. See build_gate_map() below.
+ */
};
# define gate_map() &gate_vmarea
+static inline struct vm_area_struct *build_gate_map(void)
+{
+ /* Do _not_ mark this area as readable, cuz not the entire range may
+ be readable (e.g., due to execute-only pages or holes) and the
+ tools that read /proc/PID/maps should read the interesting bits
+ from the gate-DSO file instead. */
+ gate_vmarea.vm_start = FIXADDR_USER_START;
+ gate_vmarea.vm_end = FIXADDR_USER_END;
+ return &gate_vmarea;
+}
#else
# define gate_map() NULL
+# define build_gate_map() NULL
#endif
static int show_map(struct seq_file *m, void *v)
@@ -146,7 +156,7 @@ static void *m_start(struct seq_file *m,
up_read(&mm->mmap_sem);
mmput(mm);
if (l == -1)
- map = gate_map();
+ map = build_gate_map();
}
return map;
}
_
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2004-01-08 20:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-08 20:02 Nikita Danilov [this message]
2004-01-09 13:16 ` [uml-devel] Re: [PATCH]: fix UML compilation breakage in fs/proc/task_mmu.c Nikita Danilov
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=16381.46954.397526.967308@laputa.namesys.com \
--to=nikita@namesys.com \
--cc=AKPM@Osdl.ORG \
--cc=JDike@Karaya.COM \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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