<br><font size=2 face="sans-serif">I like this approach because it seems
like we should be able to quickly finalize and publish the systemsim-add-bogusnet
patch (which is currently my main focus).</font>
<br>
<br><font size=2 face="sans-serif">Regarding the systemsim-add-systemsim.h
patch, I notice that the XLC forms (which are available in callthru_config.h)
are not in the proposed systemsim.h file. It would be nice to have
these, protected by the appropriate ifdefs of course, to enable application
development with XLC. Otherwise, we'll need to continue to ship callthru_config.h
with Mambo and point users to this if they want to use XLC.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Mike</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Arnd Bergmann <arnd@arndb.de></b></font>
<p><font size=1 face="sans-serif">01/06/2006 08:02 PM</font>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
Eric V Van hensbergen/Austin/IBM@IBMUS</font>
<br><font size=1 face="sans-serif"> cc:
David Woodhouse <dwmw2@infradead.org>,
Mike Kistler/Austin/IBM@IBMUS, Patrick Bohrer/Austin/IBM@IBMUS, rsa@us.ltcfwd.linux.ibm.com,
linuxppc64-dev@ozlabs.org, ericvh@gmail.com</font>
<br><font size=1 face="sans-serif"> Subject:
Re: Support for Bogus Net</font></table>
<br>
<br>
<br><font size=2><tt>[added linuxppc64-dev to Cc:]<br>
<br>
On Friday 06 January 2006 23:49, Eric V Van hensbergen wrote:<br>
> Okay, I'll merge it up to 2.6.15, remove the bogus halt and console
stuff<br>
> and send it out to this list. We can either merge it with the
other<br>
> "stuff" (the console stuff with systemsim.h in it), or submit
it after that<br>
> patch gets submitted mainline.<br>
<br>
How about if we make an extra patch for the systemsim.h file? I find it<br>
hard to tell which of the patches (console or the others) is more likely<br>
to go in soon, so maybe it works best to have patches like this:<br>
<br>
[patches from eric]<br>
systemsim-add-systemsim.h.diff<br>
systemsim-add-bogusdisk.diff<br>
systemsim-add-bogusnet.diff<br>
<br>
[patches from ryan]<br>
hvc-cleanups.diff<br>
hvc-more-changes.diff<br>
hvc-add-rtas.diff<br>
hvc-add-systemsim.diff<br>
<br>
with the hvc-add-systemsim.diff depending on systemsim-add-systemsim.h.diff<br>
to be applied first. For reference, I've added my last version of that
patch<br>
this mail, so we have the same base (and can get comments on it).<br>
<br>
Arnd <><<br>
<br>
Index: linux-2.6.15-rc/include/asm-powerpc/systemsim.h<br>
===================================================================<br>
--- /dev/null<br>
+++ linux-2.6.15-rc/include/asm-powerpc/systemsim.h<br>
@@ -0,0 +1,132 @@<br>
+/*<br>
+ *<br>
+ * Copyright (C) 2001, 2005 IBM<br>
+ *<br>
+ * Filename
: systemsim.h<br>
+ *<br>
+ * Originator
: Patrick Bohrer and Charles Lefurgy<br>
+ * Modified By
: Eric Van Hensbegren <ericvh@gmail.com><br>
+ *<br>
+ * Purpose
:<br>
+ *<br>
+ * This file is compiled with programs that are run under the<br>
+ * PowerPC Full System simulator. For example, stand-alone
programs<br>
+ * or operating systems. The programs call the callthru wrapper<br>
+ * functions which use an illegal PowerPC instruction to signal
the<br>
+ * simulator to emulate special support.<br>
+ *<br>
+ */<br>
+<br>
+#ifndef _SYSTEMSIM_CONFIG_H_<br>
+#define _SYSTEMSIM_CONFIG_H_<br>
+#ifdef __KERNEL__<br>
+<br>
+/* The functions callthru0 to callthru5 setup up the arguments for the<br>
+ * simulator callthru and then use the callthru instruction. Note
that<br>
+ * 0-5 specify the number of arguments after the command */<br>
+<br>
+/* Note: Arguments are cast as void* to prevent casting by the<br>
+ compiler. This way, you can pass pointers, integers, etc.
in<br>
+ machine register and have the simulator interpret what the<br>
+ register is supposed to be. To help with typing errors when
using<br>
+ callthrus, we provide wrapper functions for each callthru. The<br>
+ wrappers cast all arguments to void*. Unfortunately, this
results<br>
+ in a lot of compiler warnings that I do not know how to remove.
If<br>
+ you modify this code, be aware that we are trying to pick a type<br>
+ that is the size of the registers (32-bit or 64-bit) and that
is<br>
+ why are choosing to cast to a void* (it should be the size of
a<br>
+ machine register) */<br>
+<br>
+static inline int callthru0(int command)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c));<br>
+
return (c);<br>
+}<br>
+static inline int callthru1(int command, unsigned long arg1)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1));<br>
+
return c;<br>
+}<br>
+static inline int callthru2(int command, unsigned long arg1, unsigned
long arg2)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
register unsigned long a2 asm("r5") = arg2;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1), "r"(a2));<br>
+
return c;<br>
+}<br>
+static inline int callthru3(int command, unsigned long arg1, unsigned
long arg2,<br>
+
unsigned long arg3)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
register unsigned long a2 asm("r5") = arg2;<br>
+
register unsigned long a3 asm("r6") = arg3;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1), "r"(a2),<br>
+
"r"(a3));<br>
+
return c;<br>
+}<br>
+static inline int callthru4(int command, unsigned long arg1, unsigned
long arg2,<br>
+
unsigned long arg3, unsigned long arg4)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
register unsigned long a2 asm("r5") = arg2;<br>
+
register unsigned long a3 asm("r6") = arg3;<br>
+
register unsigned long a4 asm("r7") = arg4;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1), "r"(a2),<br>
+
"r"(a3), "r"(a4));<br>
+
return c;<br>
+}<br>
+static inline int callthru5(int command, unsigned long arg1, unsigned
long arg2,<br>
+
unsigned long arg3, unsigned long arg4,<br>
+
unsigned long arg5)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
register unsigned long a2 asm("r5") = arg2;<br>
+
register unsigned long a3 asm("r6") = arg3;<br>
+
register unsigned long a4 asm("r7") = arg4;<br>
+
register unsigned long a5 asm("r8") = arg5;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1), "r"(a2),<br>
+
"r"(a3), "r"(a4), "r"(a5));<br>
+
return c;<br>
+}<br>
+static inline int callthru6(int command, unsigned long arg1, unsigned
long arg2,<br>
+
unsigned long arg3, unsigned long arg4,<br>
+
unsigned long arg5, unsigned long arg6)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
register unsigned long a2 asm("r5") = arg2;<br>
+
register unsigned long a3 asm("r6") = arg3;<br>
+
register unsigned long a4 asm("r7") = arg4;<br>
+
register unsigned long a5 asm("r8") = arg5;<br>
+
register unsigned long a6 asm("r9") = arg6;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1), "r"(a2),<br>
+
"r"(a3), "r"(a4), "r"(a5),
"r"(a6));<br>
+
return c;<br>
+}<br>
+static inline int callthru7(int command, unsigned long arg1, unsigned
long arg2,<br>
+
unsigned long arg3, unsigned long arg4,<br>
+
unsigned long arg5, unsigned long arg6,<br>
+
unsigned long arg7)<br>
+{<br>
+
register int c asm("r3") = command;<br>
+
register unsigned long a1 asm("r4") = arg1;<br>
+
register unsigned long a2 asm("r5") = arg2;<br>
+
register unsigned long a3 asm("r6") = arg3;<br>
+
register unsigned long a4 asm("r7") = arg4;<br>
+
register unsigned long a5 asm("r8") = arg5;<br>
+
register unsigned long a6 asm("r9") = arg6;<br>
+
register unsigned long a7 asm("r10") = arg7;<br>
+
asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c),
"r"(a1), "r"(a2),<br>
+
"r"(a3), "r"(a4), "r"(a5),
"r"(a6), "r"(a7));<br>
+
return c;<br>
+}<br>
+<br>
+#endif /* __KERNEL__ */<br>
+#endif/* _SYSTEMSIM_CONFIG_H_ */<br>
</tt></font>
<br>