* [PATCH] a little more documentation in fsys.txt
@ 2003-10-10 0:55 Ian Wienand
2003-10-10 21:01 ` David Mosberger
2003-10-15 22:51 ` David Mosberger
0 siblings, 2 replies; 3+ messages in thread
From: Ian Wienand @ 2003-10-10 0:55 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
Hi,
Attached is a suggestion for a small addition to fsys.txt about how
userspace can use fast system calls.
If people think this is totally wrong, or that something like this
might be more appropriate in our WiKi, that's fine.
Thanks,
-i
ianw@gelato.unsw.edu.au
http://www.gelato.unsw.edu.au
[-- Attachment #2: fsys.txt.diff --]
[-- Type: text/plain, Size: 1875 bytes --]
===== Documentation/ia64/fsys.txt 1.5 vs edited =====
--- 1.5/Documentation/ia64/fsys.txt Wed Feb 12 19:11:32 2003
+++ edited/Documentation/ia64/fsys.txt Fri Oct 10 10:49:44 2003
@@ -229,3 +229,52 @@
PSR.bn Unchanged. Note: fsys-mode handlers may clear the bit, if needed.
Doing so requires clearing PSR.i and PSR.ic as well.
PSR.ia Unchanged. Note: the ia64 linux kernel never sets this bit.
+
+* Using fast system calls
+
+To use fast system calls, userspace applications need simply call
+__kernel_syscall_via_epc(). For example
+
+-- example fgettimeofday() call --
+-- fgettimeofday.S --
+
+#include <asm/asmmacro.h>
+
+GLOBAL_ENTRY(fgettimeofday)
+.prologue
+.save ar.pfs, r11
+mov r11 = ar.pfs
+.body
+
+mov r2 = 0xa000000000020660;; // gate address
+ // found by inspection of System.map for the
+ // __kernel_syscall_via_epc() function. See
+ // below for how to do this for real.
+
+mov b7 = r2
+mov r15 = 1087 // gettimeofday syscall
+;;
+br.call.sptk.many b6 = b7
+;;
+
+.restore sp
+
+mov ar.pfs = r11
+br.ret.sptk.many rp;; // return to caller
+END(fgettimeofday)
+
+-- end fgettimeofday.S --
+
+In reality, getting the gate address is accomplished by two extra
+values passed via the ELF auxiliary vector (include/asm-ia64/elf.h)
+
+ o AT_SYSINFO : is the address of __kernel_syscall_via_epc()
+ o AT_SYSINFO_EHDR : is the address of the kernel gate ELF DSO
+
+The ELF DSO is a pre-linked library that is mapped in by the kernel at
+the gate page. It is a proper ELF shared object so, with a dynamic
+loader that recognises the library, you should be able to make calls to
+the exported functions within it as with any other shared library.
+AT_SYSINFO points into the kernel DSO at the
+__kernel_syscall_via_epc() function for historical reasons (it was
+used before the kernel DSO) and as a convenience.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] a little more documentation in fsys.txt
2003-10-10 0:55 [PATCH] a little more documentation in fsys.txt Ian Wienand
@ 2003-10-10 21:01 ` David Mosberger
2003-10-15 22:51 ` David Mosberger
1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2003-10-10 21:01 UTC (permalink / raw)
To: linux-ia64
>>>>> On Fri, 10 Oct 2003 10:55:54 +1000, Ian Wienand <ianw@gelato.unsw.edu.au> said:
Ian> Hi, Attached is a suggestion for a small addition to fsys.txt
Ian> about how userspace can use fast system calls.
Ian> If people think this is totally wrong, or that something like
Ian> this might be more appropriate in our WiKi, that's fine.
I like the idea of improving the documentation, but since we're in
bug-fix-only mode, I won't be able to apply the patch for now.
Please resend when 2.7 is open.
Thanks,
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] a little more documentation in fsys.txt
2003-10-10 0:55 [PATCH] a little more documentation in fsys.txt Ian Wienand
2003-10-10 21:01 ` David Mosberger
@ 2003-10-15 22:51 ` David Mosberger
1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2003-10-15 22:51 UTC (permalink / raw)
To: linux-ia64
>>>>> On Fri, 10 Oct 2003 14:01:29 -0700, David Mosberger <davidm@linux.hpl.hp.com> said:
>>>>> On Fri, 10 Oct 2003 10:55:54 +1000, Ian Wienand <ianw@gelato.unsw.edu.au> said:
Ian> Hi, Attached is a suggestion for a small addition to fsys.txt
Ian> about how userspace can use fast system calls.
Ian> If people think this is totally wrong, or that something like
Ian> this might be more appropriate in our WiKi, that's fine.
David> I like the idea of improving the documentation, but since
David> we're in bug-fix-only mode, I won't be able to apply the
David> patch for now. Please resend when 2.7 is open.
Actually, it seems silly to discourage documentation improvements. If
anything, we should encourage them as 2.6.0 stabilizes (as long as
we're talking about updating real documentation, not just munging
comments for typos etc.). I checked with Andrew and he seems OK with
such updates, so I applied this patch to my tree now.
Thanks,
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-15 22:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-10 0:55 [PATCH] a little more documentation in fsys.txt Ian Wienand
2003-10-10 21:01 ` David Mosberger
2003-10-15 22:51 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox